/*
Theme Name: dds_golf-v.ru
Author: Олег Баранов
Description: Информационная тема-база знаний по эксплуатации Volkswagen Golf 5: поломки, обслуживание, диагностика и советы владельцу.
Version: 1.1
Text Domain: golffive
*/

/* ==================================================================
   Переменные и база
   ================================================================== */
:root {
    --ink: #1e2a38;
    --ink-2: #2f4a63;
    --accent: #e2661a;
    --accent-dark: #c4550f;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #eef2f6;
    --text: #23303c;
    --muted: #6e7c8a;
    --line: #dbe3ec;
    --footer-text: #c6d0da;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(30, 42, 56, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "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(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 0.6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

/* Единый контейнер ширины (A12.7) */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ==================================================================
   Шапка
   ================================================================== */
.site-header {
    background: var(--ink);
    color: #fff;
    border-bottom: 3px solid var(--accent);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 0.9rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}
.brand-logo { display: block; height: 48px; width: auto; }
.brand-svg { flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-title {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.brand-title:hover { text-decoration: none; }
.brand-desc {
    display: block;
    font-size: 0.82rem;
    color: #9fb2c4;
    margin-top: 2px;
}

.nav-toggle {
    margin-left: auto;
    display: none;
    background: transparent;
    border: 1px solid #47586a;
    color: #fff;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    color: #d7e0e9;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-weight: 500;
}
.main-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}
.main-nav .current-menu-item > a {
    background: var(--accent);
    color: #fff;
}

/* ==================================================================
   Хлебные крошки
   ================================================================== */
.breadcrumbs-bar {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}
.breadcrumbs {
    padding: 0.7rem 0;
    color: var(--muted);
}
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs .sep { margin: 0 0.35rem; color: #aab6c2; }

/* ==================================================================
   Раскладки
   ================================================================== */
.site-main { padding: 2.2rem 0 3rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
    gap: 2.4rem;
    align-items: start;
}
.layout-single { display: block; }
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

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

/* ==================================================================
   Записи и статьи
   ================================================================== */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.6rem;
}
.entry-title { margin-top: 0; }
.entry-meta {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}
.entry-thumb { margin: 0 0 1.2rem; }
.entry-thumb img { display: block; border-radius: var(--radius); width: 100%; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }

/* Таблицы */
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2rem 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: var(--surface-2); }

/* ==================================================================
   Карточки записей (A8, A10)
   ================================================================== */
.cards { display: grid; gap: 1.4rem; }

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.4rem;
    min-width: 0;
}
.card-title { font-size: 1.18rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-dark); }
.card-meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.7rem; }
.card-excerpt { color: var(--text); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 0.6rem;
    font-weight: 600;
    color: var(--accent-dark);
}

/* ==================================================================
   Пагинация (D5)
   ================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 2rem 0 0;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 500;
    line-height: 1;
}
.pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ==================================================================
   Сайдбар (светлый фон -> тёмный текст) (F)
   ================================================================== */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow);
    color: var(--text);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
}
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--ink-2); }
.sidebar .widget a:hover { color: var(--accent-dark); }
.sidebar .widget_recent_entries .post-date {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

/* ==================================================================
   Подвал (тёмный фон -> светлый текст) (E2, F)
   ================================================================== */
.site-footer {
    background: var(--ink);
    color: var(--footer-text);
    padding: 2.6rem 0 1.4rem;
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}
.site-footer .widget { margin: 0; color: var(--footer-text); }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #38495a;
}
.site-footer .widget p { color: var(--footer-text); }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 0.35rem 0; }
.site-footer .widget a { color: #dbe4ed; }
.site-footer .widget a:hover { color: var(--accent); text-decoration: none; }

.footer-bottom {
    border-top: 1px solid #38495a;
    margin-top: 2rem;
    padding-top: 1.2rem;
    font-size: 0.85rem;
    color: #9fb2c4;
}

/* ==================================================================
   Главная страница
   ================================================================== */
.front-col {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.front-section { margin: 0 0 3rem; }
.section-head { margin-bottom: 1.4rem; }
.section-head h2 { margin: 0; }
.section-head .section-sub { color: var(--muted); margin: 0.4rem 0 0; }

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

/* Блок 2: сетка рубрик */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
}
.topic-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.3rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.topic-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: 10px;
    margin-bottom: 0.9rem;
}
.topic-icon svg { width: 26px; height: 26px; }
.topic-card h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.topic-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Блок «последние записи» */
.front-latest .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Блок 3: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
    counter-reset: step;
}
.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.step h3 { font-size: 1.08rem; margin: 0 0 0.4rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* Блок 4: FAQ (аккордеон на <details>) */
.faq { display: grid; gap: 0.9rem; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 1.3rem;
    box-shadow: var(--shadow);
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    padding: 1.1rem 0;
    list-style: none;
    position: relative;
    padding-right: 2rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--accent);
    line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details p {
    margin: 0;
    padding: 0 0 1.1rem;
    color: var(--text);
}

/* CTA-плашка (пример акцентного блока с фоном — A14) */
.fs-cta {
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    padding: 2.4rem 2.2rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; }
.fs-cta p { color: #cdd8e2; max-width: 640px; margin-left: auto; margin-right: auto; }
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 0.6rem;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }

/* ==================================================================
   Комментарии
   ================================================================== */
.comments-area {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.8rem;
    margin-top: 1.6rem;
    box-shadow: var(--shadow);
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.4rem; padding: 0; }
.comment-item { margin: 0 0 1.1rem; }
.comment-inner {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem 1.1rem;
}
.comment-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.comment-author { font-weight: 600; color: var(--ink); }
.comment-date { color: var(--muted); font-size: 0.82rem; }
.comment-await { color: var(--accent-dark); font-size: 0.85rem; }
.comment-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    margin-bottom: 1rem;
}
.comment-form .submit,
.search-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.comment-form .submit:hover,
.search-submit:hover { background: var(--accent-dark); }

/* ==================================================================
   Форма поиска
   ================================================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 480px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

/* ==================================================================
   Страница 404
   ================================================================== */
.error-404 {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.4rem 2rem;
    box-shadow: var(--shadow);
}
.error-404 h1 { font-size: 4rem; margin: 0; color: var(--accent); }

/* ==================================================================
   Cookie-баннер (D6, A11) — правило [hidden] ДО основных стилей
   ================================================================== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: var(--ink);
    color: #e6edf3;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.2);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 760px; }
.cookie-banner a { color: var(--accent); }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--accent-dark); }

/* ==================================================================
   Адаптив
   ================================================================== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .front-latest .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 1.6rem; }
    .front-col { width: 92%; }
    .layout-single .content-area { width: 100%; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }

    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0.2rem; }

    .fs-split { grid-template-columns: 1fr; }
    .fs-split.reverse .fs-media { order: 0; }
    .topic-grid { grid-template-columns: 1fr; }
    .front-latest .cards { grid-template-columns: 1fr; }

    .fs-cta { padding: 1.8rem 1.4rem; }
    .entry { padding: 1.3rem; }
    .comments-area { padding: 1.2rem; }

    .card-body { padding: 1.1rem; }
}
