/*
Theme Name: dds_kosmogid.ru
Theme URI: https://kosmogid.ru/
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: ksmg
*/

/* ===== Шрифты (вложены в тему) ===== */
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/oswald-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/oswald-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/oswald-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/oswald-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/jetbrains-mono-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ===== Палитра ===== */
:root {
    --bg: #0E1214;
    --bg-head: #090C0D;
    --bg-alt: #12181B;
    --bg-posts: #0B0F11;
    --bg-lower: #101619;
    --bg-foot: #080A0B;
    --grid: #1C2428;
    --text: #E8EDEA;
    --muted: #7C8A86;
    --teal: #37E0A8;
    --amber: #F0A03C;
    --red: #E0574A;
    --line: #2A3538;
    --fill: #1A2427;
    --ink: #0E1214;
    --font-head: "Oswald", "Arial Narrow", "Roboto Condensed", "Liberation Sans Narrow", sans-serif;
    --font-mono: "JetBrains Mono", "DejaVu Sans Mono", "Liberation Mono", Consolas, monospace;
    --grid-img: linear-gradient(to right, rgba(28, 36, 40, .85) 1px, transparent 1px), linear-gradient(to bottom, rgba(28, 36, 40, .45) 1px, transparent 1px);
    --grid-size: 144px 144px;
}

/* ===== Скрытые элементы, управляемые JS ===== */
.cookie-banner[hidden] { display: none !important; }
.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;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    margin: 0;
    overflow-x: hidden;
    background-color: var(--bg);
    background-image: var(--grid-img);
    background-size: var(--grid-size);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.15;
    margin: 1.4em 0 .55em;
    color: var(--text);
    letter-spacing: .01em;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
p, li, dd, dt, td, th, figcaption, blockquote, .card-title, .entry-title, .brand-name, .widget {
    overflow-wrap: break-word;
    hyphens: auto;
}
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--teal); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
::selection { background: var(--teal); color: var(--ink); }

.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    background: var(--teal); color: var(--ink); padding: .6rem 1rem; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ===== Контейнер ===== */
.shell { width: min(92%, 1240px); margin-inline: auto; }
.shell--front { width: min(92%, 1240px); }
@media (min-width: 600px) { .shell--front { width: min(85%, 1240px); } }

/* ===== Кнопки ===== */
.btn, .comment-form .submit, .wp-block-button__link {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    padding: .7rem 1.35rem;
    background: var(--teal);
    color: var(--ink);
    border: 1px solid var(--teal);
    border-radius: 0;
    font-family: var(--font-mono);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.3;
    cursor: pointer;
    text-align: center;
    transition: transform .12s, box-shadow .12s, background .12s, color .12s;
}
.btn:hover, .comment-form .submit:hover, .wp-block-button__link:hover {
    background: transparent;
    color: var(--teal);
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--amber);
}
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn-sm { padding: .45rem .8rem; font-size: .72rem; }

/* ===== Шапка ===== */
.masthead { background: var(--bg-head); border-bottom: 1px solid var(--line); position: relative; }
.masthead-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem;
    flex-wrap: wrap; padding: 1.4rem 0;
}
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--text); min-width: 0; flex: 1 1 320px; }
.brand:hover { color: var(--text); }
.brand-mark { flex: 0 0 auto; width: 56px; height: 56px; display: block; }
.brand-svg, .brand-logo { width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; gap: .35rem; min-width: 0; max-width: 46rem; }
.brand-name {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 1.02rem;
    line-height: 1.3;
    letter-spacing: .02em;
    color: var(--text);
}
.brand-tagline { font-size: .72rem; line-height: 1.5; color: var(--muted); }

.nav-toggle {
    display: inline-flex; align-items: center; gap: .6rem;
    background: transparent; color: var(--text);
    border: 1px solid var(--line); padding: .55rem .8rem;
    font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
    cursor: pointer;
}
.nav-toggle:hover { border-color: var(--teal); color: var(--teal); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: "";
}
.nav-toggle-bars::before { position: absolute; top: -6px; left: 0; }
.nav-toggle-bars::after { position: absolute; top: 6px; left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.primary-nav { display: none; width: 100%; }
.primary-nav.is-open { display: block; }
.nav-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.nav-list li { border-bottom: 1px solid var(--line); }
.nav-list a {
    display: block; padding: .8rem .2rem;
    color: var(--text); text-decoration: none; font-size: .9rem;
}
.nav-list a:hover { color: var(--teal); }
.nav-list .current-menu-item > a, .nav-list .current_page_item > a { color: var(--teal); }

@media (min-width: 960px) {
    .nav-toggle { display: none; }
    .primary-nav { display: block; width: auto; }
    .nav-list { display: flex; flex-wrap: wrap; gap: .4rem 2rem; border: 0; }
    .nav-list li { border: 0; }
    .nav-list a { padding: .3rem 0; border-bottom: 2px solid transparent; }
    .nav-list a:hover { border-bottom-color: var(--line); }
    .nav-list .current-menu-item > a, .nav-list .current_page_item > a { border-bottom-color: var(--teal); }
}

/* Табло под шапкой */
.ticker { background: #161D20; border-top: 1px solid var(--line); }
.ticker-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ticker-cell {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .7rem;
    padding: .7rem .6rem; min-width: 0;
    border-left: 1px solid var(--line);
}
.ticker-cell:first-child { border-left: 0; padding-left: 0; }
.ticker-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.ticker-value { font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; }
.ticker-note { display: none; flex-basis: 100%; font-size: .68rem; color: var(--muted); line-height: 1.4; }
.ticker-amber .ticker-label, .ticker-amber .ticker-value { color: var(--amber); }
.ticker-teal .ticker-label, .ticker-teal .ticker-value { color: var(--teal); }
.ticker-muted .ticker-label, .ticker-muted .ticker-value { color: #A4B0AC; }
@media (min-width: 600px) {
    .ticker-cell { padding: .9rem 1.4rem; justify-content: center; }
    .ticker-label { font-size: 1rem; }
    .ticker-value { font-size: 1.6rem; }
    .ticker-note { display: block; text-align: center; }
}
@media (min-width: 960px) {
    .ticker-cell:first-child { justify-content: flex-start; }
    .ticker-cell:first-child .ticker-note { text-align: left; }
    .ticker-cell:last-child { justify-content: flex-end; }
    .ticker-cell:last-child .ticker-note { text-align: right; }
    .ticker-label, .ticker-value { font-size: 1.9rem; font-weight: 400; text-transform: none; letter-spacing: .02em; }
}

/* ===== Заголовки секций ===== */
.sec-head {
    border-left: 4px solid var(--teal);
    padding: .1rem 0 .15rem 1.1rem;
    margin: 0 0 2rem;
}
.sec-title {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(1.9rem, 5.2vw, 3.1rem);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: .045em;
}
.sec-sub { margin: .45rem 0 0; color: var(--muted); font-size: .9rem; letter-spacing: .02em; }

/* ===== Секции главной ===== */
.fs { padding: 4rem 0; background-image: var(--grid-img); background-size: var(--grid-size); }
.fs-brief { background-color: var(--bg); }
.fs-map { background-color: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fs-latest { background-color: var(--bg-posts); }
.front-lower {
    position: relative;
    background-color: var(--bg-lower);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 640' fill='none' stroke='%232A3538' stroke-width='16' stroke-linecap='round' stroke-linejoin='round' opacity='.75'%3E%3Cpath d='M20 300L300 30L580 300'/%3E%3Cpath d='M420 155V50h80v185'/%3E%3Cpath d='M70 330L300 110L530 330'/%3E%3Cpath d='M95 310V640M505 310V640'/%3E%3Crect x='258' y='190' width='84' height='84'/%3E%3Crect x='240' y='390' width='130' height='250'/%3E%3C/svg%3E"),
        var(--grid-img);
    background-repeat: no-repeat, repeat;
    background-position: right -2% bottom 0, 0 0;
    background-size: min(46%, 620px) auto, var(--grid-size);
    border-top: 1px solid var(--line);
}
.front-lower .fs { background: none; }
.fs-doc { padding-bottom: 2rem; }

/* Блок 1: сводка */
.brief-head { display: grid; gap: 0 3rem; align-items: end; }
.brief-lead { color: #B9C3C0; font-size: .875rem; max-width: 34rem; margin: -0.6rem 0 2rem; }
@media (min-width: 960px) {
    .brief-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .brief-lead { margin: 0 0 2rem; justify-self: end; border-left: 1px solid var(--line); padding-left: 1.4rem; }
}
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 600px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.board-cell {
    position: relative;
    background: var(--fill);
    border: 1px solid var(--line);
    padding: 1.4rem 1.4rem 1.2rem;
    min-width: 0;
    display: flex; flex-direction: column;
    transition: border-color .15s, transform .15s;
}
.board-cell:hover { border-color: var(--teal); transform: translateY(-3px); }
.board-down:hover { border-color: var(--amber); }
.board-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.board-value { font-family: var(--font-mono); font-size: clamp(2rem, 3.4vw, 2.75rem); font-weight: 400; line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; }
.board-arrow { flex: 0 0 auto; width: 30px; height: 30px; margin-top: .2rem; }
.board-up .board-arrow { color: var(--teal); }
.board-down .board-arrow { color: var(--amber); }
.board-text { font-size: .75rem; line-height: 1.5; color: #C3CCC9; margin: .9rem 0 .8rem; flex: 1; }
.board-ref { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; border-top: 1px dashed var(--line); padding-top: .55rem; }
.board-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: 1.1rem 0 0; font-size: .72rem; color: var(--muted); }
.lg-teal::first-letter { color: var(--teal); }
.lg-amber::first-letter { color: var(--amber); }

/* Блок 2: карта */
.map-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 960px) { .map-grid { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 3rem; } }
.map-figure { margin: 0; }
.map-figure img { width: 100%; height: auto; aspect-ratio: 1286 / 670; }
.region-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.region-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: .62rem 0; border-bottom: 1px solid var(--line);
    font-size: .95rem;
}
.region-name { min-width: 0; }
.region-tag { font-size: .75rem; text-align: right; white-space: nowrap; }
.tag-teal { color: var(--teal); }
.tag-amber { color: var(--amber); }
.region-row:hover { background: linear-gradient(90deg, rgba(55, 224, 168, .07), transparent); }
.map-legend, .chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin: 1rem 0 0; font-size: .72rem; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: .6rem; }
.dot:first-child { margin-left: 0; }
.dot-teal { background: var(--teal); box-shadow: 0 0 8px rgba(55, 224, 168, .6); }
.dot-amber { background: var(--amber); box-shadow: 0 0 8px rgba(240, 160, 60, .6); }

/* Последние записи */
.latest-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 2rem; }
.latest-head .sec-head { margin: 0; }
.link-more { font-size: .8rem; color: var(--muted); }
.link-more:hover { color: var(--teal); }

/* ===== Карточки ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1.4rem; }
@media (min-width: 960px) { .card-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Закреплённая запись поднимается наверх сверх лимита — на главной показываем ровно три карточки */
.card-grid--three > .card:nth-child(n+4) { display: none; }
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    overflow: hidden;
    min-width: 0;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--teal); transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--teal); }
.card-thumb { position: relative; background: #1E2C30; }
.card-thumb a { display: block; }
.card-thumb img, .card-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.card-marker { position: absolute; top: 0; left: 0; width: 5px; height: 46%; background: var(--teal); }
.card-pin {
    position: absolute; top: .7rem; right: .7rem;
    background: var(--amber); color: var(--ink);
    font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .2rem .5rem;
}
.card-body { flex: 1; display: flex; flex-direction: column; padding: 1.2rem 1.25rem 1.25rem; min-width: 0; }
.card-title { font-family: var(--font-mono); font-weight: 400; font-size: 1.02rem; line-height: 1.45; margin: 0 0 .6rem; letter-spacing: 0; }
.card-title a { text-decoration: none; color: var(--text); }
.card-title a:hover { color: var(--teal); }
.card-excerpt { flex: 1; font-size: .78rem; line-height: 1.6; color: #A9B4B1; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.card-date { font-size: .78rem; color: var(--muted); }
.empty-state {
    padding: 1.6rem 1.8rem; border: 1px dashed var(--line); background: var(--bg-alt); color: var(--muted);
}

/* Блок 3: разбор документа */
.doc-grid { display: grid; gap: 1.4rem; align-items: start; }
@media (min-width: 600px) { .doc-grid { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); } .doc-note { grid-column: 1 / -1; } }
@media (min-width: 960px) { .doc-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, .9fr) minmax(0, 1fr); gap: 1.6rem; } .doc-note { grid-column: auto; } }
.doc-sheet {
    background: rgba(26, 36, 39, .92);
    border: 1px solid var(--line);
    padding: 1.6rem 1.7rem;
    position: relative;
}
.doc-sheet::before {
    content: ""; position: absolute; top: 1.6rem; left: 1.7rem; width: 32%; height: 3px; background: #4A5659;
}
.doc-kicker { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: .9rem 0 1rem; }
.doc-line { font-size: .8rem; line-height: 1.65; color: #9AA6A3; margin: 0 0 .8rem; padding: .45rem .7rem; border-left: 3px solid transparent; }
.doc-line:last-child { margin-bottom: 0; }
.doc-mark-teal { color: var(--text); border-left-color: var(--teal); background: rgba(55, 224, 168, .1); }
.doc-mark-amber { color: var(--text); border-left-color: var(--amber); background: rgba(240, 160, 60, .12); }
.doc-points {
    list-style: none; counter-reset: pt; margin: 0;
    background: rgba(26, 36, 39, .92); border: 1px solid var(--line);
    padding: 1.2rem 1.3rem;
}
.doc-points li {
    counter-increment: pt; display: flex; gap: .8rem; align-items: baseline;
    padding: .55rem .5rem; font-size: .8rem; border-bottom: 1px solid var(--line);
}
.doc-points li:last-child { border-bottom: 0; }
.doc-points li::before { content: counter(pt) "."; color: var(--muted); flex: 0 0 auto; }
.doc-points li.is-key { background: rgba(55, 224, 168, .12); box-shadow: inset 3px 0 0 var(--teal); color: var(--text); }
.doc-points li.is-key::before { color: var(--teal); }
.doc-note { font-size: .82rem; color: #B9C3C0; padding: .2rem 0; }
.doc-note p { margin-bottom: 1.4rem; }

/* Блок 4: цена метра */
.fs-meter { padding-top: 2.5rem; }
.meter-grid { display: grid; gap: 2rem; align-items: stretch; }
@media (min-width: 960px) { .meter-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 2.4rem; } }
.chart { min-width: 0; }
.chart-plot {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem;
    height: 330px; padding: 1.6rem .2rem 0;
    border-top: 1px solid var(--line);
    background-image: repeating-linear-gradient(to top, transparent 0, transparent 59px, rgba(42, 53, 56, .8) 59px, rgba(42, 53, 56, .8) 60px);
    background-position: 0 -2.2rem;
}
.chart-group { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.chart-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; min-height: 0; border-bottom: 1px solid #4A5659; margin: 0 -.2rem; }
.bar {
    position: relative; display: block; width: min(26px, 40%);
    height: var(--h);
    transition: height .9s cubic-bezier(.2, .8, .2, 1), filter .15s;
}
.chart.is-armed .bar { height: 0; }
.chart.is-armed.is-live .bar { height: var(--h); }
.bar-teal { background: var(--teal); }
.bar-amber { background: var(--amber); }
.bar em {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    font-style: normal; font-size: .64rem; color: var(--muted); padding-bottom: .2rem; white-space: nowrap;
}
.bar:hover { filter: brightness(1.15); }
.chart-label {
    display: block; flex: 0 0 2.2rem; text-align: center; font-size: .7rem; color: var(--muted);
    padding-top: .55rem; background: var(--bg-lower); margin: 0 -.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chart-unit { margin-left: auto; font-style: italic; }
.meter-note {
    position: relative;
    background: rgba(18, 24, 27, .95);
    border: 1px solid var(--line);
    border-top: 3px solid var(--amber);
    padding: 1.5rem 1.5rem 1.3rem;
    font-size: .82rem; color: #C3CCC9;
    align-self: start;
}
.meter-flag { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--amber); margin-bottom: .8rem; }
.meter-note p:last-child { margin-bottom: 0; }
@media (max-width: 599px) {
    .chart-plot { height: 240px; gap: .2rem; }
    .bar { width: 42%; }
    .bar em { display: none; }
    .chart-label { font-size: .6rem; }
}

/* ===== Внутренние страницы ===== */
.inner-top { background-color: var(--bg-alt); background-image: var(--grid-img); background-size: var(--grid-size); border-bottom: 1px solid var(--line); padding: 1.6rem 0 .4rem; }
.inner-top .sec-head { margin: 1.4rem 0 1.6rem; }
.page-title { font-size: clamp(1.9rem, 5vw, 3rem); }
.inner-body { padding: 2.6rem 0 4rem; }

.crumbs { font-size: .74rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; padding-bottom: .9rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.crumbs-sep { color: var(--teal); }
.crumbs-current { color: var(--text); }

.layout-single { display: block; }
.layout-single .content-area { width: 85%; margin-left: auto; margin-right: auto; }
.layout-with-sidebar { display: block; }
.layout-with-sidebar .content-area, .layout-with-sidebar .sidebar { min-width: 0; }
@media (max-width: 959px) {
    .layout-single .content-area { width: 100%; }
    .layout-with-sidebar .sidebar { margin-top: 3rem; }
}
@media (min-width: 960px) {
    .layout-with-sidebar { display: grid; grid-template-columns: minmax(0, 67fr) minmax(0, 27fr); column-gap: 6%; align-items: start; }
}

/* ===== Запись и страница ===== */
.entry-head { margin-bottom: 1.8rem; }
.entry-cats { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip {
    display: inline-block; padding: .25rem .6rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
    background: var(--fill); border: 1px solid var(--line); color: var(--teal); text-decoration: none;
}
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip-ghost { color: var(--muted); text-transform: none; letter-spacing: 0; }
.entry-title { font-size: clamp(1.8rem, 4.4vw, 2.8rem); margin: 0 0 .7rem; text-transform: none; letter-spacing: .01em; }
.entry-meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.entry-meta-sep { color: var(--teal); }
.entry-cover { margin: 0 0 2rem; border: 1px solid var(--line); position: relative; }
.entry-cover::before { content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 40%; background: var(--teal); }
.entry-cover img { width: 100%; height: auto; }

.entry-content { font-size: .92rem; line-height: 1.8; color: #D5DCD9; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--text); }
.entry-content h2 { border-left: 4px solid var(--teal); padding-left: .8rem; font-size: clamp(1.4rem, 3vw, 1.85rem); }
.entry-content p { margin: 0 0 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; margin: 0 0 1.3em; }
.entry-content li { margin-bottom: .45em; }
.entry-content ul { list-style: none; padding-left: 1.3rem; }
.entry-content ul li { position: relative; }
.entry-content ul li::before { content: ""; position: absolute; left: -1.15rem; top: .72em; width: 7px; height: 7px; background: var(--teal); }
.entry-content ol li::marker { color: var(--amber); font-weight: 700; }
.entry-content blockquote, .wp-block-quote {
    margin: 1.8em 0; padding: 1.3rem 1.5rem 1.3rem 1.6rem;
    background: var(--fill); border: 1px solid var(--line); border-left: 4px solid var(--amber);
    color: var(--text); font-size: 1rem;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite { display: block; margin-top: .6rem; font-size: .75rem; color: var(--muted); font-style: normal; }
.entry-content img { height: auto; }
.entry-content figure { margin: 1.8em 0; }
.entry-content figcaption, .wp-element-caption { font-size: .72rem; color: var(--muted); margin-top: .5rem; }
.entry-content code, .entry-content kbd { background: var(--fill); border: 1px solid var(--line); padding: .05em .35em; font-size: .88em; }
.entry-content pre { background: #070A0B; border: 1px solid var(--line); padding: 1.1rem 1.2rem; overflow-x: auto; font-size: .82rem; }
.entry-content hr { border: 0; border-top: 1px dashed var(--line); margin: 2.4em 0; }
.entry-content .alignleft { float: left; margin: .3em 1.4em 1em 0; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.4em; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }
.entry-content::after { content: ""; display: table; clear: both; }

table { width: 100%; border-collapse: collapse; margin: 0 0 1.6em; font-size: .82rem; border: 1px solid var(--line); }
th, td { border: 1px solid #34444A; padding: .6rem .8rem; text-align: left; vertical-align: top; }
th { background: var(--fill); color: var(--teal); font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; }
tr:nth-child(even) td { background: rgba(26, 36, 39, .45); }
.wp-block-table { overflow-x: auto; }
.wp-block-table table, .wp-block-table th, .wp-block-table td { border: 1px solid #34444A; }
.wp-block-table thead { border-bottom: 2px solid var(--teal); }
.wp-block-table tfoot { border-top: 2px solid var(--line); }

.entry-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.entry-tags-label { font-size: .72rem; color: var(--muted); margin-right: .3rem; }

.post-nav { display: grid; gap: 1rem; margin-top: 2.4rem; }
@media (min-width: 600px) { .post-nav { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.post-nav-link {
    display: block; padding: 1rem 1.2rem; background: var(--bg-alt); border: 1px solid var(--line);
    text-decoration: none; color: var(--text); min-width: 0;
}
.post-nav-link:hover { border-color: var(--teal); color: var(--text); }
.post-nav-next { text-align: right; grid-column: -2; }
.post-nav-dir { display: block; font-size: .68rem; color: var(--teal); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .3rem; }
.post-nav-title { display: block; font-size: .85rem; line-height: 1.45; }

/* ===== Пагинация (type => plain) ===== */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 2.6rem; }
.pager .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.6rem; height: 2.6rem; padding: 0 .8rem;
    border: 1px solid var(--line); background: var(--bg-alt);
    color: var(--text); text-decoration: none; font-size: .82rem;
}
.pager a.page-numbers:hover { border-color: var(--teal); color: var(--teal); }
.pager .page-numbers.current { background: var(--teal); border-color: var(--teal); color: var(--ink); font-weight: 700; }
.pager .page-numbers.dots { border: 0; background: none; min-width: auto; padding: 0 .3rem; color: var(--muted); }
.pager-inline { margin-top: 1.6rem; font-size: .8rem; }

/* ===== Сайдбар и виджеты ===== */
.sidebar {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    padding: 1.6rem 1.5rem;
    color: #C3CCC9;
}
.sidebar .widget + .widget { margin-top: 2rem; padding-top: 1.6rem; border-top: 1px dashed var(--line); }
.widget-title {
    font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .06em;
    margin: 0 0 1rem; padding-left: .7rem; border-left: 3px solid var(--teal);
}
.sidebar .widget-title { color: var(--text); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .8rem; line-height: 1.5; }
.widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: #DCE3E0; text-decoration: none; }
.sidebar .widget a:hover { color: var(--teal); }
.sidebar .widget .post-date { display: block; font-size: .7rem; color: var(--muted); }
.sidebar .widget p { font-size: .82rem; color: #C3CCC9; }
.sidebar .search-form { flex-direction: column; }

/* ===== Поиск ===== */
.search-form { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0; }
.search-field {
    flex: 1 1 220px; min-width: 0;
    background: #070A0B; color: var(--text);
    border: 1px solid var(--line); border-radius: 0;
    padding: .7rem .9rem; font-family: var(--font-mono); font-size: .85rem;
}
.search-field::placeholder { color: var(--muted); }
.search-field:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 1px var(--teal); }

/* ===== 404 ===== */
.err-box { text-align: left; padding: 1rem 0 2rem; }
.err-code {
    font-family: var(--font-mono); font-size: clamp(5rem, 18vw, 10rem); line-height: 1; margin: 0 0 .5rem;
    color: transparent; -webkit-text-stroke: 2px var(--teal); letter-spacing: -.04em;
}
.err-text { color: #B9C3C0; max-width: 38rem; }

/* ===== Комментарии ===== */
.comments { margin-top: 3.4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comments-title { margin: 0 0 1.4rem; font-size: 1.6rem; text-transform: uppercase; letter-spacing: .05em; }
.comments-count { font-family: var(--font-mono); font-size: 1rem; color: var(--ink); background: var(--teal); padding: .1rem .5rem; vertical-align: middle; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-left: 1.4rem; padding-left: 1rem; border-left: 1px dashed var(--line); }
.note-body { background: var(--bg-alt); border: 1px solid var(--line); padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin-bottom: .6rem; }
.note-avatar { width: 40px; height: 40px; border: 1px solid var(--line); }
.note-author { font-weight: 700; font-size: .85rem; }
.note-date { font-size: .7rem; color: var(--muted); }
.note-wait { font-size: .75rem; color: var(--amber); }
.note-text { font-size: .85rem; color: #D5DCD9; }
.note-text p:last-child { margin-bottom: 0; }
.note-reply a { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); text-decoration: none; }
.comment-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; font-size: .8rem; }
.comments-closed { color: var(--muted); }
.comment-respond { background: var(--bg-alt); border: 1px solid var(--line); padding: 1.5rem 1.5rem 1.6rem; margin-top: 1.6rem; }
.comment-reply-title { margin: 0 0 .8rem; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .05em; }
.comment-reply-title small { font-family: var(--font-mono); font-size: .72rem; margin-left: .6rem; text-transform: none; letter-spacing: 0; }
.cf-note { font-size: .75rem; color: var(--muted); }
.cf-field { margin: 0 0 1rem; }
.cf-field label { display: block; font-size: .75rem; color: #C3CCC9; margin-bottom: .35rem; }
.cf-field input, .cf-field textarea {
    width: 100%; background: #070A0B; color: var(--text); border: 1px solid var(--line); border-radius: 0;
    padding: .65rem .8rem; font-family: var(--font-mono); font-size: .85rem;
}
.cf-field input:focus, .cf-field textarea:focus { border-color: var(--teal); outline: none; }
.cf-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .75rem; color: #C3CCC9; }
.cf-check input { margin-top: .3rem; accent-color: var(--teal); }
.req { color: var(--amber); }
.form-submit { margin: 1rem 0 0; }

/* ===== Подвал ===== */
.sitefoot { background-color: var(--bg-foot); border-top: 1px solid var(--line); color: #B3BDBA; }
.foot-grid { display: grid; gap: 2.2rem; padding: 3.2rem 0 2.6rem; }
@media (min-width: 600px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .foot-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 3rem; } }
.foot-col { min-width: 0; }
.sitefoot .widget-title { color: var(--text); font-family: var(--font-mono); text-transform: none; letter-spacing: .02em; font-size: 1.15rem; }
.sitefoot .widget, .sitefoot .widget p, .sitefoot .textwidget { color: #B3BDBA; font-size: .8rem; line-height: 1.7; }
.sitefoot .widget a { color: #DCE3E0; text-decoration: none; }
.sitefoot .widget a:hover { color: var(--teal); text-decoration: underline; text-decoration-color: var(--teal); }
.sitefoot .widget li { border-bottom: 0; padding: .3rem 0; }
.sitefoot .menu li a::before { content: "> "; color: var(--teal); }
.foot-bottom { border-top: 1px solid var(--line); }
.copyright { margin: 0; padding: 1.3rem 0 1.5rem; text-align: center; font-size: .75rem; color: var(--muted); }

/* ===== Cookie-баннер ===== */
.cookie-banner {
    position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 90;
    width: min(92%, 860px);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .9rem 1.4rem;
    background: #0B0F11; color: var(--text);
    border: 1px solid var(--teal);
    box-shadow: 5px 5px 0 rgba(55, 224, 168, .25);
    padding: 1rem 1.3rem;
}
.cookie-text { margin: 0; flex: 1 1 320px; font-size: .78rem; line-height: 1.6; color: #C3CCC9; }
.cookie-prompt { color: var(--teal); font-weight: 700; margin-right: .3rem; }
.cookie-accept { flex: 0 0 auto; }

/* ===== WordPress-служебное ===== */
.alignwide, .alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.sticky, .bypostauthor, .gallery-caption { outline: 0; }
.wp-block-image img { height: auto; }

/* ===== Мобильная коррекция плашек ===== */
@media (max-width: 599px) {
    .fs { padding: 3rem 0; }
    .board-cell { padding: 1.2rem 1.15rem 1rem; }
    .doc-sheet { padding: 1.3rem 1.15rem; }
    .doc-sheet::before { left: 1.15rem; top: 1.3rem; }
    .doc-points { padding: 1rem 1rem; }
    .meter-note { padding: 1.3rem 1.15rem 1.1rem; }
    .sidebar { padding: 1.3rem 1.15rem; }
    .comment-respond { padding: 1.2rem 1.1rem 1.3rem; }
    .cookie-banner { padding: .9rem 1rem; bottom: .6rem; }
    .brand-mark { width: 46px; height: 46px; }
    .brand-name { font-size: .92rem; }
    .front-lower { background-size: 80% auto, var(--grid-size); background-position: right -30% bottom 0, 0 0; }
}
