/*
Theme Name: Astra Child (Меридиан)
Theme URI: https://china-medicine.ru/
Template: astra
Author: China-Medicine.ru
Description: Дочерняя тема Astra для проекта "Меридиан" — цвета, шрифты и базовые токены перенесены из wp-content/_migration-reference/site/src/styles/global.css (Astro-версия), без восстановления по памяти.
Version: 0.1.0
Text Domain: astra-child
*/

/* ---------------------------------------------------------------
   Design tokens "Меридиан" — 1:1 перенос из _migration-reference/
   site/src/styles/global.css. Источник правды — тот файл, не этот
   комментарий: если токены разойдутся, чинить нужно там и досюда.
   ------------------------------------------------------------- */
:root {
  --paper: #EEF1EC;
  --paper-card: #F8F7F2;
  --ink: #1F2A33;
  --ink-soft: #445059;
  --seal: #B23A2E;
  --seal-dark: #8C2C22;
  --jade: #3F6355;
  --jade-soft: #E4EBE6;
  --slate: #6B7A80;
  --gold: #B08D4F;
  --line: rgba(31, 42, 51, 0.14);
  --font-display: 'PT Serif', Georgia, 'Noto Serif', serif;
  --font-body: 'Segoe UI', -apple-system, 'PT Sans', Roboto, sans-serif;
  --font-mono: 'Consolas', 'SF Mono', 'JetBrains Mono', monospace;
}

:root[data-theme="dark"] {
  --paper: #161D22;
  --paper-card: #1D262C;
  --ink: #EDEFEA;
  --ink-soft: #B9C3C6;
  --line: rgba(237, 239, 234, 0.14);
  --jade-soft: rgba(63, 99, 85, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161D22;
    --paper-card: #1D262C;
    --ink: #EDEFEA;
    --ink-soft: #B9C3C6;
    --line: rgba(237, 239, 234, 0.14);
    --jade-soft: rgba(63, 99, 85, 0.28);
  }
}

/* ---------------------------------------------------------------
   Base resets + shared primitives — same 1:1 port as above.
   ------------------------------------------------------------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* 2026-07-19 bg-audit finding: this rule has never actually painted
   anywhere — Astra assigns its OWN container-layout class to <body>
   per template (ast-separate-container on archives/singles/404,
   ast-plain-container on WordPress "Page" post types), and each of
   THOSE classes carries its own background-color at class-selector
   specificity (0,1,0), which beats this plain `body{}` rule (0,0,1)
   regardless of load order. Site-wide the winning color has always
   been Astra's own --ast-global-color-5 (#F0F5FA) via
   .ast-separate-container — NOT this rule's var(--paper) (#EEF1EC),
   which is dead code in practice. That mismatch is tracked as tech debt
   (see project memory), out of scope for this fix.
   The only 3 templates on .ast-plain-container (kontakty + the 2 legal
   pages) instead got Astra's --ast-global-color-4 (#FFFFFF) — a visible
   off-white-vs-white mismatch the user's audit caught. Overriding
   ast-plain-container's own background directly (not touching the
   body{} rule above) is the targeted, minimal fix: matches those 3
   pages to the color already showing everywhere else, without touching
   the other 69 pages' actual (Astra-sourced) background at all. */
body.ast-plain-container { background-color: #F0F5FA; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; }

/* Sitewide type scale (2026-07-18 consistency audit). H1 36px/1.4 was
   previously inherited silently from the Astra parent theme — declared
   here explicitly so the scale is owned by the child theme, not an
   accident of the parent's defaults. Same desktop values as before.
   The ONE approved exception: .hero h1 on the homepage (34px/1.1) —
   that's a banner composition, not a document title (see its rule in
   components.css).
   The mobile step below is NOT optional: the bare 36px rule overrode
   Astra's own responsive h1 downscale, and single long medical words
   («Эндопротезирование», «конфиденциальности») stopped fitting a 375px
   viewport — caught as 3 new page overflows in the post-change
   regression. 28px is the widest size at which the longest such word
   fits the mobile hero padding with margin; the homepage hero has its
   own 25px mobile rule and is unaffected. */
h1 { font-size: 36px; line-height: 1.4; }
@media (max-width: 640px) {
  h1 { font-size: 28px; line-height: 1.25; }
}

.page-shell {
  max-width: 920px;
  margin: 0 auto;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section { padding: 26px 40px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: none; }
/* 26px — the unified inner-page section-heading size (2026-07-18
   consistency audit, user-picked compromise): the old 22px was too far
   from the homepage's 30px to read as one site, while 30px itself
   overwhelms the narrow 70ch reading column. The homepage keeps 30px
   via its own body.home override (wide bands carry a larger scale).
   margin-bottom 32px = the sitewide "heading → its own content" rule
   (same as home/archives); body.page adds 80px above on legal/kontakty. */
.section h2 { font-size: 26px; margin: 0 0 32px; }
@media (max-width: 640px) {
  /* Mirrors home's own mobile downscale (30px → 24px there). */
  .section h2 { font-size: 22px; }
}
.section p { margin: 0 0 12px; max-width: 70ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--jade);
  margin: 0 0 8px;
  display: block;
}

.note {
  font-size: 12.5px;
  color: var(--slate);
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 10px;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate);
  padding: 18px 40px 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.crumb b { color: var(--ink); }
.crumb .sep { opacity: .5; }
.crumb a { text-decoration: none; border-bottom: 2px solid var(--jade); color: inherit; }

@media (max-width: 640px) {
  .section, .crumb { padding-left: 16px; padding-right: 16px; }
}
