/* Every chart gets a screen of its own, the chart on top and its text in a
   card below. The replay is the one pinned screen: its section is tall and
   the map and card stay put while the reader scrolls through the days, then
   leave together. */
.pin, .panel {
  height: 100svh;
  margin: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.5rem;
  padding: 1.5rem 0.75rem 2.75rem;
}
.replay { height: 300svh; }

/* Scrolling turns pages: each chart snaps to the top of the screen and one
   flick moves on one page. The replay is a page taller than the screen, so
   it scrolls freely inside before snapping to the next. */
html { scroll-snap-type: y mandatory; }
.replay, .panel { scroll-snap-align: start; scroll-snap-stop: always; }
main > section:not(.story) { scroll-snap-align: start; }
footer.site { scroll-snap-align: end; }
.pin { position: sticky; top: 0; }

.card {
  max-width: 30rem;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.card p { margin: 0 0 0.6rem; }
.card p:last-child { margin-bottom: 0; }

.graphic { min-height: 0; width: 100%; }
.graphic svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* chart text */
.graphic { position: relative; }
.graphic text { fill: var(--ink); font: 13px var(--body); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.graphic .muted { fill: var(--muted); }
.graphic .small { font-size: 12px; }
.graphic .place { font-size: 13px; }
.graphic .chart-title { font-weight: 700; }
.graphic .value { font-weight: 700; fill: var(--moth); }

/* maps */
.land { vector-effect: non-scaling-stroke; fill: var(--land); stroke: var(--land-edge); stroke-width: 1; }
.basin { fill: var(--moth-soft); fill-opacity: 0.35; stroke: var(--moth-soft); transition: opacity 400ms; }
.graphic .area-label { font-size: 15px; font-weight: 700; }
.graphic .key-title { font-weight: 700; }
.today { stroke: var(--ink); stroke-width: 2; }
.city { fill: var(--ink); }
.alps { fill: var(--muted); }
.route { fill: none; stroke: var(--ink); stroke-width: 2; }
.arrow-head { fill: var(--ink); }
.surface { transition: opacity 500ms; }
.rain { transition: opacity 500ms; }
.basin.outline { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.zoom { transform-origin: 0 0; transition: transform 700ms ease-in-out; }
.sighting { fill: var(--moth); opacity: 0.75; transition: opacity 200ms; }
.basin.off, .surface.off, .rain.off, .sighting.off, g.off { opacity: 0; }
g.off { transition: opacity 400ms; }
.day { fill: var(--moth); transition: opacity 400ms; }
.day.dim { opacity: 0.2; }
.windflow { position: absolute; top: 0; left: 0; pointer-events: none; }
.graphic .wind-note { fill: var(--wind); }

/* Open-Meteo asks for a link wherever its data is shown */
.card .map-credit { font-size: 0.75rem; color: var(--muted); }

/* year bars */
.bar { fill: var(--moth); }
.bar-total { fill: var(--land-edge); }
.graphic .value.total { fill: var(--ink); }
.graphic .mark { transition: y 600ms ease-in-out, height 600ms ease-in-out; }

@media (prefers-reduced-motion: reduce) {
  .sighting, .basin, .surface, .zoom, .graphic .mark, .day { transition: none; }
}

@media (min-width: 900px) {
  .pin, .panel { grid-template-rows: none; grid-template-columns: 22rem 1fr; align-items: center; gap: 2rem; max-width: 74rem; margin: 0 auto; padding: 5svh 1.5rem; }
  .pin .graphic, .panel .graphic { grid-row: 1; grid-column: 2; height: 90svh; }
  .pin .card, .panel .card { grid-row: 1; grid-column: 1; }
}
}
}

/* replay date and count */
.counter { transition: opacity 300ms; }
.graphic .counter-date { font: 600 26px var(--display); fill: var(--moth); }
.graphic .counter-count { font-size: 13px; fill: var(--ink); }

.scroll-on { color: var(--moth); font-weight: 700; transition: opacity 300ms; }
.replay.is-done .scroll-on { opacity: 0; }
.scroll-on::after { content: " \2193"; }
