/*
Theme Name: Arkum Clean
Theme URI: https://arkum.ru
Description: Справочник по чистоте и уходу за домом arkum.ru. Свежая аква-палитра с лимонным сигналом, Manrope + Inter, тёмная/светлая тема без вспышки, hero со сценой из капель и пены, определитель "что отмываем", секция подручных средств, хаб рубрик, нумерованный индекс популярного, липкое оглавление статьи.
Version: 0.8.1
Author: site-builder
Text Domain: prpeople
*/

/* =========================================================
   arkum.ru - чистота и уход за домом
   Direction: свежий бытовой минимализм (аква + лимон, вода и пена)
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* type */
  --font-display: 'Manrope', system-ui, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* лейбл-шрифт (кикеры, счётчики, метки): раньше был моноширинный, теперь тот же Manrope */
  --font-mono: 'Manrope', system-ui, 'Segoe UI', sans-serif;

  /* accents (переопределяются в темах) */
  --accent: #16b3a8;      /* аква: основной акцент */
  --accent-soft: #4ad7cb;
  --lemon: #f2c522;       /* лимон: сигнал «средство» */
  --lemon-ink: #2a2205;   /* тёмная краска поверх лимонного */
  --red: #e2564d;         /* осторожно / нельзя */
  --green: #35b97a;       /* ок */

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

/* ---------- Dark theme (default): глубокий сине-зелёный ---------- */
:root[data-theme="dark"] {
  --bg: #0b1e22;
  --bg-2: #0f262b;
  --surface: #123036;
  --surface-2: #163942;
  --surface-hi: #1b454e;
  --line: #23525b;
  --line-soft: #1a424a;
  --text: #e9f6f4;
  --text-2: #a9c6c6;
  --text-3: #7ba0a3;
  --on-accent: #06232a;   /* текст на аква-кнопке */
  --accent: #2ed3c6;
  --accent-soft: #7ef0e5;
  --lemon: #ffd94a;
  --grid-line: rgba(255, 255, 255, .04);
  --hero-glow-1: rgba(46, 211, 198, .16);
  --hero-glow-2: rgba(255, 217, 74, .10);
  --card-shadow: 0 1px 0 rgba(255,255,255,.04), 0 18px 40px -22px rgba(0,0,0,.75);
  --chip-bg: #0e262b;
}

/* ---------- Light theme: воздушная, почти белая с мятным оттенком ---------- */
:root[data-theme="light"] {
  --bg: #f2faf8;
  --bg-2: #e8f4f1;
  --surface: #ffffff;
  --surface-2: #f5fbf9;
  --surface-hi: #ffffff;
  --line: #d2e7e2;
  --line-soft: #e3f0ed;
  --text: #0f272b;
  --text-2: #4a666b;
  --text-3: #7b989c;
  --on-accent: #ffffff;   /* белый текст на глубокой аква-кнопке */
  --accent: #0b7d77;      /* глубже, чтобы хватало контраста на белом */
  --accent-soft: #0f9a92;
  --lemon: #f2c522;
  --grid-line: rgba(11, 125, 119, .06);
  --hero-glow-1: rgba(22, 179, 168, .16);
  --hero-glow-2: rgba(242, 197, 34, .12);
  --card-shadow: 0 1px 2px rgba(10, 60, 55, .05), 0 16px 36px -24px rgba(10, 60, 55, .35);
  --chip-bg: #f6fcfa;
}

/* ---------- 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(--accent); color: var(--on-accent); 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(--accent);
  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: 12px;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent));
  display: grid; place-items: center;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  position: relative;
}
/* капля вместо гаечной молнии */
.brand-drop {
  width: 15px; height: 15px;
  background: var(--on-accent);
  border-radius: 50% 50% 50% 2px;
  transform: rotate(-45deg);
  box-shadow: inset -2px -2px 0 -1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.22rem; letter-spacing: -.2px; }
.brand-tld { color: var(--text-3); font-weight: 600; }
.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(--accent); }
.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(--accent); border-color: var(--accent); 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(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-soft); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); 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(--accent); border-bottom-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem); }
/* фон: мягкое свечение + сетка кафельной плитки */
.hero-tiles {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    radial-gradient(900px 520px at 8% -10%, var(--hero-glow-1), transparent 62%),
    radial-gradient(760px 560px at 95% 2%, var(--hero-glow-2), transparent 58%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent);
  mask-image: linear-gradient(to bottom, #000 58%, transparent);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr; 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: 800;
  font-size: clamp(2.05rem, 4.6vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -.8px;
  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(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 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-сцена: капли, пена, блик ---------- */
.hero-scene { position: relative; display: grid; place-items: center; }
.hero-svg { width: 100%; max-width: 460px; height: auto; overflow: visible; }

/* отмытая поверхность (плитка) */
.scene-surface > rect,
.scene-surface > path:not(.scene-gloss) {
  fill: none; stroke: var(--accent); stroke-opacity: .35; stroke-width: 1.6;
}
.scene-surface > rect { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
.scene-gloss { fill: url(#prpGloss); stroke: none; }
.gloss-a { stop-color: var(--lemon); }
.gloss-b { stop-color: var(--lemon); }

/* полоса блика на поверхности */
.scene-shine {
  fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round;
  stroke-opacity: .5; filter: blur(1px);
}

/* пузыри пены */
.scene-bubbles circle {
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
  stroke: var(--accent); stroke-width: 1.6; stroke-opacity: .55;
}
.scene-bubbles .b1-hi, .scene-bubbles .b2-hi, .scene-bubbles .b3-hi {
  fill: color-mix(in srgb, var(--accent-soft) 55%, transparent); stroke: none;
}
.scene-bubbles .b2 { fill: color-mix(in srgb, var(--lemon) 16%, transparent); stroke: var(--lemon); stroke-opacity: .6; }
.scene-bubbles .b6 { fill: color-mix(in srgb, var(--lemon) 22%, transparent); stroke: var(--lemon); stroke-opacity: .7; }
.scene-bubbles .b1 { animation: floaty 7s ease-in-out infinite; transform-origin: 150px 120px; }
.scene-bubbles .b2 { animation: floaty 5.5s ease-in-out infinite reverse; transform-origin: 248px 82px; }
.scene-bubbles .b3 { animation: floaty 6.4s ease-in-out .8s infinite; transform-origin: 300px 160px; }
.scene-bubbles .b4 { animation: floaty 8s ease-in-out .4s infinite reverse; transform-origin: 93px 196px; }
.scene-bubbles .b5 { animation: floaty 6s ease-in-out 1.2s infinite; transform-origin: 212px 186px; }

/* капли */
.scene-drops path {
  fill: color-mix(in srgb, var(--accent) 22%, transparent);
  stroke: var(--accent); stroke-width: 1.8; stroke-opacity: .75;
}
.scene-drops .d2 { fill: color-mix(in srgb, var(--lemon) 26%, transparent); stroke: var(--lemon); }
.scene-drops .d1 { animation: floaty 5.2s ease-in-out infinite; transform-origin: 196px 250px; }
.scene-drops .d3 { animation: floaty 6.8s ease-in-out .6s infinite reverse; transform-origin: 78px 258px; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-9px) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  .scene-bubbles circle, .scene-drops path { animation: none !important; }
}

/* ---------- Определитель «что отмываем» ---------- */
.solver-section { padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 4.5rem); }
.solver {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(1rem, 2.4vw, 2rem);
  align-items: stretch;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: clamp(1.2rem, 2.6vw, 2rem);
}
.solver-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.solver-col-head { display: flex; align-items: center; gap: .8rem; }
.solver-col-head > div { display: flex; flex-direction: column; }
.solver-col-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.solver-col-sub { font-size: .82rem; color: var(--text-3); }
.solver-ico {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center;
}
.solver-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.solver-ico-stain { background: color-mix(in srgb, var(--lemon) 20%, transparent); color: var(--lemon); }
:root[data-theme="light"] .solver-ico-stain { color: #8a6c00; }
.solver-ico-obj { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
/* вертикальный разделитель «или» */
.solver-div {
  display: grid; place-items: center; position: relative;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3);
}
.solver-div::before, .solver-div::after {
  content: ""; width: 1px; background: var(--line); flex: 1; position: absolute; left: 50%;
}
.solver-div::before { top: 0; height: calc(50% - 1.4rem); }
.solver-div::after { bottom: 0; height: calc(50% - 1.4rem); }
.solver-div span { background: var(--surface); padding: .3rem 0; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .9rem;
  background: var(--chip-bg); border: 1px solid var(--line);
  color: var(--text); padding: .5rem .85rem; border-radius: 100px;
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); background: var(--surface); }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.chip-stain .chip-dot { background: var(--lemon); }
.chip-stain:hover { border-color: var(--lemon); color: var(--text); background: color-mix(in srgb, var(--lemon) 12%, var(--surface)); }
.chip-obj:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

/* ---------- Арсенал: подручные средства ---------- */
.arsenal-section { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
.ars-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem;
}
.ars-card {
  height: 100%;
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.2rem 1.15rem 1.1rem;
  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);
}
.ars-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--lemon) 55%, var(--line)); box-shadow: var(--card-shadow); }
.ars-ico {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: .5rem;
  display: grid; place-items: center;
  background: var(--lemon); color: var(--lemon-ink);
}
.ars-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ars-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; }
.ars-sub { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: .5rem; }
.ars-row { font-size: .86rem; color: var(--text-2); line-height: 1.5; }
.ars-row b { color: var(--text); font-weight: 600; }
.ars-go { margin-top: auto; padding-top: .8rem; font-size: .82rem; font-weight: 600; color: var(--accent); }
.ars-card:hover .ars-go { color: var(--accent-soft); }

.ars-warn {
  display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap;
  margin: 1.4rem 0 0; padding: .95rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--red) 40%, var(--line));
  background: color-mix(in srgb, var(--red) 7%, var(--surface));
  border-radius: var(--radius-lg);
  color: var(--text-2); font-size: .92rem;
}
.ars-warn-ico { width: 22px; height: 22px; flex-shrink: 0; color: var(--red); }
.ars-warn-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ars-warn a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 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(--accent); margin: 0 0 .5rem;
}
.section-head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.15rem); letter-spacing: -.4px; }
.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(--accent); 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(--accent); }
.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(--accent); }

/* ---------- 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(--accent); }
.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(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 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(--accent); }
.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); }
.feat-meta .am-sep, .card-meta .am-sep { opacity: .5; }

/* ---------- Счётчик просмотров ---------- */
.prp-views { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.prp-views svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .8; flex-shrink: 0; }
.qa-item-meta .prp-views, .qa-q-who .prp-views { font-family: var(--font-mono); font-size: .78rem; }

/* ---------- 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(--accent); }
.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(--accent) 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(--accent); 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; }
.footer-col a { color: var(--text-2); font-size: .92rem; transition: color var(--speed) var(--ease); }
.footer-col a:hover { color: var(--accent); }
.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); }

/* ---------- 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: 1060px) {
  /* 6 рубрик + «Все рубрики» в одну строку: ужимаем пункты меню */
  .nav-menu a { padding: .5rem .55rem; font-size: .86rem; }
}

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-scene { order: -1; }
  .hero-svg { max-width: 330px; }
  .solver { grid-template-columns: 1fr; }
  .solver-div { padding-block: .2rem; }
  .solver-div::before, .solver-div::after { display: none; }
  .solver-div span { position: relative; padding: 0 .8rem; }
  .solver-div span::before, .solver-div span::after {
    content: ""; position: absolute; top: 50%; width: 40vw; max-width: 220px; height: 1px; background: var(--line);
  }
  .solver-div span::before { right: 100%; }
  .solver-div span::after { left: 100%; }
  .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; }
  .hero-svg { max-width: 260px; }
  .solver { padding: 1rem; }
  .chip { font-size: .86rem; padding: .45rem .7rem; }
  .ars-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Additions: popular index, inner pages
   ========================================================= */

/* ---------- Popular articles index ---------- */
.poplist {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(6, 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(--accent); 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(--accent) 8%, transparent), transparent); }
.pop-link:hover .pop-title { color: var(--accent); }
.pop-link:hover .pop-go { color: var(--accent); 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(--accent); }
.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(--accent); color: var(--accent); }
.pagination button[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); 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(--accent); border: 1px solid color-mix(in srgb, var(--accent) 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); }
/* Статичная страница (page.php): без правой колонки оглавления, поэтому ограничиваем строку сами */
.page-body { max-width: 74ch; margin-top: 2.2rem; }
.article-meta .am-rubric { color: var(--accent); }
.article-meta .am-sep { opacity: .5; }
.article-meta .am-upd time { color: var(--text-2); }
.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(--accent); 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(--accent); 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(--accent); 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(--accent); background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--text); font-weight: 700; }

/* summary box */
.summary-box { margin: 2.6rem 0 0; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: var(--radius-lg); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 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(--accent); 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(--accent); 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(--accent); color: var(--accent); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); 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(--accent); 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(--accent); }
.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(--accent); 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(--accent); border-color: var(--accent); color: var(--on-accent); }
.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(--accent); 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(--accent); border: 1px solid var(--accent); 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(--accent); }
.qa-ra-kicker { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); }
.qa-ra-title { color: var(--text); font-weight: 600; font-size: .92rem; flex: 1; min-width: 200px; }
.qa-ra-arrow { color: var(--accent); 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(--accent); 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(--accent); }
.qa-field textarea { resize: vertical; min-height: 110px; }
.qa-consent {
  display: block; position: relative; padding-left: 1.6rem; margin: 0 0 1rem;
  font-size: .82rem; font-weight: 400; color: var(--text-3); line-height: 1.45;
}
.qa-consent input { position: absolute; left: 0; top: .18rem; margin: 0; }
.qa-consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.qa-hp { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; overflow: hidden; margin: 0; }
.qa-submit { display: block; margin-top: 20px; 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(--accent); transform: translateY(-1px); }
.qa-tema-icon { color: var(--accent); 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(--accent); 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; }

/* похожие вопросы: та же подача, что и qa-inline в статье */
.qa-similar { margin-top: 2.5rem; border-top: 1px solid var(--line-soft); padding-top: 1.5rem; }
.qa-similar h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 1rem; }

/* ---------- Страница 404 ----------
   Раньше шаблона не было вообще: несуществующий адрес отдавал ветку "лента" из index.php,
   то есть страницу без h1 и без единой ссылки на рубрики. */
.not-found-inner { max-width: 660px; margin-inline: auto; text-align: center; }
.not-found-code {
  font-family: var(--font-display); font-weight: 800; line-height: 1;
  font-size: clamp(4rem, 12vw, 7rem); color: var(--accent); margin: .2rem 0;
}
.not-found .hero-sub { max-width: none; margin-inline: auto; }
.not-found-search { max-width: 520px; margin: 1.6rem auto; }
.not-found-actions { display: flex; justify-content: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.not-found-chips { justify-content: center; }
