/* Atlas de Angra dos Reis · one-page web atlas v0.2 (staging). Editorial cartographic style.
   Fonts: Fraunces (display), Source Serif 4 (text), Source Sans 3 (UI, labels, charts). All vendored (SIL OFL). */
@font-face { font-family: "Fraunces"; src: url("../../vendor/fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../../vendor/fonts/fraunces-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../../vendor/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: optional; }
@font-face { font-family: "Source Serif 4"; src: url("../../vendor/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../../vendor/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }

:root {
  --paper: #f3eee3; --paper-2: #ebe4d4; --paper-3: #e2d9c4;
  --ink: #1f2421;      /* 14.6:1 on paper */
  --ink-2: #4d534d;    /* 7.2:1 */
  --rule: #cfc6b2; --grid: #ddd5c4;
  --sea: #c9d6d3; --deep: #0b3c5d; --forest: #2e5e3a;
  --terra: #c4643c; --terra-ink: #96401f; --gold: #e3b23c; --azul: #2f5aa8;
  --serif-d: "Fraunces", Georgia, serif;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --spine-h: 3.25rem; --thumb-w: 2.6rem;
  --story-w: min(38rem, 40vw);
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* z-index scale */
  --z-map: 1; --z-over: 10; --z-card: 20; --z-nav: 30; --z-spine: 40; --z-tip: 50;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--spine-h) + 1rem); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.62 var(--serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html[data-lang="pt"] [lang="en"]:not(html) { display: none !important; }
html[data-lang="en"] [lang="pt"]:not(html) { display: none !important; }
a { color: var(--terra-ink); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
button { font-family: var(--sans); cursor: pointer; color: inherit; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .4rem; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 100; font-family: var(--sans); }
.skip:focus { left: .5rem; }

/* ---------------------------------------------------------------- spine (masthead) */
.spine { position: fixed; inset: 0 0 auto 0; height: var(--spine-h); z-index: var(--z-spine); display: flex; align-items: center; gap: 1.2rem;
  padding: 0 1rem 0 calc(var(--thumb-w) + 1rem); background: var(--paper); border-bottom: 1px solid var(--ink); box-shadow: 0 3px 0 -1px var(--paper), 0 4px 0 -1px var(--ink); }
.spine .mark { display: flex; align-items: baseline; gap: .7rem; text-decoration: none; color: var(--ink); min-width: 0; }
.spine .t1 { font: 600 1.12rem/1 var(--serif-d); letter-spacing: .005em; white-space: nowrap; }
.spine .t2 { font: italic 400 1rem/1 var(--serif-d); color: var(--terra-ink); white-space: nowrap; }
.spine .ed { margin-left: auto; font: 600 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.spine .ed::before { content: ""; display: inline-block; width: .55rem; height: .55rem; background: var(--gold); margin-right: .45rem; vertical-align: 0; }
.lang { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 2px; overflow: hidden; flex: none; }
.lang button { font: 700 .78rem var(--sans); letter-spacing: .06em; background: transparent; border: 0; min-width: 2.6rem; min-height: 2rem; padding: 0 .55rem; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- thumb index */
.thumbs { position: fixed; left: 0; top: var(--spine-h); bottom: 0; width: var(--thumb-w); z-index: var(--z-nav); display: flex; flex-direction: column;
  justify-content: center; gap: 3px; background: var(--paper); border-right: 1px solid var(--rule); }
.thumbs a { position: relative; display: grid; place-items: center; height: 2.7rem; margin-right: -1px; text-decoration: none; color: var(--paper);
  font: italic 500 .9rem/1 var(--serif-d); letter-spacing: -.04em; background: var(--tab, var(--ink-2)); transition: transform .25s var(--ease), width .25s var(--ease); width: 84%; border-radius: 0 3px 3px 0; }
.thumbs a .lb { position: absolute; left: calc(100% + .5rem); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--ink); color: var(--paper);
  font: 600 .78rem var(--sans); letter-spacing: .04em; padding: .3rem .55rem; border-radius: 2px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.thumbs a:hover .lb, .thumbs a:focus-visible .lb { opacity: 1; }
.thumbs a[aria-current="true"] { width: 100%; }
.thumbs a .pg { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--paper); opacity: .85; }
.thumbs a:not([aria-current="true"]) .pg { display: none; }

/* ---------------------------------------------------------------- layout */
.wrap { display: grid; grid-template-columns: var(--story-w) 1fr; padding-top: var(--spine-h); padding-left: var(--thumb-w); }
.story { grid-column: 1; grid-row: 1; position: relative; z-index: 2; background: var(--paper); border-right: 1px solid var(--rule); }
.mapcol { grid-column: 2; grid-row: 1; position: sticky; top: var(--spine-h); height: calc(100vh - var(--spine-h)); height: calc(100svh - var(--spine-h)); overflow: hidden; }
#map, #map2 { position: absolute; inset: 0; background: var(--sea); }
#map2 { pointer-events: none; visibility: hidden; z-index: 2; }
#map2.on { visibility: visible; }

.step { padding: 4.2rem 2.4rem 3.6rem 2.6rem; min-height: 82vh; border-top: 1px solid var(--rule); }
.chapter > .step:first-child { border-top: 2px solid var(--ink); }
.step.opener { min-height: calc(100vh - var(--spine-h)); padding-top: 3.2rem; border-top: 0; }
.step > p, .step > h2, .step > h3, .step > .lede { max-width: 34rem; }
.kicker { font: 700 .76rem var(--sans); letter-spacing: .17em; text-transform: uppercase; color: var(--terra-ink); display: flex; gap: .7rem; align-items: baseline; margin: 0 0 .6rem; }
.kicker .num { font: italic 500 1.15rem var(--serif-d); letter-spacing: 0; color: var(--ink); text-transform: none; }
h1, h2, h3 { font-family: var(--serif-d); font-weight: 500; line-height: 1.06; letter-spacing: -.012em; margin: .2rem 0 1rem; font-variation-settings: "SOFT" 50, "opsz" 72; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 5.4vw, 4.8rem); font-weight: 380; line-height: .98; margin-bottom: 1.4rem; }
h1 em { font-style: italic; color: var(--terra-ink); font-weight: 300; }
h2 { font-size: clamp(1.85rem, 2.9vw, 2.55rem); }
h3 { font-size: clamp(1.4rem, 2vw, 1.7rem); font-weight: 500; }
p { margin: 0 0 1rem; text-wrap: pretty; }
.lede { font-size: 1.2rem; line-height: 1.52; }
.hint, .small { font: .86rem/1.4 var(--sans); color: var(--ink-2); }
.warn { font: 600 .86rem/1.4 var(--sans); color: var(--terra-ink); border-left: 3px solid var(--terra); padding-left: .6rem; }
.cue { font: 600 .74rem var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); margin-top: 2.4rem; }
.cue::after { content: ""; display: block; width: 1px; height: 2.4rem; background: var(--ink-2); margin: .5rem 0 0 .2rem; animation: drip 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* the thread (chain of chapters) */
.chain { list-style: none; padding: 0; margin: 1.8rem 0; display: flex; flex-wrap: wrap; gap: .2rem 0; font: 600 .82rem var(--sans); letter-spacing: .06em; text-transform: lowercase; }
.chain li { display: flex; align-items: center; }
.chain li + li::before { content: "→"; color: var(--ink-2); margin: 0 .35rem; font-weight: 400; }
.chain a { color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--terra); padding: .35rem 0; }
.chain a:hover { color: var(--terra-ink); }

/* key figures */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem 1.4rem; margin: 1.6rem 0 1.2rem; padding: 1rem 0 .9rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); max-width: 34rem; }
.fig p { margin: 0; }
.fig .v { white-space: nowrap; font: 500 2.05rem/1 var(--serif-d); font-variant-numeric: lining-nums tabular-nums; }
.fig .v small { font: 600 .9rem var(--sans); margin-left: .15rem; color: var(--ink-2); }
.fig .l { font: .84rem/1.3 var(--sans); color: var(--ink-2); margin-top: .35rem; }
.fig .s { font: italic .74rem var(--sans); color: var(--ink-2); margin-top: .2rem; }

/* about-the-data (CRITICAL_REVIEW §3): collapsible, always present */
.about { font: .9rem/1.45 var(--sans); background: var(--paper-2); border-left: 3px solid var(--deep); padding: .2rem .95rem; margin: 1.4rem 0 0; max-width: 34rem; }
.about summary, .about .t { font: 700 .74rem var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--deep); cursor: pointer; padding: .55rem 0; list-style: none; margin: 0; min-height: 24px; }
.about summary::-webkit-details-marker { display: none; }
.about summary::before { content: "+"; display: inline-block; width: 1em; font-weight: 700; }
.about[open] summary::before { content: "−"; }
.about p { margin: 0 0 .7rem; }
.draft-note { padding: .2rem .95rem .1rem; }

.try { font: .92rem/1.45 var(--sans); border: 1px dashed var(--ink-2); padding: .5rem .85rem; max-width: 34rem; margin: 1rem 0; }
.try .t { font: 700 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; margin: .1rem 0 .3rem; color: var(--ink-2); }
.try p { margin: 0 0 .35rem; }
button.inline { font: 700 .9rem var(--sans); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 2px; padding: .1rem .45rem; min-height: 28px; }
button.inline[aria-pressed="true"], button.act[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
button.act { font: 700 .9rem var(--sans); background: transparent; border: 1.5px solid var(--ink); border-radius: 2px; padding: .45rem .8rem; min-height: 44px; transition: background-color .15s, color .15s; }
button.act:hover, .seg button:hover { background: var(--paper-3); }
button.act[aria-pressed="true"]:hover { background: var(--ink); }

.seg { display: inline-flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 1rem; }
.seg button { font: 600 .9rem var(--sans); border: 1.5px solid var(--ink); background: transparent; padding: .4rem .75rem; border-radius: 2px; min-height: 44px; transition: background-color .15s; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* tables */
.tbl { width: 100%; max-width: 34rem; border-collapse: collapse; font: .86rem/1.35 var(--sans); margin: 1rem 0; font-variant-numeric: tabular-nums lining-nums; }
.tbl th { text-align: left; font-weight: 600; }
.tbl thead th { font: 700 .7rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--ink); padding: .3rem .5rem .3rem 0; }
.tbl td, .tbl tbody th { border-bottom: 1px solid var(--rule); padding: .42rem .5rem .42rem 0; vertical-align: top; }
.tbl td.n { text-align: right; }
.tbl.src td:first-child { font-weight: 600; }

/* events list */
.events { list-style: none; padding: 0; margin: 1rem 0; max-width: 34rem; }
.events li { display: grid; grid-template-columns: 6.6rem 1fr; gap: .9rem; padding: .5rem 0; border-top: 1px solid var(--rule); }
.events .d { font: 700 .88rem var(--sans); color: var(--terra-ink); font-variant-numeric: lining-nums; }
.events .x { font-size: .98rem; line-height: 1.45; }

/* ribbon */
.ribbon { height: 5.6rem; margin: 1.4rem 0 .4rem; max-width: 34rem; }
.ribbon svg { width: 100%; height: 100%; overflow: visible; }
.ribbon text { font: 10.5px var(--sans); fill: var(--ink-2); }

/* ---------------------------------------------------------------- charts (dataviz rules: thin marks, hairline grid,
   text in text tokens, legend for >= 2 series, table view) */
.chart { margin: 1.4rem 0 .6rem; max-width: 34rem; }
.chart figcaption { font: 700 .78rem var(--sans); letter-spacing: .04em; color: var(--ink); margin-bottom: .4rem; }
.chart .plot svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.chart svg text { font-size: 11.5px; fill: var(--ink-2); }
.chart svg text.lab { fill: var(--ink); font-weight: 600; }
.chart svg .gridl { stroke: var(--grid); stroke-width: 1; }
.chart svg .axis { stroke: var(--ink-2); stroke-width: 1; }
.chart svg [data-tip] { cursor: default; }
.chart svg .hit { fill: transparent; }
.chart svg .sel { stroke: var(--ink); stroke-width: 2; }
.chart .key { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font: .8rem var(--sans); color: var(--ink); margin: .2rem 0 .4rem; padding: 0; list-style: none; }
.chart .key li { display: flex; align-items: center; gap: .35rem; }
.chart .key i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.chart .key i.line { height: 0; border-top: 2px solid; border-radius: 0; width: 18px; }
.chart .key i.dash { height: 0; border-top: 2px dashed; border-radius: 0; width: 18px; }
.chart details.tv { font: .8rem var(--sans); margin-top: .3rem; }
.chart details.tv summary { cursor: pointer; color: var(--ink-2); min-height: 24px; }
.chart details.tv table { margin: .4rem 0; }
.chart.small { max-width: 30rem; }
.tip { position: fixed; z-index: var(--z-tip); pointer-events: none; background: var(--ink); color: var(--paper); font: .8rem/1.35 var(--sans); padding: .35rem .55rem; border-radius: 3px; max-width: 16rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* event slider */
.slider { max-width: 34rem; margin: 1rem 0 .4rem; font: .9rem var(--sans); }
.slider label { display: block; font-weight: 600; margin-bottom: .2rem; }
.slider output { font-weight: 700; color: var(--deep); }
.slider input[type=range] { width: 100%; accent-color: var(--deep); height: 44px; margin: 0; }
.slider .ticks { display: flex; justify-content: space-between; font: .72rem var(--sans); color: var(--ink-2); margin-top: -.5rem; padding: 0 .3rem; }

/* ---------------------------------------------------------------- map furniture */
.maptitle { position: absolute; left: .9rem; top: .9rem; z-index: var(--z-over); margin: 0; max-width: min(28rem, 58%); background: rgba(243, 238, 227, .94);
  border-left: 3px solid var(--terra); padding: .4rem .75rem .45rem; font: 500 1.05rem/1.25 var(--serif-d); box-shadow: 0 1px 4px rgba(31,36,33,.12); }
.maptitle:empty { display: none; }
.maptitle small { display: block; font: 700 .66rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--terra-ink); margin-bottom: .1rem; }

.search { position: absolute; left: .9rem; bottom: auto; top: 4.6rem; z-index: var(--z-over); display: flex; gap: 0; box-shadow: 0 1px 4px rgba(31,36,33,.15); }
.search input { font: .92rem var(--sans); width: 13.5rem; height: 2.5rem; padding: 0 .7rem; border: 1.5px solid var(--ink); border-right: 0; border-radius: 2px 0 0 2px; background: var(--paper); color: var(--ink); }
.search input:focus-visible { outline: 3px solid var(--azul); outline-offset: 0; }
.search button { height: 2.5rem; min-width: 2.75rem; font: 700 .85rem var(--sans); border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 0 2px 2px 0; }
.search-msg { position: absolute; top: 100%; left: 0; margin-top: .3rem; font: .8rem var(--sans); background: var(--paper); padding: 0 .4rem; }
.search-msg:empty { display: none; }

.tools { position: absolute; right: .7rem; top: 7.6rem; z-index: var(--z-over); display: flex; flex-direction: column; gap: 4px; }
.tools button { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.4rem; min-height: 2.9rem; background: rgba(243,238,227,.96); border: 1.5px solid var(--ink);
  border-radius: 2px; font: 600 .66rem/1.1 var(--sans); letter-spacing: .02em; padding: .25rem 0; transition: background-color .15s; }
.tools button .k { font: 700 .92rem/1 var(--sans); margin-bottom: .12rem; }
.tools button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tools button:hover:not([aria-pressed="true"]) { background: var(--paper-3); }
.tools button[disabled] { opacity: .5; cursor: not-allowed; background: var(--paper-2); color: var(--ink-2); border-style: dashed; }

.legend { position: absolute; left: .9rem; bottom: 2.2rem; z-index: var(--z-over); max-width: 17.5rem; background: rgba(243, 238, 227, .96); border: 1px solid var(--rule);
  font: .8rem/1.3 var(--sans); box-shadow: 0 1px 6px rgba(31, 36, 33, .12); }
.legend-toggle { display: none; }
.legend-body { padding: .6rem .8rem .65rem; }
.legend-body:empty { display: none; }
.legend h4 { margin: 0 0 .4rem; font: 700 .7rem var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.legend .it { display: flex; align-items: center; gap: .5rem; margin: .2rem 0; }
.legend .sw { width: 1.3rem; height: .8rem; flex: none; border: 1px solid rgba(31,36,33,.25); }
.legend .ln { width: 1.3rem; height: 0; flex: none; border-top: 2.5px solid var(--ink); }
.legend .dot { width: .8rem; height: .8rem; border-radius: 50%; flex: none; margin: 0 .25rem; }
.legend .ramp { display: flex; height: .7rem; margin: .3rem 0 .15rem; }
.legend .ramp span { flex: 1; }
.legend .rl { display: flex; justify-content: space-between; font-size: .7rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend .src { margin-top: .45rem; font-size: .7rem; color: var(--ink-2); }
.legend .note { color: var(--terra-ink); font-weight: 600; margin-top: .3rem; }

.card { position: absolute; right: 4.6rem; top: .9rem; z-index: var(--z-card); width: 19rem; max-height: calc(100% - 4rem); overflow: auto; background: var(--paper);
  border: 1px solid var(--ink); box-shadow: 0 6px 24px rgba(31,36,33,.22); font: .88rem/1.4 var(--sans); padding: .9rem 1rem .8rem; }
.card h3 { font: 600 1.2rem/1.15 var(--serif-d); margin: 0 1.6rem .4rem 0; }
.card .ty { font: 700 .66rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--terra-ink); margin: 0 0 .2rem; }
.card dl { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; margin: .5rem 0; }
.card dt { color: var(--ink-2); }
.card dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.card .ab { border-top: 1px solid var(--rule); margin-top: .6rem; padding-top: .5rem; font-size: .8rem; color: var(--ink-2); }
.card .ab b { color: var(--deep); letter-spacing: .1em; text-transform: uppercase; font-size: .68rem; display: block; }
.card-x { position: absolute; right: .35rem; top: .35rem; width: 2.2rem; height: 2.2rem; border: 0; background: transparent; font: 400 1.5rem/1 var(--sans); }
.card-x:hover { background: var(--paper-2); }

.swipe { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.swipe-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 44px; margin-left: -22px; pointer-events: auto; background: transparent; border: 0; cursor: ew-resize; touch-action: none; }
.swipe-handle::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: var(--paper); box-shadow: 0 0 0 1px var(--ink); }
.swipe-handle span { position: absolute; top: 50%; left: 2px; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 700 .9rem var(--sans); }
.swipe-tag { position: absolute; bottom: 2.2rem; font: 700 .78rem var(--sans); letter-spacing: .08em; background: var(--ink); color: var(--paper); padding: .25rem .5rem; }
.swipe-tag.l { left: 50%; transform: translateX(calc(-100% - 14px)); }
.swipe-tag.r { left: 50%; transform: translateX(14px); }
.mapcol.comparing .legend { bottom: 4.4rem; }

.toast { position: absolute; left: 50%; bottom: 3rem; transform: translateX(-50%); z-index: var(--z-card); background: var(--ink); color: var(--paper); font: 600 .85rem var(--sans); padding: .45rem .8rem; border-radius: 2px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }
.nomap { position: absolute; inset: 30% 10% auto; z-index: var(--z-over); background: var(--paper); border: 1px solid var(--ink); padding: 1rem; font: .95rem var(--sans); }

/* labels (HTML markers, collision-culled in JS) */
.lbl { font: 600 12px var(--sans); color: var(--ink); text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 2px var(--paper); pointer-events: none; white-space: nowrap; }
.lbl.hide { visibility: hidden; }
.lbl.cidade { font: 600 15px var(--serif-d); }
.lbl.cidade::before, .lbl.vila::before { content: ""; display: inline-block; width: 6px; height: 6px; border: 1.5px solid var(--ink); background: var(--paper); border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.lbl.water { font: italic 400 14px var(--serif-d); color: var(--deep); letter-spacing: .1em; }
.lbl.island { font: italic 500 13px var(--serif-d); }
.lbl.mount { font: 600 10.5px var(--sans); letter-spacing: .22em; text-transform: uppercase; color: #4a4336; }
.lbl.zone { font-size: 11px; color: #7a1f0d; }
.lbl.val { font: 700 11px var(--sans); color: var(--deep); }
.lbl.bairro { font-size: 11.5px; }
.maplibregl-ctrl-group { border-radius: 2px !important; border: 1.5px solid var(--ink); box-shadow: none !important; }
.maplibregl-ctrl-group button { width: 2.25rem !important; height: 2.25rem !important; }
.maplibregl-ctrl-scale { background: rgba(243, 238, 227, .85); border-color: var(--ink); color: var(--ink); font-family: var(--sans); }
.maplibregl-ctrl-attrib { font-family: var(--sans); font-size: 11px; }
.maplibregl-ctrl-attrib-button { width: 30px !important; height: 30px !important; }
.maplibregl-canvas:focus-visible { outline: 3px solid var(--azul); outline-offset: -3px; }

footer.colophon { font: .8rem var(--sans); color: var(--ink-2); padding: 1.5rem 2.6rem 3rem; border-top: 2px solid var(--ink); }
.printnote { display: none; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 900px) {
  .maplibregl-ctrl-bottom-right { bottom: 4.9rem; }
  :root { --spine-h: 3rem; --thumb-w: 0px; }
  .spine { padding: 0 .7rem; gap: .6rem; }
  .spine .t2, .spine .ed { display: none; }
  .spine .t1 { font-size: 1rem; }
  .spine .lang { margin-left: auto; }
  .thumbs { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: calc(48px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    flex-direction: row; gap: 2px; border-right: 0; border-top: 1px solid var(--ink); }
  .thumbs a { flex: 1; height: 100%; width: auto; border-radius: 0; font-size: .9rem; }
  .thumbs a[aria-current="true"] { width: auto; flex: 1.4; }
  .thumbs a .lb { display: none; }
  .wrap { display: block; padding-left: 0; }
  .mapcol { position: sticky; top: var(--spine-h); height: 50vh; height: 50svh; z-index: 5; border-bottom: 2px solid var(--ink); }
  .story { border-right: 0; z-index: auto; padding-bottom: 56px; }
  .step { min-height: 62vh; padding: 2.2rem 1.15rem 2.4rem; }
  .step.opener { min-height: auto; padding-top: 1.8rem; }
  body { font-size: 1.03rem; }
  .maptitle { font-size: .84rem; left: .45rem; top: .45rem; max-width: 62%; padding: .25rem .5rem; }
  .maptitle small { display: none; }
  .search { top: auto; bottom: .5rem; left: .45rem; }
  .search input { width: min(6.6rem, 26vw); font-size: 1rem; }
  .search input { height: 2.75rem; }
  .search button { height: 2.75rem; }
  .tools { top: auto; bottom: .5rem; right: .45rem; flex-direction: row; }
  .tools button { width: 2.9rem; min-height: 2.75rem; font-size: .6rem; }
  .maplibregl-ctrl-top-right { display: none; }
  .legend { left: auto; right: .45rem; top: .45rem; bottom: auto; max-width: 13rem; max-height: calc(100% - 4.4rem); overflow: auto; font-size: .74rem; }
  .legend-toggle { display: block; width: 100%; min-height: 2.4rem; font: 700 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; background: var(--paper); border: 0; text-align: left; padding: 0 .6rem; }
  .legend-toggle::after { content: " +"; }
  .legend-toggle[aria-expanded="true"]::after { content: " −"; }
  .legend-body { padding: .2rem .6rem .5rem; }
  .legend .src { display: none; }
  .card { left: .45rem; right: .45rem; top: auto; bottom: 3.6rem; width: auto; max-height: 70%; }
  .events li { grid-template-columns: 5.4rem 1fr; }
  .maplibregl-ctrl-bottom-right { bottom: 3.3rem; }
  .swipe-tag { bottom: 5.6rem; }
}
@media (max-width: 380px) { .search input { width: 7.5rem; } }

/* ---------------------------------------------------------------- motion, print */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  @page { margin: 16mm 14mm; }
  .spine, .thumbs, .mapcol, .skip, .cue, .seg, .slider, button.act, .try, .tip { display: none !important; }
  .wrap { display: block; padding: 0; }
  .story { border: 0; }
  body { font-size: 10.5pt; background: #fff; }
  .step { min-height: 0; padding: 0 0 6mm; border-top: 0; break-inside: avoid-page; }
  .chapter { break-before: page; }
  .chapter:first-child { break-before: auto; }
  .about { background: #f6f3ec; }
  .about summary::before { content: ""; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  .printnote { display: inline; margin-left: 1em; }
}
/* v0.2 additions: model table in chapter III */
.tblfig { margin: 1.1rem 0 .9rem; max-width: 34rem; }
.tblfig figcaption { font: 600 .84rem/1.35 var(--sans); margin-bottom: .45rem; }
.tbl th.n { text-align: right; }
h4.sub { font: 600 1.15rem/1.25 var(--serif-d); margin: 1.8rem 0 .4rem; }
