/*
Theme Name: dds_garant26.ru
Author: Ольга Грачева
Description: Информационная тема для правового медиа-ресурса. Понятные статьи, обзоры судебной практики, практические инструкции и экспертные диалоги. Адаптивная вёрстка, без коммерческих форм.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: garmedia
*/

:root {
    --ink: #1b2435;
    --ink-soft: #4a566b;
    --primary: #1f3a5f;
    --primary-deep: #16273f;
    --accent: #b07d2e;
    --accent-soft: #d9b066;
    --paper: #faf7f1;
    --surface: #ffffff;
    --line: #e3ddd1;
    --footer-bg: #16273f;
    --footer-ink: #d6dcea;
    --footer-muted: #93a0bd;
    --radius: 10px;
    --shell: min(92%, 1180px);
    --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
}

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

a { color: var(--primary); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    color: var(--ink);
    line-height: 1.25;
    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; }

.shell {
    width: var(--shell);
    margin-inline: auto;
}

/* ---------- Шапка ---------- */
.site-header {
    background: var(--surface);
    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;
    text-decoration: none;
}
.brand-logo, .brand svg.brand-logo { display: block; width: 52px; height: 52px; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    line-height: 1.2;
}
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    display: block;
    max-width: 520px;
}
.header-nav { margin-left: auto; }
.nav-toggle {
    display: none;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.main-menu a {
    display: block;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.97rem;
}
.main-menu a:hover,
.main-menu .current-menu-item > a {
    background: var(--paper);
    color: var(--primary);
}

/* ---------- Макеты ---------- */
.site-main { padding: 34px 0 48px; }

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

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

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
    font-size: 0.86rem;
    color: var(--ink-soft);
    margin-bottom: 22px;
}
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; color: var(--accent); }

/* ---------- Карточки записей ---------- */
.card-grid {
    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;
    min-width: 0;
}
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-placeholder {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumb-placeholder svg { width: 64px; height: 64px; opacity: 0.85; }
.card-body {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.card-meta {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.card-title { font-size: 1.22rem; margin: 0 0 10px; }
.card-title a { text-decoration: none; color: var(--ink); }
.card-title a:hover { color: var(--primary); }
.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: 14px;
}
.card-more a {
    display: inline-block;
    font-weight: 600;
    text-decoration: none;
    color: var(--primary);
}
.card-more a:hover { color: var(--accent); }

/* Горизонтальная карточка (последние записи на главной) */
.post-row {
    display: flex;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 22px;
    min-width: 0;
}
.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-thumb-wrap img,
.card-thumb-wrap .ph {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-thumb-wrap .ph {
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumb-wrap .ph svg { width: 56px; height: 56px; opacity: 0.85; }
.post-row .card-body { padding: 22px 24px 22px 0; }

/* ---------- Записи / страницы (содержимое) ---------- */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px 36px;
}
.entry-title { margin-top: 0; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 20px;
}
.entry-meta a { color: var(--accent); text-decoration: none; }
.entry-content { min-width: 0; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content img { border-radius: 8px; display: block; margin: 1em 0; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content blockquote {
    border-left: 4px solid var(--accent);
    margin: 1.4em 0;
    padding: 4px 0 4px 20px;
    color: var(--ink-soft);
    font-style: italic;
}

/* Таблицы */
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    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: 10px 12px; text-align: left; }
.entry-content th { background: var(--paper); }

/* ---------- Главная ---------- */
.fp-wrap {
    width: min(85%, 1180px);
    margin-inline: auto;
}
.section {
    padding: 46px 0;
    border-bottom: 1px solid var(--line);
}
.section:last-of-type { border-bottom: 0; }
.section-head { max-width: 720px; margin-bottom: 28px; }
.section-head .eyebrow {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.82rem;
    display: block;
    margin-bottom: 8px;
}

/* Блок 1: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img, .split-media svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}
.split-text p:last-child { margin-bottom: 0; }

/* Блок 2: сетка направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    min-width: 0;
}
.feature .icon {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: var(--paper);
    border-radius: 10px;
    margin-bottom: 14px;
}
.feature .icon svg { width: 26px; height: 26px; }
.feature h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* Блок 3: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 26px;
    counter-reset: step;
}
.step {
    position: relative;
    padding: 28px 24px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.12rem; margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }

/* Блок 4: FAQ */
.faq { max-width: 820px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 22px;
    margin-bottom: 14px;
}
.faq summary {
    cursor: pointer;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 16px 0;
    list-style: none;
    color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+';
    float: right;
    color: var(--accent);
    font-size: 1.4rem;
    line-height: 1;
}
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); }

.latest-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.latest-head .all-link { text-decoration: none; font-weight: 600; color: var(--accent); }

/* ---------- Сайдбар ---------- */
.sidebar {
    min-width: 0;
}
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 22px;
    margin-bottom: 24px;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.15rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}
.sidebar .widget a { color: var(--primary); text-decoration: none; }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar .post-date { display: block; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Пагинация ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}
.pagination a.page-numbers:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.pagination .page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: 0;
    background: none;
}

/* ---------- Форма поиска ---------- */
.search-form {
    display: flex;
    gap: 8px;
    min-width: 0;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
}
.search-form .search-submit {
    padding: 11px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--primary-deep); }

/* ---------- Комментарии ---------- */
.comments-area {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-top: 30px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-body {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px 18px;
}
.comment-meta { font-size: 0.85rem; margin-bottom: 8px; }
.comment-author { font-weight: 700; color: var(--primary); }
.comment-date { color: var(--ink-soft); margin-left: 10px; }
.comment-reply a { font-size: 0.85rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-top: 4px;
}
.comment-form .submit {
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 22px;
    font-weight: 600;
    cursor: pointer;
}

/* ---------- 404 ---------- */
.error-404 {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 48px 32px;
}
.error-404 .code {
    font-family: var(--serif);
    font-size: 4.5rem;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 10px;
}
.error-404 .search-form { max-width: 460px; margin: 24px auto 0; }
.btn-home {
    display: inline-block;
    margin-top: 18px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
}
.btn-home:hover { background: var(--primary-deep); color: #fff; }

/* ---------- CTA внутри секций ---------- */
.cta-link {
    display: inline-block;
    margin-top: 8px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
}
.cta-link:hover { background: #946720; color: #fff; }

/* ---------- Подвал ---------- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 48px 0 0;
    margin-top: 20px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 36px;
}
.site-footer .widget { margin-bottom: 0; min-width: 0; }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.15rem;
    margin: 0 0 14px;
}
.site-footer p { color: var(--footer-ink); }
.site-footer a { color: var(--accent-soft); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 6px 0; }
.site-footer .post-date { color: var(--footer-muted); display: block; font-size: 0.8rem; }
.footer-bottom {
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 22px 0;
    font-size: 0.85rem;
    color: var(--footer-muted);
}

/* ---------- Cookie-баннер ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: var(--primary-deep);
    color: #eef2f8;
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; }
.cookie-banner a { color: var(--accent-soft); }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 22px;
    font-weight: 700;
    cursor: pointer;
}
.cookie-accept:hover { background: #946720; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .split { grid-template-columns: minmax(0, 1fr); }
    .split.reverse .split-media { order: 0; }
    .layout-single.is-wide { width: 92%; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    .header-nav { margin-left: auto; }
    .nav-toggle { display: inline-block; }
    .main-menu {
        display: none;
        position: absolute;
        left: 0; right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        gap: 0;
        padding: 8px 16px 16px;
        z-index: 50;
    }
    .site-header { position: relative; }
    .main-menu.is-open { display: flex; }
    .main-menu a { padding: 12px 8px; }

    .post-row { flex-direction: column; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
        aspect-ratio: 16 / 9;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img,
    .card-thumb-wrap .ph {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .post-row .card-body { padding: 0 22px 22px; }
    .entry { padding: 24px 20px; }
    .comments-area { padding: 22px 18px; }
}
