/* Reference guide pages (/guides). Loaded after site.css, before nothing.
   site.css supplies the palette, chrome and the web-interface baseline; this file
   is only the reading layout. Generated pages carry no <style> of their own. */

main{flex:1;padding:2.2rem 0 3.5rem}

.crumbs{font-family:ui-monospace,"Cascadia Code",Consolas,Menlo,monospace;
  font-size:.75rem;color:var(--ink-soft);margin:0 0 1.4rem}
.crumbs a{text-decoration:none}
.crumbs a:hover{text-decoration:underline}
.crumbs span[aria-hidden]{padding:0 .35rem;color:var(--line)}

h1{font-size:clamp(1.9rem,4vw,2.6rem);margin:0 0 .6em}
.lede{font-size:1.12rem;color:var(--ink);max-width:44rem;margin:0 0 1.8rem}

/* the fact box under the lede */
.facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));gap:1px;
  max-width:48rem;margin:0 0 2.6rem;background:var(--line);border:1px solid var(--line);
  border-radius:8px;overflow:hidden}
.facts > div{background:var(--card);padding:.9rem 1.1rem}
.facts dt{font-family:ui-monospace,"Cascadia Code",Consolas,Menlo,monospace;
  font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;color:var(--accent);
  margin:0 0 .35rem}
.facts dd{margin:0;font-size:.92rem;color:var(--ink)}

section{margin:0 0 2.6rem;max-width:48rem}
section h2{font-family:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  font-weight:600;font-size:1.3rem;margin:0 0 .7rem}
section p{margin:0 0 1rem;color:var(--ink);line-height:1.65}

code{font-family:ui-monospace,"Cascadia Code",Consolas,Menlo,monospace;font-size:.86em;
  background:var(--card);border:1px solid var(--line);border-radius:3px;padding:.08em .32em}

pre{background:#142019;border-radius:8px;padding:1rem 1.1rem;overflow-x:auto;margin:0 0 1.2rem}
/* In dark mode the page is nearly as dark as the code block, so the block stops
   reading as a raised panel. A hairline gives it its edge back. Dark is opt-in
   via [data-theme="dark"] now, same as site.css. */
[data-theme="dark"] pre{border:1px solid var(--line)}
pre code{background:none;border:0;padding:0;color:#C9E8D2;font-size:.82rem;line-height:1.7}

.cap{font-family:ui-monospace,"Cascadia Code",Consolas,Menlo,monospace;font-size:.7rem;
  letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);margin:0 0 .45rem}
.note{font-size:.92rem;color:var(--ink-soft);border-left:2px solid var(--line);
  padding-left:.9rem;margin:0}

/* reference tables. Wide content scrolls inside itself, never the page. */
.ref{display:block;overflow-x:auto;width:100%;border-collapse:collapse;margin:0 0 1.2rem;
  font-size:.9rem}
.ref th,.ref td{text-align:left;padding:.6rem .8rem;border-bottom:1px solid var(--line);
  vertical-align:top}
.ref th{font-family:ui-monospace,"Cascadia Code",Consolas,Menlo,monospace;font-size:.68rem;
  letter-spacing:.1em;text-transform:uppercase;color:var(--accent);white-space:nowrap}
.ref td:first-child{white-space:nowrap}
.ref tbody tr:last-child td{border-bottom:0}

/* hub list, and the related list at the foot of each page */
.index,.related ul{list-style:none;padding:0;margin:0;border-top:1px solid var(--line)}
.index li,.related li{padding:.85rem 0;border-bottom:1px solid var(--line)}
.index a,.related a{text-decoration:none;font-size:1.02rem}
.index a:hover,.related a:hover{text-decoration:underline}
.index span,.related span{display:block;color:var(--ink-soft);font-size:.9rem;margin-top:.2rem}
.index .tag{display:inline-block;margin-top:.4rem;font-family:ui-monospace,Consolas,monospace;
  font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft);
  border:1px solid var(--line);border-radius:99px;padding:.12rem .5rem}

.cta{max-width:48rem;background:var(--card);border:1px solid var(--line);border-radius:8px;
  padding:1.3rem 1.4rem;margin:0 0 2.6rem}
.cta h2{font-family:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  font-weight:600;font-size:1.15rem;margin:0 0 .5rem}
.cta p{margin:0 0 1rem;color:var(--ink-soft);font-size:.95rem;line-height:1.6}
.cta .go{display:inline-block;text-decoration:none;font-size:.88rem;font-weight:600;
  background:var(--accent);color:var(--on-accent);padding:.55rem 1.1rem;border-radius:5px}
.cta .go:hover{background:var(--accent-deep)}

/* Exactly four tiles wrapped 3-then-1 under auto-fit, which reads as a mistake rather than
   a layout. Four goes 2x2; three still sit in one row. Scoped above the mobile breakpoint
   because :has() outranks the plain .facts rule below and would otherwise beat it. */
@media(min-width:641px){
  .facts:has(> div:nth-child(4)){grid-template-columns:repeat(2,1fr)}
}

@media(max-width:640px){
  .facts{grid-template-columns:1fr}
  pre code{font-size:.76rem}
}
