/* Wakemap – nachtkaart met posterpanelen (combinatie van richting A en B) */

:root {
  --water: #08132A;
  --water-deep: #04091A;
  --land: #1E2F52;
  --map-border: #3A5382;
  --paper: #F4EEDC;
  --paper-2: #EAE2CB;
  --navy: #1B2A4A;
  --ink: #1B2A4A;
  --muted: #5B6478;
  --muted-2: #8A93AB;
  --line: rgba(27, 42, 74, 0.25);
  --accent: #FF7A3D;
  --accent-strong: #E2542B;
  --accent-soft: rgba(226, 84, 43, 0.12);
  --font-display: "Anton", Impact, "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --radius: 3px;
  --gutter: 28px;
}

* { box-sizing: border-box; }

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

body {
  background: var(--water);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
}

a { color: var(--accent-strong); }
a:hover { color: #B93F1D; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap;
}

/* --- Kaart ------------------------------------------------------------- */

#map {
  position: fixed;
  inset: 0;
  background: var(--water);
}

/* Golfpatroon over het water, met vignet aan boven- en onderrand. */
#map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(4, 9, 26, 0.5) 0%, rgba(4, 9, 26, 0) 24%, rgba(4, 9, 26, 0) 80%, rgba(4, 9, 26, 0.55) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='44'%3E%3Cpath d='M0 22 Q 35 6 70 22 T 140 22' fill='none' stroke='%235FA8FF' stroke-opacity='0.11' stroke-width='1.2'/%3E%3Cpath d='M-70 44 Q -35 28 0 44 T 70 44' fill='none' stroke='%235FA8FF' stroke-opacity='0.06' stroke-width='1'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.maplibregl-canvas:focus { outline: none; }

/* --- Panelen (crème papier, navy rand) ---------------------------------- */

.panel {
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  color: var(--ink);
}

.brand {
  position: fixed;
  left: var(--gutter);
  top: var(--gutter);
  width: 420px;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 22px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
  z-index: 3;
}

.brand__stripes {
  position: absolute;
  right: -6px;
  top: -8px;
  display: flex;
  gap: 6px;
  transform: skewX(-28deg);
}
.brand__stripes i { display: block; width: 6px; height: 34px; background: var(--accent-strong); }
.brand__stripes i:nth-child(2) { background: var(--navy); }
.brand__stripes i:nth-child(3) { background: var(--accent-strong); opacity: 0.45; }

.brand__row { display: flex; align-items: center; gap: 14px; }
.brand__mark { flex: none; }

.brand__title {
  margin: 0;
  font-size: 40px;
  color: var(--navy);
  text-transform: uppercase;
}
.brand__title span { color: var(--accent-strong); }

.brand__tagline {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand__stats {
  margin: 0;
  display: flex;
  gap: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat b { font-size: 28px; font-weight: 400; color: var(--accent-strong); }
.stat--alt b { color: var(--navy); }

/* --- Zoeken ------------------------------------------------------------- */

.search {
  position: fixed;
  left: var(--gutter);
  top: 214px;
  width: 420px;
  max-width: calc(100vw - 2 * var(--gutter));
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 18px;
  z-index: 4;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(226, 84, 43, 0.25);
}
.search.is-open { border-radius: var(--radius) var(--radius) 0 0; }

.search__icon { flex: none; }

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  outline: none;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }

.search__kbd {
  font: 600 12px/1 var(--font-body);
  color: var(--muted);
  border: 1.5px solid var(--navy);
  border-radius: var(--radius);
  padding: 4px 7px;
}
.search:focus-within .search__kbd { display: none; }

.search__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.search__clear:hover { color: var(--navy); }
.search__clear[hidden] { display: none; }

.results {
  position: fixed;
  left: var(--gutter);
  top: 270px;
  width: 420px;
  max-width: calc(100vw - 2 * var(--gutter));
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding-bottom: 8px;
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 4;
}

.results__group {
  padding: 12px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.result:hover, .result.is-active {
  background: var(--accent-soft);
  border-left-color: var(--accent-strong);
}
.result mark { background: transparent; color: var(--accent-strong); font-weight: 700; }
.result__sub { flex: none; font-size: 12px; color: var(--muted); text-align: right; }

.results__empty { margin: 0; padding: 14px 16px; color: var(--muted); }

.results__hint {
  display: flex;
  gap: 16px;
  margin: 8px 0 0;
  padding: 12px 16px 4px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}

/* --- Legenda, knoppen, status ------------------------------------------ */

.legend {
  position: fixed;
  left: var(--gutter);
  bottom: var(--gutter);
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  z-index: 2;
}
.legend__item { display: flex; align-items: center; gap: 8px; }
.legend__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 122, 61, 0.2);
  margin: 0 4px;
}
.legend__cluster {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--navy);
  color: var(--paper);
  font: 400 12px var(--font-display);
  font-style: normal;
}

.controls {
  position: fixed;
  right: var(--gutter);
  bottom: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 2;
}

.controls__reset {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  font: 600 13px var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.controls__reset:hover { background: var(--paper-2); }

.controls__zoom { display: flex; flex-direction: column; overflow: hidden; }
.controls__zoom button {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}
.controls__zoom button:first-child { border-bottom: 2px solid var(--navy); }
.controls__zoom button:hover { background: var(--paper-2); }

.status {
  position: fixed;
  left: 50%;
  bottom: var(--gutter);
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--muted);
  z-index: 5;
}
.status.is-error { color: #B93F1D; border-color: #B93F1D; }

.noscript {
  position: fixed; inset: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--water); color: var(--paper); z-index: 10;
}

/* --- MapLibre-overrides -------------------------------------------------- */

.maplibregl-ctrl-attrib {
  background: rgba(4, 9, 26, 0.7) !important;
  color: var(--muted-2);
  font: 11px var(--font-body);
  padding: 3px 8px;
}
.maplibregl-ctrl-attrib a { color: #B4BCD0; text-decoration: none; }
.maplibregl-ctrl-attrib a:hover { color: var(--paper); }
.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }

.maplibregl-popup { z-index: 3; }
.maplibregl-popup-content {
  padding: 0;
  background: transparent;
  border-radius: var(--radius);
  box-shadow: none;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--navy); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--navy); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--navy); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--navy); }
.maplibregl-popup-close-button {
  top: 14px; right: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}
.maplibregl-popup-close-button:hover { background: var(--paper-2); color: var(--navy); }

.wm-card {
  width: 312px;
  max-width: 88vw;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  color: var(--ink);
}
.wm-card__bar {
  height: 6px;
  background: linear-gradient(90deg, var(--accent-strong) 0 55%, var(--navy) 55% 70%, transparent 70%);
}
.wm-card__body { display: flex; flex-direction: column; gap: 10px; padding: 16px 44px 18px 18px; }
.wm-card__title { margin: 0; font-size: 24px; line-height: 1; color: var(--navy); }
.wm-card__place { margin: 0; font-size: 14px; color: var(--muted); }
.wm-card__chips { display: flex; gap: 8px; }
.chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
  border: 1.5px solid var(--accent-strong);
  padding: 4px 8px;
  border-radius: 2px;
}
.wm-card__body .btn { margin: 4px -26px 0 0; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  background: var(--accent-strong);
  color: var(--paper) !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.btn:hover { background: #C9491F; }
.wm-card__none { margin: 4px 0 0; font-size: 13px; color: var(--muted-2); }

/* --- Mobiel ---------------------------------------------------------------- */

@media (max-width: 720px) {
  :root { --gutter: 14px; }

  .brand {
    width: auto;
    right: var(--gutter);
    padding: 10px 14px;
    gap: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    clip-path: none;
  }
  .brand__stripes { display: none; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__title { font-size: 26px; }
  .brand__tagline { display: none; }
  .brand__stats { padding: 0; border: 0; gap: 12px; font-size: 12px; }
  .stat b { font-size: 18px; }
  .stat--alt { display: none; }

  .search { top: 78px; width: auto; right: var(--gutter); height: 50px; }
  .search__kbd { display: none; }
  .results { top: 128px; width: auto; right: var(--gutter); max-height: calc(100vh - 160px); }
  .results__hint { display: none; }

  .legend { display: none; }
  /* 'Heel Europa' onder het zoekveld, zodat de popup-sheet onderaan vrij blijft. */
  .controls { top: 138px; right: var(--gutter); bottom: auto; }
  .controls__reset { height: 36px; font-size: 12px; }
  .controls__zoom { display: none; }

  /* Popup onderaan als sheet */
  .maplibregl-popup {
    position: fixed !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    transform: none !important;
    max-width: none !important;
  }
  .maplibregl-popup-tip { display: none; }
  .maplibregl-popup-content { width: 100%; }
  .wm-card {
    width: 100%;
    max-width: none;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .wm-card__body { padding: 14px 20px 22px; }
  .wm-card__body .btn { margin-right: 0; height: 50px; }
  .maplibregl-popup-close-button { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .search, .result { transition: none; }
}
