/* Snowmap – nettside. Farger og form følger iOS-appen (Theme.swift). */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/outfit-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/outfit-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --rim: #eaf2f7;          /* lys isbakgrunn */
  --rim-dyp: #d3e6f1;
  --flate: #ffffff;
  --blekk: #14303f;        /* tekst og mørke flater */
  --blekk-dus: #4c6777;    /* sekundær tekst, 5,6:1 mot --rim */
  --is: #3e7ca6;           /* aksent */
  --is-lys: #9fd0e8;
  --hav: #0f2836;          /* kartets hav */
  --nisse: #b02f26;
  --topp-hoyde: 64px;
  --kant: 20px;
  --frost: rgba(234, 242, 247, 0.93);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--topp-hoyde); }

body {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--blekk);
  background: var(--rim);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 650; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 2.9rem); }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem); }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

a { color: var(--is); text-underline-offset: 0.18em; }
a:hover { color: var(--blekk); }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--is); outline-offset: 2px; border-radius: 6px; }

.hopp {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--blekk); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.hopp:focus { top: 12px; color: #fff; }

/* ------------------------------------------------------------ topp */

.topp {
  position: sticky; top: 0; z-index: 1500;
  height: var(--topp-hoyde);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--kant);
  background: var(--frost);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(20, 48, 63, 0.08);
}

.merke {
  display: inline-flex; align-items: center; gap: 0.3em;
  font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  color: #16283a; text-decoration: none;
}
.merke span { color: #3d7ab8; margin-left: -0.3em; }
.merke-ikon { width: auto; height: 1.12em; flex: none; }

.topp nav { display: flex; gap: 4px; }
.topp nav a {
  color: var(--blekk); text-decoration: none; font-weight: 500;
  padding: 10px 12px; border-radius: 12px; min-height: 44px; display: inline-flex; align-items: center;
}
.topp nav a:hover { background: rgba(20, 48, 63, 0.07); }

/* språkmeny */
.sprakvelger { position: relative; margin-left: 4px; }
.sprakvelger summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--blekk); font-weight: 500;
}
.sprakvelger summary::-webkit-details-marker { display: none; }
.sprakvelger summary:hover, .sprakvelger[open] summary { background: rgba(20, 48, 63, 0.07); }
.sprakliste {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 1600;
  display: grid; min-width: 11rem; padding: 6px;
  background: var(--flate); border-radius: 16px; border: 1px solid rgba(20, 48, 63, 0.1);
  box-shadow: 0 16px 40px rgba(8, 24, 34, 0.25);
}
.topp .sprakliste a { display: flex; min-height: 42px; padding: 8px 12px; border-radius: 10px; font-weight: 400; }

/* På smale skjermer er det bare plass til navnet og språkmenyen; siden er kort nok til å rulle. */
@media (max-width: 720px) {
  .topp nav > a { display: none; }
}

/* ------------------------------------------------------------ kart */

.kart { background: var(--rim); }

.kart-intro { padding: 28px var(--kant) 20px; max-width: 34rem; }
.kart-intro p { margin-top: 10px; color: var(--blekk-dus); }

.sok { margin-top: 18px; }
.sok label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.sok-rad { display: flex; gap: 8px; }
.sok input {
  flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 14px;
  font: inherit; color: var(--blekk);
  background: var(--flate); border: 1.5px solid rgba(20, 48, 63, 0.22); border-radius: 14px;
}
.sok input::placeholder { color: #6b8291; }
.sok-rad button {
  flex: none; white-space: nowrap; height: 48px; padding: 0 20px; font-weight: 600;
  background: var(--blekk); color: #fff; border: 0; border-radius: 14px;
}
.sok-rad button:hover { background: #0c2230; }
.sok-treff {
  list-style: none; margin: 8px 0 0; padding: 6px;
  background: var(--flate); border-radius: 14px; border: 1px solid rgba(20, 48, 63, 0.12);
}
.sok-treff button {
  display: block; width: 100%; text-align: left; min-height: 44px; padding: 8px 10px;
  background: none; border: 0; border-radius: 10px; color: var(--blekk-dus);
}
.sok-treff button b { color: var(--blekk); font-weight: 600; }
.sok-treff button:hover { background: var(--rim); }
.sok-melding { margin-top: 8px; font-size: 0.95rem; color: var(--blekk-dus); min-height: 1.4em; }
.kart-intro .sok-melding { margin-top: 8px; }

.kart-flate { position: relative; height: 62vh; min-height: 380px; max-height: 760px; background: var(--hav); }
#map { position: absolute; inset: 0; background: var(--hav); font-family: inherit; outline-offset: -4px; }
#map:focus-visible { outline-color: var(--is-lys); border-radius: 0; }

.kart-status {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 800;
  margin: 0; padding: 10px 16px; max-width: calc(100% - 32px);
  background: var(--frost); border-radius: 14px; font-size: 0.95rem; text-align: center;
}
.kart-status[hidden] { display: none; }
.kart-status button, .sted-melding button {
  margin-left: 4px; padding: 6px 12px; min-height: 36px; font-weight: 600;
  background: var(--blekk); color: #fff; border: 0; border-radius: 10px;
}

.snolag { opacity: 0.96; }

.bynavn { width: 0 !important; height: 0 !important; }
.bynavn i {
  position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%;
  background: rgba(234, 242, 247, 0.85);
}
.bynavn span {
  position: absolute; left: 6px; top: -9px; white-space: nowrap;
  font-size: 12px; font-weight: 500; letter-spacing: 0.01em; color: rgba(234, 242, 247, 0.92);
  text-shadow: 0 0 3px var(--hav), 0 0 6px var(--hav), 0 1px 2px var(--hav);
}

.valgt-sted {
  border-radius: 50%; background: #fff; border: 5px solid var(--is);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 4px 14px rgba(8, 24, 34, 0.5);
}

.leaflet-bar { border: 0 !important; box-shadow: 0 4px 16px rgba(8, 24, 34, 0.35) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-bar a { width: 44px !important; height: 44px !important; line-height: 44px !important; color: var(--blekk) !important; background: var(--frost) !important; font-size: 22px !important; }
.leaflet-bar a:hover { background: #fff !important; }
.leaflet-container .leaflet-control-attribution {
  background: rgba(15, 40, 54, 0.7); color: rgba(234, 242, 247, 0.85); font-size: 11px; padding: 2px 8px; border-radius: 8px 0 0 0;
}

/* tidslinje */
.tidslinje {
  display: flex; gap: 4px; padding: 10px var(--kant); overflow-x: auto;
  scrollbar-width: none; background: var(--rim);
}
.tidslinje::-webkit-scrollbar { display: none; }
.tidslinje:empty { display: none; }
.tidslinje button {
  flex: 1 0 58px; min-height: 62px; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: transparent; border: 0; border-radius: 16px; color: var(--blekk-dus);
}
.tidslinje button span { font-size: 0.82rem; font-weight: 500; }
.tidslinje button b { font-size: 1.35rem; font-weight: 650; color: var(--blekk); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tidslinje button:hover { background: rgba(20, 48, 63, 0.07); }
.tidslinje button[aria-pressed="true"] { background: var(--is); color: #fff; }
.tidslinje button[aria-pressed="true"] b { color: #fff; }

/* valgt sted */
.sted { margin: 4px var(--kant) 24px; padding: 18px 20px 20px; background: var(--flate); border-radius: 22px; }
.sted[hidden] { display: none; }
.sted-hode { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sted h2 { font-size: 1.3rem; letter-spacing: -0.01em; }
.sted-dato { color: var(--blekk-dus); font-size: 0.95rem; margin-top: 2px; }
.lukk {
  flex: none; width: 44px; height: 44px; margin: -8px -10px 0 0;
  display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--blekk-dus);
}
.lukk:hover { background: var(--rim); color: var(--blekk); }
.sted-sjanse { display: flex; align-items: baseline; gap: 12px; margin-top: 12px; }
.sted-sjanse b { font-size: 2.6rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.sted-sjanse span { color: var(--blekk-dus); }
.sted dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(20, 48, 63, 0.1); }
.sted dt { color: var(--blekk-dus); }
.sted dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.sted-melding { margin-top: 12px; color: var(--blekk-dus); }

/* Bred skjerm: kartet fyller hele flaten, og panelene ligger oppå. */
@media (min-width: 1180px) {
  :root { --kant: 32px; }
  .kart { position: relative; height: clamp(600px, calc(100vh - var(--topp-hoyde)), 920px); background: var(--hav); }
  .kart-flate { position: absolute; inset: 0; height: auto; min-height: 0; max-height: none; }
  .kart-intro, .tidslinje, .sted {
    position: absolute; z-index: 900;
    background: var(--frost);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(8, 24, 34, 0.35);
  }
  .kart-intro { left: 32px; top: 28px; width: 23.5rem; max-width: none; padding: 26px 26px 20px; border-radius: 26px; }
  /* width: max-content: an absolutely placed box at left: 50% may otherwise only
     be half as wide as the map, and the last days spill out of the panel. */
  .tidslinje { left: 32px; bottom: 28px; width: max-content; padding: 6px; border-radius: 22px; overflow: visible; }
  .tidslinje button { flex: 0 0 66px; }
  .kart-intro { z-index: 950; }   /* search results lie over the timeline, not under it */
  .sted { right: 32px; bottom: 28px; width: 19rem; margin: 0; }
  .kart-status { top: 24px; }
}

/* Wide enough to centre the timeline without touching the place panel on the right. */
@media (min-width: 1500px) {
  .tidslinje { left: 50%; transform: translateX(-50%); }
}

/* ------------------------------------------------------------ appen */

.appen {
  max-width: 1180px; margin: 0 auto; padding: 72px var(--kant) 56px;
  display: grid; gap: 48px;
}
.appen-tekst { max-width: 34rem; }
.ingress { margin-top: 14px; font-size: 1.2rem; color: var(--blekk-dus); }
.appen-tekst h3 { margin-top: 32px; }
.appen-tekst h3 + p { margin-top: 6px; color: var(--blekk-dus); }

.skjermer {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(var(--kant) * -1); padding: 8px var(--kant) 24px; scrollbar-width: none;
}
.skjermer::-webkit-scrollbar { display: none; }
.skjermer img {
  flex: 0 0 62%; max-width: 270px; height: auto; scroll-snap-align: center;
  border-radius: 30px; border: 6px solid var(--blekk); background: var(--blekk);
  box-shadow: 0 18px 40px rgba(20, 48, 63, 0.22);
}

@media (min-width: 900px) {
  .appen { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: center; padding-top: 104px; padding-bottom: 88px; }
  .skjermer { overflow: visible; margin: 0; padding: 28px 0; gap: 18px; align-items: center; }
  .skjermer img { flex: 1 1 0; min-width: 0; max-width: none; }
  .skjermer img:nth-child(2) { transform: translateY(-28px); }
}

/* ------------------------------------------------------------ annonser */

.annonse { max-width: 1010px; margin: 0 auto; padding: 0 var(--kant) 56px; }
.annonse[hidden] { display: none; }
.annonse-merke { font-size: 0.8rem; color: var(--blekk-dus); margin-bottom: 6px; }
.annonse-demo {
  min-height: 110px; display: grid; place-items: center; text-align: center;
  border: 2px dashed rgba(20, 48, 63, 0.3); border-radius: 16px; color: var(--blekk-dus);
}
.annonse ins { min-height: 100px; }

/* ------------------------------------------------------------ julenissen */

.nisse { background: var(--nisse); color: #fff; }
.nisse-innhold { max-width: 1180px; margin: 0 auto; padding: 72px var(--kant); }
.nisse h2 { max-width: 20ch; }
.nedtelling { display: flex; flex-wrap: wrap; gap: 8px 36px; margin-top: 22px; }
.nedtelling[hidden] { display: none; }
.nedtelling span { font-size: 1.05rem; color: #ffe1dc; }
.nedtelling b {
  display: block; font-size: clamp(2.8rem, 1.6rem + 6vw, 5.5rem); font-weight: 650; letter-spacing: -0.04em; line-height: 1;
  color: #fff; font-variant-numeric: tabular-nums; min-width: 1.2ch;
}
.nisse-tekst { margin-top: 26px; max-width: 34rem; color: #fff; }
.nisse :focus-visible { outline-color: #fff; }

.nisse + .annonse { padding-top: 56px; }

/* ------------------------------------------------------------ bunn */

.bunn { background: var(--rim-dyp); padding: 48px var(--kant) 56px; font-size: 0.95rem; color: #35505f; }
.bunn > * { max-width: 44rem; margin-left: auto; margin-right: auto; }
.bunn p + p { margin-top: 12px; }
.bunn .merke { display: flex; font-size: 1.4rem; margin-bottom: 14px; }
.bunn a { color: var(--blekk); }

/* ------------------------------------------------------------ undersider */

.side { max-width: 44rem; margin: 0 auto; padding: 56px var(--kant) 88px; }
.side h1 { margin-bottom: 18px; }
.side h2 { font-size: 1.45rem; margin-top: 40px; letter-spacing: -0.01em; }
.side p, .side ul { margin-top: 12px; }
.side ul { padding-left: 1.2em; }
.side li + li { margin-top: 6px; }
.utkast { padding: 14px 18px; background: #fff4d6; border-radius: 14px; color: #5a4300; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .leaflet-fade-anim .leaflet-popup, .leaflet-zoom-anim .leaflet-zoom-animated { transition: none !important; }
}

/* Smale telefoner: menyen må få plass ved siden av navnet. */
@media (max-width: 420px) {
  .topp { padding: 0 12px; gap: 8px; }
  .topp .merke { font-size: 1.35rem; }
  .topp nav { gap: 0; }
  .topp nav a { padding: 10px 6px; font-size: 0.92rem; }
}
@media (max-width: 360px) {
  .topp { padding: 0 8px; gap: 4px; }
  .topp .merke { font-size: 1.15rem; }
  .topp nav a { padding: 10px 4px; font-size: 0.84rem; }
}
