/*
Theme Name: dds_znak-ra.ru
Author: Виталий Назаров
Description: Информационная тема о наружной рекламе и рекламном производстве: вывески, стенды, материалы, подсветка, крепления и подготовка макетов к печати.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: znakra
*/

/* =========================================================
   Переменные и база
   ========================================================= */
:root {
    --navy:      #16233d;
    --navy-2:    #1f3253;
    --navy-3:    #243657;
    --amber:     #f5a623;
    --amber-2:   #ffcf6b;
    --ink:       #1c2433;
    --muted:     #5b6a83;
    --line:      #e2e7f0;
    --bg:        #ffffff;
    --bg-soft:   #f4f6fb;
    --side-bg:   #f4f6fb;
    --foot-bg:   #16233d;
    --radius:    12px;
    --shadow:    0 6px 24px rgba(22, 35, 61, 0.08);
    --shell:     min(92%, 1180px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: #b06d00; text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--navy);
    color: #fff;
    padding: 10px 16px;
    z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

.btn {
    display: inline-block;
    background: var(--amber);
    color: var(--navy);
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 8px;
    border: 2px solid var(--amber);
    transition: background .15s, color .15s;
}
.btn:hover { background: var(--amber-2); border-color: var(--amber-2); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* =========================================================
   Шапка
   ========================================================= */
.site-head {
    background: #fff;
    border-bottom: 3px solid var(--navy);
}
.head-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin-right: auto;
}
.brand-link { display: inline-flex; }
.brand-logo, .brand-mark { width: 52px; height: 52px; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name a { color: var(--navy); font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.brand-desc { color: var(--muted); font-size: 0.82rem; line-height: 1.3; }

.primary-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.primary-nav .nav-list a {
    display: block;
    padding: 8px 14px;
    color: var(--navy);
    font-weight: 600;
    border-radius: 6px;
}
.primary-nav .nav-list a:hover,
.primary-nav .nav-list .current-menu-item > a {
    background: var(--bg-soft);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 40px;
    background: var(--navy);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0 10px;
}
.nav-toggle span { display: block; height: 3px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* =========================================================
   Раскладки
   ========================================================= */
.site-main { display: block; }
.page-wrap { padding: 28px 0 48px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.48fr) minmax(0, 1fr);
    gap: 2.4rem;
    align-items: start;
}
.layout-single { display: block; }
.layout-single .content-area {
    max-width: 900px;
    margin-inline: auto;
}
.content-area { min-width: 0; }

/* =========================================================
   Хлебные крошки
   ========================================================= */
.crumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 18px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--navy); }
.crumbs .sep { margin: 0 6px; color: #b7c1d4; }

/* =========================================================
   Карточки записей
   ========================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.6rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
    min-width: 0;
}
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.card-title { font-size: 1.15rem; margin: 0 0 8px; }
.card-title a { color: var(--navy); }
.card-excerpt { color: #40506a; font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 10px;
    font-weight: 700;
    color: #b06d00;
}

/* =========================================================
   Сайдбар и виджеты
   ========================================================= */
.sidebar {
    background: var(--side-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 22px 8px;
    min-width: 0;
}
.sidebar .widget { margin-bottom: 22px; }
.sidebar .widget-title {
    font-size: 1.05rem;
    color: var(--navy);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--amber);
}
.sidebar,
.sidebar a,
.sidebar li { color: var(--ink); }
.sidebar a { color: #b06d00; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li {
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
}
.sidebar li:last-child { border-bottom: none; }
.sidebar .post-date { color: var(--muted); font-size: 0.8rem; display: block; }

/* =========================================================
   Одиночная запись / страница
   ========================================================= */
.single-post { background: #fff; }
.single-head { margin-bottom: 18px; }
.single-title { font-size: 2rem; }
.single-meta { color: var(--muted); font-size: 0.88rem; }
.single-thumb { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }
.single-thumb img { width: 100%; display: block; }
.single-content { min-width: 0; }
.single-content img { border-radius: 8px; display: block; margin: 1.2em 0; }
.single-content h2 { margin-top: 1.4em; }
.single-content h3 { margin-top: 1.2em; }
.single-content ul, .single-content ol { padding-left: 1.3em; }
.single-content blockquote {
    margin: 1.4em 0;
    background: var(--bg-soft);
    border-left: 4px solid var(--amber);
    border-radius: 8px;
    padding: 16px 20px;
    color: #33415a;
}
.single-content pre {
    background: var(--navy);
    color: #eef2f8;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    min-width: 0;
}
.single-tags { margin-top: 24px; font-size: 0.88rem; }
.single-tags a {
    display: inline-block;
    background: var(--bg-soft);
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0 6px 6px 0;
}
.page-head { margin-bottom: 24px; }
.page-lead { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }

/* Таблицы */
.single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
}
.single-content table,
.single-content th,
.single-content td {
    border: 1px solid #c7d0e0;
}
.single-content th, .single-content td { padding: 10px 12px; text-align: left; }
.single-content th { background: var(--bg-soft); }

/* =========================================================
   Главная — общие секции
   ========================================================= */
.fs { padding: 46px 0; }
.fs:nth-child(even) { background: var(--bg-soft); }
.fs-title { font-size: 1.7rem; margin-bottom: 26px; text-align: center; }

/* Блок 1: текст + иллюстрация */
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.6rem;
    align-items: center;
}
.intro-text { min-width: 0; }
.intro-text h1 { font-size: 2.1rem; }
.intro-media { min-width: 0; }
.intro-media img { width: 100%; border-radius: var(--radius); display: block; box-shadow: var(--shadow); }

/* Блок 2: рубрики */
.rubric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.4rem;
}
.rubric {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    min-width: 0;
    box-shadow: var(--shadow);
}
.rubric-ico { display: inline-flex; width: 46px; height: 46px; margin-bottom: 10px; }
.rubric-ico svg { width: 100%; height: 100%; }
.rubric h3 { margin: 0 0 6px; }
.rubric p { margin: 0; color: #40506a; font-size: 0.94rem; }

/* Последние записи */
.fs-latest .empty { text-align: center; }

/* Блок 3: этапы */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.4rem;
}
.step {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px 22px;
    min-width: 0;
    box-shadow: var(--shadow);
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--navy);
    color: var(--amber);
    font-weight: 800;
    font-size: 1.15rem;
    border-radius: 50%;
    margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; color: #40506a; font-size: 0.94rem; }

/* Блок 4: галерея + CTA */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}
.gal-item {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--navy);
    box-shadow: var(--shadow);
    min-width: 0;
}
.gal-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.gal-item figcaption {
    padding: 12px 16px;
    color: #eef2f8;
    font-weight: 600;
    font-size: 0.95rem;
}
.gallery-cta {
    margin-top: 30px;
    background: var(--navy);
    border-radius: var(--radius);
    padding: 30px 34px;
    text-align: center;
    color: #eef2f8;
}
.gallery-cta p { color: #d6deec; margin: 0 0 18px; }

/* =========================================================
   Пагинация (type => plain, класс .page-numbers)
   ========================================================= */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}
.pager .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(--navy);
    font-weight: 600;
    background: #fff;
}
.pager a.page-numbers:hover { background: var(--bg-soft); text-decoration: none; }
.pager .page-numbers.current {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.pager .page-numbers.dots {
    border: none;
    background: none;
}

/* =========================================================
   Комментарии
   ========================================================= */
.comments-area { margin-top: 44px; }
.comments-title { font-size: 1.35rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol { list-style: none; }
.comment-list .children { list-style: none; margin: 0 0 0 24px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-body {
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.comment-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.comment-author { font-weight: 700; color: var(--navy); }
.comment-meta time { color: var(--muted); font-size: 0.82rem; }
.comment-content { min-width: 0; }
.comment-actions { margin-top: 6px; font-size: 0.85rem; }
.comment-respond {
    margin-top: 26px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}
.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 #c7d0e0;
    border-radius: 8px;
    font: inherit;
    margin-top: 4px;
}
.comment-form p { margin-bottom: 14px; }
.form-submit .submit {
    background: var(--amber);
    color: var(--navy);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

/* =========================================================
   Форма поиска
   ========================================================= */
.search-form { margin: 16px 0; }
.search-label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.search-row { display: flex; gap: 8px; min-width: 0; }
.search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #c7d0e0;
    border-radius: 8px;
    font: inherit;
}
.search-submit {
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}
.error-404 { text-align: center; padding: 20px 0 40px; }
.error-404 .search-form { max-width: 480px; margin-inline: auto; }
.back-home { margin-top: 24px; }

/* =========================================================
   Подвал
   ========================================================= */
.site-foot {
    background: var(--foot-bg);
    color: #d6deec;
    margin-top: 40px;
    padding: 44px 0 24px;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.foot-col { min-width: 0; }
/* Контраст в тёмном футере — светлый текст (F) */
.site-foot,
.site-foot p,
.site-foot li,
.site-foot .widget { color: #d6deec; }
.site-foot .widget-title { color: #fff; font-size: 1.05rem; margin: 0 0 12px; }
.site-foot a { color: var(--amber-2); }
.site-foot a:hover { color: #fff; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.site-foot li:last-child { border-bottom: none; }
.foot-bottom {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.12);
}
.copyright { margin: 0; font-size: 0.88rem; color: #9fb0cc; }

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

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--navy);
    color: #eef2f8;
    padding: 16px 22px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
}
.cookie-text { margin: 0; font-size: 0.9rem; max-width: 820px; }
.cookie-accept {
    background: var(--amber);
    color: var(--navy);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--amber-2); }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .sidebar { margin-top: 8px; }
    .intro-grid { grid-template-columns: minmax(0, 1fr); }
    .intro-text h1 { font-size: 1.8rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.6rem; }
    .fs { padding: 34px 0; }
    .fs-title { font-size: 1.4rem; }

    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav .nav-list { flex-direction: column; gap: 2px; }
    .primary-nav .nav-list a { padding: 12px 10px; border-bottom: 1px solid var(--line); }

    .gallery-cta { padding: 22px 18px; }
    .comment-list .children { margin-left: 12px; }
    .cookie-banner { padding: 14px 16px; gap: 12px; }
    .cookie-text { font-size: 0.85rem; }
}
