/*
Theme Name: dds_marinadelta.com
Theme URI: https://marinadelta.com/
Author: Марина Дельта
Description: Тема справочника «Азбука недвижимости»: разворот словаря, каталожные карточки, штампы и библиотечные ярлыки.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mdelta
*/

/* ---------- Служебные правила hidden (до основных стилей) ---------- */
.cookie-banner[hidden] { display: none !important; }

/* ---------- Переменные ---------- */
:root {
    --paper: #EFE6D3;
    --paper-card: #F6EFDF;
    --paper-old: #D9CBB0;
    --paper-aside: #E6DAC1;
    --ink: #1F3A34;
    --ink-deep: #162B27;
    --muted: #6E6350;
    --stamp: #B8442C;
    --gold: #C9A227;
    --gold-soft: #DCC27A;
    --on-dark: #EFE6D3;
    --on-dark-muted: #B9C4B6;
    --f-display: "Playfair Display", "Times New Roman", Georgia, serif;
    --f-text: "Old Standard TT", "PT Serif", Georgia, "Times New Roman", serif;
    --f-hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;
    --rule: 3px double var(--ink);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(rgba(110, 99, 80, .16) .6px, transparent .9px),
        radial-gradient(rgba(110, 99, 80, .10) .5px, transparent .8px),
        var(--mdelta-paper-tile, none);
    background-size: 23px 23px, 37px 37px, 800px 180px;
    background-position: 0 0, 11px 17px, 0 0;
    font-family: var(--f-text);
    font-size: 1.0625rem;
    line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(31, 58, 52, .45); transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--stamp); text-decoration-color: var(--stamp); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px dashed var(--stamp); outline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 { font-family: var(--f-display); color: var(--ink); line-height: 1.2; margin: 1.6em 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
p, li, h1, h2, h3, h4, dd, dt, td, th, figcaption, blockquote { overflow-wrap: break-word; hyphens: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--ink); color: var(--paper); padding: .6rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; color: var(--paper); }

.shell { width: min(92%, 1180px); margin-inline: auto; }

/* ---------- Кнопки-штампы и ссылки-отсылки ---------- */
.stamp-btn,
.search-form button,
.form-submit .submit {
    display: inline-block;
    padding: .55rem 1.15rem;
    border: 3px solid var(--ink);
    outline: 1px solid var(--ink);
    outline-offset: -7px;
    background: transparent;
    color: var(--ink);
    font-family: var(--f-text);
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.3;
    cursor: pointer;
    border-radius: 0;
    transition: background .15s, color .15s, transform .15s;
}
.stamp-btn:hover,
.search-form button:hover,
.form-submit .submit:hover { background: var(--ink); color: var(--paper); outline-color: var(--paper); transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--stamp); }
.stamp-btn-sm { padding: .4rem .8rem; font-size: .72rem; border-width: 2px; outline-offset: -5px; }
.ref-link { font-style: italic; text-decoration: underline; }
.ref-link::before { content: "→ "; font-style: normal; color: var(--stamp); }

/* ---------- Шапка ---------- */
.masthead { padding-top: 1.6rem; }
.masthead-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: flex-start; gap: 1rem; text-decoration: none; color: var(--ink); min-width: 0; flex: 1 1 520px; max-width: 760px; }
.brand:hover { color: var(--ink); }
.brand-mark { flex: 0 0 auto; }
.brand-svg { display: block; width: 96px; height: 60px; }
.brand-logo { display: block; max-height: 70px; width: auto; }
.brand-text { display: block; min-width: 0; }
.brand-name { display: block; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.25; }
.brand-desc { display: block; margin-top: .35rem; font-size: .82rem; line-height: 1.45; color: var(--muted); }

.site-nav { flex: 0 1 auto; padding-top: .9rem; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; }
.nav-list li { display: flex; align-items: center; }
.nav-list li + li::before { content: ""; width: 1px; height: 1em; background: var(--ink); margin: 0 1rem; opacity: .7; }
.nav-list a { font-weight: 700; font-size: .84rem; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.nav-list a:hover,
.nav-list .current-menu-item > a { color: var(--stamp); border-bottom-color: var(--stamp); }

.nav-toggle { display: none; align-items: center; gap: .6rem; background: transparent; border: 2px solid var(--ink); padding: .45rem .8rem; font-family: var(--f-text); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; color: var(--ink); cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; content: ""; }
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

/* Алфавитный указатель */
.abc-strip {
    display: flex;
    justify-content: space-between;
    gap: .2rem;
    margin-top: 1.4rem;
    padding: .55rem .2rem;
    border-top: var(--rule);
    border-bottom: var(--rule);
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    overflow: hidden;
}
.abc-strip span { flex: 0 0 auto; width: 1.8em; text-align: center; position: relative; line-height: 1.8; }
.abc-strip .abc-on { color: var(--stamp); }
.abc-strip .abc-on::after { content: ""; position: absolute; inset: 0 .05em; border: 2px solid var(--stamp); border-radius: 50%; transform: rotate(-8deg); }

/* ---------- Раскладки ---------- */
.site-main { display: block; padding-bottom: 4rem; }
.layout-single { display: block; width: 85%; margin-left: auto; margin-right: auto; }
.layout-with-sidebar { display: grid; grid-template-columns: minmax(0, 67fr) minmax(0, 27fr); column-gap: 6%; align-items: start; }
.content-area, .sidebar { min-width: 0; }

.crumbs { margin: 1.4rem 0 1.8rem; font-size: .86rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--stamp); }
.crumbs .sep { margin: 0 .35rem; color: var(--gold); }
.crumbs span:last-child { color: var(--ink); }

.page-head { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: var(--rule); }
.page-title { margin: 0 0 .4rem; font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.1; }
.page-lead { color: var(--muted); margin: 0; }

/* ---------- Заголовки секций ---------- */
.sec-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem 1.2rem;
    padding-top: .9rem;
    margin-bottom: 2.2rem;
    border-top: 1px solid var(--ink);
}
.sec-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.2rem;
    padding: 0 .4rem;
    background: var(--ink);
    color: var(--paper);
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .05em;
}
.sec-title {
    margin: 0;
    padding-bottom: .35rem;
    font-family: var(--f-text);
    font-weight: 700;
    font-size: clamp(1.05rem, 2.2vw, 1.4rem);
    letter-spacing: .32em;
    text-transform: uppercase;
    border-bottom: var(--rule);
    min-width: 0;
}
.sec-aside { margin: 0 0 0 auto; font-family: var(--f-hand); font-size: 1.45rem; color: var(--muted); display: flex; align-items: center; gap: .6rem; }
.sec-aside::after { content: ""; width: 90px; height: 1px; background: var(--muted); box-shadow: 0 0 0 0 transparent; }
.sec-head-dark { border-top-color: var(--gold); }
.sec-head-dark .sec-num { background: var(--gold); color: var(--ink-deep); }
.sec-head-dark .sec-title { color: var(--on-dark); border-bottom-color: var(--gold); }

/* ---------- Главная ---------- */
.front { width: 85%; margin-left: auto; margin-right: auto; padding-top: 2.2rem; }
.fs { margin-bottom: 3.6rem; }

/* 01. Словарная статья дня */
.entry-spread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, .75fr); gap: 2.4rem; align-items: start; }
.entry-word { min-width: 0; }
.entry-headword {
    margin: 0;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(3.6rem, 6.6vw, 6.2rem);
    line-height: .95;
    letter-spacing: -.02em;
    transform: scaleX(.8);
    transform-origin: left center;
    hyphens: none;
    overflow-wrap: normal;
    white-space: nowrap;
}
.entry-trans { margin: 1.4rem 0 .2rem; font-size: 1.6rem; }
.entry-pos { margin: 0; font-style: italic; font-size: 1.35rem; color: var(--muted); }
.entry-text { padding-left: 2.2rem; border-left: 1px solid var(--ink); min-width: 0; font-size: 1.12rem; }
.see-also { margin: 1.6rem 0 0; padding-top: .8rem; border-top: 1px solid var(--ink); font-size: 1rem; }
.see-also a { font-style: italic; }
.entry-margin { position: relative; min-width: 0; padding-top: .4rem; text-align: center; }
.margin-note { margin: 0; font-family: var(--f-hand); font-size: 2.3rem; line-height: 1; color: var(--stamp); transform: rotate(-9deg); }
.margin-arrow { display: block; margin: -.2rem auto .4rem 0; width: 80px; height: auto; }
.margin-stamp {
    display: inline-block;
    padding: .55rem 1.1rem;
    border: 3px solid var(--ink);
    outline: 1px solid var(--ink);
    outline-offset: 3px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.2;
    font-size: 1rem;
    transform: rotate(-6deg);
    margin-top: .8rem;
}

/* 02. Термины по шагам */
.fs-steps {
    background-color: var(--paper-old);
    background-image: linear-gradient(180deg, rgba(201, 162, 39, .10), rgba(201, 162, 39, .26)), repeating-linear-gradient(0deg, rgba(110, 99, 80, .06) 0 1px, transparent 1px 6px);
    padding: 1.6rem 2.2rem 2.4rem;
    border-top: var(--rule);
    border-bottom: var(--rule);
}
.fs-steps .sec-head { border-top: 0; padding-top: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2.4rem; counter-reset: none; }
.step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    padding: 1.1rem .9rem 1.2rem;
    background: var(--paper-card);
    border: 2px solid var(--ink);
    outline: 1px solid var(--muted);
    outline-offset: -6px;
    box-shadow: 4px 4px 0 rgba(31, 58, 52, .18);
}
.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -2.2rem;
    width: 1.9rem;
    height: 14px;
    transform: translateY(-50%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 14'%3E%3Cpath d='M0 7h27M21 1l7 6-7 6' fill='none' stroke='%231F3A34' stroke-width='2.4'/%3E%3C/svg%3E") no-repeat center / contain;
}
.step-num { font-family: var(--f-display); font-weight: 700; font-size: 2.4rem; line-height: 1; }
.step-name { margin: .35rem 0 .45rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 1rem; }
.step-note { font-size: .92rem; line-height: 1.4; }

/* 03. Новые статьи — каталожный ящик */
.drawer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem; padding: .6rem .4rem 0; }
.drawer .card:nth-child(1) { transform: rotate(-1.4deg); }
.drawer .card:nth-child(2) { transform: rotate(.9deg) translateY(8px); }
.drawer .card:nth-child(3) { transform: rotate(-.6deg); }
.drawer .card:hover { transform: rotate(0) translateY(-4px); }
.drawer-more { margin: 2.2rem 0 0; text-align: right; }
.empty-note { color: var(--muted); font-style: italic; }

/* Карточка записи */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 1.3rem 1.3rem 1.1rem;
    background: var(--paper-card);
    border: 1.5px solid var(--ink);
    box-shadow: 5px 5px 0 -1px var(--paper-old), 5px 5px 0 0 var(--ink), 10px 10px 0 -1px var(--paper-card), 10px 10px 0 0 rgba(31, 58, 52, .5);
    transition: transform .2s, box-shadow .2s;
}
.card:hover { box-shadow: 5px 5px 0 -1px var(--paper-old), 5px 5px 0 0 var(--stamp), 10px 10px 0 -1px var(--paper-card), 10px 10px 0 0 rgba(31, 58, 52, .5); }
.card-stamp {
    position: absolute;
    top: .55rem;
    right: .6rem;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(184, 68, 44, .6);
    border-radius: 50%;
    background: radial-gradient(circle, transparent 11px, rgba(184, 68, 44, .55) 11px 12.5px, transparent 13px);
    transform: rotate(-14deg);
    pointer-events: none;
}
.sticky .card-stamp, .card.sticky .card-stamp { background: radial-gradient(circle, rgba(184, 68, 44, .55) 5px, transparent 6px, transparent 11px, rgba(184, 68, 44, .55) 11px 12.5px, transparent 13px); }
.card-top { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; align-items: start; padding-right: 2.6rem; }
.card-thumb { display: block; border: 1px solid rgba(31, 58, 52, .35); background: var(--paper-card); }
.card-thumb img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.card-title { margin: 0; font-size: 1.22rem; line-height: 1.25; min-width: 0; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-body { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-top: .9rem; }
.card-excerpt { flex: 1; font-size: .94rem; line-height: 1.55; padding-top: .7rem; background: repeating-linear-gradient(180deg, transparent 0 calc(1.55em - 1px), rgba(31, 58, 52, .12) calc(1.55em - 1px) 1.55em); background-position: 0 .7rem; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.card-date { font-size: .82rem; color: var(--muted); letter-spacing: .05em; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.2rem 1.8rem; }
.layout-with-sidebar .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 04. Картотека понятий */
.fs-catalog {
    background-color: var(--ink);
    background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 28px);
    color: var(--on-dark);
    padding: 1.6rem 2.2rem 2.6rem;
    border-top: 3px double var(--gold);
    border-bottom: 3px double var(--gold);
}
.fs-catalog .sec-head { border-top: 0; padding-top: 0; }
.catalog { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2.2rem 1.6rem; }
.catalog-box { min-width: 0; }
.catalog-tab {
    display: inline-block;
    min-width: 3.6rem;
    margin-left: .9rem;
    padding: .1rem 1rem .05rem;
    background: var(--gold);
    color: var(--ink-deep);
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}
.catalog-list { list-style: none; margin: 0; padding: 0; }
.catalog-list li + li { margin-top: .4rem; }
.catalog-list a {
    display: block;
    padding: .5rem .8rem;
    background: var(--paper-card);
    color: var(--ink);
    text-decoration: none;
    border-bottom: 3px solid var(--paper-old);
    box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
    font-size: .95rem;
    line-height: 1.3;
    transition: transform .15s, background .15s;
}
.catalog-list a:hover { background: #FFF8E8; transform: translateX(4px); color: var(--ink); }
.catalog-list b { font-weight: 700; }
.catalog-list i { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* 05. Как читать справочник */
.howto { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 2fr); gap: 2.4rem; align-items: center; }
.howto-book { margin: 0; min-width: 0; }
.howto-book img { display: block; width: 100%; height: auto; }
.howto-book figcaption { margin-top: .8rem; font-size: .92rem; font-style: italic; color: var(--muted); }
.scheme { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr); min-width: 0; }
.co { display: flex; align-items: center; gap: .5rem; min-width: 0; font-size: .95rem; color: var(--muted); }
.co em { font-style: normal; line-height: 1.25; }
.co-l { grid-column: 1; justify-content: flex-end; text-align: right; color: #8A6A1E; }
.co-r { grid-column: 3; text-align: left; }
.lead { flex: 1 1 40px; min-width: 24px; max-width: 120px; height: 1px; background: var(--gold); position: relative; }
.lead::before, .lead::after { content: ""; position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.co-l .lead::before { left: -3px; } .co-l .lead::after { right: -3px; }
.co-r .lead::before { left: -3px; } .co-r .lead::after { right: -3px; }
.sp {
    grid-column: 2;
    min-width: 0;
    padding: .6rem 1.4rem;
    background: var(--paper-card);
    border-left: 1.5px solid var(--ink);
    border-right: 1.5px solid var(--ink);
    font-size: .95rem;
}
.sp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-top: 1.5px solid var(--ink); padding-top: 1.2rem; }
.sp-word { font-family: var(--f-display); font-weight: 700; font-size: 3rem; line-height: 1; transform: scaleX(.82); transform-origin: left; }
.sp-illu { display: block; width: 104px; height: auto; flex: 0 0 auto; }
.sp-pos span { font-size: 1.1rem; }
.sp-pos i { color: var(--muted); }
.sp-def { border-bottom: 0; }
.sp-ex { background-image: linear-gradient(var(--paper-card), var(--paper-card)); border-top: 1px dashed rgba(31, 58, 52, .35); }
.sp-links { border-bottom: 1.5px solid var(--ink); padding-bottom: 1.2rem; font-style: italic; }
.sp-links b { font-style: italic; }

/* ---------- Запись и страница ---------- */
.sheet { background: var(--paper-card); border: 1.5px solid var(--ink); outline: 1px solid rgba(31, 58, 52, .35); outline-offset: -8px; padding: 2.2rem 2.4rem 2.4rem; box-shadow: 6px 6px 0 rgba(31, 58, 52, .12); }
.sheet-head { margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: var(--rule); }
.sheet-meta { margin: .4rem 0 0; display: flex; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.sheet-cat a { color: var(--stamp); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; text-decoration: none; border: 1.5px solid var(--stamp); padding: .05rem .5rem; }
.sheet-thumb { margin: 0 0 1.6rem; }
.sheet-thumb img { display: block; width: 100%; height: auto; border: 1px solid var(--ink); }
.sheet-tags { margin: 2rem 0 0; padding-top: .8rem; border-top: 1px solid var(--ink); font-style: italic; }
.sheet-tags a { margin-right: .5rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 1.7rem; padding-bottom: .3rem; border-bottom: 1px solid rgba(31, 58, 52, .35); }
.entry-content h3 { font-size: 1.35rem; }
.entry-content ul, .entry-content ol { padding-left: 1.6rem; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .35em; }
.entry-content ul li::marker { color: var(--stamp); }
.entry-content ol li::marker { color: var(--stamp); font-weight: 700; }
.entry-content blockquote { margin: 1.6em 0; padding: 1.1rem 1.4rem 1.1rem 1.6rem; border-left: 4px solid var(--stamp); background: rgba(217, 203, 176, .45); font-style: italic; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; display: block; overflow-x: auto; }
.entry-content table, .entry-content th, .entry-content td { border: 1px solid var(--ink); }
.entry-content th, .entry-content td { padding: .55rem .75rem; text-align: left; vertical-align: top; }
.entry-content th { background: var(--paper-old); font-weight: 700; }
.entry-content img { display: block; height: auto; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { font-size: .88rem; color: var(--muted); font-style: italic; margin-top: .4rem; }
.entry-content pre { overflow-x: auto; background: var(--paper-old); padding: 1rem; }
.entry-content hr { border: 0; border-top: var(--rule); margin: 2em 0; }
.page-links { margin-top: 1.6rem; font-weight: 700; }

.post-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; margin-top: 2.4rem; }
.post-nav a { display: block; padding: 1rem 1.2rem; border: 1.5px solid var(--ink); background: var(--paper-card); text-decoration: none; font-family: var(--f-display); font-weight: 700; line-height: 1.3; min-width: 0; }
.post-nav a span { display: block; font-family: var(--f-text); font-weight: 400; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .3rem; }
.post-nav-next { text-align: right; grid-column: 2; }
.post-nav a:hover { border-color: var(--stamp); }

/* ---------- Сайдбар ---------- */
.sidebar { background: var(--paper-aside); border: 1.5px solid var(--ink); padding: 1.6rem 1.5rem; color: var(--ink); box-shadow: 5px 5px 0 rgba(31, 58, 52, .15); }
.sidebar .widget + .widget { margin-top: 2rem; }
.sidebar .widget-title { margin: 0 0 1rem; padding-bottom: .4rem; font-family: var(--f-text); font-size: .95rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); border-bottom: var(--rule); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: .55rem 0; border-bottom: 1px dashed rgba(31, 58, 52, .35); line-height: 1.4; }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--ink); text-decoration: none; }
.sidebar a:hover { color: var(--stamp); text-decoration: underline; }
.sidebar .post-date { display: block; font-size: .8rem; color: var(--muted); }
.sidebar p { color: var(--ink); }

/* ---------- Пагинация ---------- */
.pager { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.6rem; align-items: center; }
.pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; height: 2.6rem; padding: 0 .8rem; border: 2px solid var(--ink); background: var(--paper-card); color: var(--ink); font-weight: 700; text-decoration: none; }
.pager a.page-numbers:hover { background: var(--ink); color: var(--paper); }
.pager .page-numbers.current { background: var(--stamp); border-color: var(--stamp); color: #FFF7EA; }
.pager .page-numbers.dots { border: 0; background: none; min-width: auto; }

/* ---------- Поиск ---------- */
.search-form { display: flex; gap: .6rem; margin: 1.4rem 0; flex-wrap: wrap; }
.search-field { flex: 1 1 220px; min-width: 0; padding: .6rem .9rem; border: 2px solid var(--ink); background: var(--paper-card); font-family: var(--f-text); font-size: 1rem; color: var(--ink); border-radius: 0; }
.empty-box { padding: 1.6rem 1.8rem; border: 1.5px dashed var(--ink); background: var(--paper-card); }

/* 404 */
.nf { text-align: center; }
.nf-code { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(5rem, 15vw, 9rem); line-height: 1; color: var(--stamp); transform: rotate(-4deg); }
.nf .search-form { max-width: 520px; margin-inline: auto; justify-content: center; }

/* ---------- Комментарии ---------- */
.notes { margin-top: 2.8rem; }
.notes-title, .comment-reply-title { font-family: var(--f-text); font-size: 1.05rem; letter-spacing: .22em; text-transform: uppercase; border-bottom: var(--rule); padding-bottom: .4rem; margin: 0 0 1.4rem; }
.notes-list, .notes-list .children { list-style: none; margin: 0; padding: 0; }
.notes-list .children { margin-left: 2rem; }
.note-body { padding: 1.1rem 1.3rem; background: var(--paper-card); border: 1px solid var(--ink); border-left: 4px solid var(--gold); margin-bottom: 1rem; }
.note-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.note-ava { display: block; border-radius: 0; border: 1px solid var(--ink); }
.note-author { font-weight: 700; }
.note-head time { font-size: .82rem; color: var(--muted); }
.note-wait { color: var(--stamp); font-style: italic; font-size: .9rem; }
.note-reply a { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; }
.comment-respond { margin-top: 2rem; padding: 1.6rem 1.8rem; background: var(--paper-card); border: 1.5px solid var(--ink); }
.comment-form p { margin-bottom: 1rem; }
.comment-form label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: .6rem .8rem; border: 2px solid var(--ink); background: #FFFBF2; font-family: var(--f-text); font-size: 1rem; color: var(--ink); border-radius: 0; }
.comment-form-cookies-consent { display: flex; gap: .6rem; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; margin: 0; }
.comment-notes, .logged-in-as { font-size: .88rem; color: var(--muted); }
.comment-reply-title small { display: block; margin-top: .4rem; letter-spacing: .05em; text-transform: none; }

/* ---------- Подвал ---------- */
.colophon { background-color: var(--ink-deep); background-image: repeating-linear-gradient(0deg, rgba(239, 230, 211, .025) 0 1px, transparent 1px 5px); color: var(--on-dark); padding: 3.2rem 0 1.6rem; border-top: 4px double var(--gold); }
.colophon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.colophon-col { display: flex; gap: 1.2rem; align-items: flex-start; min-width: 0; padding: 0 2rem; }
.colophon-col + .colophon-col { border-left: 1px solid rgba(201, 162, 39, .35); }
.colophon-col:first-child { padding-left: 0; }
.colophon-col:last-child { padding-right: 0; }
.colophon-art { display: block; flex: 0 0 auto; width: 104px; height: auto; }
.colophon-art-ink { width: 78px; }
.colophon-widgets { min-width: 0; flex: 1; }
.colophon .widget + .widget { margin-top: 1.4rem; }
.colophon .widget-title { margin: 0 0 1rem; font-family: var(--f-text); font-size: .9rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-soft); }
.colophon, .colophon p, .colophon .textwidget { color: var(--on-dark-muted); font-size: .95rem; line-height: 1.6; }
.colophon a { color: var(--on-dark); text-decoration-color: rgba(239, 230, 211, .5); }
.colophon a:hover { color: var(--gold-soft); text-decoration-color: var(--gold-soft); }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { margin-bottom: .45rem; }
.colophon .post-date { color: var(--on-dark-muted); font-size: .8rem; display: block; }
.copyright { margin: 2.6rem 0 0; padding-top: 1.2rem; border-top: 1px solid rgba(201, 162, 39, .4); text-align: center; font-size: .86rem; color: var(--on-dark-muted); }

/* ---------- Cookie-баннер ---------- */
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1.4rem;
    background: var(--paper-card);
    border: 2px solid var(--ink);
    outline: 1px solid var(--ink);
    outline-offset: -7px;
    box-shadow: 6px 6px 0 rgba(22, 43, 39, .35);
}
.cookie-text { margin: 0; font-size: .92rem; line-height: 1.45; flex: 1; min-width: 0; }
.cookie-accept { flex: 0 0 auto; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .front, .layout-single { width: 100%; }
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); row-gap: 2.6rem; }
    .entry-spread { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
    .entry-margin { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 1.2rem; text-align: left; }
    .margin-arrow { margin: 0; transform: rotate(-30deg); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
    .step:not(:last-child)::after { display: none; }
    .step:last-child { grid-column: 1 / -1; }
    .drawer, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .howto { grid-template-columns: minmax(0, 1fr); }
    .howto-book { max-width: 460px; margin-inline: auto; }
    .scheme { grid-template-columns: minmax(0, 1fr); max-width: 560px; width: 100%; justify-self: center; }
    .scheme > * { grid-row: auto !important; grid-column: 1 !important; }
    .co { justify-content: flex-start; text-align: left; padding: .5rem 0 .2rem; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #8A6A1E; }
    .co .lead { display: none; }
    .co::before { content: "◆"; color: var(--gold); font-size: .7rem; }
    .sp { border: 1.5px solid var(--ink); margin-bottom: .2rem; padding: .8rem 1.1rem; }
    .colophon-grid { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; }
    .colophon-col, .colophon-col:first-child, .colophon-col:last-child { padding: 0; }
    .colophon-col + .colophon-col { border-left: 0; border-top: 1px solid rgba(201, 162, 39, .35); padding-top: 2rem; }
    .site-nav { padding-top: .4rem; }
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; }
    .site-nav { flex: 1 0 100%; display: none; padding-top: 0; }
    .site-nav.is-open { display: block; }
    .nav-list { flex-direction: column; border-top: var(--rule); border-bottom: var(--rule); }
    .nav-list li + li::before { display: none; }
    .nav-list li + li { border-top: 1px solid rgba(31, 58, 52, .25); }
    .nav-list a { display: block; padding: .7rem 0; }
    .masthead-row { align-items: center; }
    .brand { flex: 1 1 0; }
    .abc-strip { flex-wrap: wrap; justify-content: flex-start; font-size: .95rem; }
}

@media (max-width: 600px) {
    body { font-size: 1rem; }
    .brand-svg { width: 64px; height: 40px; }
    .brand-desc { display: none; }
    .brand-name { font-size: .98rem; }
    .margin-stamp { margin-right: .6rem; }
    .abc-strip span { width: 1.6em; }
    .front { padding-top: 1.4rem; }
    .fs { margin-bottom: 2.8rem; }
    .sec-title { letter-spacing: .18em; }
    .sec-aside { margin-left: 0; font-size: 1.25rem; }
    .entry-spread { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
    .entry-text { padding-left: 0; border-left: 0; padding-top: 1.2rem; border-top: 1px solid var(--ink); }
    .entry-headword { font-size: clamp(3.4rem, 18vw, 5rem); }
    .fs-steps { padding: 1.4rem 1.2rem 1.8rem; }
    .fs-catalog { padding: 1.4rem 1.2rem 2rem; }
    .steps { grid-template-columns: minmax(0, 1fr); }
    .step:last-child { grid-column: auto; }
    .drawer, .card-grid, .layout-with-sidebar .card-grid { grid-template-columns: minmax(0, 1fr); }
    .drawer .card:nth-child(n) { transform: none; }
    .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 1rem; }
    .catalog-list a { padding: .45rem .6rem; font-size: .9rem; }
    .sheet { padding: 1.4rem 1.2rem 1.6rem; outline-offset: -6px; }
    .post-nav { grid-template-columns: minmax(0, 1fr); }
    .post-nav-next { grid-column: auto; }
    .sidebar { padding: 1.3rem 1.2rem; }
    .comment-respond { padding: 1.3rem 1.1rem; }
    .notes-list .children { margin-left: 1rem; }
    .cookie-banner { flex-direction: column; align-items: stretch; padding: 1rem 1.2rem; }
    .colophon-col { flex-direction: column; }
    .colophon-art { width: 84px; }
}

@media (max-width: 380px) {
    .catalog { grid-template-columns: minmax(0, 1fr); }
    .card-top { grid-template-columns: 72px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

/* Мягкие края вырезанных гравюр, чтобы фон картинки растворялся в фоне секции */
.howto-book img,
.colophon-art,
.sp-illu {
    -webkit-mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 62%, transparent 100%);
    mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 62%, transparent 100%);
}
.step-note, .step-name, .card-title, .catalog-list a, .co em, .brand-name { hyphens: manual; }
.nf-code { margin-bottom: .6rem; }
