/* Blog article components: summary box, key numbers, bar charts, comparison tables,
   step lists, week planner, inline citations and the sources list.
   Loaded only by blog-*.html (bg + en). Editorial look: references Turo (stat cards),
   Obvious (eyebrow labels, calm figures), Substack / NYT (reading typography). */

/* ---------- Reading typography ---------- */
.post-body {
  max-width: 70ch; gap: 20px; font-size: 18px; line-height: 1.75; font-weight: 450; color: var(--text);
  /* standard upright Cyrillic forms read better in long text than Montserrat's Bulgarian "locl" forms */
  font-feature-settings: "locl" 0;
}
.post-body > p:first-child { font-size: 20px; line-height: 1.65; }
.post-body h2 {
  margin-top: 28px; font-size: clamp(26px, 3vw, 32px); line-height: 1.2; letter-spacing: -.005em;
  display: grid; gap: 14px;
}
.post-body h2::before { content: ""; width: 44px; height: 2px; border-radius: 2px; background: var(--rose); }
.post-body .sources h2::before, .post-body .tldr h2::before { content: none; }
.post-body ul { padding-left: 0; list-style: none; gap: 10px; }
.post-body ul > li { position: relative; padding-left: 22px; }
.post-body ul > li::before { content: ""; position: absolute; left: 3px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); }
.post-body a:not(.btn) { color: var(--text); text-decoration-color: var(--rose); text-underline-offset: 3px; }

/* shared small label ("eyebrow") used by the boxes below */
.post-body .tldr h2,
.post-body .viz figcaption::before,
.post-body .duo > div > b,
.post-body .callout b {
  font-family: var(--body); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text);
}

/* ---------- "Накратко" summary ---------- */
.post-body .tldr {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px); display: grid; gap: 14px; box-shadow: 0 18px 40px -32px rgba(119, 99, 84, .45);
}
.post-body .tldr h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.post-body .tldr h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.post-body .tldr ul { gap: 12px; font-size: 16.5px; line-height: 1.6; }
.post-body .tldr li { padding-left: 30px; }
.post-body .tldr li::before {
  left: 0; top: .2em; width: 18px; height: 18px; border-radius: 50%; background: var(--blush);
  -webkit-mask: none; box-shadow: inset 0 0 0 1px var(--rose);
}
.post-body .tldr li::after {
  content: ""; position: absolute; left: 6px; top: calc(.2em + 4px); width: 4px; height: 8px;
  border: solid var(--mauve); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg);
}

/* ---------- inline citation: <sup class="cite"><a href="#src-1">1</a></sup> ---------- */
.post-body sup.cite { font-size: .6em; line-height: 0; vertical-align: super; margin-left: 2px; }
.post-body sup.cite a {
  display: inline-block; min-width: 1.5em; padding: 2px 4px; border-radius: 99px; background: var(--blush);
  color: var(--text); font-weight: 700; text-align: center; text-decoration: none; transition: background .2s, color .2s;
}
.post-body sup.cite a:hover, .post-body sup.cite a:focus-visible { background: var(--mauve); color: #fff; }

/* ---------- key numbers: <div class="facts"><div class="fact"><b>…</b><span>…</span></div>…</div> ---------- */
.post-body .facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 8px 0;
}
.post-body .fact {
  container-type: inline-size; position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 20px 20px; display: grid; gap: 10px; align-content: start;
}
.post-body .fact::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--rose), var(--blush)); }
.post-body .fact b {
  display: grid; gap: 8px; align-content: start;
  font-family: var(--display); font-weight: 500; line-height: 1; color: var(--text); letter-spacing: -.01em;
  /* the number stays on one line and scales with the card; the unit sits under it in small caps */
  font-size: min(44px, 22cqi); white-space: nowrap;
}
.post-body .fact b small, .post-body .fact b:not(:has(small))::after {
  font: 700 11.5px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--text); white-space: normal;
}
/* cards without a unit keep an empty unit line, so the text below starts at the same height in every card */
.post-body .fact b:not(:has(small))::after { content: "\00a0"; }
.post-body .fact span { font-size: 14.5px; line-height: 1.55; color: var(--text); }

/* ---------- figures: charts, tables, planners ---------- */
.post-body .viz {
  margin: 10px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 30px); display: grid; gap: 18px;
}
.post-body .viz figcaption { font-family: var(--display); font-size: clamp(19px, 2.2vw, 22px); line-height: 1.3; display: grid; gap: 8px; }
.post-body .viz figcaption::before { content: "Графика"; }
html[lang="en"] .post-body .viz figcaption::before { content: "Figure"; }
.post-body .viz .viz-src { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--text); }

/* horizontal bars: <ul class="bars"><li style="--v:62%"><span>label</span><i></i><b>62%</b></li></ul> */
.post-body .bars { gap: 14px; }
.post-body .bars li { display: grid; grid-template-columns: minmax(120px, 36%) 1fr auto; align-items: center; gap: 14px; padding: 0; font-size: 15px; line-height: 1.35; }
.post-body .bars li::before { content: none; }
.post-body .bars i { position: relative; height: 14px; border-radius: 99px; background: var(--shell); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.post-body .bars i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--blush), var(--rose)); }
.post-body .bars li.hl i::before { background: linear-gradient(90deg, var(--rose), var(--cocoa)); }
.post-body .bars li.hl span, .post-body .bars li.hl b { color: var(--text); font-weight: 700; }
.post-body .bars b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; font-size: 15px; }
@media (max-width: 520px) {
  .post-body .bars li { grid-template-columns: 1fr auto; row-gap: 6px; }
  .post-body .bars span { grid-column: 1 / -1; }
}

/* comparison table */
.post-body .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.post-body .compare { width: 100%; min-width: 480px; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 1.55; }
.post-body .compare th, .post-body .compare td { padding: 13px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.post-body .compare thead th { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text); background: var(--shell); border-bottom: 0; }
.post-body .compare thead th:first-child { border-radius: 12px 0 0 12px; }
.post-body .compare thead th:last-child { border-radius: 0 12px 12px 0; }
.post-body .compare tbody th { font-weight: 700; width: 28%; }
.post-body .compare tbody tr:nth-child(even) > * { background: rgba(239, 230, 219, .35); }
.post-body .compare tbody tr:last-child > * { border-bottom: 0; }

/* numbered steps / timeline */
.post-body .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.post-body .steps li { position: relative; counter-increment: step; padding: 0 0 24px 60px; }
.post-body .steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--rose); color: var(--text);
  font-family: var(--display); font-size: 16px;
}
.post-body .steps li:not(:last-child)::after { content: ""; position: absolute; left: 20.5px; top: 48px; bottom: 6px; width: 1px; background: linear-gradient(var(--rose), var(--line)); }
.post-body .steps li:last-child { padding-bottom: 0; }
.post-body .steps b { display: block; font-size: 17px; line-height: 1.4; padding-top: 9px; }
.post-body .steps p { margin: 4px 0 0; font-size: 16px; line-height: 1.65; color: var(--text); }

/* week planner */
.post-body .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.post-body .week .day { border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px; text-align: center; display: grid; gap: 4px; font-size: 12px; line-height: 1.3; background: var(--shell); }
.post-body .week .day b { font-family: var(--body); font-weight: 700; font-size: 14px; }
.post-body .week .day.on { background: var(--cocoa); border-color: var(--cocoa); color: #fff; }
.post-body .week .day.lite { background: var(--blush); border-color: var(--rose); }
.post-body .week-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text); }
.post-body .week-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--shell); border: 1px solid var(--line); }
.post-body .week-legend .on::before { background: var(--cocoa); border-color: var(--cocoa); }
.post-body .week-legend .lite::before { background: var(--blush); border-color: var(--rose); }
@media (max-width: 420px) { .post-body .week .day span { display: none; } }

/* two-column do / avoid cards */
.post-body .duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.post-body .duo > div { border-radius: var(--radius-lg); padding: 22px; display: grid; gap: 12px; align-content: start; font-size: 15.5px; line-height: 1.6; }
.post-body .duo > div > b { display: flex; align-items: center; gap: 10px; }
.post-body .duo > div > b::before {
  content: ""; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--cocoa)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.post-body .duo ul { gap: 8px; }
.post-body .duo .yes { background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px -34px rgba(119, 99, 84, .5); }
.post-body .duo .no { background: var(--blush); border: 1px solid transparent; }
.post-body .duo .no > b::before { background-color: var(--rose); }

/* callout / tip: <p class="callout"><b>Важно:</b> …</p> */
.post-body .callout {
  position: relative; background: var(--blush); border: 0; border-radius: var(--radius-lg);
  padding: 22px 24px 22px 66px; font-size: 16.5px; line-height: 1.7;
}
.post-body .callout::before {
  content: "i"; position: absolute; left: 22px; top: 22px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--cocoa); color: #fff; font-family: var(--display); font-style: italic; font-size: 16px; line-height: 1;
}
.post-body .callout b { display: block; margin-bottom: 4px; }

/* pull quote */
.post-body blockquote {
  margin: 12px 0; padding: 6px 0 6px 28px; border-left: 2px solid var(--rose);
  font-family: var(--display); font-size: clamp(22px, 2.6vw, 27px); line-height: 1.4; color: var(--text);
}
.post-body blockquote cite { display: block; margin-top: 10px; font-family: var(--body); font-style: normal; font-size: 13px; color: var(--text); }

/* ---------- sources ---------- */
.post-body .sources { margin-top: 28px; padding: clamp(20px, 3vw, 28px); background: var(--shell); border: 1px solid var(--line); border-radius: var(--radius-lg); display: grid; gap: 14px; }
.post-body .sources h2 { margin: 0; font-size: 22px; }
.post-body .sources > p { margin: 0; font-size: 14px; }
.post-body .sources ol { margin: 0; padding: 0; list-style: none; counter-reset: src; display: grid; gap: 12px; font-size: 14px; line-height: 1.6; color: var(--text); }
.post-body .sources li { position: relative; counter-increment: src; padding-left: 34px; scroll-margin-top: 110px; overflow-wrap: anywhere; }
.post-body .sources li::before {
  content: counter(src); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--text);
}
.post-body .sources li:target { background: #fff; border-radius: 10px; box-shadow: 0 0 0 8px #fff, 0 0 0 9px var(--rose); }
.post-body .sources a { color: var(--text); }
.post-body .reviewed { font-size: 13px; color: var(--text); }

/* ---------- reading progress (pure CSS, only where scroll-driven animations exist) ---------- */
@supports (animation-timeline: scroll()) {
  body:has(.post-body)::before {
    content: ""; position: fixed; inset: 0 0 auto; height: 3px; z-index: 80; transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--rose), var(--cocoa));
    animation: post-progress linear both; animation-timeline: scroll(root);
  }
  @keyframes post-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
@media (prefers-reduced-motion: reduce) { body:has(.post-body)::before { display: none; } }

/* =====================================================================
   Editorial pass (2026-10-21): plain, print-like figures instead of the
   usual "AI card" look (no gradient strips, pill bars, soft shadows,
   auto "Графика" eyebrows). Meaning colours are used only where they carry
   meaning: green = do / yes / training day, red = avoid / no.
   Both pass WCAG AA as text on white.
   ===================================================================== */
.post-body {
  --ok: #2E6E46; --ok-bg: #EDF5EF; --ok-line: #B9D6C2;
  --bad: #A63A2B; --bad-bg: #FBEFEC; --bad-line: #E8C2BA;
  --ink: var(--text); --rule: #DCCFC2;
}

/* figures: a top rule and a plain caption, like a newspaper chart */
.post-body .viz { background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; padding: 16px 0 0; gap: 16px; box-shadow: none; }
.post-body .viz figcaption { font-family: var(--body); font-size: 17px; font-weight: 700; line-height: 1.4; gap: 0; color: var(--ink); }
.post-body .viz figcaption::before { content: none; }
.post-body .viz .viz-src { border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink); opacity: 1; }

/* bars: label above, a flat bar, the value at the end — no rounded pills, no gradients */
.post-body .bars { gap: 16px; }
.post-body .bars li { grid-template-columns: 1fr auto; row-gap: 6px; font-size: 15.5px; }
.post-body .bars span { grid-column: 1 / -1; }
.post-body .bars i { height: 10px; border-radius: 1px; background: #EFE6DB; box-shadow: none; }
.post-body .bars i::before { border-radius: 1px; background: #A8947F; }
.post-body .bars li.hl i::before { background: var(--ink); }
.post-body .bars b { font-size: 16px; font-weight: 700; color: var(--ink); }

/* key numbers: no coloured strip, a thin rule above each number */
.post-body .fact { background: transparent; border: 0; border-top: 1px solid var(--ink); border-radius: 0; padding: 14px 0 0; }
.post-body .fact::before { content: none; }

/* summary: a ruled box, ticks in green */
.post-body .tldr { background: transparent; border: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); border-radius: 0; padding: 16px 0 18px; box-shadow: none; }
.post-body .tldr h2::after { content: none; }
.post-body .tldr li::before { background: var(--ok-bg); box-shadow: inset 0 0 0 1px var(--ok-line); }
.post-body .tldr li::after { border-color: var(--ok); }

/* do / avoid: green and red, side rule instead of floating cards */
.post-body .duo > div { border-radius: 4px; box-shadow: none; padding: 18px 20px; }
.post-body .duo .yes { background: var(--ok-bg); border: 0; border-left: 3px solid var(--ok); }
.post-body .duo .no { background: var(--bad-bg); border: 0; border-left: 3px solid var(--bad); }
.post-body .duo .yes > b { color: var(--ok); }
.post-body .duo .no > b { color: var(--bad); }
.post-body .duo .yes > b::before { background-color: var(--ok); }
.post-body .duo .no > b::before {
  background: var(--bad) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.post-body .duo .yes li::before { background: var(--ok); }
.post-body .duo .no li::before { background: var(--bad); }

/* week planner: training day = solid green, light activity = green tint, rest = plain */
.post-body .week .day { border-radius: 4px; }
.post-body .week .day.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.post-body .week .day.lite { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ink); }
.post-body .week-legend span::before { border-radius: 2px; }
.post-body .week-legend .on::before { background: var(--ok); border-color: var(--ok); }
.post-body .week-legend .lite::before { background: var(--ok-bg); border-color: var(--ok-line); }

/* tables: rules only, no tinted pill header */
.post-body .compare thead th { background: transparent; border-bottom: 2px solid var(--ink); border-radius: 0 !important; }
.post-body .compare tbody tr:nth-child(even) > * { background: transparent; }
.post-body .compare th, .post-body .compare td { border-bottom-color: var(--rule); }

/* steps: plain numbers on a thin line */
.post-body .steps li::before { background: transparent; border: 0; border-radius: 0; width: 42px; height: auto; place-items: start; font-size: 22px; font-weight: 500; color: var(--ink); }
.post-body .steps li:not(:last-child)::after { left: 12px; top: 34px; background: var(--rule); }

/* callout: a left rule, no round "i" badge */
.post-body .callout { background: transparent; border-left: 3px solid var(--ink); border-radius: 0; padding: 4px 0 4px 20px; }
.post-body .callout::before { content: none; }

/* citations and reading progress: flat */
.post-body sup.cite a { border-radius: 3px; background: #EFE6DB; }
.post-body .sources { background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; padding: 16px 0 0; }
.post-body .sources li::before { border-radius: 2px; }
@supports (animation-timeline: scroll()) { body:has(.post-body)::before { background: var(--ink); height: 2px; } }

/* phones: larger reading text, tighter figure spacing */
@media (max-width: 520px) {
  .post-body { font-size: 17px; line-height: 1.7; }
  .post-body .bars li { font-size: 15px; }
  .post-body .viz figcaption { font-size: 16.5px; }
}
