/* css/guides.css — typography for the static guide pages (guides/*.html).
   Loaded AFTER css/site.css, which owns the header/footer chrome. Palette is
   the game's: near-black green background, bone text, mossy line, bright green
   accent. */

.guide-page {
  background: var(--site-bg);
  color: var(--site-text);
  font-family: "PixootPixel", "Courier New", ui-monospace, "Segoe UI Mono", monospace;
  /* Crisp grid (ONE FONT EVERYWHERE): 10px base = PixootPixel's native
     bitmap scale (font-size/10). Prose-bearing text inherits this and
     steps to 20px at ≥900px (media block at the bottom): 10px prose in
     the 760px column would measure ~119 chars/line, 20px measures ~59. */
  font-size: 10px;
  line-height: 1.7;
  margin: 0;
  -webkit-text-size-adjust: 100%;
}

/* ---------- breadcrumb ---------- */
.crumbs {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 1.5rem 0;
  /* 0.78rem = 12.48px → ≤14 band → 10. */
  font-size: 10px;
  color: var(--site-dim);
  letter-spacing: 0.4px;
}

.crumbs a {
  color: var(--site-link);
  text-decoration: none;
}

.crumbs a:hover,
.crumbs a:focus {
  text-decoration: underline;
}

/* ---------- main typography ---------- */
.guide-page main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 2rem;
}

.guide-page h1 {
  /* Fixed 20px + a 30px step at ≥900px: both are PixootPixel multiples of
     10, so the (often two-line) page title stays crisp at every width.
     The old clamp(1.25rem, 4.6vw, 1.875rem) only landed crisp at its two
     ends and slid through soft sizes in between. */
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0.5px;
  color: var(--site-accent);
  margin: 0.6rem 0 0.8rem;
}

.guide-page h2 {
  /* clamp(1.02rem…1.25rem) = 16.3 → 20px: only the top end was crisp.
     16–19 band → 20, fixed at every width (the accent border + margin
     carry the hierarchy, not size). */
  font-size: 20px;
  line-height: 1.35;
  color: var(--site-text);
  border-left: 4px solid var(--site-accent);
  padding-left: 0.6rem;
  margin: 2.2rem 0 0.7rem;
}

.guide-page h3 {
  /* Explicit, because the HTML UA sheet gives every h3 its OWN 1.17em
     (11.7 / 23.4px here) — inheritance from the prose rung never applies
     to headings. 10px base, 20px at ≥900. The old 0.98rem sat within 4%
     of the paragraph; the link colour is the real distinction. */
  font-size: 10px;
  color: var(--site-link);
  margin: 1.5rem 0 0.5rem;
}

.guide-page p {
  /* No font-size: inherits the prose rung (10px base, 20px ≥900) — the old
     0.94rem (15.04px) was soft at every width. */
  margin: 0 0 1rem;
}

.guide-page .lede {
  /* No font-size: inherits the prose rung (10px base, 20px ≥900). The old
     1.02rem (16.32px) was within 8% of the paragraph — the dim colour and
     the rule under it are the intro's identity, not size. */
  line-height: 1.65;
  color: var(--site-dim);
  border-bottom: 1px solid var(--site-line);
  padding-bottom: 1.1rem;
  margin-bottom: 0.4rem;
}

.guide-page a {
  color: var(--site-link);
  text-decoration: none;
  border-bottom: 1px solid rgba(126, 230, 154, 0.35);
}

.guide-page a:hover,
.guide-page a:focus {
  color: var(--site-accent);
  border-bottom-color: var(--site-accent);
}

.guide-page ul,
.guide-page ol {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
  /* No font-size: inherits the prose rung (10px base, 20px ≥900). */
}

.guide-page li {
  margin-bottom: 0.45rem;
}

.guide-page li::marker {
  color: var(--site-accent);
}

.guide-page strong,
.guide-page b {
  color: #fff6d8;
  font-weight: 700;
}

/* The UA sheet sizes sup/sub `smaller` (0.833× → 8.33 / 16.67px, off the
   grid). Pin them to the prose rung (1em = 10px → 20px at ≥900); the
   raised / lowered baseline keeps the footnote look. */
.guide-page sup,
.guide-page sub {
  font-size: 1em;
}

.guide-page code,
.guide-page kbd {
  background: var(--site-panel);
  border: 1px solid var(--site-line);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  /* No font-size: the old 0.88em resolved to a soft fraction of a soft
     parent (8.8 / 13.2 / 17.6px). Inline code now inherits the crisp prose
     rung exactly; the panel background + border carry the distinction. */
  /* ONE FONT EVERYWHERE: the UA sheet pins code/kbd to the smooth system
     monospace (an author rule is required to beat it) — inherit the page's
     PixootPixel stack instead; the advance is the same 0.6em so widths and
     wrapping are unchanged. */
  font-family: inherit;
  color: #d8f5c6;
}

/* ---------- tables ---------- */
.guide-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.3rem;
  /* 0.85rem (13.6px) → ≤14 band → 10. Tables stay 10px at EVERY width:
     reference data reads compact, and the ≤560 bestiary fit (below) only
     gets more slack from the narrower glyphs. */
  font-size: 10px;
  border: 1px solid var(--site-line);
}

.guide-page th,
.guide-page td {
  border: 1px solid var(--site-line);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.guide-page th {
  background: var(--site-panel);
  color: var(--site-accent);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.guide-page td {
  color: var(--site-text);
}

.guide-page tbody tr:nth-child(even) td {
  background: rgba(16, 24, 12, 0.55);
}

/* ---------- next-guide row + related list ---------- */
.next-guide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2rem 0 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--site-panel);
  border: 1px solid var(--site-line);
  border-left: 4px solid var(--site-accent);
  /* No font-size: inherits the prose rung (10px base, 20px ≥900). */
}

.next-guide .next-label {
  color: var(--site-dim);
  letter-spacing: 1px;
  /* 0.74rem (11.84px) → ≤14 band → 10. A kicker stays 10 at every width. */
  font-size: 10px;
  text-transform: uppercase;
}

.next-guide a {
  border-bottom: none;
  color: var(--site-accent);
  font-weight: 700;
}

.related {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--site-line);
}

.related h2,
.related h3 {
  border-left: none;
  padding-left: 0;
  /* 1rem = 16px → 16–19 band → 20: the heading rung at both widths. */
  font-size: 20px;
  color: var(--site-dim);
  margin-top: 0;
}

.related ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.related li {
  margin-bottom: 0.5rem;
}

@media (max-width: 560px) {
  .crumbs,
  .guide-page main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Data tables on a 360px phone: 1rem main padding leaves 328px of content,
     and the widest table (the bestiary BOSS table) had a min-content of ~366px
     against the 0.78rem face — cell padding + the text pushed it right and
     dragged the whole page sideways (scrollWidth 383 at a 360 viewport).
     Round 1 trimmed both. This sweep then snapped the table face to a flat
     10px (was 0.74rem = 11.84px here, 0.85rem = 13.6px above 560), so the
     text is now ~16% narrower than the size that was proven to fit — keep
     the padding trim: it is still what leaves breathing room, and the fit
     only got more slack. */
  .guide-page th,
  .guide-page td {
    padding: 0.4rem 0.35rem;
  }
}

/* ---------- desktop step (crisp grid) ----------
   ONE FONT EVERYWHERE: 10px is the base rung; the prose rung steps to
   20px at ≥900px and the h1 to 30px — both multiples of 10, so every
   rendered size stays on PixootPixel's bitmap grid. Everything without
   an explicit font-size above (p, li, lede, h3, inline code/kbd,
   .next-guide) rides this inherited step; tables, breadcrumbs, the
   next-label kicker and the site chrome deliberately stay 10px. */
@media (min-width: 900px) {
  .guide-page {
    font-size: 20px;
  }
  .guide-page h1 {
    font-size: 30px;
  }
  .guide-page h3 {
    font-size: 20px;
  }
}
