/*
Theme Name: TLT Almaz Remont
Theme URI: https://tltalmaz.ru
Description: Тема сайта tltalmaz.ru (ремонт и отделка дома). Строительный стиль: графит и зелёный лазерного уровня, Oswald + Inter + JetBrains Mono, тёмная и светлая тема без вспышки, hero с разрезом пирога пола, считалка расхода материалов, лента этапов ремонта, шпаргалка расхода, хаб рубрик, нумерованный индекс популярного, липкое оглавление статьи.
Version: 1.2.0
Author: site-builder
Text Domain: prpeople
*/

/* =========================================================
   tltalmaz.ru - справочник по ремонту и отделке
   Direction: строительно-техническое издание (стройплощадка, разметка, уровень)
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* type */
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* accents (shared across themes)
     Имя токена историческое (--amber), значение нишевое: зелёный луч лазерного уровня.
     Переопределяется в блоках тем ниже, потому что на светлом фоне яркий зелёный не читается. */
  --amber: #8ede4e;       /* laser green */
  --amber-soft: #b5eb8a;

  /* Фон и текст кнопок ОТДЕЛЬНЫМИ токенами, а не через --amber: тот же --amber красит ссылки,
     иконки, бордеры и маркеры списков по всей теме, и подгонка его под контраст с белым
     перекрасила бы весь сайт.
     ЦВЕТ ТЕКСТА КНОПКИ СЧИТАТЬ ПО ФОРМУЛЕ WCAG, А НЕ ПОДБИРАТЬ НА ГЛАЗ: захардкоженный тёмный ink
     ломается на каждом сайте, где акцент светлой темы тёмный (кнопка выходит тёмной с тёмным
     текстом, контраст 3,5 при норме 4,5). При белом тексте фон приходится углублять: #bd5600
     даёт с белым 4.67, а исходный #ff8a00 дал бы 2.36. Значения стартовые, менять под палитру. */
  --btn-bg: #2f6b1c;
  --btn-bg-hover: #275a17;
  --btn-ink: #ffffff;
  --cyan: #25c2c8;        /* diagnostic readout */
  --red: #e23b4c;         /* fault / mig zazhiganiya */
  --green: #38b86f;       /* ok */

  /* layout */
  --wrap: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 4px;
  --radius-lg: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --speed: .28s;
}

/* ---------- Dark theme (default) ---------- */
:root[data-theme="dark"] {
  --bg: #0e1210;
  --bg-2: #131815;
  --surface: #171d1a;
  --surface-2: #1e2521;
  --surface-hi: #252d28;
  --line: #2b342e;
  --line-soft: #232b26;
  --text: #eef3ef;
  --text-2: #a9b5ad;
  --text-3: #78847c;
  --ink-inverse: #0e1210;
  /* На тёмном фоне светит сам зелёный: фон кнопки яркий, текст тёмный (контраст около 11). */
  --btn-bg: #8ede4e;
  --btn-bg-hover: #7ccb3e;
  --btn-ink: #0e1210;
  --grid-line: rgba(255, 255, 255, .035);
  --hero-glow-1: rgba(142, 222, 78, .16);
  --hero-glow-2: rgba(37, 194, 200, .10);
  --card-shadow: 0 1px 0 rgba(255,255,255,.03), 0 18px 40px -22px rgba(0,0,0,.8);
  --chip-bg: #11161d;
}

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  --bg: #f4f2ee;          /* warm concrete/paper */
  --bg-2: #eceae4;
  --surface: #ffffff;
  --surface-2: #f7f5f1;
  --surface-hi: #ffffff;
  --line: #ddd8cf;
  --line-soft: #e6e1d8;
  --text: #1a1d22;
  --text-2: #4d535d;
  --text-3: #7d8590;
  --ink-inverse: #ffffff;
  --grid-line: rgba(20, 20, 20, .04);
  --hero-glow-1: rgba(85, 160, 40, .16);
  --hero-glow-2: rgba(37, 194, 200, .12);
  --card-shadow: 0 1px 2px rgba(30,40,20,.04), 0 16px 36px -24px rgba(40,60,25,.32);
  --chip-bg: #f6f8f3;
  /* На светлом фоне яркий лазерный зелёный нечитаем, поэтому акцент углублён:
     #2f6b1c даёт с белым 6,4 и годится и для ссылок, и для фона кнопки с белым текстом. */
  --amber: #2f6b1c;
  --amber-soft: #4b8f31;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.08; font-weight: 600; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--amber); color: #0f1115; padding: .6rem 1rem; border-radius: var(--radius);
  font-weight: 600; transition: top .2s var(--ease);
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 68px;
}
.brand { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(145deg, #4b8f31, #2f6b1c);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px -6px rgba(47, 107, 28, .6), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative;
}
/* Ромб, а не молния: тот же глиф, что в фавиконе, отсылка к имени домена. */
.brand-bolt {
  width: 17px; height: 17px;
  background: #ffffff;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: .2px; }
.brand-dot { color: var(--amber); }
.brand-tld { color: var(--text-3); font-weight: 500; }
.brand-tag {
  font-family: var(--font-mono); font-size: .58rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--text-3); margin-top: 4px;
}

.main-nav { margin-left: auto; }
.nav-menu {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-menu a {
  display: block; padding: .5rem .8rem; border-radius: var(--radius);
  font-size: .92rem; font-weight: 500; color: var(--text-2);
  transition: color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.nav-menu a:hover { color: var(--text); background: var(--surface-2); }
.nav-menu a.nav-all { color: var(--amber); }
.nav-toggle { display: none; }

.theme-toggle {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text-2);
  transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.theme-toggle:hover { color: var(--amber); border-color: var(--amber); transform: translateY(-1px); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: .95rem; border-radius: var(--radius);
  padding: .72rem 1.3rem; border: 1px solid transparent;
  transition: transform var(--speed) var(--ease), background var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-bg-hover); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-1px); }
.btn-link {
  background: transparent; color: var(--text-2); padding-inline: .4rem;
  border-bottom: 1px dashed var(--text-3); border-radius: 0;
}
.btn-link:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem); }
.hero-grid-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    radial-gradient(900px 500px at 12% -8%, var(--hero-glow-1), transparent 60%),
    radial-gradient(800px 600px at 92% 0%, var(--hero-glow-2), transparent 55%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.25fr .95fr; gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em;
  color: var(--text-2); margin: 0 0 1.1rem;
  border: 1px solid var(--line); background: var(--surface);
  padding: .35rem .7rem; border-radius: 100px;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(56,184,111,.6); animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(56,184,111,.55);} 70% { box-shadow: 0 0 0 7px rgba(56,184,111,0);} 100% { box-shadow: 0 0 0 0 rgba(56,184,111,0);} }

h1, #hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  letter-spacing: -.5px;
  text-wrap: balance;
}
#hero-title { margin-bottom: 1.1rem; }
.hero-sub { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--text-2); max-width: 38ch; margin: 0 0 1.7rem; }

.hero-search {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: .4rem .4rem .4rem .9rem;
  max-width: 540px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.hero-search:focus-within { border-color: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 18%, transparent); }
.search-icon { display: grid; place-items: center; color: var(--text-3); flex-shrink: 0; }
.search-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.hero-search input {
  flex: 1; min-width: 0; border: none; background: transparent; color: var(--text);
  font-size: .98rem; padding: .5rem .2rem; font-family: var(--font-body);
}
.hero-search input::placeholder { color: var(--text-3); }
.hero-search input:focus { outline: none; }
.search-go { flex-shrink: 0; }

.hero-actions { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.4rem; flex-wrap: wrap; }

/* ---------- Считалка расхода (виджет hero) ---------- */
.calc {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.calc-head {
  display: flex; align-items: center; gap: .6rem;
  padding: .8rem 1rem; border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.calc-led {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 10px var(--amber);
}
.calc-title { font-family: var(--font-display); font-weight: 600; letter-spacing: .3px; font-size: 1.05rem; }
.calc-meta {
  margin-left: auto; font-family: var(--font-mono); font-size: .68rem;
  color: var(--text-3); letter-spacing: .1em;
}
.calc-body { padding: 1rem; display: grid; gap: .9rem; }
.calc-modes { display: flex; flex-wrap: wrap; gap: .4rem; }
.calc-mode {
  font-family: var(--font-body); font-weight: 600; font-size: .82rem;
  background: var(--chip-bg); border: 1px solid var(--line); color: var(--text-2);
  padding: .4rem .7rem; border-radius: var(--radius);
  transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.calc-mode:hover { color: var(--text); border-color: var(--amber-soft); }
.calc-mode.is-on { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.calc-field { display: grid; gap: .3rem; }
.calc-field span {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3);
}
.calc-field input {
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700;
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius); padding: .55rem .7rem; width: 100%;
}
.calc-field input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.calc-out {
  display: block; padding: .8rem .9rem; border-radius: var(--radius);
  background: var(--bg); border: 1px dashed var(--line);
  font-size: 1rem; color: var(--text-2);
}
.calc-out b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--text); font-weight: 600; }
.calc-sub { display: block; margin-top: .25rem; font-size: .85rem; color: var(--text-3); }
.calc-note { margin: 0; font-size: .8rem; line-height: 1.5; color: var(--text-3); }
@media (max-width: 520px) { .calc-fields { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-weight: 700; font-size: .85rem;
  background: var(--chip-bg); border: 1px solid var(--line);
  color: var(--text); padding: .42rem .7rem; border-radius: var(--radius);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: var(--cyan); color: var(--cyan); }
.chip.chip-code { color: var(--amber); }
.chip.chip-code:hover { border-color: var(--amber); color: var(--amber-soft); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chips-tasks .chip { font-family: var(--font-body); font-weight: 600; font-size: .82rem; }

/* ---------- Лента этапов ремонта ---------- */
.stages { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
.section-lead { margin: 0; max-width: 42ch; color: var(--text-2); font-size: .95rem; }
.stage-list {
  list-style: none; margin: 1.6rem 0 0; padding: 0;
  display: grid; gap: .8rem;
}
.stage {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-lg); padding: 1rem 1.1rem;
}
.stage-num {
  font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700;
  color: var(--amber); line-height: 1.2;
}
.stage-body { display: grid; gap: .45rem; }
.stage-name { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; }
.stage-text { margin: 0; color: var(--text-2); font-size: .92rem; }
@media (min-width: 860px) { .stage-list { grid-template-columns: 1fr 1fr; } }

/* ---------- Шпаргалка расхода ---------- */
.rashod-table-wrap { margin-top: 1.4rem; overflow-x: auto; }
.rashod-table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 640px; }
.rashod-table th, .rashod-table td {
  text-align: left; padding: .72rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
.rashod-table thead th {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line);
}
.rashod-table tbody th { font-weight: 600; white-space: nowrap; }
.rashod-table tbody th a { color: var(--amber); }
.rashod-table tbody th a:hover { text-decoration: underline; }
.rashod-num { font-family: var(--font-mono); color: var(--text); }
.rashod-hint { color: var(--text-2); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.featured { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  margin-bottom: 2rem; flex-wrap: wrap;
}
.kicker {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--amber); margin: 0 0 .5rem;
}
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -.3px; }
.section-note { color: var(--text-2); font-size: .98rem; margin: 0; max-width: 30ch; }

/* ---------- Rubric grid ---------- */
.rubric-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem;
}
.rubric-card {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.15rem 1.15rem 1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); position: relative; overflow: hidden;
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.rubric-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--amber); transform: scaleY(0); transform-origin: top;
  transition: transform var(--speed) var(--ease);
}
.rubric-card:hover { transform: translateY(-3px); border-color: var(--line); background: var(--surface-hi); }
.rubric-card:hover::before { transform: scaleY(1); }
.rubric-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rubric-ico { width: 34px; height: 34px; color: var(--amber); }
.rubric-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rubric-count {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 700;
  color: var(--text-3); background: var(--bg-2); border: 1px solid var(--line);
  padding: .15rem .5rem; border-radius: 100px;
}
.rubric-name { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; letter-spacing: .1px; }
.rubric-go { font-size: .82rem; color: var(--text-3); font-family: var(--font-mono); margin-top: auto; }
.rubric-card:hover .rubric-go { color: var(--cyan); }

/* ---------- Featured ---------- */
.featured-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1.1rem;
}
.feat-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; min-height: 240px;
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.feat-card:hover { transform: translateY(-3px); border-color: var(--amber); }
.feat-card.feat-lead { grid-row: span 2; }
.feat-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.feat-lead .feat-media { aspect-ratio: 16 / 11; }
.feat-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.feat-card:hover .feat-media img { transform: scale(1.04); }
.feat-body { padding: 1.1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.feat-lead .feat-body { padding: 1.4rem; }
.feat-tag, .card-tag {
  align-self: flex-start; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  padding: .2rem .5rem; border-radius: var(--radius);
}
.feat-title { font-family: var(--font-display); font-weight: 600; line-height: 1.18; font-size: 1.12rem; letter-spacing: .1px; }
.feat-lead .feat-title { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.feat-card a.feat-title:hover, .card a.card-title:hover { color: var(--amber); }
.feat-desc { color: var(--text-2); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feat-lead .feat-desc { -webkit-line-clamp: 4; }
.feat-meta, .card-meta { margin-top: auto; font-family: var(--font-mono); font-size: .74rem; color: var(--text-3); display: flex; align-items: center; gap: .5rem; }
.feat-meta time, .card-meta time { color: var(--text-3); }

/* ---------- Filter box ---------- */
.filter-box {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .35rem .7rem; min-width: 280px;
}
.filter-box:focus-within { border-color: var(--amber); }
.filter-box input { border: none; background: transparent; color: var(--text); font-size: .92rem; flex: 1; min-width: 0; font-family: var(--font-body); }
.filter-box input:focus { outline: none; }
.filter-box input::placeholder { color: var(--text-3); }
.filter-count { font-family: var(--font-mono); font-size: .74rem; color: var(--text-3); flex-shrink: 0; }

/* ---------- Card grid ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem;
}
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--card-shadow); }
.card-media-link { display: block; }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 1rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.04rem; line-height: 1.2; letter-spacing: .1px; }
.card-desc { color: var(--text-2); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.no-results { text-align: center; color: var(--text-2); padding: 2.5rem 0; font-size: 1.05rem; }

/* ---------- FAQ ---------- */
.faq { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
.faq-wrap { max-width: 860px; }
.faq-list { display: grid; gap: .7rem; }
.faq-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; transition: border-color var(--speed) var(--ease);
}
.faq-item[open] { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.3rem; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: .1px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { position: relative; width: 18px; height: 18px; flex-shrink: 0; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; background: var(--amber); border-radius: 2px;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.faq-icon::before { width: 14px; height: 2px; }
.faq-icon::after { width: 2px; height: 14px; transition: transform var(--speed) var(--ease); }
.faq-item[open] .faq-icon::after { transform: translate(-50%, -50%) scaleY(0); }
.faq-a { padding: 0 1.3rem 1.2rem; color: var(--text-2); }
.faq-a p { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 5vw, 3.5rem); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 2rem; padding-bottom: 2.5rem; align-items: start; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.footer-about { color: var(--text-2); font-size: .92rem; max-width: 38ch; margin: .8rem 0 0; }
.footer-col h3 {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); margin: 0 0 .9rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
/* inline-block + padding: без них ссылки футера выходят высотой 17px и на мобильном не дотягивают
   до нормального тап-таргета */
.footer-col a { color: var(--text-2); font-size: .92rem; transition: color var(--speed) var(--ease); display: inline-block; padding: .35rem 0; }
.footer-col a:hover { color: var(--amber); }
.footer-col .fcount { font-family: var(--font-mono); font-size: .72rem; color: var(--text-3); margin-left: .3rem; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 1.4rem 2rem; display: flex; flex-direction: column; gap: .6rem; }
.disclaimer { color: var(--text-3); font-size: .82rem; margin: 0; max-width: 80ch; }
.copyright { color: var(--text-2); font-size: .86rem; margin: 0; font-family: var(--font-mono); }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: .4rem; }
.footer-links a { color: var(--text-2); font-size: .86rem; text-decoration: none; }
.footer-links a:hover { color: var(--text-1); text-decoration: underline; }
.am-updated { color: var(--text-3); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .console { max-width: 560px; }
  .featured-grid { grid-template-columns: 1fr 1fr; }
  .feat-card.feat-lead { grid-column: span 2; grid-row: auto; }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: grid; place-items: center; gap: 4px; width: 42px; height: 42px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    margin-left: auto;
  }
  .nav-toggle-bar { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .main-nav { margin-left: 0; }
  .nav-menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1rem;
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height var(--speed) var(--ease), visibility var(--speed) var(--ease);
  }
  .nav-menu.open { max-height: 420px; visibility: visible; }
  .nav-menu a { padding: .8rem .4rem; border-bottom: 1px solid var(--line-soft); }
  .featured-grid { grid-template-columns: 1fr; }
  .feat-card.feat-lead { grid-column: auto; }
  .section-head { align-items: flex-start; }
  .filter-box { min-width: 0; width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .hero-actions { gap: .8rem; }
  .footer-cols { grid-template-columns: 1fr; }
}

/* =========================================================
   Additions: hero auto-art, popular index, inner pages
   ========================================================= */

/* ---------- Hero line-art: разрез пирога пола, раскладка плитки, лазерный уровень ---------- */
.hero-art {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  pointer-events: none; color: var(--text); opacity: .05;
  -webkit-mask-image: linear-gradient(to bottom, #000 52%, transparent);
  mask-image: linear-gradient(to bottom, #000 52%, transparent);
}
:root[data-theme="dark"] .hero-art { opacity: .06; }
.hero-art-stroke * {
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
/* луч уровня: пунктир акцентным цветом, он один во всём арте цветной */
.hero-art .hero-beam { stroke: var(--amber); stroke-dasharray: 26 14; stroke-width: 3; opacity: .9; }

/* ---------- Popular articles index ---------- */
.poplist {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(10, auto);
  grid-auto-flow: column; column-gap: 3rem;
}
.pop-item { border-top: 1px solid var(--line); }
.pop-link {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: 1rem .5rem 1rem .25rem; transition: background var(--speed) var(--ease);
}
.pop-num { font-family: var(--font-mono); font-weight: 700; font-size: .95rem; color: var(--amber); min-width: 2.2ch; text-align: right; }
.pop-main { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.pop-title { font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; line-height: 1.2; letter-spacing: .1px; color: var(--text); transition: color var(--speed) var(--ease); }
.pop-rubric { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.pop-go { color: var(--text-3); font-size: 1.15rem; transition: color var(--speed) var(--ease), transform var(--speed) var(--ease); }
.pop-link:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--amber) 8%, transparent), transparent); }
.pop-link:hover .pop-title { color: var(--amber); }
.pop-link:hover .pop-go { color: var(--amber); transform: translateX(4px); }

/* ---------- Breadcrumbs ---------- */
.crumbs { padding-block: 1.2rem 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; padding: 0; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .03em; color: var(--text-3); }
.crumbs li { display: flex; align-items: center; gap: .5rem; }
.crumbs li + li::before { content: "/"; color: var(--text-3); opacity: .55; }
.crumbs a { color: var(--text-2); transition: color var(--speed) var(--ease); }
.crumbs a:hover { color: var(--amber); }
.crumbs [aria-current="page"] { color: var(--text); }

/* ---------- Category page ---------- */
.cat-head { padding-block: .4rem 0; }
.cat-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -.4px; margin: .5rem 0 0; }
.cat-intro { max-width: 720px; color: var(--text-2); font-size: 1.06rem; line-height: 1.72; margin: 1rem 0 0; }
.cat-intro p { margin: 0 0 1rem; }
.cat-intro p:last-child { margin-bottom: 0; }
.cat-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; margin-top: 2.6rem; }
.pagination button {
  font-family: var(--font-mono); font-size: .9rem; min-width: 44px; height: 44px;
  display: inline-grid; place-items: center; padding: 0 .8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text-2); cursor: pointer;
  transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.pagination button:hover:not([disabled]):not([aria-current]) { border-color: var(--amber); color: var(--amber); }
.pagination button[aria-current="page"] { background: var(--amber); border-color: var(--amber); color: #1a1205; font-weight: 700; }
.pagination button[disabled] { opacity: .4; cursor: default; }

/* ---------- Article page ---------- */
.article { padding-block: .5rem clamp(3rem, 6vw, 5rem); }
.article-head { max-width: 820px; }
.article-tag {
  display: inline-block; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  padding: .22rem .55rem; border-radius: var(--radius);
}
.article-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -.4px; margin: .9rem 0 1rem; text-wrap: balance; }
.article-excerpt { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-2); max-width: 62ch; margin: 0; line-height: 1.55; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.1rem; margin-top: 1.3rem; font-family: var(--font-mono); font-size: .76rem; color: var(--text-3); }
.article-meta .am-rubric { color: var(--amber); }
.article-meta .am-sep { opacity: .5; }
.article-hero { width: 100%; margin: 1.9rem 0 0; overflow: hidden; border-block: 1px solid var(--line); background: var(--bg-2); height: clamp(260px, 40vw, 520px); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; margin-top: 2.4rem; }

/* table of contents */
.toc { position: sticky; top: 88px; align-self: start; }
.toc-inner { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 1.1rem 1.1rem 1.2rem; }
.toc-title { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin: 0 0 .9rem; font-weight: 700; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; display: grid; gap: .55rem; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: .6rem; font-size: .86rem; color: var(--text-2); line-height: 1.3; transition: color var(--speed) var(--ease); }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: .7rem; color: var(--amber); flex-shrink: 0; }
.toc a:hover, .toc a.active { color: var(--text); }

/* prose / article body */
.prose { max-width: 760px; font-size: 1.04rem; color: var(--text); line-height: 1.72; }
.prose > p { margin: 0 0 1.15rem; }
.prose > p.lead { font-size: 1.16rem; color: var(--text); }
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -.2px; line-height: 1.15; margin: 2.3rem 0 .9rem; padding-left: .9rem; border-left: 3px solid var(--amber); scroll-margin-top: 84px; }
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin: 1.6rem 0 .7rem; }
.prose > ul, .prose > ol { margin: 0 0 1.25rem; padding-left: 0; display: grid; gap: .55rem; }
.prose > ul { list-style: none; }
.prose > ul > li { position: relative; padding-left: 1.5rem; color: var(--text-2); }
.prose > ul > li::before { content: ""; position: absolute; left: .2rem; top: .6em; width: 7px; height: 7px; background: var(--amber); transform: rotate(45deg); }
.prose > ol { list-style: none; counter-reset: steps; }
.prose > ol > li { position: relative; padding-left: 2.6rem; min-height: 1.7rem; counter-increment: steps; color: var(--text-2); }
.prose > ol > li::before { content: counter(steps); position: absolute; left: 0; top: 0; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--amber); background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; }
.prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.prose a:hover { text-decoration-color: var(--amber); }
.prose strong { color: var(--text); font-weight: 700; }

/* tables (размеры, сравнения материалов) */
.prose .table-wrap { margin: 1.8rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose thead th {
  text-align: left; white-space: nowrap;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  padding: .75rem .9rem;
}
.prose tbody td { padding: .75rem .9rem; border-bottom: 1px solid var(--line-soft); color: var(--text-2); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: none; }
.prose tbody tr:hover td { background: var(--surface-2); }
.prose tbody td:first-child { color: var(--text); font-weight: 600; }

/* summary box */
.summary-box { margin: 2.6rem 0 0; border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--line)); border-radius: var(--radius-lg); background: linear-gradient(180deg, color-mix(in srgb, var(--amber) 6%, var(--surface)), var(--surface)); padding: 1.5rem 1.6rem; }
.summary-box h2 { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.32rem; margin: 0 0 1rem; }
.summary-box h2::before { content: ""; width: 11px; height: 11px; background: var(--amber); border-radius: 2px; }
.summary-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.summary-box li { position: relative; padding-left: 1.7rem; color: var(--text-2); }
.summary-box li::before { content: ""; position: absolute; left: .15rem; top: .5em; width: 8px; height: 8px; border: 2px solid var(--amber); border-radius: 50%; }

/* article faq + related */
.article-faq { margin-top: 2.8rem; }
.article-faq > h2, .related > h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -.2px; margin: 0 0 1.1rem; }
.related { margin-top: 3rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }

@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; order: -1; top: auto; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .poplist { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; column-gap: 0; }
  .related-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   WordPress integration bridge (markup from WP core/templates)
   ============================================================ */
.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; }
main#main { display: block; }

/* the_content() body lives inside .prose; summary/faq are nested divs */
.prose .faq-box { margin-top: 2.8rem; }
.prose .faq-box > h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -.2px; line-height: 1.15; margin: 0 0 1rem; padding: 0; border: 0; }
.prose .faq-box p { margin: 0 0 1.1rem; color: var(--text-2); }
.prose .faq-box .faq-q { margin: 1.7rem 0 .5rem; font-family: var(--font-body); font-weight: 400; font-size: 1rem; color: var(--text-2); }
.prose .faq-box .faq-q strong { display: block; margin-bottom: .35rem; font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.25; color: var(--text); }
.prose .summary-box p { color: var(--text-2); margin: 0 0 .6rem; }
.prose .summary-box h2 { border: 0; padding: 0; }

/* the_content media */
.prose img { border-radius: var(--radius-lg); height: auto; }
.prose figure { margin: 1.6rem 0; }
.prose figcaption { font-size: .82rem; color: var(--text-3); margin-top: .5rem; text-align: center; }
.prose .wp-block-image img, .prose .aligncenter { display: block; margin-inline: auto; }
.prose h2[id], .prose h3[id] { scroll-margin-top: 84px; }

/* WP pagination: the_posts_pagination() */
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; }
.pagination .page-numbers { font-family: var(--font-mono); font-size: .9rem; min-width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0 .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-2); transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease), background var(--speed) var(--ease); }
.pagination a.page-numbers:hover { border-color: var(--amber); color: var(--amber); }
.pagination .page-numbers.current { background: var(--amber); border-color: var(--amber); color: #1a1205; font-weight: 700; }
.pagination .page-numbers.dots { background: transparent; border-color: transparent; min-width: 1.5rem; }
.pagination .screen-reader-text { display: none; }

/* WP body padding so sticky header never overlaps anchored content */
body { scroll-padding-top: 84px; }
/* =========================================================
   QA-модуль «Вопрос-ответ» (опционален; активен только с inc/qa.php)
   ========================================================= */

/* --- Список вопросов --- */
.qa-list { display: flex; flex-direction: column; gap: .75rem; }
.qa-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.15rem; transition: border-color .18s, transform .18s;
}
.qa-item:hover { border-color: var(--amber); transform: translateY(-1px); }
.qa-item-title { margin: 0 0 .35rem; font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.qa-item-title a { color: var(--text); text-decoration: none; }
.qa-item-title a:hover { color: var(--amber); }
.qa-item-meta { margin: 0; font-size: .82rem; color: var(--text-3); display: flex; flex-wrap: wrap; gap: .45rem; align-items: baseline; }
.qa-sep { color: var(--text-3); opacity: .7; }
.qa-views { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .02em; }
.qa-item-teaser { margin: .5rem 0 0; font-size: .9rem; color: var(--text-2); line-height: 1.5; }
.qa-item-expert { color: var(--amber); font-weight: 600; }

/* --- Страница вопроса --- */
.qa-single { padding: 1rem 0 3.5rem; }
.qa-single .wrap { max-width: 860px; }
.qa-head { margin-bottom: 1.25rem; }
.qa-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.15; margin: .5rem 0 0; text-transform: none; }
.qa-question-card {
  display: grid; grid-template-columns: 46px 1fr; gap: .9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.15rem 1.25rem;
}
.qa-avatar {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-hi); border: 1px solid var(--line); color: var(--text-2);
  font-family: var(--font-mono); font-weight: 700; font-size: .95rem;
}
.qa-avatar-expert { background: var(--amber); border-color: var(--amber); color: #1a1205; }
.qa-q-who { margin: 0 0 .4rem; font-size: .85rem; color: var(--text-3); }
.qa-q-who strong { color: var(--text); font-weight: 600; }
.qa-q-text { color: var(--text-2); line-height: 1.6; }
.qa-q-text p { margin: 0 0 .6rem; }
.qa-q-text p:last-child { margin-bottom: 0; }

.qa-answer-card {
  margin-top: 1rem; background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--amber); border-radius: 12px; padding: 1.25rem 1.35rem;
}
.qa-answer-head { display: grid; grid-template-columns: 46px 1fr auto; gap: .9rem; align-items: center; margin-bottom: .9rem; }
.qa-a-who { margin: 0; font-size: .95rem; }
.qa-a-role { color: var(--text-3); font-size: .84rem; margin-left: .35rem; }
.qa-a-date { margin: .15rem 0 0; font-size: .8rem; color: var(--text-3); }
.qa-badge {
  font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--amber); border: 1px solid var(--amber); border-radius: 999px; padding: .25rem .6rem; white-space: nowrap;
}
.qa-answer-text { font-size: .98rem; }

.qa-related-article {
  margin-top: 1rem; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  background: var(--chip-bg); border: 1px dashed var(--line); border-radius: 10px;
  padding: .85rem 1.1rem; text-decoration: none; transition: border-color .18s;
}
.qa-related-article:hover { border-color: var(--amber); }
.qa-ra-kicker { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--amber); }
.qa-ra-title { color: var(--text); font-weight: 600; font-size: .92rem; flex: 1; min-width: 200px; }
.qa-ra-arrow { color: var(--amber); font-weight: 700; }

.qa-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.4rem 0; }
.qa-actions .btn-primary, .qa-actions .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 8px; border: 1px solid transparent; padding: .65rem 1.25rem;
  font-family: var(--font-body); font-weight: 600; font-size: .92rem; transition: all .18s;
}
.qa-actions-hero { margin: 1.1rem 0 0; }

/* --- Форма --- */
.qa-form-box {
  margin: 1.5rem 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.4rem 1.5rem;
}
.qa-form-box[hidden] { display: none; }
.qa-form-title { font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 .35rem; }
.qa-form-note { margin: 0 0 1rem; font-size: .85rem; color: var(--text-3); }
.qa-form-ok {
  margin: 0; padding: .9rem 1.1rem; border-radius: 8px; font-size: .92rem;
  background: var(--chip-bg); border: 1px solid var(--amber); color: var(--text);
}
.qa-form-ok[hidden] { display: none; }
.qa-form-error {
  margin: 0 0 1rem; padding: .9rem 1.1rem; border-radius: 8px; font-size: .92rem;
  background: var(--chip-bg); border: 1px solid var(--red); color: var(--text);
}
.qa-form-error[hidden] { display: none; }
.qa-form[hidden] { display: none; }
.qa-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.qa-field { display: block; margin-bottom: .8rem; font-size: .84rem; color: var(--text-2); font-weight: 600; }
.qa-field input, .qa-field textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .6rem .75rem;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-family: var(--font-body); font-size: .95rem;
}
.qa-field input:focus, .qa-field textarea:focus { outline: none; border-color: var(--amber); }
.qa-field textarea { resize: vertical; min-height: 110px; }
.qa-consent {
  display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 1rem;
  font-size: .82rem; font-weight: 400; color: var(--text-3); line-height: 1.45;
}
.qa-consent input { margin-top: .2rem; flex-shrink: 0; }
.qa-consent a { color: var(--amber); }
.qa-hp { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; overflow: hidden; margin: 0; }
.qa-submit { cursor: pointer; border: 1px solid transparent; border-radius: 8px; padding: .7rem 1.5rem; font-weight: 700; font-size: .95rem; }

/* --- Сетка тем на хабе --- */
.qa-tema-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.qa-tema-card {
  display: flex; align-items: center; gap: .7rem; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .85rem 1rem;
  transition: border-color .18s, transform .18s;
}
.qa-tema-card:hover { border-color: var(--amber); transform: translateY(-1px); }
.qa-tema-icon { color: var(--amber); display: flex; }
.qa-tema-icon svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.qa-tema-name { flex: 1; color: var(--text); font-weight: 600; font-size: .9rem; }
.qa-tema-count { font-family: var(--font-mono); font-size: .78rem; color: var(--text-3); background: var(--chip-bg); border: 1px solid var(--line-soft); border-radius: 999px; padding: .15rem .55rem; }

/* --- Блоки в статье и на главной --- */
.qa-inline { margin-top: 2.5rem; border-top: 1px solid var(--line-soft); padding-top: 1.5rem; }
.qa-inline h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 1rem; }
.qa-more { margin: .9rem 0 0; font-size: .9rem; }
.qa-more a { color: var(--amber); text-decoration: none; font-weight: 600; }
.qa-more a:hover { text-decoration: underline; }
.qa-list-home { max-width: 860px; }

@media (max-width: 640px) {
  .qa-form-row { grid-template-columns: 1fr; }
  .qa-question-card, .qa-answer-card { padding: 1rem; }
  .qa-answer-head { grid-template-columns: 40px 1fr; }
  .qa-badge { display: none; }
  .qa-avatar { width: 40px; height: 40px; }
  .qa-question-card { grid-template-columns: 40px 1fr; }
}
.qa-q-who .qa-sep, .qa-a-date .qa-sep { margin-inline: .2rem; }

/* --- Статичная страница (политика конфиденциальности и т.п.) --- */
.page-prose { margin-top: 2.2rem; }
.page-article .article-meta { margin-top: 1rem; }

/* --- Счётчик просмотров (выводится в карточках, в featured и в шапке статьи) --- */
.prp-views { white-space: nowrap; }

/* --- Заголовок страниц пагинации главной (h1 вместо h2: страницы канонизируются на себя) --- */
.section-head h1.feed-title { font-family: var(--font-display); font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -.3px; }

/* --- Страница 404 --- */
.not-found-inner { max-width: 660px; margin-inline: auto; text-align: center; }
.not-found-code {
  font-family: var(--font-display); font-size: clamp(4rem, 14vw, 7rem); line-height: 1;
  color: var(--amber); opacity: .35; margin: .2rem 0 .6rem;
}
.not-found h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: .8rem; }
.not-found .hero-sub { max-width: none; margin: 0 auto 1.6rem; }
.not-found-search { display: flex; gap: .6rem; max-width: 480px; margin: 0 auto 1.6rem; flex-wrap: wrap; }
.not-found-search input {
  flex: 1 1 220px; padding: .8rem 1rem; border-radius: 100px; font: inherit;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.not-found-actions { display: flex; justify-content: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.not-found-chips { justify-content: center; display: flex; flex-wrap: wrap; gap: .5rem; }
