/* Lokalsidan (/lokal/<slug>). Bygger på site.css; portad från legacy public/v2/lokalsida.css. */
.lokal { --up: #33B5E1; --down: #BBE6F4; --ok: #2E9E6B; --warn: #E8A33D; --frame: #2A4552; --flow: #BBE6F4; --temp: #E8A33D; container: page / inline-size; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .lokal { --up: #0097D2; --down: #8DCFEA; --ok: #1E8657; --warn: #C9821C; --frame: #C3D4DB; --flow: #00445F; --temp: #D2791F; } }
:root[data-theme="light"] .lokal { --up: #0097D2; --down: #8DCFEA; --ok: #1E8657; --warn: #C9821C; --frame: #C3D4DB; --flow: #00445F; --temp: #D2791F; }
.lokal .num { font-variant-numeric: tabular-nums; }
.lokal .wrap { max-width: 1180px; }

.intro { padding-block: 16px 12px; display: grid; gap: 4px; }
.intro h1 { margin: 0; font-weight: 900; font-size: 2rem; line-height: 1.05; color: var(--heading); letter-spacing: -.01em; text-wrap: balance; }
@container page (min-width: 760px) { .intro h1 { font-size: 2.6rem; } .intro { padding-block: 26px 18px; } }
.intro .where { color: var(--muted); font-weight: 600; }
.intro .crumb { margin: 0 0 4px; font-size: .9rem; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; font-size: .875rem; color: var(--muted); }
.status b { color: var(--fg); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-label); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg); background: var(--surface); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

/* Hero-bild och sifferruta */
.stage { display: grid; gap: 14px; }
@container page (min-width: 760px) { .stage { grid-template-columns: 7fr 5fr; gap: 24px; align-items: start; } .stage--solo { grid-template-columns: 1fr; } }
.media { display: grid; gap: 8px; min-width: 0; }
.screen { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pane { position: absolute; inset: 0; }
.pane > img, .pane > iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
.screen-hit { position: absolute; inset: 0; border: 0; padding: 0; background: transparent; cursor: pointer; }
.screen-hit .expand { position: absolute; left: 8px; bottom: 8px; width: 30px; height: 30px; opacity: .85; border-radius: 50%; background: rgb(0 22 29 / .66); display: grid; place-items: center; }
.screen-hit .expand svg { width: 15px; height: 15px; fill: #fff; }
.screen-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.osd { position: absolute; display: flex; gap: 6px; align-items: center; font-family: var(--font-label); text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; font-weight: 700; color: #fff; }
.osd--tl { top: 10px; left: 10px; } .osd--br { bottom: 10px; right: 10px; }
.media__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); }
.media__cap { flex: 1 1 16rem; min-width: 0; }
.media__cap a { color: var(--accent); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; background: var(--surface); }
.seg a { padding: 4px 10px; border-radius: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; text-decoration: none; }
.seg a:hover { color: var(--fg); }
.seg a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }

.kpi { background: var(--surface); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; min-width: 0; }
@container page (min-width: 760px) { .kpi { padding: 20px 22px; } }
.kpi__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.today { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.today div { display: grid; }
.big { font-size: 2.5rem; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.today .big { font-size: clamp(1.6rem, 8.5cqw, 2.5rem); }
.big--up { color: var(--up); }
.kpi .fine { font-size: .78rem; color: var(--muted); margin: -2px 0 0; }
.kpi .fine b { color: var(--fg); }

/* Sektioner */
.lokal .section { padding-block: 30px 0; display: grid; gap: 12px; min-width: 0; }
.lokal .section h2 { font-size: 1.3rem; }
.lokal .section .lead { font-size: .92rem; }
@container page (min-width: 760px) { .lokal .section h2 { font-size: 1.5rem; } .lokal .section { padding-block: 40px 0; } }

.focus { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fcard { background: var(--surface); border-radius: var(--radius); padding: 14px; display: grid; gap: 4px; min-width: 0; }
.fcard .big { font-size: 2.2rem; }
.delta { font-size: .85rem; color: var(--muted); }
.delta .pos { color: var(--ok); }
.delta .neg { color: var(--live); }

/* Diagram */
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; background: var(--surface); justify-self: start; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
html:not(.js) .seg { display: none; }
.chart { display: grid; gap: 6px; min-width: 0; }
.chart svg { width: 100%; height: auto; display: block; max-width: 100%; touch-action: pan-y; overflow: visible; }
.chart svg.off { display: none; }
.days .u { fill: var(--up); }
.days .d { fill: var(--down); opacity: .75; }
.days .axis { stroke: var(--fg); }
.chart .ax { fill: var(--muted); font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif; font-size: var(--ax, 11px); }
.chart .ax--r { text-anchor: end; }
.chart .ax--c { text-anchor: middle; }
.days .flow, .days .temp { fill: none; stroke-width: 1.5; stroke-linejoin: round; opacity: .9; pointer-events: none; }
.days .flow { stroke: var(--flow); }
.days .temp { stroke: var(--temp); }
.rd-flow { color: var(--flow); }
.rd-temp { color: var(--temp); }
.days .hl { fill: var(--accent); opacity: .1; pointer-events: none; }
.readout { display: flex; gap: 4px 14px; align-items: baseline; font-size: .9rem; min-height: 1.5em; flex-wrap: wrap; }
.readout b { font-weight: 800; }
.legend { display: flex; gap: 6px 14px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend i.u { background: var(--up); } .legend i.d { background: var(--down); opacity: .75; }
.legend i.t { background: var(--accent-2); } .legend i.f { background: var(--muted); }
.legend i.line { height: 3px; vertical-align: 3px; }
.legend i.line.flow { background: var(--flow); } .legend i.line.temp { background: var(--temp); }
.source { font-size: .78rem; color: var(--muted); }

/* Arter */
.species { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.species li { display: grid; gap: 4px; }
.species .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.species .row1 b { font-weight: 800; }
.species .row1 span { font-size: .85rem; color: var(--muted); }
.species .row1 strong { color: var(--fg); }
.bar { height: 8px; display: flex; border-radius: 2px; overflow: hidden; background: var(--surface-2); }
.bar i { display: block; height: 100%; }
.bar i.u { background: var(--up); } .bar i.d { background: var(--down); opacity: .75; }

/* Klipp */
.lokal .chips { display: flex; gap: 6px; overflow-x: auto; margin-inline: -16px; padding: 2px 16px; scrollbar-width: none; }
.chips button span { font-weight: 400; opacity: .7; margin-left: 4px; }
.strip--row { grid-auto-columns: 78%; }
@container page (min-width: 760px) { .strip--row { grid-auto-columns: calc((100% - 36px) / 4); margin-inline: 0; padding-inline: 0; padding-bottom: 10px; } }
.lokal .card { cursor: default; }
.card[hidden] { display: none; }

/* Om */
.about { max-width: 68ch; }
.about p { margin: 0 0 10px; }
.about details { border-top: 1px solid var(--line); padding-block: 12px; }
.about details:last-of-type { border-bottom: 1px solid var(--line); }
.about summary { cursor: pointer; font-weight: 800; }
.about details p { margin: 10px 0 0; }
.sel { user-select: all; }
.lokal { padding-bottom: 8px; }

/* Historik: kurva år mot år och staplar per år */
.hist path { fill: none; stroke-linejoin: round; }
.hist path.cur { stroke: var(--up); stroke-width: 3; }
.hist path.cmp { stroke: var(--muted); stroke-width: 2; }
.hist path.other { stroke: var(--line); stroke-width: 1.5; }
.hist .hl-line { stroke: var(--accent); opacity: .5; pointer-events: none; }
.chart .axis--soft { stroke: var(--line); }
.hyear .seg--salmon { fill: var(--up); }
.hyear .seg--trout { fill: var(--accent-2); }
.hyear .seg--salmonid { fill: var(--muted); }
.hyear .seg--cur { opacity: .55; }
.hyear .hl { fill: var(--accent); opacity: .1; pointer-events: none; }
html:not(.js) #hist-f { display: none; }

/* Siffrorna i sidhuvudet (layout "header", räknare): fyra kolumner på smal skärm, "idag" större och först på bred. */
.intro__main { display: grid; gap: 4px; min-width: 0; }
.hstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; min-width: 0; }
.hst { display: grid; gap: 2px; min-width: 0; align-content: start; }
.hst--today .label { color: var(--accent); }
.hst__date, .hst__dir { display: none; }
.hst__row { display: flex; align-items: center; gap: 10px; }
.hst__num { font-size: 1.35rem; font-weight: 900; line-height: 1.05; letter-spacing: -.01em; }
.hst--today .hst__num { color: var(--up); }
.hst__sub { font-size: .7rem; color: var(--muted); white-space: nowrap; }
@container page (min-width: 760px) {
  .intro--stats { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
  .hstats { display: flex; align-items: flex-end; gap: 26px; border-top: 0; padding-top: 0; margin-top: 0; }
  .hst--today { padding-right: 22px; border-right: 1px solid var(--line); }
  .hst--today .hst__date { display: inline; }
  .hst--today .hst__dir { display: block; font-size: .85rem; line-height: 1.4; }
  .hst--today .hst__sub { display: none; }
  .hst__num { font-size: 1.6rem; }
  .hst--today .hst__num { font-size: 3rem; line-height: .95; }
  .hst__sub { font-size: .75rem; }
}
