/* reading.css — reading-first typography for articles and news feeds.
   Inspired by the reading experience of meduza.io (headline-as-summary,
   serif headlines, text-only feed) and hightech.fm (bold lead, H2 rhythm,
   full-bleed cover). Pure CSS, no framework.
   Override the tokens below per site (accent color, fonts).
   audioburo.ru: brand green #2c9831 / dark #08571e / light bg #eef8ef. */

:root {
  /* ---- tokens: change these per site ---- */
  --rd-accent: #2c9831;            /* one accent per site: bullets, CTA buttons */
  --rd-accent-dark: #08571e;       /* links and kickers (readable contrast on white) */
  --rd-accent-ink: #ffffff;        /* text on accent surfaces */
  --rd-ink: #1a1a1a;               /* body text */
  --rd-ink-2: #6b6b6b;             /* meta, captions */
  --rd-bg: #ffffff;                /* reading surface */
  --rd-bg-2: #eef8ef;              /* cards, CTA blocks */
  --rd-line: #e4e4e0;
  --rd-font-serif: "Source Serif 4", "Lora", Georgia, "Times New Roman", serif;
  --rd-font-sans: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --rd-measure: 680px;             /* text column width */
  --rd-gutter: 16px;               /* side padding on phones */
  --rd-body-size: 18px;
  --rd-body-lh: 1.6;
}

@media (min-width: 600px) {
  :root { --rd-gutter: 24px; --rd-body-size: 19px; }
}

/* ---- column ---- */
.rd-wrap {
  max-width: var(--rd-measure);
  margin: 0 auto;
  padding: 0 var(--rd-gutter);
  background: var(--rd-bg);
  color: var(--rd-ink);
  font-family: var(--rd-font-sans);
  font-size: var(--rd-body-size);
  line-height: var(--rd-body-lh);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

/* ---- article header ---- */
.rd-kicker {
  display: inline-block;
  margin: 24px 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rd-accent-dark);
  text-decoration: none;
}

.rd-title {
  margin: 0 0 16px;
  font-family: var(--rd-font-serif);
  font-size: clamp(26px, 6.5vw, 36px);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.rd-title--sans {            /* hightech-style bold sans alternative */
  font-family: var(--rd-font-sans);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.rd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--rd-ink-2);
}
.rd-meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--rd-line); }
.rd-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; background: var(--rd-bg-2);
}

/* ---- body ---- */
.rd-lead {
  font-weight: 700;
  font-size: calc(var(--rd-body-size) + 1px);
  margin: 0 0 24px;
}
.rd-body > p { margin: 0 0 1.25em; }
.rd-body h2 {
  margin: 44px 0 14px;
  font-size: clamp(22px, 5.5vw, 27px);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.rd-body h3 { margin: 32px 0 10px; font-size: 20px; font-weight: 700; }
.rd-body a { color: var(--rd-accent-dark); text-decoration: underline; text-decoration-color: var(--rd-accent); text-underline-offset: 3px; }
.rd-body strong { font-weight: 700; }

.rd-body blockquote, .rd-quote {
  margin: 28px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--rd-accent);
  font-family: var(--rd-font-serif);
  font-size: calc(var(--rd-body-size) + 1px);
  color: var(--rd-ink);
}
.rd-quote cite { display: block; margin-top: 8px; font-family: var(--rd-font-sans); font-size: 14px; font-style: normal; color: var(--rd-ink-2); }

/* bullets with an accent dot — "context" block like Meduza */
.rd-body ul, .rd-context { list-style: none; padding: 0; margin: 0 0 24px; }
.rd-body ul li, .rd-context li {
  position: relative;
  padding-left: 22px;
  margin: 0 0 14px;
}
.rd-body ul li::before, .rd-context li::before {
  content: "";
  position: absolute; left: 2px; top: .62em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rd-accent);
}
.rd-body ol { padding-left: 24px; margin: 0 0 24px; }
.rd-body ol li { margin-bottom: 10px; }

.rd-figure { margin: 28px calc(-1 * var(--rd-gutter)); }
.rd-figure img { display: block; width: 100%; height: auto; }
.rd-figure figcaption { padding: 8px var(--rd-gutter) 0; font-size: 14px; color: var(--rd-ink-2); }
@media (min-width: 720px) {
  .rd-figure { margin-left: 0; margin-right: 0; }
  .rd-figure img { border-radius: 8px; }
  .rd-figure figcaption { padding-left: 0; }
}

/* ---- feed (list page) ---- */
.rd-h1 { margin: 28px 0 6px; font-family: var(--rd-font-serif); font-size: clamp(28px, 7vw, 38px); line-height: 1.15; font-weight: 600; }
.rd-intro { margin: 0 0 8px; font-size: 16px; color: var(--rd-ink-2); }
.rd-tabs { display: flex; gap: 22px; margin: 20px 0 8px; border-bottom: 1px solid var(--rd-line); overflow-x: auto; }
.rd-tabs a {
  padding: 10px 0; font-size: 13px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--rd-ink-2); text-decoration: none; white-space: nowrap;
}
.rd-tabs a[aria-current="page"] { color: var(--rd-accent-dark); border-bottom: 2px solid var(--rd-accent); }

.rd-feed { list-style: none; padding: 0; margin: 0; }
.rd-feed-item { padding: 24px 0; border-bottom: 1px solid var(--rd-line); }
/* category + "N дней назад" come from data-meta: the <li> markup must stay
   parseable by article-factory (<li><a><strong>title</strong></a><span>desc</span></li>) */
.rd-feed-item[data-meta]::before {
  content: attr(data-meta);
  display: block; margin: 0 0 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rd-accent-dark);
}
.rd-feed-item a { color: inherit; text-decoration: none; }
.rd-feed-item a strong, .rd-feed-item h2 {
  display: block;
  margin: 0 0 8px;
  font-family: var(--rd-font-serif);
  font-size: clamp(21px, 5.6vw, 26px);
  line-height: 1.22; font-weight: 600; letter-spacing: -0.01em;
}
.rd-feed-item a:hover strong { color: var(--rd-accent-dark); }
.rd-feed-desc { display: block; font-size: 16px; line-height: 1.5; color: var(--rd-ink-2); }
.rd-feed-item time, .rd-feed-item .rd-feed-kicker { font-size: 14px; color: var(--rd-ink-2); }
.rd-feed-kicker { color: var(--rd-accent-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; margin-right: 10px; }

/* related list — hightech style: category label */
.rd-related { margin: 48px 0 24px; }
.rd-related h2 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--rd-ink-2); margin: 0 0 14px; }
.rd-related ul { list-style: none; padding: 0; margin: 0; }
.rd-related li { padding: 14px 0; border-top: 1px solid var(--rd-line); }
.rd-related a { color: inherit; text-decoration: none; font-weight: 700; font-size: 17px; line-height: 1.3; }
.rd-related a:hover { color: var(--rd-accent-dark); }
.rd-related .rd-feed-kicker { display: block; margin: 6px 0 0; }

/* ---- lead capture ---- */
.rd-cta {
  margin: 36px calc(-1 * var(--rd-gutter));
  padding: 24px var(--rd-gutter);
  background: var(--rd-bg-2);
}
@media (min-width: 720px) { .rd-cta { margin-left: 0; margin-right: 0; border-radius: 12px; } }
.rd-cta h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.rd-cta p { margin: 0 0 16px; font-size: 16px; color: #4a5a4c; }
.rd-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.rd-form { display: grid; gap: 10px; position: relative; }
.rd-form input, .rd-form textarea {
  width: 100%; box-sizing: border-box;
  padding: 13px 14px; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
  border: 1px solid #cfe3d1; border-radius: 10px; background: var(--rd-bg); color: var(--rd-ink);
}
.rd-form textarea { min-height: 88px; resize: vertical; }
.rd-form input:focus, .rd-form textarea:focus { outline: 2px solid var(--rd-accent); outline-offset: 1px; border-color: transparent; }
.rd-form .rd-hp { position: absolute; left: -9999px; }  /* honeypot: hidden from humans */
.rd-form small { font-size: 13px; color: var(--rd-ink-2); }
.rd-form small a { color: var(--rd-accent-dark); }
.rd-form .rd-error { font-size: 14px; color: #c0392b; }

.rd-btn {
  display: inline-flex; justify-content: center; align-items: center;
  min-height: 48px; padding: 0 22px; box-sizing: border-box;
  font: inherit; font-size: 16px; font-weight: 700;
  color: var(--rd-accent-ink); background: var(--rd-accent);
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
}
.rd-btn:hover { background: var(--rd-accent-dark); }
.rd-btn--ghost { background: transparent; color: var(--rd-accent-dark); border: 1.5px solid var(--rd-accent); }
.rd-btn--ghost:hover { background: var(--rd-accent); color: var(--rd-accent-ink); }
.rd-btn[disabled] { opacity: .6; cursor: progress; }

.rd-thanks { padding: 8px 0; font-weight: 700; }

/* sticky bottom bar on phones, appears after scrolling (lead.js toggles .is-on) */
.rd-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px var(--rd-gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--rd-bg); border-top: 1px solid var(--rd-line);
  box-shadow: 0 -6px 24px rgba(0,0,0,.06);
  transform: translateY(110%); transition: transform .25s ease;
}
.rd-bar.is-on { transform: translateY(0); }
.rd-bar span { font-size: 15px; font-weight: 700; line-height: 1.3; }
.rd-bar .rd-btn { flex-shrink: 0; min-height: 44px; padding: 0 18px; }
@media (min-width: 900px) { .rd-bar { display: none; } }
.rd-bar-spacer { height: 84px; }

/* ---- dark mode (optional; respects system setting) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --rd-ink: #ececec; --rd-ink-2: #9a9a9a; --rd-accent-dark: #61c93e;
    --rd-bg: #121212; --rd-bg-2: #1b241c; --rd-line: #2a2a2a;
  }
  :root:not([data-theme="light"]) .rd-cta p { color: #b5c4b7; }
  :root:not([data-theme="light"]) .rd-form input, :root:not([data-theme="light"]) .rd-form textarea { border-color: #2f4431; }
}
:root[data-theme="dark"] {
  --rd-ink: #ececec; --rd-ink-2: #9a9a9a; --rd-accent-dark: #61c93e;
  --rd-bg: #121212; --rd-bg-2: #1b241c; --rd-line: #2a2a2a;
}

/* ---- audioburo.ru: site chrome for reading pages (header / footer) ---- */
.rd-page { margin: 0; background: var(--rd-bg); color: var(--rd-ink); font-family: var(--rd-font-sans); overflow-x: hidden; }
.rd-site { border-bottom: 1px solid var(--rd-line); background: var(--rd-bg); }
.rd-site-in {
  max-width: var(--rd-measure); margin: 0 auto; padding: 0 var(--rd-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 4px 18px; min-height: 56px; flex-wrap: wrap;
}
.rd-wordmark { font-family: var(--rd-font-serif); font-weight: 700; font-size: 22px; letter-spacing: .02em; color: var(--rd-accent-dark); text-decoration: none; }
.rd-site-nav { margin: 0; border: 0; gap: 16px; order: 3; width: 100%; }
@media (min-width: 720px) { .rd-site-nav { order: 0; width: auto; } }
.rd-site-tg { min-height: 36px; padding: 0 14px; font-size: 14px; }
.rd-footer { margin-top: 48px; padding: 28px 0 36px; border-top: 1px solid var(--rd-line); font-size: 15px; color: var(--rd-ink-2); line-height: 1.7; }
.rd-footer a { color: inherit; }
.rd-footer-cols { display: grid; gap: 20px; grid-template-columns: 1fr; width: 100%; }
@media (min-width: 720px) { .rd-footer-cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.rd-archive { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.rd-archive li { padding: 8px 0; border-top: 1px solid var(--rd-line); }
.rd-archive a { color: var(--rd-ink-2); font-weight: 500; text-decoration: none; }
.rd-body pre { margin: 0 0 24px; padding: 14px 16px; background: var(--rd-bg-2); border-radius: 8px; overflow-x: auto; font-size: 15px; line-height: 1.5; }
.rd-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.rd-body img { display: block; width: 100%; height: auto; margin: 8px 0 4px; border-radius: 8px; background: var(--rd-bg-2); }
.rd-figure img { aspect-ratio: 16 / 9; object-fit: cover; background: var(--rd-bg-2); }
.rd-audio { margin: -6px 0 28px; padding: 14px 16px; border-radius: 12px; background: var(--rd-bg-2); }
.rd-audio-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 10px; font-size: 15px; }
.rd-audio-head span { color: var(--rd-ink-2); font-size: 14px; }
.rd-audio-head a { margin-left: auto; color: var(--rd-accent-dark); font-size: 14px; font-weight: 700; }
.rd-audio audio { display: block; width: 100%; height: 40px; }
.rd-video { margin: 28px calc(-1 * var(--rd-gutter)); }
.rd-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0d1a10; }
.rd-video figcaption { padding: 8px var(--rd-gutter) 0; font-size: 14px; color: var(--rd-ink-2); }
@media (min-width: 720px) { .rd-video { margin-left: 0; margin-right: 0; } .rd-video video { border-radius: 10px; } .rd-video figcaption { padding-left: 0; } }
