/* ==========================================================================
   Reisemålsstrategi – Nordkynregionen 2026-2036
   Digital publikasjon / presentasjon
   ========================================================================== */

:root {
  --bg:           #0e1d25;
  --bg-deep:      #0a151b;
  --panel:        #0b171d;
  --ink:          #e9f2ef;
  --ink-soft:     rgba(233, 242, 239, .82);
  --ink-dim:      rgba(233, 242, 239, .70);
  --line:         rgba(255, 255, 255, .09);
  --line-soft:    rgba(255, 255, 255, .06);
  --accent:       #5cc3b0;
  --accent-deep:  #308878;
  --accent-soft:  rgba(92, 195, 176, .14);
  --page:         #eefcf6;

  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --dur: 300ms;

  --topbar-h: 74px;
  --bottombar-h: 70px;
  --gutter: 22px;
}

/* --- base ---------------------------------------------------------------- */

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

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(1100px 640px at 50% 34%, rgba(48, 136, 120, .16), transparent 68%),
    radial-gradient(900px 620px at 88% 108%, rgba(48, 136, 120, .09), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.noscript {
  position: fixed;
  inset: auto 0 40% 0;
  text-align: center;
  color: var(--ink-soft);
}

/* --- app shell ----------------------------------------------------------- */

.app {
  position: relative;
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--bottombar-h);
  height: 100vh;
  height: 100dvh;
}

.topbar,
.bottombar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(14, 29, 37, .92), rgba(14, 29, 37, .72));
  border-color: var(--line-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.topbar {
  z-index: 36;
  border-bottom: 1px solid var(--line-soft);
}
.bottombar { border-top: 1px solid var(--line-soft); }

/* --- brand --------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  user-select: none;
}

.brand__logo {
  display: block;
  width: auto;
  height: 35px;
  opacity: .96;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .35));
}

.brand__rule {
  flex: none;
  width: 1px;
  height: 34px;
  background: var(--line);
}

.brand__text { min-width: 0; }

.brand__title {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.005em;
  color: #f1faf7;
  white-space: nowrap;
}

.brand__subtitle {
  margin: 4px 0 0;
  font-size: 1px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

/* --- section indicator --------------------------------------------------- */

.section {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  margin: 0 10px;
  font-size: 14px;
  letter-spacing: .01em;
  color: var(--ink-dim);
  pointer-events: none;
  transition: opacity 180ms ease;
  opacity: .95;
}

.section.is-changing { opacity: 0; }

.section__no {
  flex: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.section__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- toolbar ------------------------------------------------------------- */

.tools {
  display: flex;
  align-items: center;
  flex: none;
  gap: 8px;
  margin-left: auto;
}

.tools__sep {
  width: 1px;
  height: 22px;
  margin: 0 3px;
  background: var(--line);
}

.tool {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, .032);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tool:hover {
  background: var(--accent-soft);
  border-color: rgba(92, 195, 176, .32);
  color: #eafff9;
}

.tool:active { transform: translateY(.5px); }

.tool[disabled] {
  opacity: .32;
  pointer-events: none;
}

.tool svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: rgba(92, 195, 176, .38);
  color: #eafff9;
}

.zoomgroup {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, .032);
}

.zoomgroup .tool {
  width: 31px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.zoomgroup .tool:hover { background: var(--accent-soft); }

.zoomlevel {
  min-width: 62px;
  height: 32px;
  padding: 0 2px;
  border: 0;
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  background: transparent;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.zoomlevel:hover { background: var(--accent-soft); color: #eafff9; }

body.is-zoomed .zoomlevel { color: var(--accent); }

.ico-collapse { display: none; }
body.is-fullscreen .ico-expand { display: none; }
body.is-fullscreen .ico-collapse { display: block; }

/* --- stage --------------------------------------------------------------- */

.stage-area {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}

.stage {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #07131a;
  box-shadow:
    0 34px 80px -30px rgba(0, 0, 0, .9),
    0 4px 18px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(255, 255, 255, .07);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
  cursor: grab;
}

.stage.is-dragging { cursor: grabbing; }
.stage.is-zoomed { cursor: grab; }
.stage.is-zoomed.is-dragging { cursor: grabbing; }

.stage__content {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
  transition: transform 220ms var(--ease);
}

.stage__content.is-direct { transition: none; }

.track {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  background-color: var(--page);
  background-position: 50% 50%;
  background-size: cover;
  background-repeat: no-repeat;
  visibility: hidden;
  z-index: 1;
}

.slide.is-visible {
  visibility: visible;
  will-change: transform;
}

.slide.is-current { z-index: 1; }

.slide.is-incoming {
  z-index: 2;
  box-shadow: 0 0 54px rgba(0, 0, 0, .34);
}


.slide__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms linear;
  user-select: none;
  -webkit-user-drag: none;
}

.slide__img.is-loaded { opacity: 1; }

/* --- edge navigation ----------------------------------------------------- */

.edge {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 62px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}

.edge--prev { left: 0; }
.edge--next { right: 0; }

.edge--prev { background: linear-gradient(90deg, rgba(6, 18, 24, .34), transparent); }
.edge--next { background: linear-gradient(270deg, rgba(6, 18, 24, .34), transparent); }

.edge svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 7px rgba(0, 0, 0, .55));
}

.stage:hover .edge { opacity: .7; }
.edge:hover { opacity: 1; }

.stage.is-zoomed .edge,
.edge[disabled] { display: none; }

/* --- footer -------------------------------------------------------------- */

.bottombar {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 26px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.navbtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, .032);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.navbtn:hover {
  background: var(--accent-soft);
  border-color: rgba(92, 195, 176, .32);
  color: #eafff9;
}

.navbtn[disabled] { opacity: .28; pointer-events: none; }

.navbtn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.counter {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 74px;
  margin: 0 4px;
  justify-content: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
  color: var(--ink-soft);
}

.counter__total { color: var(--ink-dim); font-size: 14px; }

.rail {
  position: relative;
  display: flex;
  align-items: center;
  height: 28px;
  cursor: pointer;
  touch-action: none;
}

.rail__track {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .11);
  transition: height 160ms ease;
}

.rail:hover .rail__track,
.rail.is-seeking .rail__track { height: 5px; }

.rail__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(48, 136, 120, .95), var(--accent));
  transition: width var(--dur) var(--ease);
}

.rail.is-seeking .rail__fill { transition: none; }

.rail__ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rail__tick {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 11px;
  margin-top: -5.5px;
  background: rgba(255, 255, 255, .3);
}

.rail__bubble {
  position: absolute;
  top: -32px;
  transform: translateX(-50%);
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(11, 23, 29, .96);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.rail:hover .rail__bubble,
.rail.is-seeking .rail__bubble { opacity: 1; }

.hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 14px;
  letter-spacing: .01em;
  color: var(--ink-dim);
  white-space: nowrap;
}

.hint kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .04);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.15;
  text-align: center;
  color: var(--ink-soft);
}

.hint__dot { margin: 0 3px; opacity: .5; }

/* --- thumbnails ---------------------------------------------------------- */

.thumbs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(4, 11, 15, .58);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

.thumbs-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.thumbs {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 424px;
  max-width: 92vw;
  background: linear-gradient(180deg, #0c1a21, var(--panel) 60%);
  border-right: 1px solid var(--line);
  box-shadow: 30px 0 70px rgba(0, 0, 0, .5);
  transform: translateX(-102%);
  transition: transform var(--dur) var(--ease);
}

.thumbs.is-open { transform: none; }

.thumbs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.thumbs__eyebrow {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.thumbs__title {
  margin: 0;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.05;
  color: #f1faf7;
}

.thumbs__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 32px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.thumbs__grid::-webkit-scrollbar { width: 9px; }
.thumbs__grid::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 9px;
  background-clip: content-box;
  background-color: rgba(255, 255, 255, .18);
}

.thumbs__section {
  grid-column: 1 / -1;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.thumbs__section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.thumb {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  transition: transform 160ms ease;
}

.thumb:hover { transform: translateY(-1px); }

.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 5px;
  background: var(--page);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.thumb:hover img { border-color: rgba(255, 255, 255, .28); }

.thumb__no {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(8, 20, 26, .82);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .82);
  line-height: 1.5;
}

.thumb.is-active img {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent), 0 8px 22px -8px rgba(0, 0, 0, .8);
}

.thumb.is-active .thumb__no {
  background: var(--accent);
  color: #06231d;
  font-weight: 600;
}

/* --- loader -------------------------------------------------------------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  background: var(--bg);
  transition: opacity 500ms ease, visibility 500ms;
}

body.is-ready .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__logo {
  width: 168px;
  height: auto;
  opacity: .92;
}

.loader__bar {
  position: relative;
  overflow: hidden;
  width: 190px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .1);
}

.loader__bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  border-radius: 2px;
  background: var(--accent);
  animation: loader-slide 1.15s ease-in-out infinite;
}

.loader__text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

@keyframes loader-slide {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(250%); }
}

/* --- fullscreen ---------------------------------------------------------- */

/* In fullscreen the stage owns the whole viewport and the chrome floats
   on top, fading away when the pointer is idle. */
body.is-fullscreen .app { grid-template-rows: minmax(0, 1fr); }

body.is-fullscreen .topbar,
body.is-fullscreen .bottombar {
  position: fixed;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: linear-gradient(180deg, rgba(9, 19, 25, .97), rgba(9, 19, 25, .82));
}

body.is-fullscreen .topbar { top: 0; }
body.is-fullscreen .bottombar { bottom: 0; height: var(--bottombar-h); }

body.is-fullscreen:not(.ui-idle) .topbar,
body.is-fullscreen:not(.ui-idle) .bottombar {
  opacity: 1;
  transform: none;
}

body.is-fullscreen.ui-idle .topbar,
body.is-fullscreen.ui-idle .bottombar {
  opacity: 0;
  pointer-events: none;
}

body.is-fullscreen.ui-idle .topbar { transform: translateY(-10px); }
body.is-fullscreen.ui-idle .bottombar { transform: translateY(10px); }

body.is-fullscreen.ui-idle .edge { display: none; }

/* --- responsive (desktop-first) ----------------------------------------- */

@media (max-width: 1240px) {
  .section { display: none; }
  .hint { display: none; }
  .bottombar { grid-template-columns: auto minmax(80px, 1fr); }
}

@media (max-width: 900px) {
  :root { --topbar-h: 64px; --bottombar-h: 62px; --gutter: 14px; }
  .brand__logo { height: 28px; }
  .brand__title { font-size: 17px; }
  .brand__subtitle { font-size: 14px; letter-spacing: .08em; }
  .brand__rule { display: none; }
  .tools__sep { display: none; }
  .zoomgroup { display: none; }
}

/* --- reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 1ms; }
  .stage__content { transition-duration: 1ms; }
  .loader__bar span { animation-duration: 2s; }
}

/* --- large displays ------------------------------------------------------ */

@media (min-width: 1900px) {
  :root { --topbar-h: 84px; --bottombar-h: 78px; --gutter: 28px; }

  .brand { gap: 18px; }
  .brand__logo { height: 54px; }
  .brand__rule { height: 38px; }
  .brand__title { font-size: 20px; }
  .brand__subtitle { font-size: 14px; margin-top: 6px; }

  .section { font-size: 15px; gap: 11px; }
  .section__no { font-size: 15px; }

  .tool { width: 38px; height: 38px; border-radius: 10px; }
  .tool svg { width: 19px; height: 19px; }
  .zoomgroup .tool { width: 35px; height: 36px; }
  .zoomlevel { height: 36px; min-width: 68px; font-size: 15px; }

  .navbtn { width: 36px; height: 36px; border-radius: 10px; }
  .navbtn svg { width: 18px; height: 18px; }
  .counter { font-size: 15px; min-width: 82px; }
  .counter__total { font-size: 15px; }
  .hint { font-size: 15px; }

  .rail { height: 32px; }
  .rail__track { height: 4px; }
  .rail__bubble { font-size: 15px; top: -36px; }

  .thumbs { width: 486px; }
  .thumbs__head { padding: 24px 22px 16px 28px; }
  .thumbs__title { font-size: 26px; }
  .thumbs__grid { padding: 18px 22px 36px 28px; gap: 12px; }
  .thumbs__eyebrow { font-size: 15px; }
  .thumbs__section { font-size: 15px; }
  .thumb__no { font-size: 15px; }
}
