/*
Theme Name: dds_retrogid.ru
Author: Алексей Громов
Description: Тема для образовательной платформы о кинематографе, медиа и видеопроизводстве.
Version: 1.1
Text Domain: retrogid
*/

/* ============================ Переменные ============================ */
:root{
    --bg:        #14110f;
    --surface:   #211d1a;
    --surface-2: #1a1714;
    --footer-bg: #100d0b;
    --line:      #3a332d;
    --amber:     #d8a657;
    --amber-2:   #e7c074;
    --red:       #b04037;
    --text:      #f0e9df;
    --muted:     #b3a99b;
    --maxw:      1180px;
    --maxw-single: 1100px;
    --radius:    12px;
}

/* ============================ База ============================ */
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}
h1,h2,h3,h4{
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 .6em;
    letter-spacing: .2px;
}
h1{ font-size: 2.1rem; }
h2{ font-size: 1.65rem; }
h3{ font-size: 1.25rem; }
p{ margin: 0 0 1em; }
a{ color: var(--amber); text-decoration: none; }
a:hover{ color: var(--amber-2); text-decoration: underline; }
img{ max-width: 100%; height: auto; }

.screen-reader-text{
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.page-title{ margin: 0 0 28px; }

/* ============================ Контейнеры ширины ============================ */
.shell{
    width: min(92%, var(--maxw));
    margin-inline: auto;
}
.container-single{
    width: min(85%, var(--maxw-single));
    margin-inline: auto;
}

/* ============================ Шапка ============================ */
.site-header{
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}
.header-inner{
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}
.brand{
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}
.brand-logo{ display: block; height: 56px; width: auto; }
.brand-text{ min-width: 0; }
.site-title{
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}
.site-title a{ color: var(--text); }
.site-title a:hover{ color: var(--amber); text-decoration: none; }
.site-desc{
    color: var(--muted);
    font-size: .82rem;
    margin: 4px 0 0;
    line-height: 1.45;
}

/* ============================ Навигация ============================ */
.main-nav{ flex-shrink: 0; }
.nav-toggle{
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .95rem;
}
.main-nav ul{
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a{
    display: block;
    padding: 8px 14px;
    color: var(--text);
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: .95rem;
    border-radius: 8px;
}
.main-nav a:hover{ background: var(--surface); color: var(--amber); text-decoration: none; }
.main-nav .current-menu-item > a{ color: var(--amber); }

/* ============================ Раскладка контента ============================ */
.site-main{ padding: 34px 0 50px; }
.layout-with-sidebar{
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 40px;
    align-items: start;
}
.layout-single{ display: block; }
.content-area{ min-width: 0; }

/* ============================ Хлебные крошки ============================ */
.breadcrumbs{
    font-size: .85rem;
    color: var(--muted);
    margin: 0 0 22px;
    font-family: "Helvetica Neue", Arial, sans-serif;
}
.breadcrumbs a{ color: var(--muted); }
.breadcrumbs a:hover{ color: var(--amber); text-decoration: none; }
.breadcrumbs .sep{ margin: 0 6px; color: var(--line); }
.breadcrumbs span:last-child{ color: var(--text); }

/* ============================ Карточки записей ============================ */
.cards{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}
.card{
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-thumb{
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.card-thumb img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-thumb-fallback{
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #2a2420, #16120f);
    position: relative;
}
.card-thumb-fallback::after{
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(216,166,87,.18), transparent 60%);
}
.card-body{
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-width: 0;
}
.card-title{ font-size: 1.18rem; margin: 0 0 8px; }
.card-title a{ color: var(--text); }
.card-title a:hover{ color: var(--amber); text-decoration: none; }
.card-meta{
    color: var(--muted);
    font-size: .8rem;
    font-family: "Helvetica Neue", Arial, sans-serif;
    margin: 0 0 10px;
}
.card-excerpt{ color: var(--muted); font-size: .95rem; }
.card-excerpt p{ margin: 0 0 0.5em; background: none; }
.card-more{
    margin-top: auto;
    padding-top: 12px;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: .9rem;
    font-weight: 600;
}

/* ============================ Одиночная запись / страница ============================ */
.entry{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
}
.entry-title{ margin-top: 0; }
.entry-meta{
    color: var(--muted);
    font-size: .85rem;
    font-family: "Helvetica Neue", Arial, sans-serif;
    margin-bottom: 18px;
}
.entry-thumb{ margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img{ display: block; width: 100%; height: auto; }
.entry-content{ min-width: 0; }
.entry-content img{ height: auto; border-radius: 8px; }
.entry-content h2,.entry-content h3{ margin-top: 1.4em; }
.entry-content ul,.entry-content ol{ padding-left: 1.3em; }
.entry-content blockquote{
    margin: 1.4em 0;
    padding: 12px 22px;
    border-left: 4px solid var(--amber);
    background: var(--surface-2);
    color: var(--text);
}

/* таблицы */
table{ border-collapse: collapse; width: 100%; margin: 1.4em 0; }
table, th, td{ border: 1px solid var(--line); }
th, td{ padding: 10px 12px; text-align: left; }
th{ background: var(--surface-2); color: var(--text); }

/* ============================ Сайдбар / виджеты ============================ */
.sidebar{ min-width: 0; }
.sidebar .widget{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    color: var(--text);
}
.sidebar .widget-title{
    color: var(--amber);
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.sidebar .widget a{ color: var(--text); }
.sidebar .widget a:hover{ color: var(--amber); }
.sidebar ul{ list-style: none; margin: 0; padding: 0; }
.sidebar li{
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: .95rem;
}
.sidebar li:last-child{ border-bottom: 0; }
.sidebar .post-date{ display: block; color: var(--muted); font-size: .78rem; }

/* ============================ Пагинация ============================ */
.pagination{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 36px 0 0;
    justify-content: center;
}
.pagination .page-numbers{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface);
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: .9rem;
}
.pagination a.page-numbers:hover{ border-color: var(--amber); color: var(--amber); text-decoration: none; }
.pagination .page-numbers.current{
    background: var(--amber);
    border-color: var(--amber);
    color: #1a1410;
    font-weight: 700;
}
.pagination .page-numbers.dots{ border: 0; background: transparent; }

/* ============================ Главная ============================ */
.section{ margin: 0 0 56px; }
.section-head{ text-align: center; max-width: 720px; margin: 0 auto 32px; }
.section-head h2{ margin-bottom: 10px; }
.section-head p{ color: var(--muted); margin: 0; }
.eyebrow{
    display: inline-block;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: .75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 10px;
}

/* Слайдер (hero) */
.hero-slider{
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-2);
}
.slides{ position: relative; }
.slide{
    display: none;
    position: relative;
}
.slide.is-active{ display: block; }
.slide img{
    display: block;
    width: 100%;
    height: clamp(280px, 42vw, 520px);
    object-fit: cover;
}
.slide-caption{
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 28px 32px;
    background: linear-gradient(0deg, rgba(16,13,11,.92), rgba(16,13,11,0));
}
.slide-caption h2{ margin: 0 0 6px; color: #fff; }
.slide-caption p{ margin: 0; color: #e7ddcd; max-width: 640px; }
.slider-btn{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px; height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(20,17,15,.7);
    color: var(--amber);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}
.slider-btn:hover{ background: rgba(20,17,15,.95); }
.slider-prev{ left: 16px; }
.slider-next{ right: 16px; }
.slider-dots{
    position: absolute;
    left: 0; right: 0; bottom: 14px;
    display: flex;
    gap: 8px;
    justify-content: center;
}
.slider-dots button{
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 0;
    background: rgba(240,233,223,.4);
    cursor: pointer;
    padding: 0;
}
.slider-dots button.is-active{ background: var(--amber); }

/* Текст + иллюстрация */
.media-row{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}
.media-row.reverse .media-figure{ order: 2; }
.media-figure{ min-width: 0; }
.media-figure svg, .media-figure img{
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}
.media-text{ min-width: 0; }
.media-text h2{ text-align: left; }

/* Сетка преимуществ / направлений */
.feature-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.feature{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px;
    min-width: 0;
}
.feature .ic{
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--amber);
    margin-bottom: 14px;
}
.feature h3{ font-size: 1.1rem; margin-bottom: 6px; }
.feature p{ color: var(--muted); font-size: .92rem; margin: 0; }

/* Пошаговый блок */
.steps{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    counter-reset: step;
}
.step{
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 22px 22px;
    min-width: 0;
}
.step::before{
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -18px; left: 22px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--amber);
    color: #1a1410;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    border-radius: 50%;
}
.step h3{ font-size: 1.08rem; margin: 6px 0 6px; }
.step p{ color: var(--muted); font-size: .92rem; margin: 0; }

/* Галерея */
.gallery-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.gallery-grid figure{
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}
.gallery-grid img{
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Последние записи */
.latest-head{ display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.latest-head h2{ margin: 0; }
.latest-head a{ font-family: "Helvetica Neue", Arial, sans-serif; font-size: .9rem; }

/* ============================ Подвал ============================ */
.site-footer{
    background: var(--footer-bg);
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 46px 0 26px;
}
.footer-cols{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
}
.site-footer .widget{ color: var(--muted); min-width: 0; }
.site-footer .widget-title{
    color: var(--text);
    font-size: 1.05rem;
    margin: 0 0 14px;
}
.site-footer .widget p{ color: var(--muted); font-size: .92rem; }
.site-footer .widget a{ color: var(--amber-2); }
.site-footer .widget a:hover{ color: var(--text); }
.site-footer ul{ list-style: none; margin: 0; padding: 0; }
.site-footer li{ padding: 6px 0; font-size: .92rem; }
.footer-bottom{
    border-top: 1px solid var(--line);
    margin-top: 34px;
    padding-top: 20px;
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

/* ============================ Поиск ============================ */
.search-form{ display: flex; gap: 8px; }
.search-form .search-field{
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: .95rem;
}
.search-form .search-submit{
    padding: 10px 18px;
    background: var(--amber);
    color: #1a1410;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 600;
}
.search-form .search-submit:hover{ background: var(--amber-2); }

/* ============================ Комментарии ============================ */
.comments-area{
    margin-top: 34px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
}
.comments-area .comment-list{ list-style: none; margin: 0 0 24px; padding: 0; }
.comments-area .comment-list ul{ list-style: none; padding-left: 24px; }
.comment-inner{
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
}
.comment-meta{ display: flex; gap: 14px; align-items: baseline; margin-bottom: 6px; }
.comment-author{ font-weight: 700; color: var(--text); font-family: "Helvetica Neue", Arial, sans-serif; }
.comment-date{ color: var(--muted); font-size: .8rem; }
.comment-awaiting{ color: var(--amber); font-size: .85rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea{
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    margin-bottom: 12px;
}
.comment-form label{ display: block; font-size: .9rem; margin-bottom: 4px; color: var(--muted); }
.comment-form .submit{
    padding: 11px 22px;
    background: var(--amber);
    color: #1a1410;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* ============================ 404 ============================ */
.error-404{ text-align: center; padding: 30px 0 10px; }
.error-404 .big{ font-size: 5rem; color: var(--amber); font-family: "Helvetica Neue", Arial, sans-serif; margin: 0; }
.error-404 .search-form{ max-width: 460px; margin: 24px auto 0; }

/* ============================ Контакты (статика) ============================ */
.contact-list{ list-style: none; padding: 0; margin: 18px 0 0; }
.contact-list li{ margin-bottom: 10px; }

/* ============================ Cookie-баннер ============================ */
.cookie-banner[hidden]{ display: none !important; }
.cookie-banner{
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--surface);
    border-top: 1px solid var(--amber);
    padding: 16px 0;
}
.cookie-inner{
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-banner p{ margin: 0; font-size: .9rem; color: var(--muted); flex: 1; min-width: 240px; }
.cookie-banner button{
    padding: 10px 22px;
    background: var(--amber);
    color: #1a1410;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-weight: 600;
    flex-shrink: 0;
}
.cookie-banner button:hover{ background: var(--amber-2); }

/* ============================ Адаптив ============================ */
@media (max-width: 960px){
    .layout-with-sidebar{ grid-template-columns: 1fr; }
    .media-row{ grid-template-columns: 1fr; }
    .media-row.reverse .media-figure{ order: 0; }
    .gallery-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px){
    body{ font-size: 17px; }
    h1{ font-size: 1.7rem; }
    h2{ font-size: 1.4rem; }
    .nav-toggle{ display: block; }
    .main-nav{ width: 100%; }
    .main-nav ul{
        display: none;
        flex-direction: column;
        margin-top: 12px;
        width: 100%;
    }
    .main-nav.open ul{ display: flex; }
    .main-nav a{ background: var(--surface); }
    .gallery-grid{ grid-template-columns: 1fr; }
    .footer-cols{ grid-template-columns: 1fr; }
    .slide-caption{ padding: 18px; position: static; background: var(--surface-2); }
    .slide img{ height: clamp(200px, 56vw, 320px); }
}
