/*
Theme Name: dds_buttexarx.ru
Theme URI: https://buttexarx.ru/
Author: Дмитрий Воронов
Author URI: https://buttexarx.ru/
Description: Портал о технических стандартах, инженерном обслуживании и энергоэффективности жилья. Инженерная точность и энергия порядка — тёмный технический минимализм с медными акцентами.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dds_buttexarx
*/

/* ================================================================
   1. БАЗА — переменные и сброс
   ================================================================ */
:root {
    --bg: #12161A;
    --bg-card: #1A2026;
    --bg-card-2: #1F262D;
    --accent: #D97A2B;
    --accent-hot: #E89F3E;
    --accent-cool: #B66422;
    --graphite: #5B6E7C;
    --graphite-dim: #2A3540;
    --text: #E6EDF2;
    --text-dim: #8A9AA8;
    --text-fade: #6B7886;
    --divider: rgba(217, 122, 43, 0.18);
    --etch-shadow: 0 1px 0 rgba(217, 122, 43, 0.08), 0 8px 24px rgba(0, 0, 0, 0.45);
    --grid-line: rgba(91, 110, 124, 0.10);

    --font-head: 'Fira Code', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', ui-monospace, monospace;

    --container: min(92%, 1180px);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(217, 122, 43, 0.04), transparent 50%),
        radial-gradient(at 100% 100%, rgba(91, 110, 124, 0.06), transparent 50%);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    overflow-x: hidden;
    min-height: 100vh;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .18s ease, border-color .18s ease;
}
a:hover { color: var(--accent-hot); }

p { margin: 0 0 1em; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 1.6em 0 0.7em;
    line-height: 1.25;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

.entry-content h2,
.entry-content h3 {
    position: relative;
    padding-bottom: 8px;
}
.entry-content h2::after,
.entry-content h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 2px;
    background: var(--accent);
}

/* ================================================================
   2. ОБОЛОЧКА И СЕТКА
   ================================================================ */
.shell {
    width: var(--container);
    margin-inline: auto;
}

.site-main { padding: 32px 0 72px; }

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
}
.layout.has-sidebar {
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    gap: 6%;
}
/* A12: single-column layout — block, не grid */
.layout.no-sidebar { display: block; }
.layout.no-sidebar .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

.content-area { min-width: 0; }

@media (max-width: 960px) {
    .layout.has-sidebar { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .layout.no-sidebar .content-area { width: 100%; }
}

/* Узкая single-column обёртка для front-page и no-sidebar — block, не grid (A12) */
.single-col {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 960px) {
    .single-col { width: 92%; }
}

/* ================================================================
   3. ШАПКА
   ================================================================ */
.site-header {
    background: linear-gradient(180deg, #161B21 0%, #11161B 100%);
    border-bottom: 1px solid var(--divider);
    box-shadow: 0 2px 0 rgba(217, 122, 43, 0.04);
    position: relative;
}
.site-header::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, var(--accent) 70%, transparent 100%);
    opacity: 0.55;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.brand-mark {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, rgba(217, 122, 43, 0.18), transparent 70%);
    box-shadow: inset 0 0 0 3px rgba(18, 22, 26, 0.6);
}
.brand-mark svg { width: 26px; height: 26px; display: block; }
.brand-logo {
    max-height: 56px;
    width: auto;
    display: block;
}

.brand-text { min-width: 0; }
.brand-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
}
.brand-title a { color: var(--text); }
.brand-title a:hover { color: var(--accent-hot); }
.brand-tag {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    margin-top: 4px;
    line-height: 1.3;
}

/* ================================================================
   4. ОСНОВНАЯ НАВИГАЦИЯ
   ================================================================ */
.primary-nav { display: block; }
.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.primary-nav a {
    display: inline-block;
    padding: 10px 14px;
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    border: 1px solid transparent;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all .18s ease;
    position: relative;
}
.primary-nav a:hover {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(217, 122, 43, 0.06);
}
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(217, 122, 43, 0.10);
}
.primary-nav .current-menu-item > a::before,
.primary-nav .current_page_item > a::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 14px;
    font-family: var(--font-head);
    cursor: pointer;
    border-radius: 3px;
    align-items: center;
    gap: 8px;
}
.nav-toggle:hover { background: rgba(217, 122, 43, 0.10); }
.nav-toggle .bars {
    display: inline-block;
    width: 18px;
    height: 2px;
    background: var(--accent);
    position: relative;
}
.nav-toggle .bars::before,
.nav-toggle .bars::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: var(--accent);
}
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }

@media (max-width: 768px) {
    .header-inner { flex-wrap: nowrap; }
    .nav-toggle { display: inline-flex; }
    .primary-nav[hidden] { display: none !important; }
    .primary-nav {
        flex: 1 0 100%;
        order: 3;
        margin-top: 14px;
    }
    .primary-nav ul {
        flex-direction: column;
        gap: 4px;
    }
    .primary-nav a { display: block; }
}

/* ================================================================
   5. ХЛЕБНЫЕ КРОШКИ
   ================================================================ */
.breadcrumbs {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-dim);
    padding: 18px 0 6px;
    margin: 0;
}
.breadcrumbs a {
    color: var(--text-dim);
    border-bottom: 1px dotted var(--graphite);
}
.breadcrumbs a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.breadcrumbs .sep { color: var(--accent); padding: 0 6px; opacity: 0.7; }
.breadcrumbs span:last-child { color: var(--text); }

/* ================================================================
   6. ГЕРОЙ-БЛОК ГЛАВНОЙ
   ================================================================ */
.hero {
    padding: 56px 0 32px;
    border-bottom: 1px solid var(--divider);
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
.hero-eyebrow {
    font-family: var(--font-mono);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    margin: 0 0 12px;
}
.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(1.8rem, 4.4vw, 2.6rem);
}
.hero-lead {
    color: var(--text-dim);
    font-size: 1.05rem;
    margin: 0 0 24px;
}
.hero-side {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
    padding: 24px;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 24px 24px;
    position: relative;
}
.hero-side::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent);
}
.hero-side h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.hero-side ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.hero-side li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--graphite-dim);
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.hero-side li:last-child { border-bottom: none; }
.hero-side li b { color: var(--text); font-weight: 600; }

/* ================================================================
   7. КНОПКИ
   ================================================================ */
.btn,
.btn-primary,
.button,
input[type="submit"],
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 26px 0 22px;
    background: var(--accent);
    color: #11161B;
    font-family: var(--font-head);
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 0 0 transparent;
    text-decoration: none;
}
.btn::before,
.btn-primary::before,
.wp-block-button__link::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: rgba(17, 22, 27, 0.4);
}
.btn:hover,
.btn-primary:hover,
.button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
    background: var(--accent-hot);
    color: #11161B;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(217, 122, 43, 0.25), 0 4px 18px rgba(0, 0, 0, 0.4);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 18px;
    background: var(--graphite-dim);
    color: var(--text);
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--accent);
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: all .18s ease;
}
.btn-ghost:hover {
    background: rgba(217, 122, 43, 0.10);
    border-color: var(--accent-hot);
    color: var(--accent-hot);
    transform: translateY(-1px);
}

/* ================================================================
   8. КАРТОЧКИ ЗАПИСЕЙ
   ================================================================ */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    position: relative;
    min-width: 0;
}
.card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0.3);
    transform-origin: top;
    transition: transform .25s ease;
    z-index: 1;
}
.card:hover {
    transform: translateY(-3px);
    border-color: rgba(217, 122, 43, 0.45);
    box-shadow: var(--etch-shadow);
}
.card:hover::before { transform: scaleY(1); }

.card-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--graphite-dim);
    display: block;
}
.card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 10;
    transition: transform .4s ease;
}
.card:hover .card-thumb img { transform: scale(1.04); }

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-fade);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.card-meta .dot { color: var(--accent); }

.card-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }

.card-excerpt {
    color: var(--text-dim);
    font-size: 0.92rem;
    flex: 1;
    margin-bottom: 16px;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-excerpt p:last-child { margin-bottom: 0; }
.card-excerpt a { color: var(--accent); border-bottom: 1px dotted var(--accent); }

.card-cta {
    align-self: flex-start;
    font-family: var(--font-head);
    font-size: 0.82rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}
.card-cta:hover {
    color: var(--accent-hot);
    border-bottom-color: var(--accent-hot);
}
.card-cta::after { content: ' →'; font-family: var(--font-body); }

/* Энергоэффективность — бейдж */
.energy-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.78rem;
    color: #11161B;
    border-radius: 2px;
    flex-shrink: 0;
}
.energy-badge.a { background: #5BC373; }
.energy-badge.b { background: #9CC256; }
.energy-badge.c { background: var(--accent); }
.energy-badge.d { background: #C25656; }

/* ================================================================
   9. САЙДБАР И ВИДЖЕТЫ
   ================================================================ */
.sidebar { min-width: 0; }

.widget {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
    padding: 22px 22px 20px;
    margin-bottom: 24px;
    position: relative;
}
.widget::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0.5;
}

.widget-title {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--divider);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--graphite-dim);
    font-size: 0.92rem;
}
.widget li:last-child { border-bottom: none; }
.widget li a {
    color: var(--text);
    display: inline-block;
}
.widget li a:hover { color: var(--accent); }
.widget .post-date { color: var(--text-fade); font-family: var(--font-mono); font-size: 0.78rem; }

.sidebar .widget { color: var(--text); }
.sidebar .widget a { color: var(--text); }
.sidebar .widget a:hover { color: var(--accent); }

/* ================================================================
   10. СОДЕРЖИМОЕ ЗАПИСИ / СТРАНИЦЫ
   ================================================================ */
.entry {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
    padding: 32px 36px;
}
@media (max-width: 600px) {
    .entry { padding: 24px 18px; }
}

.entry-header { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--divider); }
.entry-title { margin: 0 0 12px; font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.entry-meta {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.entry-meta a { color: var(--text-dim); border-bottom: 1px dotted var(--graphite); }
.entry-meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.entry-content { color: var(--text); }
.entry-content > * { min-width: 0; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 22px; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: 6px; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 16px 20px 16px 22px;
    background: var(--graphite-dim);
    border-left: 4px solid var(--accent);
    font-style: italic;
    color: var(--text);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content code {
    font-family: var(--font-mono);
    background: var(--graphite-dim);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.9em;
    color: var(--accent-hot);
}
.entry-content pre {
    background: #0D1116;
    border: 1px solid var(--divider);
    border-left: 4px solid var(--accent);
    padding: 18px;
    overflow-x: auto;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--text);
}
.entry-content pre code { background: none; padding: 0; color: inherit; }
.entry-content img {
    border-radius: 3px;
    border: 1px solid var(--divider);
    display: block;
    margin: 1em auto;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--graphite);
    font-size: 0.92rem;
}
.entry-content th, .entry-content td {
    border: 1px solid var(--graphite-dim);
    padding: 10px 14px;
    text-align: left;
}
.entry-content th {
    background: var(--graphite-dim);
    color: var(--accent);
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.entry-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--divider);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
}
.entry-footer .tag-list a {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    border: 1px solid var(--accent);
    border-radius: 2px;
    color: var(--accent);
    font-size: 0.78rem;
    background: var(--graphite-dim);
    transition: all .18s ease;
}
.entry-footer .tag-list a:hover { background: var(--accent); color: #11161B; transform: translateY(-1px); }

/* ================================================================
   11. ПАГИНАЦИЯ
   ================================================================ */
.pagination {
    margin: 40px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-family: var(--font-head);
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid var(--accent);
    border-radius: 3px;
    color: var(--accent);
    background: transparent;
    transition: all .18s ease;
    text-decoration: none;
}
.pagination a:hover {
    background: rgba(217, 122, 43, 0.10);
    color: var(--accent-hot);
    border-color: var(--accent-hot);
}
.pagination .current {
    background: var(--accent);
    color: #11161B;
    border-color: var(--accent);
}
.pagination .dots {
    border: none;
    color: var(--text-dim);
}

/* ================================================================
   12. ФРОНТ-СТРАНИЦА — ТЕМАТИЧЕСКИЕ БЛОКИ
   ================================================================ */
.section {
    padding: 56px 0;
    border-bottom: 1px solid var(--divider);
}
.section:last-of-type { border-bottom: none; }

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.section-head h2 {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    position: relative;
    padding-bottom: 10px;
}
.section-head h2::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 56px; height: 2px;
    background: var(--accent);
}
.section-head .subtitle {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Блок «Принципы инженерного подхода» */
.principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 18px;
}
.principle {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    padding: 24px 22px;
    border-radius: 4px;
    position: relative;
    min-width: 0;
}
.principle::before {
    content: attr(data-index);
    position: absolute;
    top: 12px; right: 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    opacity: 0.6;
}
.principle h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--accent);
}
.principle p { margin: 0; color: var(--text-dim); font-size: 0.93rem; }

/* Блок «Стандарты в работе» — горизонтальные строки-индикаторы */
.standards {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
    padding: 30px;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
}
.standards-list { display: grid; gap: 14px; }
.standard-row {
    display: grid;
    grid-template-columns: minmax(0, 80px) minmax(0, 1fr) minmax(0, auto);
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
    background: rgba(18, 22, 26, 0.55);
    border-left: 3px solid var(--accent);
    border-radius: 2px;
    min-width: 0;
}
@media (max-width: 600px) {
    .standard-row { grid-template-columns: minmax(0, 1fr); }
}
.standard-row .code {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
}
.standard-row .name { color: var(--text); font-size: 0.95rem; }
.standard-row .meta {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Блок «Категории» */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 14px;
}
.cat-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all .18s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
}
.cat-tile::after {
    content: '↗';
    color: var(--accent);
    font-family: var(--font-body);
    transition: transform .2s ease;
}
.cat-tile:hover {
    background: rgba(217, 122, 43, 0.08);
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
}
.cat-tile:hover::after { transform: translate(2px, -2px); }

/* Блок «Метрики проекта» */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 18px;
}
.metric {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
    padding: 26px 18px;
    position: relative;
    min-width: 0;
}
.metric::before {
    content: '';
    position: absolute;
    left: 50%; top: 0;
    transform: translateX(-50%);
    width: 40px; height: 2px;
    background: var(--accent);
}
.metric .num {
    font-family: var(--font-head);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 8px;
}
.metric .label {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ================================================================
   13. ПОДВАЛ
   ================================================================ */
.site-footer {
    background: #0D1116;
    border-top: 1px solid var(--divider);
    margin-top: 60px;
    color: var(--text-dim);
    position: relative;
}
.site-footer::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding: 48px 0 36px;
}
@media (max-width: 860px) {
    .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

.footer-grid .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--text-dim);
}
.footer-grid .widget::before { display: none; }
.footer-grid .widget-title {
    color: var(--accent);
    font-size: 0.92rem;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 8px;
}
.footer-grid .widget,
.footer-grid .widget p,
.footer-grid .widget li {
    color: var(--text-dim);
}
.footer-grid .widget li {
    border-color: rgba(91, 110, 124, 0.18);
}
.footer-grid .widget a {
    color: var(--text);
}
.footer-grid .widget a:hover { color: var(--accent); }
.footer-grid .widget .post-date {
    color: var(--text-fade);
}

.copyright {
    padding: 22px 0;
    border-top: 1px solid var(--divider);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-fade);
    letter-spacing: 0.04em;
}
.copyright b { color: var(--text); font-weight: 600; }

/* ================================================================
   14. ПОИСК
   ================================================================ */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 520px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-card);
    border: 1px solid var(--graphite);
    border-radius: 3px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
}
.search-form .search-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(217, 122, 43, 0.18);
}
.search-form .search-submit {
    height: 44px;
    padding: 0 18px;
}

/* ================================================================
   15. КОММЕНТАРИИ
   ================================================================ */
.comments-area {
    margin-top: 36px;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
    padding: 28px 32px;
}
@media (max-width: 600px) { .comments-area { padding: 22px 18px; } }
.comments-title {
    font-family: var(--font-head);
    font-size: 1.2rem;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--divider);
}
.comment-list {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
}
.comment-list li { margin-bottom: 18px; }
.comment-body {
    background: var(--graphite-dim);
    border-left: 3px solid var(--accent);
    padding: 16px 18px;
    border-radius: 2px;
}
.comment-author {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.comment-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 10px;
}
.comment-content { color: var(--text); }
.comment-content p:last-child { margin-bottom: 0; }
.children {
    list-style: none;
    margin: 14px 0 0;
    padding-left: 22px;
    border-left: 1px dashed var(--graphite);
}

.comment-respond { margin-top: 24px; }
.comment-form label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--graphite);
    border-radius: 3px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
}
.comment-form textarea { min-height: 130px; }
.comment-form input:focus, .comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.comment-form p { margin: 0 0 14px; }
.form-submit input[type="submit"] { width: auto; }

/* ================================================================
   16. 404
   ================================================================ */
.notfound {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 4px;
}
.notfound .code {
    font-family: var(--font-head);
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 14px;
    letter-spacing: 0.05em;
}
.notfound h1 { margin: 0 0 14px; }
.notfound p { color: var(--text-dim); max-width: 480px; margin: 0 auto 24px; }
.notfound .search-form { margin: 0 auto 24px; }

/* ================================================================
   17. COOKIE-БАННЕР
   ================================================================ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    background: #11161B;
    border: 1px solid var(--accent);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 720px;
    margin: 0 auto;
}
.cookie-banner p {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
}
.cookie-banner button {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 22px;
    background: var(--accent);
    color: #11161B;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.cookie-banner button:hover { background: var(--accent-hot); transform: translateY(-1px); }

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        gap: 12px;
    }
    .cookie-banner button { width: 100%; }
}

/* ================================================================
   18. УТИЛИТЫ И КЛАССЫ WP
   ================================================================ */
.alignleft  { float: left;  margin: 6px 18px 12px 0; }
.alignright { float: right; margin: 6px 0 12px 18px; }
.aligncenter { display: block; margin: 18px auto; }
.alignwide { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 6px;
}
.sticky { /* для совместимости */ }
.bypostauthor { /* для совместимости */ }
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
    gap: 8px;
    margin: 1em 0;
}
.gallery-item { margin: 0 !important; }

/* Decorative engineer grid background — фон для blog-страницы */
.page-blog .site-main {
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Финальный сектор «Инженерный итог» (engineering trace stub) */
.engtrace {
    margin-top: 40px;
    background: var(--graphite-dim);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 22px 26px;
    position: relative;
}
.engtrace h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.engtrace ul { margin: 0; padding-left: 20px; }
.engtrace li { margin-bottom: 6px; color: var(--text); }
