/* St. John Almanac, the facts section. Tokens only: every colour is the shell's, so day and night both work.
   The parts are the shell's own (page-head, tiles, fold, band-head); what is here is the island's outline,
   the small drawings and the word that stands under each figure. */

/* ----- the opening: the island's own outline on the sea ----- */
.facts-head { background: var(--forest); min-height: clamp(26rem, 44vw, 31rem); }
@media (min-width: 60rem) { .facts-head > svg.page-head-art { left: auto; right: 0; width: 66%; } }
.facts-head::after { background: linear-gradient(180deg, rgba(var(--photo-shade), 0) 0%, rgba(var(--photo-shade), 0) 46%, rgba(var(--photo-shade), 0.6) 100%); }
.facts-head > svg.page-head-art { object-fit: contain; padding: clamp(0.9rem, 3vw, 2rem) clamp(0.5rem, 3vw, 3rem) 0; box-sizing: border-box; }
.facts-isle { overflow: hidden; }   /* the cays' path runs past the drawing's box: keep it inside */
.facts-isle .isle-cays { fill: color-mix(in srgb, var(--land-edge) 55%, var(--water-edge)); }
.facts-isle .isle-land { fill: var(--land-edge); }
.facts-isle .isle-park { fill: var(--reef); }
.facts-isle .isle-pond { fill: var(--water-edge); }
.facts-head .facts-isle .isle-cays { fill: color-mix(in srgb, var(--on-forest-soft) 55%, var(--forest)); }
.facts-head .facts-isle .isle-land { fill: color-mix(in srgb, var(--on-forest) 62%, var(--on-forest-soft)); }
.facts-head .facts-isle .isle-park { fill: color-mix(in srgb, var(--forest) 50%, var(--on-forest-soft)); }
.facts-head .facts-isle .isle-pond { fill: color-mix(in srgb, var(--on-forest-soft) 70%, var(--forest)); }

/* ----- the six figures under the opening ----- */
.facts-top-band { padding-block: clamp(1.1rem, 3vw, 1.8rem) 0; }
.facts-top { grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 44%), 1fr)); gap: 0.9rem 1.5rem; }
.facts-top a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
.facts-top a:hover { color: var(--accent); }

/* ----- a band ----- */
.facts-lede { margin: 0; max-width: var(--measure); font-size: var(--step-0, 1rem); line-height: 1.55; color: var(--ink-soft); }
.facts-first { padding-top: clamp(1.4rem, 3.5vw, 2.4rem); }
.facts-with-pic { display: grid; gap: 1.1rem 1.4rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 60rem) { .facts-with-pic { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); } }
.facts-pic { margin: 0; }
.facts-pic img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--land-edge); }
.facts-pic figcaption { margin-top: 0.45rem; font-size: var(--step--1); line-height: 1.4; color: var(--ink-soft); }
.facts-pic .read-credit { display: block; font-size: 0.75rem; opacity: 0.9; }

/* ----- the word under a figure: how it is known ----- */
.fact { scroll-margin-top: 1rem; }
.fact .tile-n { overflow-wrap: anywhere; }
.fact .tile-n--word { font-size: clamp(1.3rem, 1.2vw + 1.05rem, 1.9rem); line-height: 1.1; }   /* a figure that is a word (the commonest tree) must fit a narrow tile */
.fact-word { margin-top: auto; padding-top: 0.35rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.fact-word a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule); }
.fact-word a:hover { color: var(--accent); border-color: currentColor; }
.fact--counted .fact-word a { color: var(--accent); }
.fact--nobody .fact-word a, .fact--estimate .fact-word a { color: var(--gold); }
.fact:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.fact-nobody { display: flex; align-items: center; min-height: 1em; }
.fact-nobody svg { height: 0.82em; width: auto; fill: none; stroke: var(--ink-soft); stroke-width: 3.2; stroke-linecap: round; }
.fact-nobody svg .q { stroke: var(--gold); }
.fold-in dd .fact-src, .fold-in dd .fact-when { color: var(--ink-soft); }
.fold-in dl > div { scroll-margin-top: 1rem; }
.fold-in dl > div:target dt { color: var(--accent); }

/* ----- the park on the island's outline ----- */
.facts-park { display: grid; gap: 1.1rem 2rem; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 46rem) { .facts-park { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); } }
.facts-park-map svg { display: block; width: 100%; height: auto; }
.facts-key { margin: 0.5rem 0 0; font-size: var(--step--1); color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; }
.facts-key .k { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 0.6rem; }
.facts-key .key { display: inline-block; width: 0.85rem; height: 0.85rem; border-radius: 3px; }
.facts-key .key--park { background: var(--reef); }
.facts-key .key--land { background: var(--land-edge); }
.facts-park-hundred { display: flex; gap: 1rem; align-items: center; }
.facts-park-hundred p { margin: 0; font-size: 0.97rem; line-height: 1.4; }
.facts-park-hundred b { display: block; font-family: var(--display); font-size: 1.35rem; font-weight: 600; line-height: 1.15; }
.facts-hundred { flex: none; width: min(8.5rem, 36vw); height: auto; }
.facts-hundred .on { fill: var(--reef); }
.facts-hundred .mid { fill: color-mix(in srgb, var(--reef) 42%, var(--land-edge)); }
.facts-hundred .off { fill: var(--land-edge); }
.facts-park-hundred .key { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; margin-right: 0.3rem; vertical-align: -0.05em; }
.facts-park-hundred .key--mid { background: color-mix(in srgb, var(--reef) 42%, var(--land-edge)); }
.facts-park-hundred .key--land { background: var(--land-edge); border: 1px solid var(--rule); }
.facts-year-one--wide { max-width: 34rem; }

/* ----- the small drawings of a year ----- */
.facts-years { display: grid; gap: 1.2rem 1.6rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .facts-years { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.facts-year-one { margin: 0; min-width: 0; }
.facts-year-one figcaption { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 0.3rem; }
.facts-year-one figcaption b { color: var(--ink); font-family: var(--display); font-size: 1.15rem; font-weight: 600; margin-right: 0.3rem; }
.facts-year, .facts-cols { display: block; width: 100%; height: auto; }
.facts-year .grid, .facts-cols .grid { stroke: var(--rule); stroke-width: 1; }
.facts-year .base, .facts-cols .base { stroke: var(--ink-soft); stroke-width: 1; }
.facts-year .ax, .facts-cols .ax { font-family: var(--text); font-size: 11px; fill: var(--ink-soft); }
.facts-year .val, .facts-cols .val { font-family: var(--text); font-size: 12px; font-weight: 700; fill: var(--ink); }
.facts-year .air { fill: var(--sun); }
.facts-year .sea { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.facts-year .sea-dot { fill: var(--accent); stroke: var(--sheet); stroke-width: 2; }
.facts-year .sea-hit { fill: transparent; }
.facts-year .rain { fill: var(--accent); opacity: 0.8; }
.band--water .facts-year .sea-dot { stroke: var(--water); }
.facts-cols .col { fill: var(--water-edge); }
.facts-cols .col--now { fill: var(--accent); }

/* ----- the words at the foot ----- */
.facts-words { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 0.7rem 1.5rem; font-size: 0.95rem; line-height: 1.45; }
.facts-words b { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
