/*
Theme Name: dds_3mnyenterprises.com
Theme URI: https://3mnyenterprises.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: mnyent
*/

/* ---------- Переменные ---------- */
:root {
    --ink: #0E1A2B;
    --ink-deep: #08121F;
    --ink-panel: #13233A;
    --cobalt: #1F4FA8;
    --cobalt-hi: #2E63C6;
    --brass: #C8A24A;
    --brass-hi: #DDB963;
    --steel: #7E93AE;
    --frost: #DDE4EE;
    --mist: #B4C2D4;
    --paper: #E8ECF1;
    --paper-edge: #C9D1DC;
    --paper-text: #0E1A2B;
    --paper-muted: #5A6A7E;
    --grid-line: rgba(255, 255, 255, 0.055);
    --grid-fine: rgba(255, 255, 255, 0.022);
    --f-head: "Oswald", "Roboto Condensed", "Arial Narrow", "Segoe UI", Arial, sans-serif;
    --f-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
}

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

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--f-body);
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.65;
    letter-spacing: 0.015em;
    color: var(--frost);
    background-color: var(--ink);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        linear-gradient(var(--grid-fine) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
    background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
}

p, li, dd, td, th, blockquote, figcaption, .card-title, .entry-title, .fs-title, .widget {
    overflow-wrap: break-word;
    hyphens: auto;
}

p { margin: 0 0 1em; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--f-head);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.01em;
    margin: 1.4em 0 0.6em;
}

a { color: var(--frost); text-decoration-color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--brass-hi); }

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

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

table { border-collapse: collapse; width: 100%; margin: 0 0 1.4em; }
table, th, td { border: 1px solid var(--paper-edge); }
th, td { padding: 0.55em 0.8em; text-align: left; vertical-align: top; }

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--brass);
    color: var(--ink);
    font-family: var(--f-head);
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem 0.55rem;
    border: 0;
    border-radius: 0;
    font-family: var(--f-head);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.18s, color 0.18s, transform 0.18s;
}
.btn-cobalt {
    background: var(--cobalt);
    color: #fff;
    box-shadow: inset 0 0 0 2px var(--cobalt), inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}
.btn-cobalt:hover { background: var(--ink); color: #fff; box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px var(--brass); }
.btn-brass {
    background: var(--brass);
    color: var(--ink);
    box-shadow: inset 0 0 0 2px var(--brass), inset 0 0 0 3px rgba(14, 26, 43, 0.55);
}
.btn-brass:hover { background: var(--brass-hi); color: var(--ink); }
.btn:active { transform: translateY(1px); }

/* ---------- Шапка ---------- */
.masthead {
    background: var(--ink);
    border-bottom: 2px solid var(--cobalt);
    padding: 1.6rem 0;
}
.masthead-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 2.5rem;
    row-gap: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    min-width: 0;
    text-decoration: none;
    color: #fff;
}
.brand:hover { color: #fff; }
.brand-mark { flex: 0 0 auto; display: block; line-height: 0; }
.brand-svg, .brand-logo { display: block; max-height: 72px; width: auto; }
.brand-text { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; max-width: 680px; }
.brand-name {
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: #fff;
}
.brand-desc {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--steel);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav-list li { border-left: 2px solid var(--brass); }
.site-nav-list li:first-child { border-left: 0; }
.site-nav-list a {
    display: block;
    padding: 0.35rem 1.15rem;
    font-family: var(--f-head);
    font-size: 1.08rem;
    color: #fff;
    text-decoration: none;
    line-height: 1.25;
}
.site-nav-list li:last-child a { padding-right: 0; }
.site-nav-list a:hover,
.site-nav-list .current-menu-item > a { color: var(--brass-hi); }

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    background: transparent;
    color: #fff;
    border: 3px double var(--brass);
    border-radius: 0;
    font-family: var(--f-head);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

/* ---------- Главная: каркас секций ---------- */
.fs { position: relative; padding: 3.6rem 0; }
.fs-frame {
    width: 85%;
    margin-inline: auto;
    padding: 0.6rem 0 0.6rem 2.2rem;
    border-left: 2px solid var(--brass);
    position: relative;
}
.fs-eyebrow {
    margin: 0 0 0.4rem;
    font-family: var(--f-head);
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--frost);
}
.fs-title {
    margin: 0 0 1.4rem;
    font-family: var(--f-head);
    font-weight: 500;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    line-height: 1.1;
    text-transform: uppercase;
    color: #fff;
}
.fs-title-xl { font-size: clamp(2.1rem, 4.6vw, 3.8rem); font-weight: 600; line-height: 1.08; }

/* Наклонные полосы-разделители */
.slant { position: relative; height: 70px; margin: -1rem 0; pointer-events: none; }
.slant::before, .slant::after { content: ""; position: absolute; inset: 0; }
.slant-a::before { background: var(--cobalt); clip-path: polygon(0 0, 46% 48%, 0 86%); }
.slant-a::after { background: var(--brass); clip-path: polygon(0 92%, 100% 22%, 100% 78%, 0 100%); }
.slant-b::before { background: var(--cobalt); clip-path: polygon(0 0, 100% 52%, 100% 58%, 0 5%); opacity: 0.8; }
.slant-b::after { background: var(--brass); clip-path: polygon(0 4%, 100% 30%, 100% 100%, 64% 46%, 0 14%); }

/* Блок 1 — этапы */
.fs-stages { padding-top: 4rem; }
.fs-stages-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    align-items: center;
    gap: 2rem;
}
.fs-stages-head { min-width: 0; }
.fs-stages-head .fs-title { margin-bottom: 0; }
.fs-scheme { position: relative; margin: 0; padding: 0 64px; min-width: 0; }
.fs-scheme img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 549 / 495;
    object-fit: cover;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 62%, transparent 100%);
    mask-image: radial-gradient(ellipse at center, #000 62%, transparent 100%);
}
.elev {
    position: absolute;
    font-family: var(--f-head);
    font-size: 0.72rem;
    color: #fff;
    letter-spacing: 0.04em;
    padding: 0 0.2rem 0.1rem;
    border-bottom: 1px solid #fff;
    line-height: 1.2;
}
.elev::after {
    content: "";
    position: absolute;
    bottom: -7px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--brass);
}
.elev-l1, .elev-l2, .elev-l3 { left: 0; }
.elev-l1::after, .elev-l2::after, .elev-l3::after { right: 2px; }
.elev-r1, .elev-r2 { right: 0; }
.elev-r1::after, .elev-r2::after { left: 2px; }
.elev-l1 { top: 18%; }
.elev-l2 { top: 38%; }
.elev-l3 { top: 58%; }
.elev-r1 { top: 6%; }
.elev-r2 { top: 66%; }

.stage-line {
    position: relative;
    list-style: none;
    margin: 2.6rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    counter-reset: stage;
}
.stage-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 10px;
    height: 2px;
    background: #fff;
    opacity: 0.85;
}
.stage-node { position: relative; min-width: 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.stage-dot {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
    background: var(--brass);
    box-shadow: 0 0 0 4px var(--ink);
    transition: transform 0.2s, background-color 0.2s;
}
.stage-node:hover .stage-dot { transform: rotate(45deg); background: var(--brass-hi); }
.stage-name {
    margin-top: 1rem;
    font-family: var(--f-head);
    font-size: 1.12rem;
    line-height: 1.2;
    color: #fff;
}
.stage-note {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--mist);
}

/* Блок 2 — штампы */
.fs-roles-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 2rem;
    align-items: start;
}
.fs-roles-list { min-width: 0; }
.stamp {
    margin: 0 0 0.9rem;
    border: 6px double var(--cobalt);
    background: rgba(14, 26, 43, 0.88);
    transition: border-color 0.2s;
}
.stamp:hover { border-color: var(--cobalt-hi); }
.stamp-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 3rem 0.85rem 1.2rem;
    cursor: pointer;
    list-style: none;
    position: relative;
}
.stamp-head::-webkit-details-marker { display: none; }
.stamp-head::after {
    content: "+";
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--f-head);
    font-size: 1.6rem;
    line-height: 1;
    color: var(--brass);
}
.stamp[open] .stamp-head::after { content: "−"; }
.stamp-num {
    flex: 0 0 auto;
    font-family: var(--f-head);
    font-size: 1.9rem;
    line-height: 1;
    color: var(--brass);
}
.stamp-name {
    min-width: 0;
    font-family: var(--f-head);
    font-size: 1.45rem;
    line-height: 1.15;
    text-transform: uppercase;
    color: #fff;
}
.stamp[open] .stamp-head { padding-top: 1.2rem; }
.stamp[open] .stamp-name { font-size: 1.65rem; }
.stamp-text {
    margin: 0;
    padding: 0 1.4rem 1.3rem calc(1.2rem + 2.9rem);
    font-size: 0.95rem;
    color: var(--mist);
}
.fs-roles-photo {
    margin: 0;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px;
    background: rgba(8, 18, 31, 0.6);
}
.fs-roles-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1527 / 1050;
    object-fit: cover;
}

/* Блок «Последние записи» — листы кальки */
.fs-journal { padding-bottom: 4.2rem; }
.sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.2rem 1.8rem;
    margin-top: 0.6rem;
}
.sheet-grid-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
/* На главной — ровно три листа: закреплённая запись сверх лимита не ломает ряд */
.fs-journal .sheet-grid .sheet:nth-child(n+4) { display: none; }
.sheet { position: relative; isolation: isolate; min-width: 0; display: flex; }
.sheet::before,
.sheet::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--paper-edge);
}
.sheet::before { transform: rotate(-1.4deg) translate(-5px, 6px); opacity: 0.85; }
.sheet::after { transform: rotate(1deg) translate(5px, 4px); background: #D6DDE6; opacity: 0.7; }
.card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--paper);
    color: var(--paper-text);
    border-top: 3px solid var(--brass);
    padding: 1.1rem 1.15rem 1.3rem;
    transition: transform 0.2s;
}
.sheet:hover .card { transform: translateY(-4px); }
.card-thumb { overflow: hidden; margin-bottom: 1rem; background: #D3DAE3; }
.card-thumb a { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    filter: saturate(0.8);
    transition: transform 0.35s;
}
.sheet:hover .card-thumb img { transform: scale(1.04); }
.card-nothumb {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background-color: #DCE3EB;
    background-image:
        linear-gradient(rgba(31, 79, 168, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 79, 168, 0.1) 1px, transparent 1px);
    background-size: 16px 16px;
}
.card-nothumb svg { display: block; width: 46%; height: auto; }
.card-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card-title {
    margin: 0 0 0.45rem;
    font-family: var(--f-head);
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.2;
}
.card-title a { color: var(--paper-text); text-decoration: none; }
.card-title a:hover { color: var(--cobalt); }
.card-excerpt { font-size: 0.92rem; line-height: 1.5; color: var(--paper-muted); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-excerpt a { color: var(--cobalt); }
.card-meta { margin: 0.2rem 0 0.9rem; }
.stamp-date { font-size: 0.85rem; color: #A88429; letter-spacing: 0.05em; font-weight: 500; }
.card-more { align-self: flex-start; margin-top: auto; }
.sticky .card { border-top-color: var(--cobalt); }

.elev-rail {
    position: absolute;
    right: -88px;
    top: 7.5rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.elev-rail span {
    position: relative;
    padding: 0 0.2rem 0.1rem 0.9rem;
    font-family: var(--f-head);
    font-size: 0.8rem;
    color: #fff;
    border-bottom: 1px solid #fff;
}
.elev-rail span::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid var(--brass);
}

.empty-note {
    padding: 1.3rem 1.5rem;
    border: 3px double var(--cobalt);
    color: var(--mist);
    background: rgba(8, 18, 31, 0.6);
}

/* Блок 3 — цифры */
.fs-stats {
    background: var(--ink-deep);
    border-top: 2px solid var(--cobalt);
    border-bottom: 2px solid var(--cobalt);
    padding: 2.6rem 0 2.8rem;
}
.fs-stats .fs-title { margin-bottom: 1rem; }
.stats-row {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat:nth-child(2), .stat:nth-child(3) { align-items: center; text-align: center; }
.stat:nth-child(4) { align-items: flex-end; text-align: right; }
.stat-num {
    font-family: var(--f-head);
    font-weight: 500;
    font-size: clamp(3rem, 6vw, 4.8rem);
    line-height: 1;
    color: var(--brass);
}
.stat-label {
    margin-top: 0.3rem;
    font-family: var(--f-head);
    font-size: 1.35rem;
    line-height: 1.2;
    color: #fff;
}

/* Блок 4 — карта */
.fs-map { padding-bottom: 3.2rem; }
.map-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
}
.map-figure { margin: 0; min-width: 0; }
.map-figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1290 / 620;
    object-fit: cover;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 66%, transparent 100%);
    mask-image: radial-gradient(ellipse at center, #000 66%, transparent 100%);
}
.map-cities { list-style: none; margin: 0; padding: 0; min-width: 0; }
.map-cities li {
    position: relative;
    padding: 0.3rem 0 0.3rem 1.6rem;
    font-family: var(--f-head);
    font-size: clamp(1.4rem, 2.3vw, 2rem);
    line-height: 1.2;
    color: #fff;
}
.map-cities li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 11px;
    height: 11px;
    background: var(--brass);
    transform: translateY(-50%);
}
.map-caption { margin: 1.2rem 0 0; font-size: 0.92rem; color: var(--steel); letter-spacing: 0.03em; }

/* ---------- Внутренние страницы ---------- */
.inner { padding: 2rem 0 4.5rem; }
.crumbs {
    margin-bottom: 2rem;
    font-size: 0.88rem;
    color: var(--steel);
    letter-spacing: 0.03em;
}
.crumbs a { color: var(--frost); text-decoration: none; border-bottom: 1px solid rgba(200, 162, 74, 0.5); }
.crumbs a:hover { color: var(--brass-hi); }
.crumbs-sep { color: var(--brass); margin: 0 0.3rem; }

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

.page-head {
    margin-bottom: 2rem;
    padding-left: 1.4rem;
    border-left: 2px solid var(--brass);
}
.page-head .fs-title { margin-bottom: 0.2rem; }
.archive-desc { color: var(--mist); margin-top: 0.6rem; }

.paper {
    position: relative;
    background: var(--paper);
    color: var(--paper-text);
    border-top: 3px solid var(--brass);
    padding: 2.4rem 2.6rem;
    margin-bottom: 2rem;
    font-weight: 400;
}
.paper a { color: var(--cobalt); }
.paper a:hover { color: var(--ink); }
.paper .btn-cobalt { color: #fff; }

.entry-head { margin-bottom: 1.4rem; padding-bottom: 1.1rem; border-bottom: 1px dashed var(--paper-edge); }
.entry-title {
    margin: 0 0 0.6rem;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: clamp(1.8rem, 3.4vw, 2.7rem);
    line-height: 1.12;
    color: var(--paper-text);
}
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; font-size: 0.9rem; }
.entry-cats { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.entry-cats a {
    padding: 0.1rem 0.6rem;
    border: 3px double var(--cobalt);
    font-family: var(--f-head);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
}
.entry-cover { margin: 0 0 1.6rem; }
.entry-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.entry-content { font-size: 1.04rem; line-height: 1.75; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--paper-text); }
.entry-content h2 {
    font-size: 1.75rem;
    text-transform: uppercase;
    padding-left: 0.9rem;
    border-left: 4px solid var(--brass);
}
.entry-content h3 { font-size: 1.4rem; }
.entry-content h4 { font-size: 1.15rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.35em; }
.entry-content ul li::marker { color: var(--brass); }
.entry-content ol li::marker { color: var(--cobalt); font-family: var(--f-head); }
.entry-content blockquote {
    margin: 1.6em 0;
    padding: 1.2rem 1.5rem;
    background: #DCE3EB;
    border-left: 4px solid var(--brass);
    font-style: normal;
    color: #24364C;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content th { background: #DCE3EB; font-family: var(--f-head); font-weight: 500; }
.entry-content table, .entry-content th, .entry-content td { border-color: #AEB9C7; }
.entry-content pre {
    overflow-x: auto;
    padding: 1rem 1.2rem;
    background: var(--ink);
    color: var(--frost);
    font-size: 0.9rem;
}
.entry-content code { font-size: 0.92em; background: #DCE3EB; padding: 0.1em 0.3em; }
.entry-content pre code { background: none; padding: 0; }
.entry-content img { display: block; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption, .wp-caption-text { font-size: 0.86rem; color: var(--paper-muted); margin-top: 0.4rem; }
.entry-content hr { border: 0; border-top: 2px solid var(--paper-edge); margin: 2em 0; }

.alignleft { float: left; margin: 0.3em 1.4em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.4em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.bypostauthor .note-author::after { content: " · автор"; color: var(--brass); font-weight: 400; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }

.entry-tags { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; font-size: 0.9rem; }
.page-links { margin-top: 1.4rem; font-family: var(--f-head); }
.page-links a, .page-links > span { margin-left: 0.4rem; }

.post-navigation { margin: 0 0 2rem; }
.post-navigation .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.post-navigation .nav-next { grid-column: 2; text-align: right; }
.post-navigation a {
    display: block;
    padding: 1rem 1.2rem;
    border: 6px double var(--cobalt);
    background: rgba(8, 18, 31, 0.75);
    text-decoration: none;
    color: #fff;
}
.post-navigation a:hover { border-color: var(--brass); color: #fff; }
.pn-label { display: block; font-family: var(--f-head); font-size: 0.85rem; text-transform: uppercase; color: var(--brass); letter-spacing: 0.04em; }
.pn-title { display: block; font-family: var(--f-head); font-size: 1.1rem; line-height: 1.3; margin-top: 0.2rem; }

/* ---------- Пагинация ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 2.6rem;
}
.pager .page-numbers {
    display: inline-block;
    min-width: 2.7rem;
    padding: 0.5rem 0.8rem;
    text-align: center;
    font-family: var(--f-head);
    font-size: 1rem;
    line-height: 1.2;
    color: #fff;
    text-decoration: none;
    background: rgba(8, 18, 31, 0.7);
    border: 3px double var(--cobalt);
}
.pager a.page-numbers:hover { border-color: var(--brass); color: var(--brass-hi); }
.pager .page-numbers.current { background: var(--cobalt); border-color: #fff; color: #fff; }
.pager .page-numbers.dots { background: none; border-color: transparent; min-width: 0; }

/* ---------- Сайдбар ---------- */
.sidebar {
    min-width: 0;
    background: var(--ink-panel);
    border: 6px double rgba(31, 79, 168, 0.85);
    padding: 1.6rem 1.5rem;
    color: var(--mist);
}
.sidebar .widget { margin-bottom: 2rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title,
.basement .widget-title {
    margin: 0 0 1rem;
    padding-left: 0.8rem;
    border-left: 3px solid var(--brass);
    font-family: var(--f-head);
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.03em;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 0.55rem 0; border-bottom: 1px dashed rgba(126, 147, 174, 0.35); line-height: 1.4; }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--frost); text-decoration: none; }
.sidebar a:hover { color: var(--brass-hi); }
.sidebar .post-date { display: block; font-size: 0.82rem; color: var(--steel); }
.sidebar p { color: var(--mist); }

/* ---------- Поиск ---------- */
.seek { display: flex; gap: 0.5rem; margin: 1.2rem 0; max-width: 520px; }
.seek-field {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--paper-edge);
    border-radius: 0;
    background: #fff;
    color: var(--paper-text);
    font: inherit;
}
.seek-field:focus { border-color: var(--cobalt); outline: none; }
.sidebar .seek-field { border-color: var(--cobalt); }

/* ---------- 404 ---------- */
.lost-code {
    margin: 0;
    font-family: var(--f-head);
    font-size: clamp(4.5rem, 12vw, 8rem);
    font-weight: 600;
    line-height: 1;
    color: var(--cobalt);
    -webkit-text-stroke: 1px var(--cobalt);
}
.paper-empty p { margin-bottom: 0.4rem; }

/* ---------- Комментарии ---------- */
.notes-title, .comment-reply-title {
    margin: 0 0 1.2rem;
    font-family: var(--f-head);
    font-size: 1.5rem;
    text-transform: uppercase;
    color: var(--paper-text);
}
.notes-list, .notes-list .children { list-style: none; margin: 0; padding: 0; }
.notes-list .children { margin-left: 1.6rem; border-left: 2px solid var(--paper-edge); padding-left: 1rem; }
.note-body { padding: 1rem 0; border-bottom: 1px dashed var(--paper-edge); }
.note-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.5rem; }
.note-avatar { display: block; border-radius: 0; }
.note-author { display: block; font-family: var(--f-head); font-size: 1.05rem; }
.note-date { font-size: 0.82rem; color: var(--paper-muted); }
.note-wait { font-size: 0.88rem; color: #8A6A1E; }
.note-reply a { font-family: var(--f-head); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.04em; }
.comment-respond { margin-top: 1.6rem; }
.comment-form p { margin-bottom: 1rem; }
.comment-form label { display: block; margin-bottom: 0.3rem; font-family: var(--f-head); font-size: 0.95rem; }
.comment-form .comment-form-cookies-consent label { display: inline; font-family: var(--f-body); font-size: 0.88rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--paper-edge);
    border-radius: 0;
    background: #fff;
    font: inherit;
    color: var(--paper-text);
}
.comment-form textarea:focus, .comment-form input:focus { border-color: var(--cobalt); outline: none; }
.comment-form .submit {
    padding: 0.65rem 1.4rem;
    border: 0;
    border-radius: 0;
    background: var(--cobalt);
    color: #fff;
    font-family: var(--f-head);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: inset 0 0 0 2px var(--cobalt), inset 0 0 0 3px rgba(255, 255, 255, 0.6);
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--ink); }
.req { color: #B0322B; }
.comments-navigation .nav-links { display: flex; justify-content: space-between; margin: 1rem 0; }

/* ---------- Подвал ---------- */
.basement {
    background: var(--ink-deep);
    border-top: 2px solid var(--cobalt);
    padding: 3rem 0 1.6rem;
    color: var(--mist);
}
.basement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.2rem;
    padding-left: 2rem;
    border-left: 2px solid var(--brass);
}
.basement-col { min-width: 0; }
.basement .widget { margin-bottom: 1.5rem; font-size: 0.93rem; }
.basement p { color: var(--mist); }
.basement ul { list-style: none; margin: 0; padding: 0; }
.basement li { padding: 0.2rem 0; }
.basement a { color: #fff; text-decoration: none; }
.basement a:hover { color: var(--brass-hi); }
.basement .textwidget a { border-bottom: 1px solid var(--brass); }
.basement-copy {
    margin: 2rem 0 0;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(126, 147, 174, 0.25);
    font-size: 0.85rem;
    color: var(--steel);
    letter-spacing: 0.03em;
}

/* ---------- Cookie-баннер ---------- */
.cookie-banner {
    position: fixed;
    z-index: 90;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    width: min(92%, 780px);
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.1rem 1.4rem;
    background: var(--ink-deep);
    border: 6px double var(--brass);
    color: var(--frost);
}
.cookie-text { margin: 0; font-size: 0.9rem; line-height: 1.5; flex: 1; min-width: 0; }
.cookie-accept { flex: 0 0 auto; }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
    .elev-rail { display: none; }
}

@media (max-width: 960px) {
    .masthead-row { grid-template-columns: minmax(0, 1fr) auto; }
    .nav-toggle { display: inline-flex; }
    .site-nav { grid-column: 1 / -1; display: none; }
    .site-nav.is-open { display: block; }
    .site-nav-list { flex-direction: column; align-items: stretch; border-top: 1px solid rgba(126, 147, 174, 0.3); }
    .site-nav-list li { border-left: 0; border-bottom: 1px solid rgba(126, 147, 174, 0.2); }
    .site-nav-list a, .site-nav-list li:last-child a { padding: 0.75rem 0.2rem; }
    .site-nav-list a::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 0.7rem; background: var(--brass); vertical-align: middle; }

    .fs-frame { width: 90%; }
    .fs-stages-top { grid-template-columns: minmax(0, 1fr); }
    .fs-scheme { max-width: 420px; }
    .stage-line { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2rem; }
    .stage-line::before { display: none; }
    .stage-node { border-top: 2px solid rgba(255, 255, 255, 0.8); padding-top: 0; }
    .stage-dot { margin-top: -11px; }
    .fs-roles-grid { grid-template-columns: minmax(0, 1fr); }
    .sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sheet-grid-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
    .stat:nth-child(n) { align-items: flex-start; text-align: left; }
    .map-grid { grid-template-columns: minmax(0, 1fr); }
    .map-cities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.2rem 1rem; }

    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); row-gap: 2.5rem; }
    .layout-single .content-area { width: 100%; }
    .basement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    body { font-size: 0.97rem; }
    .masthead { padding: 1.1rem 0; }
    .brand { gap: 0.8rem; }
    .brand-svg, .brand-logo { max-height: 52px; width: auto; }
    .brand-name { font-size: 1rem; }
    .brand-desc { font-size: 0.74rem; -webkit-line-clamp: 2; }
    .nav-toggle-label { display: none; }

    .fs { padding: 2.6rem 0; }
    .fs-frame { width: 92%; padding-left: 1.1rem; }
    .fs-scheme { padding: 0 48px; }
    .elev { font-size: 0.62rem; }
    .stage-line { grid-template-columns: minmax(0, 1fr); row-gap: 1.2rem; padding-left: 0.4rem; }
    .stage-line::before { display: block; left: 15px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
    .stage-node { border-top: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; text-align: left; column-gap: 1rem; }
    .stage-dot { margin-top: 0; flex: 0 0 auto; }
    .stage-name { margin-top: 0; }
    .stage-note { flex-basis: 100%; padding-left: calc(20px + 1rem); margin-top: 0.1rem; }
    .stamp-head { padding: 0.75rem 2.6rem 0.75rem 0.9rem; gap: 0.7rem; }
    .stamp-num { font-size: 1.5rem; }
    .stamp-name, .stamp[open] .stamp-name { font-size: 1.2rem; }
    .stamp-text { padding: 0 1rem 1.1rem 1rem; }
    .sheet-grid { grid-template-columns: minmax(0, 1fr); }
    .stat-label { font-size: 1.1rem; }
    .map-cities { grid-template-columns: minmax(0, 1fr); }
    .map-cities li { font-size: 1.3rem; hyphens: manual; }
    .slant { height: 44px; }

    .inner { padding: 1.4rem 0 3rem; }
    .paper { padding: 1.6rem 1.25rem; }
    .entry-content { font-size: 1rem; }
    .entry-content h2 { font-size: 1.4rem; }
    .alignleft, .alignright { float: none; margin: 1em 0; }
    .post-navigation .nav-links { grid-template-columns: minmax(0, 1fr); }
    .post-navigation .nav-next { grid-column: 1; }
    .notes-list .children { margin-left: 0.6rem; }
    .sidebar { padding: 1.3rem 1.1rem; }

    .basement-grid { grid-template-columns: minmax(0, 1fr); padding-left: 1.1rem; gap: 1rem; }
    .cookie-banner { flex-direction: column; align-items: stretch; gap: 0.9rem; padding: 1rem 1.1rem; bottom: 0.6rem; }
    .cookie-accept { align-self: flex-start; }
    .seek { flex-direction: column; }
    .seek-btn { align-self: flex-start; }
}

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