/*
Theme Name: dds_primemovies.ru
Author: Дмитрий Горев
Description: Образовательная платформа о киноискусстве на материале советского кинематографа.
Version: 1.1
Text Domain: primemovies
*/

/* ============================================================ *
 *  Переменные
 * ============================================================ */
:root {
    --bg:        #14110f;
    --bg-soft:   #1c1815;
    --panel:     #221d19;
    --ink:       #f3ece1;
    --ink-soft:  #c9bfb1;
    --ink-mut:   #9a8f7e;
    --gold:      #d9a441;
    --gold-deep: #b07f24;
    --red:       #b8352a;
    --line:      #3a322b;
    --paper:     #f4efe6;
    --paper-ink: #251f1a;
    --maxw:      1180px;
    --radius:    6px;
}

/* ============================================================ *
 *  База
 * ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "PT Serif", Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: "Oswald", "PT Sans Narrow", "Arial Narrow", system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 0.6em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-deep); text-decoration: underline; }

img { max-width: 100%; height: auto; }

.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

.btn {
    display: inline-block;
    background: var(--gold);
    color: #1a1510;
    font-family: "Oswald", system-ui, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 0.7em 1.5em;
    border-radius: var(--radius);
    border: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--gold-deep); color: #fff; text-decoration: none; transform: translateY(-1px); }

.section-eyebrow {
    font-family: "Oswald", system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--gold);
    margin: 0 0 0.4em;
}

/* ============================================================ *
 *  Шапка
 * ============================================================ */
.site-header {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--gold-deep);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    flex: 1;
}
.brand-logo, .brand-mark {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: block;
}
.brand-text { min-width: 0; }
.brand-name {
    font-family: "Oswald", system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.15;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.brand-name a { color: inherit; }
.brand-name a:hover { color: var(--gold); text-decoration: none; }
.brand-desc {
    font-size: 0.8rem;
    color: var(--ink-mut);
    line-height: 1.4;
    margin-top: 0.25rem;
    display: block;
    max-width: 60ch;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 0.5em 0.7em;
    cursor: pointer;
    font-size: 1rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    font-family: "Oswald", system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    color: var(--ink-soft);
    padding: 0.3em 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--gold);
    border-bottom-color: var(--gold);
    text-decoration: none;
}

/* ============================================================ *
 *  Хлебные крошки
 * ============================================================ */
.crumbs {
    font-size: 0.82rem;
    color: var(--ink-mut);
    padding: 1rem 0 0;
    font-family: "Oswald", system-ui, sans-serif;
    letter-spacing: 0.02em;
}
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--gold); }
.crumbs .sep { color: var(--gold-deep); margin: 0 0.2em; }

/* ============================================================ *
 *  Макеты
 * ============================================================ */
.site-main { padding: 2.4rem 0 3rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.6rem;
    align-items: start;
}
.layout-single .content-area { width: 100%; }
.layout-single.narrow {
    width: min(85%, var(--maxw));
    margin-inline: auto;
}

.content-area { min-width: 0; }

/* ============================================================ *
 *  Карточки записей
 * ============================================================ */
.card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.6rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-row {
    display: flex;
    flex-direction: row;
    gap: 0;
}
.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: var(--bg-soft);
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-thumb-fallback {
    width: 100%;
    height: 100%;
    display: block;
}
.card-body {
    flex: 1;
    min-width: 0;
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.3rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--gold); text-decoration: none; }
.card-meta {
    font-family: "Oswald", system-ui, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--ink-mut);
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}
.card-excerpt { color: var(--ink-soft); font-size: 0.96rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; padding-top: 0.8rem; }
.card-more a {
    font-family: "Oswald", system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

/* ============================================================ *
 *  Сайдбар / виджеты
 * ============================================================ */
.sidebar { min-width: 0; }
.widget {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.6rem;
}
.widget-title {
    font-size: 1.05rem;
    color: var(--gold);
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}
.widget, .widget p, .widget li, .widget a { color: var(--ink-soft); }
.widget a:hover { color: var(--gold); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget .post-date { color: var(--ink-mut); font-size: 0.8rem; display: block; }

/* ============================================================ *
 *  Контент записи / страницы
 * ============================================================ */
.entry {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 2.2rem;
}
.entry-title { font-size: 2rem; margin-bottom: 0.4rem; }
.entry-meta {
    font-family: "Oswald", system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
    color: var(--ink-mut);
    margin-bottom: 1.4rem;
}
.entry-thumb { margin: 0 0 1.6rem; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-content { color: var(--ink); }
.entry-content p { margin: 0 0 1.2em; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content a { text-decoration: underline; }
.entry-content blockquote {
    border-left: 3px solid var(--gold);
    margin: 1.4em 0;
    padding: 0.4em 1.2em;
    color: var(--ink-soft);
    background: var(--bg-soft);
}
.entry-content img { border-radius: var(--radius); display: block; }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 0.6em 0.8em; text-align: left; }
.entry-content th { background: var(--bg-soft); color: var(--gold); }

/* ============================================================ *
 *  Главная
 * ============================================================ */
.home-wrap { width: min(85%, var(--maxw)); margin-inline: auto; }

.home-section { padding: 3rem 0; border-bottom: 1px solid var(--line); }
.home-section:last-of-type { border-bottom: 0; }

/* hero */
.hero {
    background:
        linear-gradient(180deg, rgba(20,17,15,0.62), rgba(20,17,15,0.92)),
        var(--bg-soft);
    border-bottom: 2px solid var(--gold-deep);
    padding: 0;
    position: relative;
}
.hero-inner {
    width: min(85%, var(--maxw));
    margin-inline: auto;
    padding: 4rem 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}
.hero-text h1 { font-size: 2.5rem; }
.hero-text p { color: var(--ink-soft); font-size: 1.05rem; }
.hero-figure img, .hero-figure svg { width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* split text + illustration */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img, .split-media svg { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.split-text p { color: var(--ink-soft); }

/* feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}
.feature {
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
    min-width: 0;
}
.feature-icon { width: 48px; height: 48px; margin-bottom: 0.9rem; display: block; }
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--ink-soft); font-size: 0.93rem; margin: 0; }

/* steps */
.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
    counter-reset: step;
}
.step {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.3rem;
    min-width: 0;
    position: relative;
}
.step-num {
    font-family: "Oswald", system-ui, sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--gold-deep);
    line-height: 1;
    display: block;
    margin-bottom: 0.6rem;
}
.step h3 { font-size: 1.05rem; }
.step p { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }

/* quote */
.quote-block {
    background:
        linear-gradient(135deg, rgba(184,53,42,0.12), rgba(217,164,65,0.10)),
        var(--bg-soft);
    border: 1px solid var(--gold-deep);
    border-radius: var(--radius);
    padding: 2.6rem 2.4rem;
    text-align: center;
}
.quote-block blockquote {
    margin: 0;
    font-size: 1.5rem;
    font-style: italic;
    color: var(--ink);
    line-height: 1.4;
}
.quote-block cite {
    display: block;
    margin-top: 1rem;
    font-family: "Oswald", system-ui, sans-serif;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    color: var(--gold);
}

/* gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.gallery-grid figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery-grid figcaption {
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    color: var(--ink-mut);
    background: var(--panel);
    font-family: "Oswald", system-ui, sans-serif;
    letter-spacing: 0.02em;
}

/* facts */
.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}
.fact {
    text-align: center;
    padding: 1.2rem 1rem;
    min-width: 0;
}
.fact-num {
    font-family: "Oswald", system-ui, sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}
.fact-label { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.4rem; }

/* faq */
.faq details {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 1.4rem;
    margin-bottom: 0.9rem;
}
.faq summary {
    cursor: pointer;
    padding: 1.1rem 0;
    font-family: "Oswald", system-ui, sans-serif;
    letter-spacing: 0.02em;
    color: var(--ink);
    list-style: none;
    position: relative;
    padding-right: 1.8rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 1.4rem;
}
.faq details[open] summary::after { content: "–"; }
.faq details > p { color: var(--ink-soft); margin: 0 0 1.1rem; font-size: 0.95rem; }

/* cta */
.cta {
    background:
        linear-gradient(120deg, rgba(176,127,36,0.18), rgba(20,17,15,0.4)),
        var(--bg-soft);
    border: 1px solid var(--gold-deep);
    border-radius: var(--radius);
    padding: 2.8rem 2.4rem;
    text-align: center;
}
.cta h2 { margin-bottom: 0.5rem; }
.cta p { color: var(--ink-soft); max-width: 56ch; margin-inline: auto; }

/* latest posts on home */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}
.latest-card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.latest-thumb-wrap { position: relative; overflow: hidden; }
.latest-thumb-wrap img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.latest-thumb-fallback { width: 100%; display: block; }
.latest-body { flex: 1; min-width: 0; padding: 1.2rem 1.3rem; display: flex; flex-direction: column; }
.latest-body h3 { font-size: 1.12rem; margin-bottom: 0.5rem; }
.latest-body h3 a { color: var(--ink); }
.latest-body h3 a:hover { color: var(--gold); text-decoration: none; }
.latest-meta { font-family: "Oswald", system-ui, sans-serif; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-mut); margin-bottom: 0.6rem; }
.latest-body .card-excerpt { font-size: 0.9rem; }
.latest-body .card-more { margin-top: auto; padding-top: 0.7rem; }

.section-head { margin-bottom: 1.8rem; }

/* ============================================================ *
 *  Пагинация
 * ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.4rem;
    justify-content: center;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink-soft);
    font-family: "Oswald", system-ui, sans-serif;
    font-size: 0.9rem;
}
.pager a.page-numbers:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.pager .page-numbers.current { background: var(--gold); color: #1a1510; border-color: var(--gold); }
.pager .page-numbers.dots { border: 0; background: transparent; }

/* ============================================================ *
 *  Комментарии
 * ============================================================ */
.comments-area { margin-top: 2.4rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem 2rem; }
.comments-title, .comment-reply-title { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.5rem; padding: 0; }
.comment-item { margin-bottom: 1.2rem; }
.comment-inner { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.comment-head { display: flex; gap: 1rem; align-items: baseline; margin-bottom: 0.5rem; flex-wrap: wrap; }
.comment-author { font-family: "Oswald", system-ui, sans-serif; color: var(--gold); }
.comment-date { font-size: 0.78rem; color: var(--ink-mut); }
.comment-text { color: var(--ink-soft); font-size: 0.95rem; }
.comment-await { color: var(--red); font-size: 0.85rem; }
.comment-reply a { font-size: 0.8rem; font-family: "Oswald", system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.04em; }

.comment-form { display: grid; gap: 1rem; }
.comment-form p { margin: 0; }
.comment-form label { display: block; font-family: "Oswald", system-ui, sans-serif; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    padding: 0.6rem 0.8rem;
    font-family: inherit;
    font-size: 0.95rem;
}
.comment-form textarea { min-height: 120px; }

/* ============================================================ *
 *  Форма поиска
 * ============================================================ */
.search-form { display: flex; gap: 0.5rem; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    padding: 0.55rem 0.8rem;
    font-family: inherit;
}
.search-form .search-submit { flex: 0 0 auto; }

/* ============================================================ *
 *  404
 * ============================================================ */
.notfound { text-align: center; padding: 3rem 0; }
.notfound .code { font-family: "Oswald", system-ui, sans-serif; font-size: 5rem; color: var(--gold-deep); line-height: 1; }
.notfound .search-form { max-width: 420px; margin: 1.6rem auto 0; }

/* ============================================================ *
 *  Подвал
 * ============================================================ */
.site-footer { background: #0f0d0b; border-top: 2px solid var(--gold-deep); margin-top: 2rem; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 2.6rem 0 1.8rem;
}
.footer-col { min-width: 0; }
.footer-col .widget { background: transparent; border: 0; padding: 0; margin: 0; }
.footer-col .widget-title { color: var(--gold); border-bottom-color: var(--line); }
.footer-col .widget,
.footer-col .widget p,
.footer-col .widget li,
.footer-col .widget a { color: var(--ink-soft); }
.footer-col .widget a:hover { color: var(--gold); }
.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 1.2rem 0;
    text-align: center;
    color: var(--ink-mut);
    font-size: 0.84rem;
}

/* ============================================================ *
 *  Cookie-баннер
 * ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: #0c0a08;
    border-top: 1px solid var(--gold-deep);
    padding: 1rem 0;
}
.cookie-inner {
    width: min(92%, var(--maxw));
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-inner p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; flex: 1; min-width: 220px; }

/* ============================================================ *
 *  Адаптив
 * ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .hero-inner { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 17px; }
    h1 { font-size: 1.7rem; }
    .hero-text h1 { font-size: 1.9rem; }
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0.2rem; }
    .split { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
    .feature-grid, .steps, .facts, .latest-grid, .gallery-grid { grid-template-columns: 1fr; }
    .home-wrap, .layout-single.narrow { width: 92%; }

    .card-row { flex-direction: column; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .entry { padding: 1.4rem 1.3rem; }
    .quote-block blockquote { font-size: 1.2rem; }
}
