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

:root {
  --navy:         #1c2a4a;
  --navy-mid:     #253358;
  --navy-light:   #e8ecf5;
  --rust:         #c8503a;
  --rust-dark:    #a83f2c;
  --cream:        #eee8d5;
  --cream-mid:    #e4dcc8;
  --text:         #1c2a4a;
  --text-muted:   #5a6272;
  --bg:           #eee8d5;
  --white:        #faf8f4;
  --border:       #d5cdb8;
  --accent:       #c8503a;
  --shadow:       0 2px 20px rgba(28,42,74,0.12);
  --shadow-lg:    0 8px 40px rgba(28,42,74,0.18);
  --nav-h:        60px;
  --panel-w:      420px;
  --radius:       4px;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

/* ── Navigation ─────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(28,42,74,0.35);
}

.nav-logo-text {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: 0.01em;
}

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

.nav-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--white); }

.nav-link-active {
  color: var(--white) !important;
  border-bottom: 2px solid var(--rust);
  padding-bottom: 2px;
}

.nav-link-bok {
  color: var(--white) !important;
  background: var(--rust);
  padding: 4px 10px !important;
  border-radius: 3px;
  transition: background 0.2s !important;
}

.nav-link-bok:hover { background: var(--rust-dark) !important; }

/* ── Slideshow ───────────────────────────────────────── */

.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  margin: 32px 0;
  background: var(--navy-light);
  transition: opacity 0.4s ease;
}

.slideshow.fading { opacity: 0; }

.slideshow-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slideshow-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(28,42,74,0.65));
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem;
  font-style: italic;
  pointer-events: none;
}

/* ── Flytende bokknapp på kartet ─────────────────────── */

.bok-cta {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--rust);
  color: var(--white);
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 9px 20px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}

.bok-cta:hover {
  background: var(--rust-dark);
  transform: translateX(-50%) translateY(-2px);
}

/* ── Søk ─────────────────────────────────────────────── */

.search-wrap {
  position: fixed;
  top: calc(var(--nav-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  z-index: 600;
  padding: 0 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  padding: 0 14px;
  gap: 8px;
}

.search-icon {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#searchInput {
  flex: 1;
  border: none;
  background: none;
  padding: 12px 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
}

#searchInput::placeholder { color: var(--text-muted); }

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: none;
  transition: color 0.2s;
}

.search-clear:hover { color: var(--text); }
.search-clear.visible { display: block; }

.search-results {
  list-style: none;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  margin-top: 6px;
  overflow: hidden;
  display: none;
}

.search-results.visible { display: block; }

.search-result {
  padding: 11px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.search-result:last-child { border-bottom: none; }

.search-result:hover,
.search-result.active {
  background: var(--navy-light);
}

.sr-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rust);
  flex-shrink: 0;
}

.sr-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
}

.sr-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-empty {
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.search-result mark {
  background: none;
  color: var(--rust);
  font-weight: 600;
}

/* ── Map ─────────────────────────────────────────────── */

#map {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  z-index: 1;
}

/* ── Info-widget (ekspanderbar, bottom-left) ─────────── */

.info-widget {
  position: fixed;
  bottom: 28px;
  left: 24px;
  z-index: 500;
  max-width: 240px;
}

.info-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 20px;
  padding: 8px 14px 8px 16px;
  font-family: 'Playfair Display', serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s;
  white-space: nowrap;
}

.info-toggle:hover { background: var(--navy-mid); }

.info-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.info-widget.is-open .info-chevron {
  transform: rotate(180deg);
}

.info-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease), padding 0.35s var(--ease);
  margin-bottom: 8px;
}

.info-widget.is-open .info-panel {
  max-height: 400px;
  padding: 18px 20px 16px;
}

.map-info-logo {
  display: block;
  width: 100px;
  height: auto;
  margin: 0 auto 12px;
}

.info-panel p {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-muted);
  text-align: center;
}

.map-info-contact {
  margin-top: 8px;
}

.map-info-contact a {
  color: var(--rust);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.map-info-contact a:hover {
  color: var(--rust-dark);
  text-decoration: underline;
}

.kiosk-count {
  display: block;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ── Sitatboks ───────────────────────────────────────── */

.quote-box {
  position: fixed;
  bottom: 32px;
  right: 24px;
  z-index: 500;
  background: var(--white);
  padding: 18px 20px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 270px;
  cursor: pointer;
  transition: opacity 0.3s ease, box-shadow 0.2s;
  user-select: none;
}

.quote-box:hover {
  box-shadow: var(--shadow-lg);
}

.quote-box.fading {
  opacity: 0;
}

.quote-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 8px;
}

.quote-text {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text);
  font-style: normal;
  border: none;
  margin: 0 0 8px;
  padding: 0;
  quotes: none;
}

.quote-attr {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 10px;
}

.quote-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.q-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.q-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.q-dot:hover {
  background: var(--navy-mid);
}

/* ── Markers ─────────────────────────────────────────── */

.kiosk-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.marker-dot {
  width: 13px;
  height: 13px;
  background: var(--accent);
  border: 2.5px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
  transition: transform 0.18s var(--ease), box-shadow 0.18s;
}

.kiosk-marker:hover .marker-dot {
  transform: scale(1.5);
  box-shadow: 0 2px 10px rgba(200,80,26,0.45);
}

/* Leaflet tooltip */
.kiosk-tooltip.leaflet-tooltip {
  background: var(--white);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
}

.kiosk-tooltip.leaflet-tooltip::before {
  display: none;
}

/* ── Side panel ──────────────────────────────────────── */

.panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: var(--panel-w);
  bottom: 0;
  background: var(--white);
  z-index: 800;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  overflow-y: auto;
  box-shadow: -4px 0 30px rgba(0,0,0,0.14);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.panel.is-open  { transform: translateX(0); }

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.22);
  z-index: 799;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.panel-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}

.panel-close:hover {
  background: var(--navy-light);
  color: var(--navy);
}

.panel-inner {
  padding: 32px 28px 48px;
}

/* Panel typography */
.panel-location {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 6px;
}

.panel-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 24px;
}

/* Images */
.panel-images { margin-bottom: 8px; }

.panel-img-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: zoom-in;
  display: block;
  transition: opacity 0.18s;
}

.panel-img-main:hover { opacity: 0.9; }

.panel-thumbnails {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.panel-thumb {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 2px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  opacity: 0.75;
  transition: opacity 0.2s, border-color 0.2s;
}

.panel-thumb:hover        { opacity: 1; }
.panel-thumb.active       { border-color: var(--accent); opacity: 1; }

.no-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--navy-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* History */
.panel-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.panel-history-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.panel-history {
  font-size: 0.875rem;
  line-height: 1.85;
  color: var(--text);
}

.panel-history p + p { margin-top: 12px; }

.panel-disclaimer {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--cream);
  border-radius: var(--radius);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--text-muted);
  font-style: italic;
}

.panel-year {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Lightbox ────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.93);
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
  transition: color 0.2s;
  padding: 4px 8px;
}

.lightbox-close:hover { color: var(--white); }

.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 4px 50px rgba(0,0,0,0.6);
  user-select: none;
  display: block;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: white;
  font-size: 2.2rem;
  width: 48px;
  height: 72px;
  cursor: pointer;
  border-radius: 3px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.18); }

.lightbox-prev.hidden,
.lightbox-next.hidden { display: none; }

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  z-index: 1;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 600px) {
  :root { --panel-w: 100vw; }

  /* Skjul elementer på mobil */
  .quote-box    { display: none; }
  .kiosk-count  { display: none; }
  .nav-link-bok { display: none; }

  /* Bokknapp nede til høyre på mobil */
  .bok-cta {
    left: auto;
    right: 12px;
    transform: none;
    font-size: 0.78rem;
    padding: 8px 14px;
  }

  .bok-cta:hover {
    transform: translateY(-2px);
  }

  /* Mindre søkefelt – høyrejustert så det ikke dekker zoom-knapper */
  .search-wrap {
    top: calc(var(--nav-h) + 8px);
    left: auto;
    right: 12px;
    transform: none;
    max-width: calc(100vw - 70px);
    padding: 0;
  }

  #searchInput {
    font-size: 0.82rem;
    padding: 9px 0;
  }

  .search-box {
    padding: 0 10px;
  }

  /* Info-widget */
  .info-widget {
    bottom: 16px;
    left: 12px;
  }

  .panel-inner { padding: 24px 20px 36px; }

  .lightbox-stage {
    max-width: calc(100vw - 80px);
  }

  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}
