/* Stilsettet fra Next.js-utgaven, gjenbrukt nesten uendret.
   Endringene er: Tailwind-importen er borte (klassene ble aldri brukt — ett
   treff i hele komponentmappen), @theme inline var Tailwind v4-syntaks, og
   skriftvariablene peker nå på @font-face under i stedet for på next/font. */

@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../fonts/fraunces.1e6b6cdca8d3.woff2") format("woff2");
}
@font-face {
  font-family: Karla;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/karla.5f5978e3e448.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body), system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Lenker følger temaet, aldri nettleserens blå/lilla. Knapper, faner og
   chips (lenker med klasse) styrer resten selv; vanlige lenker i tekst får
   en diskret strek under. */
a {
  color: var(--accent-ink);
}
a:not([class]) {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line-strong);
}
a:not([class]):hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Navn og verdier i tabeller: vanlig tekst som kan trykkes på. */
table a,
table a:visited {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
table a:hover {
  color: var(--accent);
  text-decoration: underline;
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 22px 72px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--bg-elevated) 0%, var(--bg-elevated-2) 100%);
  border: 1px solid var(--line);
  padding: 30px 28px 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero__ripple {
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  opacity: 0.5;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .hero__ripple {
    opacity: 0.35;
  }
}
:root[data-theme="dark"] .hero__ripple {
  opacity: 0.35;
}
.hero__eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero__eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 3px var(--moss-soft);
}
.hero__headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 10px 0 6px;
  max-width: 30ch;
  position: relative;
  z-index: 1;
}
.hero__sub {
  color: var(--ink-muted);
  font-size: 15px;
  max-width: 46ch;
  position: relative;
  z-index: 1;
}
.hero__weatherstrip {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.wchip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
  font-size: 13.5px;
  color: var(--ink);
}
.wchip svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.wchip b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  margin: 0;
}
.section-head .hint {
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ---------- Pills (station tabs / range selector) ---------- */
.pillrow {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  flex-wrap: wrap;
}
.pillrow button {
  appearance: none;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-muted);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.pillrow button.is-active {
  background: var(--accent);
  color: #fbfff9;
}
.pillrow.subtle button.is-active {
  background: var(--bg-elevated);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.pillrow button:not(.is-active):hover {
  color: var(--ink);
}
.pillrow button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- River card ---------- */
.rivercard {
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 24px 24px 22px;
  box-shadow: var(--shadow);
}
.rivercard__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rivercard__place {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 2px 0 0;
}
.rivercard__place b {
  color: var(--ink-muted);
  font-weight: 700;
}

/* ---------- Side-by-side station comparison ---------- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.compare-grid .gauges {
  grid-template-columns: 1fr;
}
@media (max-width: 760px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

.vald-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 760px) {
  .vald-grid {
    grid-template-columns: 1fr;
  }
}
/* Store bilder: ett bilde fyller hele kortet, flere legger seg to og to. */
.vald-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 10px;
  margin-top: 16px;
}
.vald-photos__item {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  background: var(--bg-elevated-2);
}
.vald-photos__item img {
  object-fit: cover;
}
.vald-photos__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 28px;
  border-radius: var(--radius-sm, 8px);
  border: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 13px;
}
.vald-photos__placeholder svg {
  width: 20px;
  height: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.moss {
  background: var(--moss-soft);
  color: var(--moss);
}
.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge.clay {
  background: var(--clay-soft);
  color: var(--clay);
}
.badge svg {
  width: 13px;
  height: 13px;
}

/* ---------- Gauges ---------- */
.gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}
@media (max-width: 620px) {
  .gauges {
    grid-template-columns: 1fr;
  }
}
.gauge__label {
  font-size: 12.5px;
  color: var(--ink-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gauge__label svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.gauge__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  margin: 4px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.gauge__value span {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-faint);
}
.gauge__track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.gauge__fill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.gauge__minmax {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 6px;
}
.gauge__trend {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.gauge__trend svg {
  width: 13px;
  height: 13px;
}
.gauge__trend.up svg {
  color: var(--clay);
}
.gauge__trend.down svg {
  color: var(--accent);
}
.gauge__trend.flat svg {
  color: var(--ink-faint);
}

/* ---------- Chart ---------- */
.rangebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.rangebar--standalone {
  margin-top: 14px;
  margin-bottom: 20px;
  padding: 0 4px;
}
.chartwrap {
  margin-top: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated-2);
  border: 1px solid var(--line);
  padding: 10px 6px 4px;
}
.chart-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-faint);
  padding: 8px 10px 0;
}

/* ---------- Caution note ---------- */
.caution {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.caution.moss {
  background: var(--moss-soft);
}
.caution.amber {
  background: var(--amber-soft);
}
.caution.clay {
  background: var(--clay-soft);
}
.caution svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
.caution.moss svg {
  color: var(--moss);
}
.caution.amber svg {
  color: var(--amber);
}
.caution.clay svg {
  color: var(--clay);
}
.caution p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
}
.caution b {
  font-weight: 700;
}

/* ---------- Map link ---------- */
.minimap__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  text-decoration: none;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
}
.minimap__link:hover {
  color: var(--accent-ink);
}
.minimap__link svg {
  width: 13px;
  height: 13px;
}
.minimap__link--standalone {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  justify-content: center;
}

/* ---------- Footer / notice ---------- */
.foot {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-faint);
  padding-top: 6px;
}
.notice {
  border: 1px solid var(--line);
  background: var(--clay-soft);
  color: var(--clay);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
}

/* ---------- Site nav ---------- */
.sitenav {
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
}
.sitenav__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 16px;
  row-gap: 4px;
  flex-wrap: wrap;
}
.sitenav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
}
.sitenav__links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.sitenav__links a {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.sitenav__links a:hover {
  color: var(--ink);
  background: var(--bg-elevated-2);
}
.sitenav__links a.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover {
  color: var(--ink);
  background: var(--bg-elevated-2);
}
.theme-toggle svg {
  width: 15px;
  height: 15px;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}
.lang-switcher select {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-switcher select:hover {
  color: var(--ink);
  background: var(--bg-elevated-2);
}
.lang-switcher select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Report page ---------- */
.date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.date-field input[type="date"],
.date-field input[type="week"],
.date-field select {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.date-field input[type="date"]:focus-visible,
.date-field input[type="week"]:focus-visible,
.date-field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Vald picker (søkbar multi-select) ---------- */
.vald-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}
.vald-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vald-picker__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  padding: 0;
  width: 15px;
  height: 15px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.vald-picker__remove:hover {
  background: rgba(0, 0, 0, 0.12);
}
.vald-picker__search {
  position: relative;
}
.vald-picker__search input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.vald-picker__search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.vald-picker__menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 4px;
}
.vald-picker__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.vald-picker__option:hover {
  background: var(--bg-elevated-2);
}
/* Ligger øverst i trefflista og gjelder alle treffene, ikke ett vald —
   skilt fra dem med farge og en linje under. */
.vald-picker__option--all {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  margin-bottom: 2px;
}
.vald-picker__empty {
  padding: 7px 10px;
  font-size: 13px;
  color: var(--ink-faint);
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fbfff9;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity 0.15s ease;
}
.export-btn:hover {
  opacity: 0.85;
}
.export-btn.subtle {
  background: transparent;
  color: var(--accent-ink);
  border-color: var(--line);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.report-table th,
.report-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.report-table th {
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.report-table tbody tr:hover {
  background: var(--bg-elevated-2);
}

/* Fangsttabellen har lange "fisker"- og "vald"-kolonner som ellers tvinger
   frem horisontal scroll bare for å se siste kolonner (vald, gjenutsatt) —
   strammer inn padding og trunkerer de to lengste kolonnene med ellipsis +
   title-tooltip. Kolonnerekkefølge: dato/tid, fisker, art, vekt/lengde,
   redskap, vald, satt ut. */
.catches-table {
  font-size: 12.5px;
}
.catches-table th,
.catches-table td {
  padding: 7px 7px;
}
.catches-table td:nth-child(2) {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catches-table td:nth-child(6) {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .gauge__fill,
  .pillrow button {
    transition: none !important;
  }
}

/* NINA: bredere side og høyere grafer. Innsiget er linjer og søyler over
   17–25 perioder — det tåler, og trenger, mer bredde enn en tekstspalte.
   Bredden vokser med skjermen og faller tilbake til .page på mobil. */
.page--wide {
  max-width: 1160px;
}

/* I React-versjonen styrte disse høyden til Recharts' ResponsiveContainer
   (som trenger et forelder-element med en ekte pikselhøyde for height="100%"
   å regne prosent av). Malsidens grafer er SVG med egen viewBox og skalerer
   seg selv via width="100%" — samme mønster som forsidens .chartwrap. Derfor
   er bare `--range` (den smale oversiktsstripa over periodevelgeren) igjen;
   `--single`/`--stacked`/`--historical` er ikke i bruk noe sted lenger. */
.nina-chart {
  width: 100%;
}
.nina-chart--range {
  height: 104px;
}

/* Dobbel slider under NINA-grafene.
   To native range-felt lagt oppå hverandre: sporet og det valgte feltet er
   egne diver under, feltene selv er gjennomsiktige og slipper bare gjennom
   klikk på selve knottene. Uten pointer-events-trikset ville det øverste
   feltet fanget all dragingen, og det nederste håndtaket vært dødt. */
.periodslider {
  position: relative;
  height: 30px;
  margin: 2px 0 4px;
  touch-action: none;
}
.periodslider__spor,
.periodslider__valgt {
  position: absolute;
  top: 13px;
  height: 4px;
  border-radius: 999px;
  pointer-events: none;
}
.periodslider__spor {
  left: 0;
  right: 0;
  background: var(--bg-elevated-2);
  border: 1px solid var(--line);
}
.periodslider__valgt {
  background: var(--accent);
}
.periodslider input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}
.periodslider input[type="range"]:focus {
  outline: none;
}
.periodslider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 24px;
  border-radius: 5px;
  background: var(--accent);
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: ew-resize;
}
.periodslider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 24px;
  border-radius: 5px;
  background: var(--accent);
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: ew-resize;
}
.periodslider input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hurtigvalg og utvalget i klartekst under slideren. */
.nina-period {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.nina-period__snarvei {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  text-transform: capitalize;
}
.nina-period__snarvei:hover {
  background: var(--bg-elevated-2);
  color: var(--ink);
}
.nina-period__snarvei.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fbfff9;
}
.nina-period__valgt {
  margin-left: auto;
  font-weight: 700;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.nina-period__count {
  color: var(--ink-faint);
}
@media (max-width: 620px) {
  .nina-period__valgt {
    margin-left: 0;
  }
}
