/* Guides: direction d4 "Listen" on reading pages. Linked only from /guides/ pages; every colour is one of the site's
   own tokens, so the two looks follow the site. Sizes are the short scale (15, 18, 22, 28, 36 px) times the Reading
   text size. Words are --ink on --bg, --panel or --accent-soft (each 12:1 or more); --accent is for edges and drawing. */
.pg-guides { background: var(--bg); color: var(--ink); font-family: var(--ui); }
.pg-guides .lay { display: block; max-width: 760px; margin: 0 auto; padding: 28px 24px 72px; }
.pg-guides main { min-width: 0; padding-top: 0; }
.pg-guides .guide { font-size: calc(18px * var(--text-scale, 1)); line-height: 1.6; }

.pg-guides h1, .pg-guides h2, .pg-guides h3 { display: block; font-family: var(--ui); color: var(--ink); line-height: 1.2; letter-spacing: -.015em; overflow-wrap: anywhere; border: 0; padding: 0; }
.pg-guides h1 { font-size: calc(36px * var(--text-scale, 1)); font-weight: 700; margin: 8px 0 16px; }
.pg-guides h2 { font-size: calc(28px * var(--text-scale, 1)); font-weight: 700; margin: 56px 0 16px; scroll-margin-top: 88px; }
.pg-guides h3 { font-size: calc(22px * var(--text-scale, 1)); font-weight: 700; margin: 0 0 12px; }
.pg-guides p, .pg-guides li { color: var(--ink); font-size: calc(18px * var(--text-scale, 1)); overflow-wrap: anywhere; }
.pg-guides p { margin: 16px 0; }
.pg-guides .guide-lead { font-size: calc(22px * var(--text-scale, 1)); line-height: 1.45; margin: 0 0 8px; }

.pg-guides a { color: var(--ink); text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .18em; }
.pg-guides a:hover { text-decoration-thickness: .16em; }
.pg-guides a:focus-visible, .pg-guides pre:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* The way back and the way on: one link each, a full touch target. */
.pg-guides .guide-back { margin: 0; font-size: calc(15px * var(--text-scale, 1)); }
.pg-guides .guide-back a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
/* The way on can run to two lines on a phone: its arrow follows the last word. */
.pg-guides .guide-next a { display: inline-block; min-height: 44px; padding: 8px 0; font-weight: 600; }
.pg-guides .guide-back a { font-size: calc(15px * var(--text-scale, 1)); }
.pg-guides .guide-back a::before { content: "\2190"; content: "\2190" / ""; margin-right: 8px; }
.pg-guides .guide-next { margin: 40px 0 0; }
.pg-guides .guide-next a::after { content: "\2192"; content: "\2192" / ""; margin-left: 8px; }
.pg-guides .guide-date { margin: 40px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: calc(15px * var(--text-scale, 1)); }

/* The index: one numbered card a guide. */
.pg-guides .guide-index { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; }
.pg-guides .guide-index > li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.pg-guides .guide-n { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 22px; font-weight: 700; line-height: 1; }
.pg-guides .guide-for { margin: 0 0 4px; font-size: calc(15px * var(--text-scale, 1)); font-weight: 600; }
.pg-guides .guide-index h2 { font-size: calc(22px * var(--text-scale, 1)); margin: 0 0 2px; }
.pg-guides .guide-index h2 a { display: inline-block; min-height: 44px; padding: 8px 0 6px; }
.pg-guides .guide-card > p:last-child { margin: 0; }

/* On this page: a list of the page's parts, two columns where there is room. */
.pg-guides .guide-contents { margin: 28px 0 0; padding: 16px 20px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.pg-guides .guide-contents h2 { font-size: calc(18px * var(--text-scale, 1)); margin: 0 0 4px; }
.pg-guides .guide-contents ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.pg-guides .guide-contents a { display: flex; align-items: center; min-height: 44px; }

/* Numbered steps: the numeral in a tinted square, as the course page numbers its units. */
.pg-guides .guide-steps { list-style: none; counter-reset: guide-step; margin: 24px 0; padding: 0; display: grid; gap: 12px; }
/* A step's first line is centred on its numeral (the square's centre is 36 px down; half a line is .8em), so a
   one-line step and a long one start alike and the square keeps the same space above and below. */
.pg-guides .guide-steps > li { counter-increment: guide-step; position: relative; box-sizing: border-box; min-height: 74px; padding: calc(36px - .8em) 16px 16px 72px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.pg-guides .guide-steps > li::before { content: counter(guide-step); position: absolute; left: 16px; top: 16px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1; }
.pg-guides .guide-steps > li > a:first-child { display: block; min-height: 44px; margin-top: -8px; padding: 8px 0 6px; }

.pg-guides .guide-why { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 16px; }
.pg-guides .guide-why > li { padding-left: 16px; border-left: 4px solid var(--accent); }

/* A research finding: what was found, where to read it, and what the School does, the last in a tinted block with
   its own tag and edge so it never rests on colour alone. */
.pg-guides .finding { margin: 24px 0; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; scroll-margin-top: 88px; }
.pg-guides .finding > p { margin: 0 0 12px; }
.pg-guides .finding-source { font-size: calc(15px * var(--text-scale, 1)); }
.pg-guides .school-does { margin: 16px 0 0; padding: 14px 16px; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; }
.pg-guides .school-does p { margin: 0; }
.pg-guides .school-tag { margin: 0 0 4px; font-size: calc(15px * var(--text-scale, 1)); font-weight: 700; }

/* The spiral drawing. Its numerals are 20 units in a 260-unit box, so they stay 15 px or more down to a 320 px screen. */
.pg-guides .spiral-figure { margin: 24px 0; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.pg-guides .spiral-drawing { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; color: var(--accent); }
.pg-guides .spiral-drawing .stop { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.pg-guides .spiral-drawing text { fill: var(--ink); font-family: var(--ui); font-size: 20px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.pg-guides figcaption { margin-top: 12px; font-size: calc(15px * var(--text-scale, 1)); color: var(--ink); }

/* Files and commands: a name bar over its file, and a block that scrolls sideways so no line breaks mid-word. */
.pg-guides code { font-family: var(--mono); font-size: inherit; color: inherit; background: transparent; }
.pg-guides pre { margin: 0 0 20px; padding: 16px; overflow-x: auto; white-space: pre; font-size: calc(15px * var(--text-scale, 1)); line-height: 1.6; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.pg-guides h3.file-name { margin: 24px 0 0; padding: 10px 16px; font-family: var(--mono); font-size: calc(18px * var(--text-scale, 1)); font-weight: 600; letter-spacing: 0; background: var(--accent-soft); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.pg-guides h3.file-name + pre { border-radius: 0 0 12px 12px; }

/* The site's header and foot on these pages: words at the floor's contrast, control edges at 4.5:1. */
.pg-guides .top { flex-wrap: nowrap; color: var(--ink); background: var(--bg); }
.pg-guides .top button { font-size: 15px; color: var(--ink); border-color: currentColor; }
.pg-guides .top-tools .ico { font-family: var(--ui); font-size: 18px; }
.pg-guides .brand { font-family: var(--ui); font-size: calc(18px * var(--text-scale, 1)); }
.pg-guides .foot, .pg-guides .foot p, .pg-guides .foot a { color: var(--ink); font-size: 15px; }

@media (max-width: 600px) {
  .pg-guides .lay { padding: 20px 20px 48px; }
  .pg-guides h1 { font-size: calc(28px * var(--text-scale, 1)); }
  .pg-guides h2 { font-size: calc(22px * var(--text-scale, 1)); margin-top: 44px; }
  .pg-guides .guide-lead { font-size: calc(18px * var(--text-scale, 1)); }
  .pg-guides .guide-contents ol { grid-template-columns: minmax(0, 1fr); }
  .pg-guides .guide-index > li { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .pg-guides .guide-n { width: 40px; height: 40px; font-size: 18px; }
  .pg-guides .finding { padding: 16px; }
  .pg-guides .guide-steps > li { min-height: 70px; padding: calc(34px - .8em) 14px 14px 64px; }
  .pg-guides .guide-steps > li::before { left: 12px; top: 14px; }
}
@media (forced-colors: active) {
  .pg-guides { color: CanvasText; background: Canvas; }
  .pg-guides a { color: LinkText; }
  .pg-guides .spiral-drawing { color: CanvasText; }
  .pg-guides .spiral-drawing .stop { fill: Canvas; stroke: CanvasText; }
  .pg-guides .spiral-drawing text { fill: CanvasText; }
  .pg-guides .guide-n, .pg-guides .guide-steps > li::before { border: 1px solid CanvasText; }
}
