/*
Theme Name: dds_stroy-marketplace.ru
Author: Алексей Кузнецов
Description: Тема «Инженерная доска» для образовательного портала о строительных материалах и технологиях: швейцарская сетка, брутализм, технические детали чертежа.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: stmark
*/

/* ===== Токены ===== */
:root {
    --bg: #14181c;
    --bg-alt: #1b2126;
    --bg-dark: #0f1215;
    --line: #2a3238;
    --grid: #1f262c;
    --hatch: #222a30;
    --text: #e8eaed;
    --muted: #8a939c;
    --accent: #4da3ff;
    --amber: #ffb347;
    --f-head: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
    --f-body: "IBM Plex Sans", "Inter", "Segoe UI", Arial, sans-serif;
    --f-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ===== Сброс и база ===== */
*, *::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-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 24px 24px;
}
body::after {
    content: "";
    position: fixed;
    right: 0;
    bottom: 0;
    width: 420px;
    height: 420px;
    pointer-events: none;
    z-index: 0;
    opacity: .04;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 420' fill='none' stroke='%23e8eaed' stroke-width='3'%3E%3Cpath d='M40 400V120h80v200h280'/%3E%3Cpath d='M120 320h60v-40h60v40h60v-40h60v40M180 280v-40h60v40h60v-40h60v40M120 240h60v-40h60v40h60v-40h100M120 200h120v-40h60v40h100M120 160h60v-40h60v40h60v-40h100'/%3E%3Cpath d='M20 120v280M14 120h12M14 400h12M40 416h360M40 410v12M400 410v12'/%3E%3C/svg%3E") no-repeat right bottom / contain;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--f-head);
    font-weight: 700;
    line-height: 1.15;
    margin: 1.4em 0 .6em;
    color: var(--text);
}
h1 { font-size: 3.2rem; letter-spacing: .01em; }
h2 { font-size: 2rem; }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.2rem; }
a { color: var(--accent); text-decoration: none; }
table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; border: 1px solid var(--line); }
th, td { border: 1px solid var(--line); padding: .6em .8em; text-align: left; vertical-align: top; }
th { background: var(--bg-alt); font-family: var(--f-head); letter-spacing: .04em; text-transform: uppercase; }
code, pre, kbd { font-family: var(--f-mono); font-size: .9em; }
pre { background: var(--bg-dark); border: 1px solid var(--line); padding: 1rem 1.2rem; overflow-x: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.stm-mono { font-family: var(--f-mono); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Анимированное подчёркивание текстовых ссылок */
.stm-entry a, .stm-widget a, .stm-crumbs a, .stm-card__title a, .stm-page-head__label a, .stm-comment a {
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: background-size .25s ease, color .2s ease;
}
.stm-entry a:hover, .stm-widget a:hover, .stm-crumbs a:hover, .stm-card__title a:hover, .stm-page-head__label a:hover, .stm-comment a:hover {
    background-size: 100% 1px;
}

/* ===== Каркас ===== */
.stm-page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.stm-main { flex: 1 0 auto; }
.stm-shell { width: min(94%, 1320px); margin-inline: auto; }
.stm-front-inner { width: 85%; margin-left: auto; margin-right: auto; }

.stm-layout { padding: 2.5rem 0 4rem; }
.stm-layout--single .stm-content { width: 85%; margin-left: auto; margin-right: auto; }
.stm-layout--aside {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    justify-content: space-between;
    align-items: start;
}
.stm-content, .stm-aside { min-width: 0; }

/* ===== Верхняя полоса и шапка ===== */
.stm-topline { height: 3px; background: linear-gradient(90deg, var(--accent), var(--amber)); }
.stm-header { background: var(--bg-dark); border-bottom: 1px solid var(--line); position: relative; }
.stm-header__row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 0; }
.stm-brand { display: flex; align-items: center; gap: .9rem; color: var(--text); min-width: 0; }
.stm-brand__mark { flex: 0 0 auto; }
.stm-brand__logo { max-height: 56px; width: auto; }
.stm-brand__svg { display: block; }
.stm-brand__text { display: flex; flex-direction: column; min-width: 0; max-width: 620px; }
.stm-brand__name {
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.2;
    letter-spacing: .02em;
    color: var(--text);
}
.stm-brand__desc {
    font-size: .78rem;
    line-height: 1.35;
    color: var(--muted);
    margin-top: .25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.stm-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: .2rem; }
.stm-nav__list a {
    display: block;
    padding: .55rem .9rem;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: 2px;
    transition: border-color .2s, color .2s;
    white-space: nowrap;
}
.stm-nav__list a:hover, .stm-nav__list .current-menu-item > a { border-color: var(--accent); color: var(--accent); }
.stm-burger {
    display: none;
    align-items: center;
    gap: .6rem;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: .5rem .8rem;
    font-family: var(--f-mono);
    font-size: .85rem;
    cursor: pointer;
}
.stm-burger__bar, .stm-burger__bar::before, .stm-burger__bar::after { display: block; width: 18px; height: 2px; background: var(--text); position: relative; }
.stm-burger__bar::before, .stm-burger__bar::after { content: ""; position: absolute; left: 0; }
.stm-burger__bar::before { top: -6px; }
.stm-burger__bar::after { top: 6px; }

/* ===== Кнопки ===== */
.stm-btn {
    display: inline-block;
    padding: .75rem 1.4rem;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.2;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.stm-btn--primary { background: var(--accent); color: #0f1215; border-color: var(--accent); }
.stm-btn--ghost { background: transparent; color: var(--text); border-color: var(--text); }
.stm-btn:hover, .stm-btn:focus-visible { background: var(--amber); border-color: var(--amber); color: #0f1215; transform: translateX(2px); }
input[type="submit"], .comment-form .submit {
    font-family: var(--f-head); font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    background: var(--accent); color: #0f1215; border: 1px solid var(--accent); border-radius: 2px; padding: .75rem 1.4rem; cursor: pointer;
    transition: background-color .2s, transform .2s;
}
input[type="submit"]:hover, .comment-form .submit:hover { background: var(--amber); border-color: var(--amber); transform: translateX(2px); }

/* ===== Заголовки секций ===== */
.stm-sec-title {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 0 0 2.2rem;
    font-size: 1.6rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.stm-sec-title::before { content: ""; flex: 0 0 10px; width: 10px; height: 10px; background: var(--accent); }
.stm-sec-title span { flex: 0 1 auto; min-width: 0; }
.stm-sec-title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); min-width: 2rem; }

/* H2 с квадратным маркером */
.stm-entry h2 { position: relative; padding-left: 20px; }
.stm-entry h2::before { content: ""; position: absolute; left: 0; bottom: .3em; width: 8px; height: 8px; background: var(--accent); }

/* ===== Разделители ===== */
.stm-divider {
    position: relative;
    height: 22px;
    width: min(94%, 1320px);
    margin-inline: auto;
}
.stm-divider::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 10px;
    height: 1px;
    background-image: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px);
}
.stm-divider::after {
    content: "";
    position: absolute;
    left: 50%; top: 7px;
    width: 7px; height: 7px;
    margin-left: -3px;
    background: var(--accent);
}
.stm-divider { background:
    linear-gradient(var(--muted), var(--muted)) left 4px / 1px 13px no-repeat,
    linear-gradient(var(--muted), var(--muted)) right 4px / 1px 13px no-repeat; }
.stm-divider--footer { margin-top: 0; }

/* ===== Секции главной ===== */
.stm-sec { padding: 4.5rem 0; background: var(--bg); position: relative; }
.stm-sec--alt {
    background-color: var(--bg-alt);
    background-image: repeating-linear-gradient(45deg, var(--hatch) 0 1px, transparent 1px 8px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

/* Hero */
.stm-hero {
    position: relative;
    overflow: hidden;
    padding: 6.5rem 0 5.5rem;
    background: #0b0e12;
    border-bottom: 1px solid var(--line);
}
.stm-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .55;
    filter: grayscale(.35);
}
.stm-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(15,18,21,.95) 0%, rgba(15,18,21,.75) 45%, rgba(20,60,110,.45) 100%),
        linear-gradient(0deg, rgba(77,163,255,.14), rgba(77,163,255,.14));
}
.stm-hero .stm-shell { position: relative; z-index: 2; }
.stm-hero__inner {
    position: relative;
    padding: 2.4rem 2.4rem 2.6rem;
    border-left: 1px solid rgba(232,234,237,.25);
}
.stm-hero__inner::before, .stm-hero__inner::after {
    content: "";
    position: absolute;
    width: 18px; height: 18px;
    border-color: var(--accent);
    border-style: solid;
}
.stm-hero__inner::before { left: -1px; top: 0; border-width: 1px 0 0 1px; }
.stm-hero__inner::after { left: -1px; bottom: 0; border-width: 0 0 1px 1px; }
.stm-hero__label { color: var(--amber); font-size: .85rem; letter-spacing: .08em; margin-bottom: 1rem; }
.stm-hero__title { margin: 0 0 1.1rem; max-width: 16ch; text-transform: uppercase; letter-spacing: .02em; }
.stm-hero__lead { max-width: 58ch; color: #c9ced3; font-size: 1.12rem; margin-bottom: 2rem; }
.stm-hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; }
.stm-hero__dim {
    position: absolute;
    right: 0; top: 2.4rem; bottom: 2.6rem;
    width: 1px;
    background: rgba(232,234,237,.25);
}
.stm-hero__dim span {
    position: absolute; top: 50%; left: 8px;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: left center;
    font-size: .72rem; color: var(--muted);
}

/* Статистика */
.stm-stats__row {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(15,18,21,.55);
}
.stm-stats__item {
    padding: 2rem 1.5rem;
    border-left: 1px solid var(--line);
    min-width: 0;
}
.stm-stats__item:first-child { border-left: 0; }
.stm-stats__num {
    display: block;
    font-family: var(--f-mono);
    font-weight: 500;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 1;
    color: var(--text);
    margin-bottom: .8rem;
}
.stm-stats__item:nth-child(2) .stm-stats__num { color: var(--accent); }
.stm-stats__cap { display: block; color: var(--muted); font-size: .92rem; line-height: 1.4; }

/* Последние записи */
.stm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
.stm-grid--list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stm-latest__all { margin: 2.2rem 0 0; text-align: right; }
.stm-empty { color: var(--muted); padding: 1.5rem 1.6rem; border: 1px dashed var(--line); background: var(--bg-alt); }

/* Карточки */
.stm-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(232,234,237,.08);
    transition: border-color .2s, transform .2s;
    min-width: 0;
}
.stm-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stm-card__thumb { overflow: hidden; border-bottom: 1px solid var(--line); }
.stm-card__thumb a { display: block; }
.stm-card__thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform .4s ease;
}
.stm-card:hover .stm-card__thumb img { transform: scale(1.05); }
.stm-card__blank {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 16 / 10;
    color: var(--muted); font-size: .8rem; letter-spacing: .1em;
    background-color: var(--bg-dark);
    background-image:
        linear-gradient(rgba(77,163,255,.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77,163,255,.09) 1px, transparent 1px);
    background-size: 16px 16px;
    transition: transform .4s ease;
}
.stm-card:hover .stm-card__blank { transform: scale(1.05); }
.stm-card__body { flex: 1; display: flex; flex-direction: column; padding: 1.3rem 1.4rem 1.5rem; min-width: 0; }
.stm-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; font-size: .78rem; color: var(--muted); margin-bottom: .6rem; }
.stm-card__cat { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stm-card__cat:hover { color: var(--accent); }
.stm-tag-hot { font-family: var(--f-mono); font-size: .72rem; color: #0f1215; background: var(--amber); padding: .1rem .45rem; border-radius: 2px; }
.stm-card__title { margin: 0 0 .7rem; font-size: 1.4rem; overflow-wrap: anywhere; }
.stm-card__title a { color: var(--text); }
.stm-card__title a:hover { color: var(--accent); }
.stm-card__excerpt { color: #bfc5cb; font-size: .95rem; flex: 1; }
.stm-card__excerpt p { margin: 0 0 0.5em; background: none; }
.stm-card__more {
    align-self: flex-start;
    margin-top: .8rem;
    font-family: var(--f-head); font-weight: 600; font-size: .98rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--accent);
    transition: color .2s, transform .2s;
}
.stm-card__more:hover { color: var(--amber); transform: translateX(2px); }

/* Zigzag */
.stm-zz {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: center;
    padding: 2.2rem 0;
    border-top: 1px dashed var(--line);
}
.stm-zz:first-of-type { border-top: 0; padding-top: 0; }
.stm-zz--rev .stm-zz__media { order: 2; }
.stm-zz__media {
    margin: 0;
    position: relative;
    background: var(--bg-dark);
    border: 1px solid var(--line);
    padding: 1.2rem;
    min-width: 0;
}
.stm-zz__media::before, .stm-zz__media::after {
    content: ""; position: absolute; width: 14px; height: 14px; border: 0 solid var(--accent);
}
.stm-zz__media::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.stm-zz__media::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.stm-zz__media img { width: 100%; aspect-ratio: 64 / 46; object-fit: contain; }
.stm-zz__text { min-width: 0; }
.stm-zz__num { color: var(--amber); font-size: .85rem; letter-spacing: .06em; margin-bottom: .5rem; }
.stm-zz__title { margin: 0 0 1rem; font-size: 1.9rem; }
.stm-zz__text p:last-child { color: #c2c8ce; margin-bottom: 0; }

/* Карта тем */
.stm-topics__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.stm-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 1 / 1;
    padding: 1.6rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: rgba(27,33,38,.7);
    color: var(--text);
    min-width: 0;
    transition: background-color .2s, color .2s, border-color .2s;
}
.stm-tile__idx { position: absolute; top: 1rem; left: 1.2rem; font-size: .8rem; color: var(--muted); transition: color .2s; }
.stm-tile__icon { position: absolute; top: 1.2rem; right: 1.2rem; width: 56px; height: 56px; color: var(--accent); transition: color .2s; }
.stm-tile__name { font-family: var(--f-head); font-weight: 700; font-size: 1.9rem; text-transform: uppercase; letter-spacing: .08em; line-height: 1.05; }
.stm-tile__sub { font-size: .9rem; color: var(--muted); margin-top: .35rem; transition: color .2s; }
.stm-tile:hover, .stm-tile:focus-visible { background: var(--accent); border-color: var(--accent); color: #0f1215; }
.stm-tile:hover .stm-tile__icon, .stm-tile:hover .stm-tile__idx, .stm-tile:hover .stm-tile__sub,
.stm-tile:focus-visible .stm-tile__icon, .stm-tile:focus-visible .stm-tile__idx, .stm-tile:focus-visible .stm-tile__sub { color: #0f1215; }

/* ===== Внутренние страницы ===== */
.stm-crumbs { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); margin-bottom: 1.6rem; overflow-wrap: anywhere; }
.stm-crumbs a { color: var(--accent); }
.stm-crumbs__sep { color: var(--line); margin: 0 .25rem; }
.stm-page-head { margin-bottom: 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); position: relative; }
.stm-page-head::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 7px; height: 7px; background: var(--accent); }
.stm-page-head__label { color: var(--amber); font-size: .82rem; margin: 0 0 .6rem; letter-spacing: .06em; }
.stm-page-head__label a { color: var(--accent); }
.stm-page-head__title { margin: 0; overflow-wrap: anywhere; }
.stm-page-head__intro { margin-top: 1rem; color: #c2c8ce; }

.stm-article__thumb { margin: 0 0 2rem; border: 1px solid var(--line); }
.stm-article__thumb img { width: 100%; }
.stm-entry { font-size: 1.05rem; overflow-wrap: break-word; }
.stm-entry > *:first-child { margin-top: 0; }
.stm-entry h2 { font-size: 2rem; margin-top: 2em; }
.stm-entry ul { padding-left: 1.2rem; }
.stm-entry ul li::marker { color: var(--accent); }
.stm-entry ol { list-style: none; counter-reset: stmstep; padding-left: 0; }
.stm-entry ol > li { counter-increment: stmstep; position: relative; padding-left: 3.4rem; margin-bottom: .6em; }
.stm-entry ol > li::before {
    content: "[" counter(stmstep, decimal-leading-zero) "]";
    position: absolute; left: 0; top: .05em;
    font-family: var(--f-mono); font-size: .9em; color: var(--accent);
}
.stm-entry blockquote, blockquote {
    margin: 1.8em 0;
    padding: .8rem 1.4rem;
    border-left: 3px solid var(--amber);
    background: rgba(27,33,38,.6);
    color: var(--text);
    font-size: 1.1rem;
}
.stm-entry blockquote p:last-child { margin-bottom: 0; }
.stm-entry img { max-width: 100%; height: auto; }
.stm-entry figure { margin: 1.6em 0; }
.stm-entry figcaption, .wp-caption-text { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.stm-article__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.stm-chip { font-family: var(--f-mono); font-size: .8rem; color: var(--text); border: 1px solid var(--line); padding: .25rem .6rem; border-radius: 2px; }
.stm-chip:hover { border-color: var(--accent); color: var(--accent); }

.stm-404 { padding: 1rem 0 2rem; }
.stm-404__code { font-size: 5rem; line-height: 1; color: var(--accent); margin: 1rem 0; }

/* Поиск */
.stm-search { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0; }
.stm-search__label { flex: 0 0 100%; font-family: var(--f-mono); font-size: .78rem; color: var(--muted); }
.stm-search__field {
    flex: 1 1 200px; min-width: 0;
    background: var(--bg-dark); color: var(--text);
    border: 1px solid var(--line); border-radius: 2px;
    padding: .7rem .9rem; font: inherit;
}
.stm-search__field:focus { outline: none; border-color: var(--accent); }

/* Пагинация (type => plain) */
.stm-pager { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 2.6rem 0 0; }
.stm-pager .page-numbers, .stm-pager > a, .stm-pager > span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.6rem; height: 2.6rem; padding: 0 .8rem;
    font-family: var(--f-mono); font-size: .9rem;
    color: var(--text); background: var(--bg-alt);
    border: 1px solid var(--line); border-radius: 2px;
    transition: border-color .2s, background-color .2s, color .2s, transform .2s;
}
.stm-pager a.page-numbers:hover { border-color: var(--accent); color: var(--accent); transform: translateX(2px); }
.stm-pager .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #0f1215; }
.stm-pager .page-numbers.dots { background: none; border: 0; min-width: auto; color: var(--muted); }

/* ===== Сайдбар и виджеты ===== */
.stm-aside { background: var(--bg-alt); border: 1px solid var(--line); padding: 1.6rem 1.5rem; color: var(--text); }
.stm-widget { margin-bottom: 2rem; }
.stm-widget:last-child { margin-bottom: 0; }
.stm-widget__title {
    margin: 0 0 1rem; padding-bottom: .6rem;
    font-size: 1.1rem; letter-spacing: .14em; text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: .6rem;
}
.stm-widget__title::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: 0 0 8px; }
.stm-widget ul { list-style: none; margin: 0; padding: 0; }
.stm-widget li { padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.stm-widget li:last-child { border-bottom: 0; }
.stm-aside .stm-widget, .stm-aside .stm-widget p, .stm-aside .stm-widget li { color: #d3d7dc; }
.stm-aside .stm-widget__title { color: var(--text); }
.stm-aside .stm-widget a { color: var(--accent); }
.stm-aside .post-date, .stm-footer .post-date { display: block; font-family: var(--f-mono); font-size: .75rem; color: var(--muted); margin-top: .2rem; }

/* ===== Подвал ===== */
.stm-footer { background: var(--bg-dark); border-top: 1px solid var(--line); padding: 3.5rem 0 1.5rem; color: #c9ced3; }
.stm-footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.stm-footer__col { min-width: 0; }
.stm-footer .stm-widget, .stm-footer .stm-widget p, .stm-footer .stm-widget li { color: #c9ced3; }
.stm-footer .stm-widget__title { color: var(--text); }
.stm-footer .stm-widget a { color: #e8eaed; }
.stm-footer .stm-widget a:hover { color: var(--accent); }
.stm-footer__copy {
    margin: 2.8rem 0 0; padding-top: 1.3rem;
    border-top: 1px solid var(--line);
    font-size: .85rem; color: var(--muted);
}
.stm-footer__copy .stm-mono { color: var(--accent); margin-right: .3rem; }

/* ===== Комментарии ===== */
.stm-comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.stm-comments__title { margin-top: 0; }
.stm-comments__list, .stm-comments__list .children { list-style: none; padding: 0; margin: 0; }
.stm-comments__list .children { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.stm-comment { background: var(--bg-alt); border: 1px solid var(--line); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.stm-comment__head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.stm-comment__head img { border-radius: 2px; }
.stm-comment__author { font-weight: 600; }
.stm-comment__date { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); }
.stm-comment__wait { color: var(--amber); font-size: .85rem; }
.comment-form label { display: block; font-family: var(--f-mono); font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%; background: var(--bg-dark); color: var(--text);
    border: 1px solid var(--line); border-radius: 2px; padding: .7rem .9rem; font: inherit;
}
.comment-form textarea:focus, .comment-form input:focus { outline: none; border-color: var(--accent); }

/* ===== Cookie-баннер ===== */
.stm-cookie[hidden] { display: none !important; }
.stm-cookie {
    position: fixed;
    left: 1rem; right: 1rem; bottom: 1rem;
    z-index: 999;
    max-width: 880px;
    margin-left: auto; margin-right: auto;
    display: flex; align-items: center; gap: 1.2rem;
    padding: 1.1rem 1.4rem;
    background: var(--bg-dark);
    color: var(--text);
    border: 1px solid var(--line);
    border-top: 2px solid var(--accent);
    border-radius: 2px;
}
.stm-cookie__text { margin: 0; font-size: .9rem; color: #c9ced3; min-width: 0; }
.stm-cookie__accept { flex: 0 0 auto; }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    h1 { font-size: 2.5rem; }
    .stm-front-inner { width: 92%; }
    .stm-layout--aside { display: block; }
    .stm-layout--single .stm-content { width: 100%; }
    .stm-aside { margin-top: 3rem; }
    .stm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stm-stats__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stm-stats__item:nth-child(3) { border-left: 0; }
    .stm-stats__item:nth-child(n+3) { border-top: 1px solid var(--line); }
    .stm-zz { gap: 2rem; }
    .stm-topics__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stm-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stm-burger { display: inline-flex; }
    .stm-header__row { flex-wrap: wrap; }
    .stm-nav { display: none; flex: 0 0 100%; }
    .stm-nav.is-open { display: block; }
    .stm-nav__list { flex-direction: column; border-top: 1px solid var(--line); padding-top: .6rem; }
}
@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    body::after { width: 220px; height: 220px; }
    .stm-front-inner { width: 100%; }
    .stm-sec { padding: 3rem 0; }
    .stm-hero { padding: 3.5rem 0 3rem; }
    .stm-hero__inner { padding: 1.6rem 1.2rem 1.8rem; }
    .stm-hero__dim { display: none; }
    .stm-sec-title { font-size: 1.25rem; letter-spacing: .1em; }
    .stm-grid, .stm-grid--list { grid-template-columns: minmax(0, 1fr); }
    .stm-stats__row { grid-template-columns: minmax(0, 1fr); }
    .stm-stats__item { border-left: 0; border-top: 1px solid var(--line); padding: 1.4rem 1.2rem; }
    .stm-stats__item:first-child { border-top: 0; }
    .stm-zz { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
    .stm-zz--rev .stm-zz__media { order: 0; }
    .stm-zz__title { font-size: 1.55rem; }
    .stm-topics__grid { gap: .8rem; }
    .stm-tile { padding: 1rem; }
    .stm-tile__icon { width: 36px; height: 36px; top: .8rem; right: .8rem; }
    .stm-tile__name { font-size: 1.3rem; }
    .stm-tile__sub { font-size: .78rem; }
    .stm-footer__cols { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
    .stm-aside { padding: 1.3rem 1.1rem; }
    .stm-brand__svg { width: 42px; height: 42px; }
    .stm-brand__name { font-size: .95rem; }
    .stm-brand__desc { display: none; }
    .stm-cookie { flex-direction: column; align-items: stretch; padding: 1rem 1.1rem; }
    .stm-latest__all { text-align: left; }
}
