/*
Theme Name: dds_cles-express.com
Author: Максим Соловьёв
Description: Информационная тема о ключах, замках и замочной фурнитуре: разборы, уход и практические советы. Адаптивная вёрстка, боковая колонка, хлебные крошки, нумерованная пагинация.
Version: 1.1
Text Domain: clesx
*/

/* ============================ Токены ============================ */
:root {
    --steel:      #1f3a52;
    --steel-dark: #16283a;
    --steel-soft: #2c5271;
    --brass:      #b9812a;
    --brass-lt:   #dfa53f;
    --ink:        #1c2530;
    --muted:      #5a6b78;
    --line:       #dde4ea;
    --paper:      #f4f6f8;
    --panel:      #ffffff;
    --panel-alt:  #eef2f5;
    --radius:     12px;
    --shell:      1160px;
    --shadow:     0 8px 26px rgba(22, 40, 58, .08);
}

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

html { scroll-behavior: smooth; }

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

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

a { color: var(--steel-soft); text-decoration: none; }
a:hover { color: var(--brass); }

h1, h2, h3, h4 {
    line-height: 1.2;
    color: var(--steel-dark);
    font-weight: 700;
    letter-spacing: -.01em;
}
h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.5rem); margin: 0 0 .6em; }
h2 { font-size: clamp(1.35rem, 1.05rem + 1.4vw, 1.85rem); margin: 0 0 .55em; }
h3 { font-size: 1.2rem; margin: 0 0 .5em; }

p { margin: 0 0 1.1em; }

:focus-visible { outline: 3px solid var(--brass-lt); outline-offset: 2px; }

.screen-reader-text {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Контейнер ширины — задаётся в одном месте (A12.7) */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

.btn {
    display: inline-block;
    padding: .72rem 1.5rem;
    background: var(--brass);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: .01em;
    transition: background .18s ease;
}
.btn:hover { background: var(--brass-lt); color: #fff; }

/* ============================ Шапка ============================ */
.site-header {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: .9rem 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.brand-logo-link { display: inline-flex; align-items: center; }
.brand-logo { display: block; height: 46px; width: auto; }
.brand-mark { display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1.05rem; color: var(--steel-dark); line-height: 1.25; }
.brand-desc { font-size: .78rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 44px; height: 40px;
    background: none; border: 1px solid var(--line); border-radius: 8px;
    cursor: pointer; padding: 0; flex-direction: column; gap: 5px;
    align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--steel-dark); }

.primary-nav { margin-left: auto; }
.nav-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: .3rem; align-items: center;
}
.nav-list li { margin: 0; }
.nav-list a {
    display: block;
    padding: .5rem .85rem;
    color: var(--ink);
    font-weight: 600;
    font-size: .96rem;
    border-radius: 7px;
}
.nav-list a:hover,
.nav-list .current-menu-item > a { color: var(--brass); background: var(--panel-alt); }

.site-main { display: block; padding: 2.2rem 0 3rem; }

/* ============================ Хлебные крошки ============================ */
.crumbs {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 1.4rem;
}
.crumbs a { color: var(--steel-soft); }
.crumbs .sep { margin: 0 .35rem; color: #9aa8b4; }

/* ============================ Раскладка страниц ============================ */
.page-shell { display: block; }
.page-shell.has-aside {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.4rem;
    align-items: start;
}
.page-shell.no-aside .content-area {
    width: 85%;
    margin-inline: auto;
}
.content-area { min-width: 0; }

@media (max-width: 960px) {
    .page-shell.has-aside { grid-template-columns: 1fr; }
    .page-shell.no-aside .content-area { width: 100%; }
}

.page-heading { margin-bottom: 1.2rem; }
.archive-desc { color: var(--muted); margin-bottom: 1.4rem; }

/* ============================ Сайдбар ============================ */
.sidebar { min-width: 0; }
.sidebar .widget,
.footer-col .widget { margin-bottom: 1.8rem; }

.sidebar .widget {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.35rem;
}
.sidebar .widget-title {
    font-size: 1.02rem;
    margin: 0 0 .9rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--brass-lt);
    color: var(--steel-dark);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: var(--ink); font-weight: 500; }
.sidebar .widget a:hover { color: var(--brass); }
.sidebar .widget .post-date { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ============================ Карточки записей ============================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(22, 40, 58, .12); }

.card-thumb-wrap { display: block; }
.card-thumb {
    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.35rem;
}
.card-meta { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; letter-spacing: .02em; }
.card-title { font-size: 1.16rem; margin: 0 0 .6rem; }
.card-title a { color: var(--steel-dark); }
.card-title a:hover { color: var(--brass); }
.card-excerpt { color: var(--muted); font-size: .95rem; flex: 1; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    margin-top: .9rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--brass);
    align-self: flex-start;
}

/* ============================ Пагинация ============================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: 2.4rem;
    justify-content: center;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    font-weight: 600;
    font-size: .92rem;
}
.pager a.page-numbers:hover { border-color: var(--brass); color: var(--brass); }
.pager .page-numbers.current {
    background: var(--steel);
    border-color: var(--steel);
    color: #fff;
}
.pager .page-numbers.dots { border: none; background: none; }

/* ============================ Запись / страница ============================ */
.post-single, .page-article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 2.1rem;
    box-shadow: var(--shadow);
}
.post-head { margin-bottom: 1.3rem; }
.post-meta { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.post-meta a { color: var(--steel-soft); }
.post-cover { margin: 0 0 1.6rem; border-radius: 10px; overflow: hidden; }
.post-cover img { display: block; width: 100%; }

.post-content { min-width: 0; }
.post-content img { border-radius: 8px; }
.post-content h2 { margin-top: 1.6em; }
.post-content h3 { margin-top: 1.4em; }
.post-content ul, .post-content ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.post-content li { margin-bottom: .4em; }
.post-content blockquote {
    margin: 1.5em 0;
    padding: 1.2rem 1.4rem;
    background: var(--panel-alt);
    border-left: 4px solid var(--brass);
    border-radius: 0 8px 8px 0;
    color: var(--steel-dark);
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content a { text-decoration: underline; text-underline-offset: 2px; }

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--line);
}
.post-content th, .post-content td {
    border: 1px solid var(--line);
    padding: .6rem .8rem;
    text-align: left;
}
.post-content th { background: var(--panel-alt); color: var(--steel-dark); }

@media (max-width: 600px) {
    .post-single, .page-article { padding: 1.4rem 1.2rem; }
}

/* ============================ Комментарии ============================ */
.comments-area { margin-top: 2rem; }
.comments-title { font-size: 1.3rem; margin-bottom: 1.2rem; }
.comment-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.comment-list ol.children { list-style: none; padding-left: 1.4rem; margin-top: 1rem; }
.comment-item { margin-bottom: 1.1rem; }
.comment-inner {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
}
.comment-head { display: flex; gap: .8rem; align-items: baseline; margin-bottom: .5rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; color: var(--steel-dark); }
.comment-date { font-size: .78rem; color: var(--muted); }
.comment-reply { margin-top: .5rem; font-size: .85rem; }

.comment-respond {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.6rem;
    margin-top: 1.5rem;
}
.comment-form label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    margin-bottom: 1rem;
    background: #fff;
}
.comment-form .submit,
.form-submit input {
    background: var(--brass);
    color: #fff;
    border: none;
    padding: .7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================ Форма поиска ============================ */
.search-form { display: flex; gap: .5rem; max-width: 460px; }
.search-field {
    flex: 1;
    min-width: 0;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.search-submit {
    padding: .6rem 1.2rem;
    background: var(--steel);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.search-submit:hover { background: var(--steel-soft); }

/* ============================ 404 ============================ */
.error-404 {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.4rem 2.2rem;
    box-shadow: var(--shadow);
}
.error-404 .search-form { margin: 1.4rem 0; }
@media (max-width: 600px) { .error-404 { padding: 1.6rem 1.3rem; } }

/* ============================ Главная ============================ */
.front { display: block; }
.front-shell { width: 85%; margin-inline: auto; }
@media (max-width: 960px) { .front-shell { width: 92%; } }

.fs { margin-bottom: 3.2rem; }
.fs:last-child { margin-bottom: 1rem; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: .9rem;
}
.eyebrow::before {
    content: "";
    width: 26px; height: 2px; background: var(--brass); display: inline-block;
}

/* Блок 1 — текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.6rem;
    align-items: center;
}
.fs-split .fs-figure img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.fs-split .fs-copy p { color: var(--muted); }
.fs-split .fs-copy .btn { margin-top: .6rem; }
@media (max-width: 780px) {
    .fs-split { grid-template-columns: 1fr; gap: 1.6rem; }
    .fs-split .fs-figure { order: -1; }
}

/* Блок 2 — сетка тем */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.3rem;
}
@media (max-width: 900px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .topic-grid { grid-template-columns: 1fr; } }
.topic {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem;
    box-shadow: var(--shadow);
}
.topic-ico {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: var(--panel-alt);
    border-radius: 10px;
    margin-bottom: 1rem;
}
.topic-ico svg { display: block; }
.topic h3 { font-size: 1.08rem; margin-bottom: .4rem; }
.topic p { font-size: .9rem; color: var(--muted); margin: 0; }

/* Блок «последние записи» */
.fs-latest .fs-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.fs-latest .fs-head .link-all { font-weight: 600; color: var(--brass); font-size: .95rem; white-space: nowrap; }

/* Блок 3 — шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
    counter-reset: step;
}
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }
.step {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem 1.4rem;
    box-shadow: var(--shadow);
}
.step .step-num {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: var(--steel);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: .9rem;
}
.step h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.step p { font-size: .92rem; color: var(--muted); margin: 0; }

.fs-steps .steps-cta { margin-top: 1.8rem; text-align: center; }

/* Блок 4 — FAQ */
.faq { display: grid; gap: .8rem; }
.faq-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 1.4rem;
    overflow: hidden;
}
.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 1.1rem 2rem 1.1rem 0;
    font-weight: 600;
    color: var(--steel-dark);
    position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: var(--brass);
    line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-a { padding: 0 0 1.2rem; color: var(--muted); font-size: .95rem; }
.faq-item .faq-a p { margin: 0; }

/* ============================ Подвал ============================ */
.site-footer {
    background: var(--steel-dark);
    color: #c6d3de;
    margin-top: 1rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 2.6rem 0 2rem;
}
@media (max-width: 780px) { .footer-cols { grid-template-columns: 1fr; gap: 1.6rem; } }

/* Контраст текста виджетов в тёмном подвале (F) */
.footer-col { min-width: 0; }
.footer-col .widget-title {
    color: #fff;
    font-size: 1rem;
    margin: 0 0 .9rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--brass);
}
.footer-col, .footer-col p { color: #b7c6d2; font-size: .92rem; }
.footer-col a { color: #dfe8ef; }
.footer-col a:hover { color: var(--brass-lt); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: .35rem 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.footer-col li:last-child { border-bottom: 0; }
.footer-col .post-date { color: #8ea2b2; font-size: .78rem; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 1.1rem 0;
    font-size: .85rem;
    color: #8ea2b2;
}

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

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--steel-dark);
    color: #dfe8ef;
    border-top: 2px solid var(--brass);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; flex: 1; min-width: 240px; font-size: .9rem; color: #c6d3de; }
.cookie-accept {
    background: var(--brass);
    color: #fff;
    border: none;
    padding: .65rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--brass-lt); }

/* ============================ Мобильное меню ============================ */
@media (max-width: 780px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .nav-list { flex-direction: column; align-items: stretch; gap: .1rem; padding-top: .6rem; }
    .nav-list a { padding: .7rem .5rem; }
}
