/*
Theme Name: dds_tv-kinoline.ru
Author: Дмитрий Соколов
Description: Информационная тема о домашнем кино: обзоры телевизоров, проекторов и аудиосистем, рецензии на фильмы и сериалы.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: kinoline
*/

/* ===== Базовые переменные ===== */
:root {
    --bg:        #11131a;
    --bg-soft:   #1a1d27;
    --bg-card:   #1f2230;
    --ink:       #e9ebf2;
    --ink-dim:   #aab0c4;
    --gold:      #e3b04b;
    --gold-2:    #f0c873;
    --line:      #2c3142;
    --accent-bg: #161925;
    --shell:     min(92%, 1180px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 { line-height: 1.25; color: #fff; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

/* ===== Контейнер ширины — в одном месте (A12.7) ===== */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

/* ===== Шапка ===== */
.site-header {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.site-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}
.site-title a { color: #fff; text-decoration: none; }
.site-desc {
    font-size: .82rem;
    color: var(--ink-dim);
    margin: 4px 0 0;
    max-width: 640px;
}

/* ===== Навигация ===== */
.main-nav { margin-left: auto; }
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 1.4rem;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.menu {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.menu a {
    display: block;
    padding: 8px 14px;
    color: var(--ink);
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
}
.menu a:hover,
.menu .current-menu-item > a {
    background: var(--bg-card);
    color: var(--gold-2);
    text-decoration: none;
}

/* ===== Каркас контента ===== */
.site-main { padding: 34px 0 50px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 38px;
    align-items: start;
}
.layout-single {
    display: block;
}
.layout-single .content-area {
    width: 85%;
    margin-inline: auto;
}

/* ===== Хлебные крошки ===== */
.crumbs {
    font-size: .85rem;
    color: var(--ink-dim);
    margin: 0 0 22px;
}
.crumbs a { color: var(--ink-dim); }
.crumbs a:hover { color: var(--gold-2); }
.crumbs .sep { margin: 0 6px; color: var(--line); }

/* ===== Карточки записей (A8, A10) ===== */
.cards { display: grid; gap: 26px; }
.cards.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    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-body {
    flex: 1;
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.15rem; margin: 0 0 8px; }
.card-title a { color: #fff; }
.card-title a:hover { color: var(--gold-2); text-decoration: none; }
.card-meta { font-size: .8rem; color: var(--ink-dim); margin: 0 0 10px; }
.card-excerpt { color: var(--ink-dim); font-size: .95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 700;
    color: var(--gold);
}
.card-more:hover { color: var(--gold-2); text-decoration: none; }

/* Список записей в одну колонку (архив/блог) */
.post-list { display: grid; gap: 22px; }
.post-row {
    display: flex;
    gap: 22px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}
.post-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.post-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.post-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post-row .card-body { flex: 1; min-width: 0; }

/* ===== Sidebar / widgets ===== */
.sidebar { min-width: 0; }
.widget {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    color: var(--ink);
}
.widget-title {
    font-size: 1.05rem;
    color: #fff;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.widget a { color: var(--gold-2); }
.widget a:hover { color: var(--gold); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget .post-date { display: block; font-size: .78rem; color: var(--ink-dim); }

/* ===== Контент записи/страницы ===== */
.entry-header { margin-bottom: 18px; }
.entry-title { font-size: 2rem; }
.entry-meta { font-size: .85rem; color: var(--ink-dim); margin-bottom: 6px; }
.entry-thumb { border-radius: 14px; overflow: hidden; margin-bottom: 22px; }
.entry-thumb img { display: block; width: 100%; }
.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: 10px; }
.entry-content h2 { margin-top: 1.4em; }

.entry-content table,
.comment-text table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}
.entry-content table th,
.entry-content table td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
}
.entry-content table th { background: var(--accent-bg); color: #fff; }

/* ===== Пагинация (A12, D5) — type=plain ===== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 34px 0 0;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-card);
    color: var(--ink);
    font-weight: 600;
}
.pager a.page-numbers:hover {
    border-color: var(--gold);
    color: var(--gold-2);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1305;
}
.pager .page-numbers.dots {
    border: none;
    background: none;
}

/* ===== Главная — секции ===== */
.front-section { padding: 46px 0; }
.front-section + .front-section { border-top: 1px solid var(--line); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 34px; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--ink-dim); margin: 0; }

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media img { display: block; width: 100%; border-radius: 16px; }
.split-text h2 { font-size: 1.9rem; }
.split-text p { color: var(--ink-dim); }

/* Блок: сетка карточек-фич */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.feature {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 26px 22px;
    text-align: center;
}
.feature .feature-ico {
    width: 56px; height: 56px;
    margin: 0 auto 14px;
    display: block;
}
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--ink-dim); font-size: .92rem; margin: 0; }

/* Блок: галерея/мозаика */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 150px;
    gap: 14px;
}
.gallery-grid figure { margin: 0; border-radius: 12px; overflow: hidden; }
.gallery-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-grid .wide { grid-column: span 2; }
.gallery-grid .tall { grid-row: span 2; }

/* Блок: FAQ / аккордеон */
.faq { max-width: 820px; margin: 0 auto; }
.faq-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-card);
    margin-bottom: 14px;
    overflow: hidden;
}
.faq-q {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.02rem;
    font-weight: 700;
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}
.faq-q .mark { color: var(--gold); transition: transform .2s; flex: 0 0 auto; }
.faq-q[aria-expanded="true"] .mark { transform: rotate(45deg); }
.faq-a[hidden] { display: none !important; }
.faq-a { padding: 0 20px 18px; color: var(--ink-dim); }

/* Hero на главной */
.hero {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 6px;
    min-height: 360px;
    display: flex;
    align-items: center;
}
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(8,9,14,.92) 0%, rgba(8,9,14,.55) 60%, rgba(8,9,14,.2) 100%);
    z-index: 1;
}
.hero-inner {
    position: relative;
    z-index: 2;
    padding: 46px;
    max-width: 600px;
}
.hero-inner h1 { font-size: 2.3rem; }
.hero-inner p { color: var(--ink-dim); font-size: 1.05rem; }

/* CTA-кнопка */
.btn {
    display: inline-block;
    background: var(--gold);
    color: #1a1305;
    font-weight: 800;
    padding: 13px 26px;
    border-radius: 10px;
    border: 0;
}
.btn:hover { background: var(--gold-2); color: #1a1305; text-decoration: none; }

/* ===== Форма поиска ===== */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
}
.search-form button {
    padding: 11px 18px;
    border-radius: 9px;
    border: 0;
    background: var(--gold);
    color: #1a1305;
    font-weight: 700;
    cursor: pointer;
}

/* ===== Комментарии ===== */
.comments-area { margin-top: 46px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-inner {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.comment-head { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; margin-bottom: 8px; }
.comment-author { font-weight: 700; color: #fff; }
.comment-date { color: var(--ink-dim); }
.comment-pending { color: var(--gold); font-size: .85rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    margin-bottom: 12px;
}
.comment-form .submit {
    background: var(--gold);
    color: #1a1305;
    border: 0;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 9px;
    cursor: pointer;
}

/* ===== Подвал ===== */
.site-footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    padding: 44px 0 0;
    color: var(--ink-dim);
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
}
/* Контраст текста виджетов в футере — явно (см. F) */
.site-footer .widget {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--ink-dim);
}
.site-footer .widget-title { color: #fff; border-bottom-color: var(--line); }
.site-footer .widget a { color: var(--gold-2); }
.site-footer .widget a:hover { color: var(--gold); }
.site-footer .widget li { border-bottom: 1px solid var(--line); }
.footer-bottom {
    margin-top: 38px;
    border-top: 1px solid var(--line);
    padding: 20px 0;
    text-align: center;
    font-size: .85rem;
    color: var(--ink-dim);
}

/* ===== Cookie-баннер (D6, A11) ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: var(--bg-card);
    border-top: 1px solid var(--line);
    padding: 16px 0;
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-inner p { margin: 0; flex: 1; min-width: 220px; font-size: .9rem; color: var(--ink-dim); }
.cookie-inner .btn { padding: 10px 22px; }

/* ===== 404 ===== */
.notfound { text-align: center; padding: 40px 0; }
.notfound .code { font-size: 5rem; font-weight: 800; color: var(--gold); line-height: 1; }
.notfound .search-form { max-width: 460px; margin: 24px auto; }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .layout-single .content-area { width: 100%; }
    .cards.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-media { order: 0; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: block; }
    .main-nav { width: 100%; margin-left: 0; }
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 12px;
    }
    .menu.is-open { display: flex; }
    .menu a { padding: 12px 14px; background: var(--bg-card); }

    .cards.cols-3 { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 200px; }
    .gallery-grid .wide, .gallery-grid .tall { grid-column: auto; grid-row: auto; }

    .post-row { flex-direction: column; }
    .post-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
        height: auto;
    }
    .post-row .card-thumb-wrap a { position: static; }
    .post-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .hero-inner { padding: 28px 22px; }
    .hero-inner h1 { font-size: 1.7rem; }
    .entry-title, .section-head h2 { font-size: 1.5rem; }
}
