/* ============================================================
   RATING GRUNTA 2026 · BLOG STYLES
   Extends styles.css tokens and components.
   Adds: blog index grid, article layout, TOC sidebar,
   mobile TOC popup, callouts, tables, myths, FAQ, related.
============================================================ */

/* ============================================================
   BREAKPOINTS in use
   - < 560px   small phones
   - 561–900   phones / small tablets (mobile nav)
   - 901–1200  tablets / small laptops
   - 1201–1600 laptops / desktops
   - > 1600    large desktops
============================================================ */

/* ============================================================
   HELPERS · reset a couple of body-level issues for blog pages
============================================================ */
body { overflow-x: hidden; }
main { display: block; }

/* Ensure content sits under top-nav even before scroll-visible */
.blog-shell { padding-top: 64px; }
@media (max-width: 900px) { .blog-shell { padding-top: 56px; } }

/* Force top-nav always visible on inner pages */
.top-nav.is-inner { transform: translateY(0) !important; }
.top-nav.is-inner .top-nav__cta { display: inline-flex; }

/* ============================================================
   BLOG INDEX · HERO
============================================================ */
.b-hero {
  position: relative;
  padding: var(--s-6) var(--gutter) var(--s-5);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-5);
  align-items: end;
  background: var(--paper);
}

.b-hero__meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-3);
}

.b-hero__title {
  font-family: var(--ff-display);
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: clamp(46px, 8.5vw, 138px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--soil);
}
.b-hero__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--terracotta);
}

.b-hero__lead {
  max-width: 460px;
  font-family: var(--ff-body);
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0;
  align-self: end;
}

.b-hero__stats {
  grid-column: 1 / -1;
  margin-top: var(--s-5);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding-top: var(--s-3);
  gap: var(--s-3);
}
.b-hero__stat { display: flex; flex-direction: column; gap: 4px; }
.b-hero__stat b {
  font-family: var(--ff-display);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  font-size: clamp(38px, 4vw, 64px);
  line-height: 1;
  color: var(--soil);
  letter-spacing: -0.03em;
}
.b-hero__stat span {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

@media (max-width: 1200px) {
  .b-hero { padding: var(--s-5) var(--gutter) var(--s-4); }
}
@media (max-width: 900px) {
  .b-hero { grid-template-columns: 1fr; gap: var(--s-3); }
  .b-hero__lead { max-width: 100%; }
  .b-hero__stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   BLOG INDEX · FILTERS
============================================================ */
.b-filters {
  padding: var(--s-4) var(--gutter);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: var(--s-4);
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 55px;
  background: var(--paper);
  z-index: 500;
}
@media (max-width: 900px) {
  .b-filters { top: 51px; gap: var(--s-2); padding: var(--s-3) var(--gutter); }
}

.b-filters__label {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
}

.b-filters__group {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.b-filters__pill {
  padding: 9px 16px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--line);
  margin-left: -1px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
  white-space: nowrap;
  background: var(--paper);
}
.b-filters__pill:first-child { margin-left: 0; }
.b-filters__pill:hover { border-color: var(--ink); }
.b-filters__pill.is-active {
  background: var(--soil);
  color: var(--paper);
  border-color: var(--soil);
}

.b-filters__count {
  margin-left: auto;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.b-filters__count b {
  font-weight: 500;
  color: var(--soil);
  font-size: 14px;
  margin-right: 4px;
}

/* ============================================================
   BLOG INDEX · FEATURED (first 3 articles)
============================================================ */
.b-featured {
  padding: var(--s-6) var(--gutter);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--s-4);
}
@media (max-width: 1200px) { .b-featured { grid-template-columns: 1.4fr 1fr; } }
@media (max-width: 900px) { .b-featured { grid-template-columns: 1fr; padding: var(--s-4) var(--gutter); } }

.b-feat-card {
  display: block;
  padding: var(--s-4) var(--s-3);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  background: var(--paper);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  position: relative;
}
.b-feat-card:hover { background: var(--paper-warm); border-color: var(--ink); }

.b-feat-card--hero {
  grid-row: span 2;
  background: var(--soil);
  color: var(--paper);
  border-color: var(--soil);
  padding: var(--s-5) var(--s-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 460px;
}
@media (max-width: 1200px) { .b-feat-card--hero { grid-row: span 2; } }
@media (max-width: 900px) { .b-feat-card--hero { grid-row: span 1; min-height: 320px; } }
.b-feat-card--hero:hover { background: #1a130d; border-color: var(--terracotta); }

.b-feat-card__kicker {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: var(--s-2);
  opacity: 0.75;
}
.b-feat-card__num {
  font-family: var(--ff-mono);
  font-size: 10px;
  opacity: 0.55;
}
.b-feat-card__title {
  font-family: var(--ff-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-2);
  color: inherit;
}
.b-feat-card--hero .b-feat-card__title {
  font-size: clamp(36px, 4.2vw, 66px);
  line-height: 0.98;
  font-weight: 900;
}
.b-feat-card__desc {
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0;
}
.b-feat-card--hero .b-feat-card__desc {
  color: rgba(243, 239, 230, 0.75);
  font-size: 19px;
}
.b-feat-card__foot {
  margin-top: var(--s-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s-2);
  border-top: 1px solid currentColor;
  border-color: var(--line);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.b-feat-card--hero .b-feat-card__foot {
  border-color: rgba(243, 239, 230, 0.25);
  opacity: 0.9;
}
.b-feat-card__arrow {
  font-family: var(--ff-display);
  font-size: 20px;
  letter-spacing: 0;
  transition: transform 0.25s var(--ease);
}
.b-feat-card:hover .b-feat-card__arrow { transform: translateX(6px); }

/* ============================================================
   BLOG INDEX · MAIN LIST
============================================================ */
.b-list {
  padding: var(--s-5) var(--gutter) var(--s-7);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--s-5);
}
@media (max-width: 1200px) {
  .b-list { grid-template-columns: 200px 1fr; gap: var(--s-4); }
}
@media (max-width: 900px) {
  .b-list { grid-template-columns: 1fr; padding: var(--s-4) var(--gutter) var(--s-5); }
}

.b-list__aside {
  position: sticky;
  top: 200px;
  align-self: start;
  border-top: 2px solid var(--ink);
  padding-top: var(--s-2);
}
@media (max-width: 900px) {
  .b-list__aside { position: static; border-top: 1px solid var(--line); padding-top: var(--s-3); margin-bottom: var(--s-3); }
}

.b-list__label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.b-list__aside h3 {
  font-family: var(--ff-display);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  font-size: 32px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 var(--s-2);
  color: var(--soil);
}
.b-list__aside p {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0;
}

.b-list__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
@media (max-width: 900px) { .b-list__grid { grid-template-columns: 1fr; } }

.b-card {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-3);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  background: var(--paper);
  transition: background 0.18s var(--ease);
  position: relative;
}
.b-card:nth-child(2n) { border-right: 0; }
@media (max-width: 900px) { .b-card { border-right: 0 !important; } }
.b-card:hover { background: var(--paper-warm); }
.b-card.is-hidden { display: none; }

.b-card__num {
  font-family: var(--ff-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  padding-top: 3px;
  font-weight: 500;
}

.b-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}
.b-card__tags {
  display: flex;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.b-card__tag--topic { color: var(--chlorophyll); }
.b-card__tag--cluster { opacity: 0.55; }

.b-card__title {
  font-family: var(--ff-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96, "SOFT" 60;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--soil);
  margin: 0;
  text-wrap: pretty;
}
.b-card__meta {
  margin-top: auto;
  padding-top: var(--s-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
}
.b-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}
.b-card:hover .b-card__cta { color: var(--terracotta); }
.b-card__cta span {
  font-family: var(--ff-display);
  font-size: 16px;
  transition: transform 0.25s var(--ease);
}
.b-card:hover .b-card__cta span { transform: translateX(4px); }

/* ============================================================
   ARTICLE PAGE · LAYOUT
============================================================ */
.a-page {
  display: block;
  padding: 0;
}

/* HERO of article */
.a-hero {
  padding: var(--s-6) var(--gutter) var(--s-5);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: relative;
}
@media (max-width: 900px) {
  .a-hero { padding: var(--s-4) var(--gutter) var(--s-4); }
}

.a-hero__crumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-4);
}
.a-hero__crumbs a { opacity: 0.7; }
.a-hero__crumbs a:hover { color: var(--terracotta); opacity: 1; }
.a-hero__crumbs .sep { opacity: 0.35; }
.a-hero__crumbs .cur { color: var(--soil); opacity: 1; }

.a-hero__tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}
.a-hero__tag {
  padding: 6px 12px;
  border: 1px solid var(--ink);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.a-hero__tag--topic { background: var(--chlorophyll); color: var(--paper); border-color: var(--chlorophyll); }
.a-hero__tag--n {
  background: var(--soil); color: var(--paper); border-color: var(--soil);
  font-weight: 500;
}
.a-hero__tag--level { color: var(--ink-soft); }

.a-hero__title {
  font-family: var(--ff-display);
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: clamp(38px, 5.6vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--soil);
  margin: 0 0 var(--s-4);
  text-wrap: balance;
  max-width: 22ch;
}

.a-hero__meta {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.a-hero__meta div b {
  display: block;
  color: var(--soil);
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}
@media (max-width: 700px) {
  .a-hero__meta { grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
}

/* Body layout: sidebar (TOC) + main + right rail */
.a-body {
  padding: var(--s-5) var(--gutter) var(--s-6);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  gap: var(--s-5);
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
}
@media (max-width: 1400px) {
  .a-body { grid-template-columns: 220px minmax(0, 1fr) 200px; gap: var(--s-4); }
}
@media (max-width: 1200px) {
  .a-body { grid-template-columns: 200px minmax(0, 1fr); }
  .a-rail { display: none; }
}
@media (max-width: 900px) {
  .a-body { grid-template-columns: 1fr; padding: var(--s-4) var(--gutter) var(--s-5); gap: var(--s-3); }
  .a-toc-side { display: none; }
}

/* ============================================================
   ARTICLE · TOC SIDEBAR (desktop)
============================================================ */
.a-toc-side {
  position: sticky;
  top: 90px;
  align-self: start;
  border-top: 2px solid var(--ink);
  padding-top: var(--s-2);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.a-toc-side__label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-2);
}

.a-toc__list { display: flex; flex-direction: column; }

.a-toc__item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.25;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.a-toc__item:hover { color: var(--terracotta); }
.a-toc__item.is-active {
  color: var(--soil);
  font-weight: 500;
  background: linear-gradient(90deg, var(--paper-warm) 0%, var(--paper) 100%);
  padding-left: 6px;
  margin-left: -6px;
}
.a-toc__item.is-active .a-toc__num { color: var(--terracotta); font-weight: 700; }
.a-toc__num {
  font-family: var(--ff-mono);
  font-size: 11px;
  opacity: 0.6;
  padding-top: 3px;
  transition: color 0.18s var(--ease);
}
.a-toc__title { text-wrap: pretty; }

/* Progress indicator on side TOC */
.a-toc-side__progress {
  position: sticky;
  top: 0;
  height: 3px;
  background: var(--line);
  margin-bottom: var(--s-2);
  overflow: hidden;
}
.a-toc-side__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--terracotta);
  transition: width 0.1s linear;
}

/* ============================================================
   ARTICLE · MOBILE TOC BUTTON + POPUP
============================================================ */
.a-toc-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 88px;
  z-index: 8000;
  width: 56px;
  height: 56px;
  background: var(--soil);
  color: var(--paper);
  border: 1px solid var(--soil);
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: none;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  transition: background 0.18s var(--ease);
}
.a-toc-fab:hover { background: var(--terracotta); border-color: var(--terracotta); }
.a-toc-fab b {
  font-weight: 500;
  font-size: 14px;
}
@media (max-width: 1200px) { .a-toc-fab { display: flex; } }
@media (max-width: 900px)  { .a-toc-fab { bottom: 76px; right: 12px; } }

.a-toc-modal {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: none;
  background: rgba(23, 22, 20, 0.7);
  padding: 20px;
  align-items: flex-end;
  justify-content: center;
}
.a-toc-modal.is-open { display: flex; }

.a-toc-modal__inner {
  background: var(--paper);
  width: 100%;
  max-width: 720px;
  max-height: 84vh;
  padding: var(--s-3) var(--s-3) var(--s-4);
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  animation: sheetUp .3s var(--ease);
}
@keyframes sheetUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.a-toc-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s-2);
}
.a-toc-modal__head b {
  font-family: var(--ff-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--soil);
}
.a-toc-modal__close {
  width: 40px; height: 40px;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-family: var(--ff-mono);
  cursor: pointer;
  font-size: 14px;
}
.a-toc-modal__close:hover { background: var(--soil); color: var(--paper); }

.a-toc-modal__list {
  overflow-y: auto;
  padding-right: 8px;
  flex: 1;
}
.a-toc-modal__list .a-toc__item {
  font-size: 17px;
  padding: 12px 4px;
}

/* ============================================================
   ARTICLE · MAIN CONTENT
============================================================ */
.a-main {
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.a-main > * { max-width: 100%; }

/* Disclaimer callout */
.a-disclaimer {
  border-left: 3px solid var(--ink);
  padding: var(--s-2) 0 var(--s-2) var(--s-3);
  margin-bottom: var(--s-4);
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  background: transparent;
}
.a-disclaimer::before {
  content: "Дисклеймер";
  display: block;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 6px;
}

/* Lead paragraph */
.a-lead {
  font-family: var(--ff-body);
  font-size: 26px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
  text-wrap: pretty;
}
@media (max-width: 900px) {
  .a-lead { font-size: 22px; }
}

/* TL;DR */
.a-tldr {
  padding: var(--s-4);
  background: var(--paper-warm);
  border: 1px solid var(--ink);
  margin-bottom: var(--s-6);
  position: relative;
}
.a-tldr__label {
  position: absolute;
  top: -12px;
  left: var(--s-3);
  background: var(--paper);
  padding: 4px 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  border: 1px solid var(--ink);
}
.a-tldr__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  counter-reset: tldr;
}
.a-tldr__item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  font-family: var(--ff-body);
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
  counter-increment: tldr;
}
.a-tldr__item::before {
  content: counter(tldr, decimal-leading-zero);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--terracotta);
  padding-top: 6px;
  font-weight: 500;
}

/* ============================================================
   ARTICLE · SECTION HEADINGS
============================================================ */
.a-section {
  margin: var(--s-6) 0;
  scroll-margin-top: 80px;
}
.a-section:first-of-type { margin-top: 0; }

.a-section__num {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.a-section__num::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
  max-width: 120px;
}

.a-section__title {
  font-family: var(--ff-display);
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--soil);
  margin: 0 0 var(--s-3);
  text-wrap: balance;
}

/* Prose paragraphs */
.a-p {
  font-family: var(--ff-body);
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 var(--s-2);
  text-wrap: pretty;
}
.a-p--bold { font-weight: normal; color: var(--soil); }
.a-p:last-child { margin-bottom: 0; }

/* Callouts inside prose: ⚠️ 🚨 */
.a-p--warn {
  border-left: 3px solid var(--terracotta);
  padding: 12px 16px;
  background: rgba(168, 79, 42, 0.08);
  color: var(--soil);
  font-size: 17px;
}
.a-p--danger {
  border-left: 3px solid var(--rust);
  padding: 12px 16px;
  background: rgba(140, 58, 28, 0.08);
  color: var(--rust);
  font-weight: 500;
  font-size: 17px;
}

/* Emphasis on inline "Пример N." etc */
.a-p--callout-lead {
  font-family: var(--ff-display);
  font-weight: 500;
  font-style: italic;
  font-size: 22px;
  color: var(--terracotta);
  margin-top: var(--s-3);
}

/* Lists */
.a-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 var(--s-3);
  counter-reset: item;
}
.a-list__item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  font-family: var(--ff-body);
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink);
  padding-left: 0;
  align-items: start;
}
/* Marker: use the first <span aria-hidden> child instead of ::before,
   because the HTML already ships an empty marker span. Otherwise we get
   three grid items (::before + 2 spans) forcing the text to wrap into a
   1-char-wide column. */
.a-list__item > span:first-child {
  width: 6px;
  height: 6px;
  background: var(--terracotta);
  margin-top: 12px;
  border-radius: 0;
  display: block;
}
.a-list__item > span:last-child {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
.a-list__item--bold { color: var(--soil); font-weight: normal; }
.a-list__item--bold > span:first-child {
  background: var(--soil);
  width: 10px;
  height: 2px;
  margin-top: 15px;
}

/* Ordered list variant (used for TL;DR-like) */
.a-list--num { counter-reset: item; }
.a-list--num .a-list__item { grid-template-columns: 32px minmax(0, 1fr); counter-increment: item; }
.a-list--num .a-list__item > span:first-child {
  content: counter(item, decimal-leading-zero);
  background: none;
  width: auto; height: auto; margin: 0;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--terracotta);
  padding-top: 6px;
  font-weight: 500;
}
.a-list--num .a-list__item > span:first-child::before {
  content: counter(item, decimal-leading-zero);
}

/* ============================================================
   ARTICLE · TABLES
============================================================ */
.a-table-wrap {
  margin: var(--s-3) 0 var(--s-4);
  border: 1px solid var(--ink);
  overflow: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.a-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ff-body);
  font-size: 16px;
  min-width: 100%;
}
.a-table th, .a-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
}
.a-table th:last-child, .a-table td:last-child { border-right: 0; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table th {
  background: var(--soil);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 12px 16px;
  white-space: nowrap;
}
.a-table td {
  font-family: var(--ff-body);
  font-size: 17px;
}
/* Highlight numeric-looking cells with mono */
.a-table td.is-num {
  font-family: var(--ff-mono);
  font-feature-settings: "tnum";
  font-size: 14px;
  white-space: nowrap;
  color: var(--soil);
}
.a-table tbody tr:nth-child(even) { background: rgba(232, 224, 204, 0.35); }
.a-table tbody tr:hover { background: var(--paper-warm); }

.a-table__note {
  border-left: 3px solid var(--ink);
  padding: 10px 16px;
  font-family: var(--ff-body);
  font-size: 15px;
  color: var(--ink-soft);
  margin: -8px 0 var(--s-4);
  background: var(--paper-warm);
}

@media (max-width: 700px) {
  .a-table th, .a-table td { padding: 10px 12px; font-size: 14px; }
  .a-table td.is-num { font-size: 12px; }
}

/* ============================================================
   ARTICLE · MYTHS
============================================================ */
.a-myths { display: grid; gap: var(--s-3); margin: var(--s-3) 0 var(--s-4); }
.a-myth {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--ink);
  background: var(--paper);
  position: relative;
}
.a-myth__n {
  font-family: var(--ff-display);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  font-size: 60px;
  line-height: 1;
  color: var(--rust);
  letter-spacing: -0.04em;
}
.a-myth__body h4 {
  font-family: var(--ff-body);
  font-style: italic;
  font-size: 20px;
  line-height: 1.35;
  color: var(--rust);
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.a-myth__body h4::before {
  content: 'Миф: ';
  font-family: var(--ff-mono);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.a-myth__body p {
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--soil);
  margin: 0;
}
.a-myth__body p::before {
  content: 'Факт: ';
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--chlorophyll);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}
@media (max-width: 600px) {
  .a-myth { grid-template-columns: 40px 1fr; padding: var(--s-2); gap: var(--s-2); }
  .a-myth__n { font-size: 38px; }
  .a-myth__body h4 { font-size: 17px; }
}

/* ============================================================
   ARTICLE · FAQ
============================================================ */
.a-faq { display: grid; gap: 0; margin: var(--s-3) 0 var(--s-4); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.a-faq details {
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.a-faq details:last-child { border-bottom: 0; }
.a-faq summary {
  cursor: pointer;
  padding: var(--s-3);
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  color: var(--soil);
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: var(--s-2);
  align-items: start;
  transition: background 0.18s var(--ease);
}
.a-faq summary::-webkit-details-marker { display: none; }
.a-faq summary:hover { background: var(--paper-warm); }
.a-faq summary::after {
  content: '+';
  font-family: var(--ff-mono);
  font-size: 24px;
  color: var(--terracotta);
  text-align: center;
  transition: transform 0.25s var(--ease);
  line-height: 1;
}
.a-faq details[open] summary::after { content: '−'; }
.a-faq details[open] summary { background: var(--paper-warm); }
.a-faq details p {
  padding: 0 var(--s-3) var(--s-3);
  margin: 0;
  font-family: var(--ff-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ============================================================
   ARTICLE · CHECKLIST
============================================================ */
.a-checklist {
  background: var(--soil);
  color: var(--paper);
  padding: var(--s-4);
  margin: var(--s-3) 0 var(--s-4);
  position: relative;
}
.a-checklist__label {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid rgba(243, 239, 230, 0.2);
}
.a-checklist__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  counter-reset: step;
}
.a-checklist__item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  font-family: var(--ff-body);
  font-size: 19px;
  line-height: 1.4;
  align-items: start;
  cursor: pointer;
  counter-increment: step;
  padding: 4px 0;
}
/* Checkbox: render as the first <span aria-hidden> child, NOT ::before,
   because the HTML already ships that empty span. Using ::before would
   add a THIRD grid item and force text into a 22px-wide column
   (letter-per-line bug). */
.a-checklist__item > span:first-child {
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(243, 239, 230, 0.5);
  margin-top: 4px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  display: block;
  box-sizing: border-box;
}
.a-checklist__item:hover > span:first-child { border-color: var(--paper); }
.a-checklist__item.is-done > span:first-child {
  background: var(--terracotta);
  border-color: var(--terracotta);
}
.a-checklist__item.is-done .a-checklist__text {
  text-decoration: line-through;
  opacity: 0.55;
}
.a-checklist__text { min-width: 0; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.a-checklist__text {
  color: var(--paper);
}
.a-checklist__text::first-letter {
  font-family: var(--ff-display);
  font-weight: 700;
  color: var(--terracotta);
}

/* ============================================================
   ARTICLE · CONCLUSION
============================================================ */
.a-conclusion {
  margin: var(--s-4) 0 var(--s-4);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: var(--s-4) 0;
  display: grid;
  gap: var(--s-3);
}
.a-conclusion__label {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.a-conclusion p {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.35;
  color: var(--soil);
  margin: 0;
  padding-left: var(--s-3);
  border-left: 3px solid var(--terracotta);
  text-wrap: pretty;
}

/* ============================================================
   ARTICLE · RIGHT RAIL (desktop only)
============================================================ */
.a-rail {
  position: sticky;
  top: 90px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  border-top: 2px solid var(--ink);
  padding-top: var(--s-2);
}
.a-rail__label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-2);
}

.a-rail__cta {
  display: block;
  padding: var(--s-3);
  background: var(--soil);
  color: var(--paper);
  border: 1px solid var(--soil);
  text-decoration: none;
  transition: background 0.2s var(--ease);
}
.a-rail__cta:hover { background: var(--terracotta); border-color: var(--terracotta); }
.a-rail__cta b {
  display: block;
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.a-rail__cta span {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.a-rail__cta:hover span { color: var(--paper); }

.a-rail__mini {
  border-top: 1px solid var(--line);
  padding-top: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.a-rail__mini a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.25;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px;
  transition: color 0.18s var(--ease);
}
.a-rail__mini a:hover { color: var(--terracotta); }
.a-rail__mini a b {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--terracotta);
  padding-top: 2px;
  font-weight: 500;
}
.a-rail__mini a:last-child { border-bottom: 0; }

/* ============================================================
   ARTICLE · RELATED (below main content)
============================================================ */
.a-related {
  padding: var(--s-6) var(--gutter);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  background: var(--paper-warm);
}
.a-related__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--ink);
  margin-bottom: var(--s-4);
}
.a-related__head h2 {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--soil);
  margin: 0;
}
.a-related__head p {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.a-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (max-width: 1100px) { .a-related__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .a-related__grid { grid-template-columns: 1fr; } }

.a-rel-card {
  padding: var(--s-3);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.18s var(--ease), transform 0.25s var(--ease);
  min-height: 180px;
}
.a-rel-card:hover { background: var(--paper); transform: translateY(-2px); }

.a-rel-card__tag {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chlorophyll);
  display: flex;
  gap: 8px;
  align-items: center;
}
.a-rel-card__tag b {
  color: var(--terracotta);
  font-weight: 500;
}
.a-rel-card__title {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.15;
  color: var(--soil);
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.a-rel-card__cta {
  margin-top: auto;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  gap: 6px;
  align-items: center;
}
.a-rel-card:hover .a-rel-card__cta { color: var(--terracotta); }

/* ============================================================
   ARTICLE · NAV PREV/NEXT
============================================================ */
.a-nav {
  padding: var(--s-5) var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 700px) { .a-nav { grid-template-columns: 1fr; } }

.a-nav a {
  padding: var(--s-3);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: background 0.18s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.a-nav a:first-child { border-right: 0; }
@media (max-width: 700px) { .a-nav a:first-child { border-right: 1px solid var(--line); border-bottom: 0; } }
.a-nav a:hover { background: var(--paper-warm); }
.a-nav__label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.a-nav__title {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: var(--soil);
  text-wrap: pretty;
}
.a-nav__arrow {
  font-family: var(--ff-display);
  font-size: 20px;
  color: var(--ink-soft);
}
.a-nav a:nth-child(2) { text-align: right; align-items: flex-end; }

/* ============================================================
   ARTICLE · FULL CATALOG STRIP (below related)
============================================================ */
.a-catalog {
  padding: var(--s-5) var(--gutter) var(--s-6);
  border-bottom: 1px solid var(--line);
}
.a-catalog__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.a-catalog__head h3 {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
  color: var(--soil);
  margin: 0;
  letter-spacing: -0.02em;
}
.a-catalog__head p {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}
.a-catalog__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
@media (max-width: 700px) { .a-catalog__list { grid-template-columns: 1fr; } }
.a-catalog__item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  padding: 14px 12px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.3;
  align-items: baseline;
  transition: background 0.15s var(--ease);
}
.a-catalog__item:hover { background: var(--paper-warm); }
.a-catalog__item.is-current { background: var(--paper-warm); font-weight: 500; color: var(--soil); position: relative; }
.a-catalog__item.is-current::after {
  content: 'вы здесь';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--terracotta);
  padding: 4px 8px;
  font-weight: 500;
  white-space: nowrap;
}
.a-catalog__item.is-current .a-catalog__tag { visibility: hidden; }
.a-catalog__num {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--terracotta);
  letter-spacing: 0.08em;
  font-weight: 500;
}
.a-catalog__tag {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.7;
  white-space: nowrap;
}

/* ============================================================
   SCROLL-TO-TOP button (already in main script.js)
============================================================ */
/* Handled by inherited script.js if present */

/* ============================================================
   MISC · word wrapping
   Normal word wrapping everywhere with soft-hyphens.
   NEVER use overflow-wrap: anywhere on prose — it breaks Russian
   words letter-by-letter inside narrow grid/flex tracks.
============================================================ */
.b-card__title, .a-rel-card__title, .a-toc__title, .a-p {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.a-table td, .a-table th {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
}
/* First column of tables (usually a label) has more room to breathe */
.a-table td:first-child, .a-table th:first-child { min-width: 110px; }

/* Any grid/flex item that holds prose needs min-width: 0 so its column
   can shrink to fit the container instead of forcing letter-by-letter wrap. */
.a-main *,
.a-list__item > *,
.a-tldr__item > *,
.a-checklist__item > *,
.a-toc__item > * { min-width: 0; }

/* Article main column: table wrapper scrolls horizontally rather than
   squeezing cells to unreadable width. */
.a-table-wrap { overflow-x: auto; max-width: 100%; }

/* Compound sections (prose + table + prose) also need a proper block flow */
.a-section > .a-list,
.a-section > .a-p,
.a-section > .a-table-wrap { max-width: 100%; }

/* Custom scrollbar for TOC */
.a-toc-side::-webkit-scrollbar { width: 4px; }
.a-toc-side::-webkit-scrollbar-thumb { background: var(--line-strong); }
.a-toc-side::-webkit-scrollbar-track { background: transparent; }
