/* Shared by the two atlas pages, /map and /books. Site tokens from questions.css.
   Light: warm paper, one accent (oxblood) for action. Dark: the same roles on the chapel tones. */
:root{
  --card:        oklch(98.8% 0.008 84);
  --water:       oklch(89% 0.025 225);
  --water-ink:   oklch(47% 0.055 230);
  --land:        var(--paper-2);
  --r-card:      20px;
  --shadow-card: 0 1px 0 rgba(60,40,20,.05), 0 30px 60px -36px rgba(60,40,20,.38);
  --shadow-pill: 0 1px 0 rgba(60,40,20,.06), 0 10px 20px -12px rgba(60,40,20,.4);
}
@media (prefers-color-scheme: dark){
  html.atlas{
    color-scheme:dark;
    --paper:      oklch(19% 0.018 55);
    --paper-2:    oklch(22.5% 0.02 55);
    --paper-3:    oklch(26% 0.02 55);
    --card:       oklch(23.5% 0.02 55);
    --rule:       oklch(32% 0.02 55);
    --rule-2:     oklch(44% 0.022 60);
    --ink:        oklch(94% 0.02 80);
    --ink-2:      oklch(84% 0.02 78);
    --muted:      oklch(72% 0.02 75);
    --ox:         #F1AA92;
    --ox-deep:    oklch(86% 0.07 45);
    --gold-deep:  oklch(78% 0.12 75);
    --water:      oklch(29% 0.035 235);
    --water-ink:  oklch(74% 0.05 230);
    --land:       oklch(24% 0.02 55);
    --shadow-paper: 0 1px 0 rgba(0,0,0,.3), 0 24px 48px -28px rgba(0,0,0,.7);
    --shadow-card:  0 1px 0 rgba(0,0,0,.3), 0 30px 60px -36px rgba(0,0,0,.8);
    --shadow-pill:  0 1px 0 rgba(0,0,0,.3), 0 10px 20px -12px rgba(0,0,0,.8);
  }
  html.atlas .btn.solid{box-shadow:none}
}

.ico{width:18px; height:18px; flex:none}

/* hero */
.atlas-hero{border-bottom:0; padding:clamp(28px,4.5vw,64px) 0 clamp(20px,3vw,36px)}
.atlas-hero .wrap{gap:clamp(16px,2vw,22px)}
.atlas-hero h1{font-size:clamp(44px,6.4vw,84px); max-width:16ch}
.atlas-hero .lede{max-width:60ch}

/* the two pages, side by side */
.switch{justify-self:start; display:inline-grid; grid-auto-flow:column; gap:4px; padding:4px; max-width:100%;
  border-radius:999px; background:var(--paper-2); border:1px solid var(--rule); margin-bottom:clamp(8px,1.5vw,18px)}
.switch a{display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:6px 18px; border-radius:999px;
  font:600 14px/1.2 var(--f-body); color:var(--ink-2); text-decoration:none; transition:color .18s, background .18s}
.switch a:hover{color:var(--ox)}
.switch a[aria-current="page"]{background:var(--card); color:var(--ox); box-shadow:var(--shadow-pill)}
.switch a:focus-visible,.tile:focus-visible,.tl a:focus-visible,.back a:focus-visible{outline:3px solid var(--gold-deep); outline-offset:2px}
@media (max-width:560px){
  .switch{display:grid; grid-template-columns:1fr 1fr; width:100%; border-radius:28px}
  .switch a{padding:6px 12px 6px 14px; border-radius:24px; font-size:13.5px}
}

/* small numbers under the hero */
.stats{list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:8px}
.stats li{display:inline-flex; align-items:baseline; gap:7px; padding:7px 14px; border-radius:999px; border:1px solid var(--rule);
  background:var(--card); font:600 11px/1.4 var(--f-mono); letter-spacing:.12em; text-transform:uppercase; color:var(--ink-2)}
.stats b{font:400 22px/1 var(--f-display); letter-spacing:0; color:var(--ox)}

/* a list of teachings */
.ref{font:500 12px/1.6 var(--f-mono); color:var(--muted); letter-spacing:.02em}
.tl{list-style:none; margin:4px 0 0; padding:0; display:grid; gap:8px}
.tl a{display:flex; gap:12px; align-items:flex-start; min-height:44px; padding:11px 14px; border-radius:12px; border:1px solid var(--rule);
  background:var(--paper); color:var(--ink); text-decoration:none; line-height:1.4; transition:border-color .18s, background .18s, transform .18s var(--ease-out)}
.tl a:hover{border-color:var(--ox); background:var(--paper-2); transform:translateY(-1px)}
.k-n{display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 4px; border-radius:9px; background:var(--ox); color:var(--paper); font-weight:600}

@media (prefers-reduced-motion: reduce){
  .switch a,.tl a{transition:none}
  .tl a:hover{transform:none}
}

/* a teaching that has no page in this language */
.lang-note{color:var(--ink-2); font-size:.85em}
/* Right to left (Arabic): tracked caps would pull joined letters apart */
[dir="rtl"] .stats li,[dir="rtl"] .tile .ct,[dir="rtl"] .back a,[dir="rtl"] .grp h2,[dir="rtl"] .also,[dir="rtl"] .book .v,[dir="rtl"] .ref,
[dir="rtl"] .chip .anc,[dir="rtl"] .tl .set,[dir="rtl"] .sources summary,[dir="rtl"] .map-key,[dir="rtl"] .region,[dir="rtl"] .iref text{letter-spacing:0}

/* three pages side by side on wide screens; the third wraps under the first two on a phone */
@media (max-width:560px){ .switch:has(a:nth-child(3)){grid-auto-flow:row} .switch a:nth-child(3):last-child{grid-column:1 / -1; justify-content:center} }
@media (min-width:561px) and (max-width:900px){ .switch{grid-auto-flow:row; grid-template-columns:auto auto; border-radius:28px} .switch a:nth-child(3):last-child{grid-column:1 / -1; justify-content:center} }
/* four pages: one row when there is room for it, two by two otherwise. In a hero that shares its width with a picture
   (.fam-hero: the family tree, the people) there is never room for four in a row. */
@media (min-width:901px) and (max-width:1180px){ .switch:has(a:nth-child(4)){grid-auto-flow:row; grid-template-columns:auto auto; border-radius:28px} }
@media (min-width:561px){ .fam-hero .switch:has(a:nth-child(4)){grid-auto-flow:row; grid-template-columns:auto auto; border-radius:28px} }
