/* TroutDrop — site styles on top of /ui/ui.css (Tailwind + Basecoat). Colors are the shadcn variables from site.ts `theme`.
   Signature element: the aging pin (.st-pin). Bright on the day of stocking, fading over 14 days, its size set by the
   number of fish; a dashed ring is a scheduled (not confirmed) stocking. public/map.js draws the same pin on the map.
   Bump ?v= in APP_HEAD (src/ui.tsx) whenever this file changes. */

:root {
  --st-fresh: oklch(0.68 0.2 42);
  --st-old: oklch(0.8 0.025 195);
  --st-rim: #fff;
  --st-water: oklch(0.94 0.02 200);
}
.dark {
  --st-fresh: oklch(0.76 0.17 50);
  --st-old: oklch(0.5 0.03 195);
  --st-rim: oklch(0.2 0.01 70);
}

/* ---- The aging pin ---- */
.st-pin {
  --age: 0;
  --d: 16px;
  display: inline-block;
  flex: none;
  box-sizing: border-box;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background: color-mix(in oklab, var(--st-fresh) calc((1 - var(--age)) * 100%), var(--st-old));
  border: 2px solid var(--st-rim);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 30%, transparent);
  opacity: calc(1 - var(--age) * 0.45);
  vertical-align: middle;
}
.st-pin.is-planned {
  background: color-mix(in oklab, var(--st-fresh) 14%, var(--st-rim));
  border: 2px dashed color-mix(in oklab, var(--st-fresh) 85%, var(--foreground));
  box-shadow: none;
}
.st-pin.is-fresh { animation: st-ping 2.2s ease-out infinite; }
@keyframes st-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--st-fresh) 55%, transparent), 0 0 0 1px color-mix(in oklab, var(--foreground) 30%, transparent); }
  70%, 100% { box-shadow: 0 0 0 12px color-mix(in oklab, var(--st-fresh) 0%, transparent), 0 0 0 1px color-mix(in oklab, var(--foreground) 30%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .st-pin.is-fresh { animation: none; box-shadow: 0 0 0 4px color-mix(in oklab, var(--st-fresh) 35%, transparent), 0 0 0 1px color-mix(in oklab, var(--foreground) 30%, transparent); }
}
.leaflet-marker-icon.st-icon { background: none; border: 0; }
.st-icon .st-pin { cursor: pointer; opacity: calc(1 - var(--age) * 0.35); }

/* ---- Lists ---- */
.st-when { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; }
.st-when .block { display: block; }
.st-table td, .st-table th { vertical-align: middle; }
.show-sm { display: none; }
@media (max-width: 40rem) { .hide-sm { display: none; } .show-sm { display: inline; } }
.st-source { margin: 0; }
.st-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.st-state-row { display: grid; gap: .15rem; }
.st-lock { display: inline-flex; align-items: center; gap: .35rem; }

/* ---- Map ---- */
.map-wrap { position: relative; isolation: isolate; z-index: 0; }
/* Never the whole screen unless asked (full screen below): a swipe on the map pans the map, so the page below must always show (the tagline band peeks
   up from the bottom). Phones get a little over half the screen. */
#map { height: min(72svh, calc(100svh - 3.5rem)); min-height: 320px; width: 100%; background: var(--st-water); }
@media (max-width: 48rem) { #map { height: 58svh; } }
/* Full screen only when asked (the button, /map or ?full=1), with the exit button always in the corner. */
.map-wrap.is-full { position: fixed; inset: 0; z-index: 1500; }
.map-wrap.is-full #map { height: 100dvh; min-height: 0; }
.map-wrap.is-full .map-controls, .map-wrap.is-full .map-title { top: calc(12px + env(safe-area-inset-top)); }
html.map-full { overflow: hidden; }
.map-btn .when-full, .map-wrap.is-full .map-btn .when-small { display: none; }
.map-wrap.is-full .map-btn .when-full { display: block; }
.leaflet-container { font-family: var(--font-body); }
.dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.map-controls { position: absolute; right: 12px; top: 12px; z-index: 600; display: flex; flex-direction: column; gap: 8px; }
.map-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer; text-decoration: none; }
.map-btn svg { width: 20px; height: 20px; }
.map-title { position: absolute; left: 12px; top: 12px; z-index: 600; max-width: calc(100% - 84px); display: grid; gap: 2px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--card); color: var(--card-foreground); text-decoration: none; }
.map-title b { font: 600 1rem/1.2 var(--font-heading, inherit); }
.map-title span { font-size: .8rem; color: var(--muted-foreground); }
.map-hint { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); z-index: 650; padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--foreground); color: var(--background); font: 500 .875rem/1.2 var(--font-body); cursor: pointer; }
.map-hint[hidden] { display: none; }
.st-legend { position: absolute; left: 12px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 600; display: grid; gap: 4px; padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card); color: var(--card-foreground); font-size: .75rem; line-height: 1.4; }
.st-scale { display: flex; align-items: center; gap: 6px; }
.st-ramp { flex: 1; min-width: 56px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--st-fresh), var(--st-old)); }
.st-scale-labels { display: flex; justify-content: space-between; color: var(--muted-foreground); }
.st-legend-row { display: flex; align-items: center; gap: 6px; color: var(--muted-foreground); }

/* ---- Sheets over the map ---- */
html.sheet-open { overflow: hidden; }
.sheet { position: fixed; z-index: 2000; background: var(--background); color: var(--foreground); overflow-y: auto; overscroll-behavior: contain;
  inset: auto 0 0 0; max-height: 88dvh; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 32px rgb(0 0 0 / .25); }
.sheet[hidden] { display: none; }
@media (min-width: 640px) {
  .sheet { inset: auto; left: 12px; bottom: 12px; top: auto; width: 26rem; max-height: calc(100dvh - 5rem); border: 1px solid var(--border); border-radius: 12px; }
  .sheet-modal { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); }
}
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; background: var(--background); border-bottom: 1px solid var(--border); }
.sheet-head h2 { flex: 1; min-width: 0; margin: 0; font-family: var(--font-heading, inherit); font-size: 1.25rem; line-height: 1.25; }
.sheet-x { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -6px -8px -6px 0; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer; }
.sheet-body { padding: 14px 16px 24px; display: grid; gap: 12px; }
.sheet-body > * { margin: 0; }
.sheet-note { font-size: .875rem; color: var(--muted-foreground); }
.sheet-label { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }
.sheet-last { display: flex; align-items: center; gap: .75rem; font-size: 1.05rem; }
.sheet-events { list-style: none; padding: 0; margin: 0; display: grid; border-top: 1px solid var(--border); }
.sheet-events li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.sheet-events .when { font-weight: 600; min-width: 6.5rem; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* /water/…/fix: the picker map and the angler's pin (the aging pin's fresh orange). */
.fix-map { height: min(60vh, 26rem); border: 1px solid var(--border); border-radius: var(--radius); }
.fix-pin { border-radius: 999px; background: oklch(0.72 0.18 50); border: 3px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35); }
.map-title span[hidden] { display: none; }

/* ---- Home: the tagline band under the map (forest green, like a trailhead sign) ---- */
.td-band { background: var(--header); color: var(--header-foreground); border-top: 4px solid var(--brand); }
.td-band .wrap { padding-block: 2.25rem 2.5rem; display: grid; gap: .75rem; }
.td-eyebrow { margin: 0; font: 600 .8125rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: color-mix(in oklab, var(--header-foreground) 72%, transparent); }
.td-tagline { margin: 0; font-family: var(--font-heading); font-weight: 800; font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.08; letter-spacing: -.01em; color: var(--header-foreground); max-width: 22ch; }
.td-band-sub { margin: 0; max-width: 60ch; font-size: 1.0625rem; color: color-mix(in oklab, var(--header-foreground) 85%, transparent); }
.td-band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: .5rem; }
.td-band-link { color: var(--header-foreground); text-underline-offset: 3px; font-weight: 500; }
.td-band-link:hover { text-decoration-thickness: 2px; }
.td-band-grid { align-items: center; }
.td-band-text { display: grid; gap: .75rem; }
.td-band-photo { margin: .5rem 0 0; }
.td-band-photo img { border: 3px solid color-mix(in oklab, var(--header-foreground) 85%, transparent); }
.td-band-photo .hero-photo-credit { color: color-mix(in oklab, var(--header-foreground) 70%, transparent); }
.td-band-photo .hero-photo-credit a { color: inherit; }
@media (min-width: 48rem) {
  .td-band-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.5rem; }
  .td-band-photo { margin: 0; }
}
/* Signed-out pitch: the catch photo beside the reason to get alerts. */
.td-pitch { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 48rem) { .td-pitch { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; } }
.map-title { max-width: min(26rem, calc(100% - 84px)); }
/* The legend in the page flow (About), not floating over a map. */
.st-legend.is-inline { position: static; width: fit-content; }
