/* De Waai animation: chrome around the animated map (see de-waai.js).
   Uses the site's brand variables from site.css, with fallbacks so it also works alone. */
.dw {
  --dw-forest: var(--forest, #3a4f44);
  --dw-seaglass: var(--seaglass, #71897c);
  --dw-ice: var(--ice, #f1f2f2);
  --dw-gold: var(--gold, #c9a227);
  --dw-ink: var(--ink, #1f2a24);
  --dw-muted: var(--muted, #5b6760);
  --dw-line: var(--line, #d8dddb);
  container-type: inline-size;
  margin: 0;
  font-family: var(--sans, "Open Sans", system-ui, sans-serif);
  color: var(--dw-ink);
  max-width: 100%;
}
.dw *, .dw *::before, .dw *::after { box-sizing: border-box; }

.dw-stage { position: relative; }
.dw-frame {
  position: relative; overflow: hidden; border-radius: 16px;
  aspect-ratio: 4 / 3; background: #dfe7c9;
  box-shadow: 0 10px 30px rgba(31, 42, 36, .12);
}
.dw-map { display: block; width: 100%; height: 100%; }

/* ---- caption (overlay on wide screens, a band under the map on phones) ---- */
.dw-caption {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  width: min(44%, 330px);
  background: rgba(251, 251, 249, .95);
  border-left: 4px solid var(--dw-gold);
  border-radius: 10px;
  padding: 10px 14px 12px;
  box-shadow: 0 4px 16px rgba(31, 42, 36, .14);
}
.dw-date { display: block; font-family: var(--serif, "Droid Serif", Georgia, serif); font-weight: 700; color: var(--dw-forest); font-size: 1.12rem; line-height: 1.25; }
.dw .dw-text { margin: 4px 0 0; font-size: .88rem; line-height: 1.45; color: var(--dw-ink); }
@media (prefers-reduced-motion: no-preference) {
  .dw-caption.dw-in { animation: dw-in .45s ease-out; }
}
@keyframes dw-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- legend ---- */
.dw .dw-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  list-style: none; margin: 0; padding: 8px 10px;
  background: rgba(251, 251, 249, .9); border-radius: 8px;
  font-size: .72rem; line-height: 1.3; color: var(--dw-ink);
  display: grid; gap: 4px;
}
.dw .dw-legend li { margin: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.dw-legend i { width: 18px; height: 11px; border-radius: 2px; flex: none; display: inline-block; }
.dw-legend .sw-wood { background: radial-gradient(circle at 30% 35%, #5b7658 1.6px, transparent 2px) 0 0 / 7px 7px, #6f8b6b; }
.dw-legend .sw-fields { background: #dfe7c9; box-shadow: inset 0 0 0 1px #b9c79b; }
.dw-legend .sw-orchard { background: radial-gradient(circle, #a7bc7c 1.1px, transparent 1.5px) 0 0 / 5px 5px, #cad7a2; }
.dw-legend .sw-water { background: #8db2c4; }
.dw-legend .sw-dike { height: 8px; background: linear-gradient(#b39a6b 0 30%, #d3c197 30% 65%, #b39a6b 65%); box-shadow: 1px 1.5px 0 rgba(111, 93, 64, .55); }

/* ---- north arrow and scale ---- */
.dw-scale {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: flex-end; gap: 10px;
  padding: 5px 8px; border-radius: 8px; background: rgba(251, 251, 249, .85);
  font-size: .68rem; font-weight: 700; color: var(--dw-forest); line-height: 1;
}
.dw-north { display: grid; justify-items: center; gap: 2px; }
.dw-north i { width: 0; height: 0; border: 5px solid transparent; border-bottom: 9px solid var(--dw-forest); border-top: 0; order: -1; }
.dw-bar { display: grid; gap: 3px; justify-items: start; }
.dw-bar i { display: block; height: 5px; border: 1.5px solid var(--dw-forest); border-top: 0; min-width: 30px; }

/* ---- labels inside the SVG (sizes in screen px, see place() in the script) ---- */
.dw-region text {
  font-family: var(--sans, "Open Sans", system-ui, sans-serif); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; fill: var(--dw-forest); fill-opacity: .72;
  paint-order: stroke; stroke: rgba(251, 251, 249, .75); stroke-width: 3px; stroke-linejoin: round;
}
.dw-lake-label text {
  font-family: var(--serif, "Droid Serif", Georgia, serif); font-style: italic; font-weight: 700; font-size: 18px;
  fill: #fff; paint-order: stroke; stroke: #2e566a; stroke-width: 3.5px; stroke-linejoin: round;
}
.dw-pin-text { font-family: var(--sans, "Open Sans", system-ui, sans-serif); font-size: 12.5px; font-weight: 700; fill: #fff; }

/* ---- controls ---- */
.dw-controls { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.dw-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: var(--dw-forest); border: 2px solid var(--dw-forest); color: #fff;
}
.dw-btn svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.dw-btn:hover { background: #2e4037; }
.dw-btn.dw-ghost { background: transparent; color: var(--dw-forest); }
.dw-btn.dw-ghost:hover { background: var(--dw-ice); }
.dw-btn:disabled { opacity: .35; cursor: default; }
.dw-btn:focus-visible, .dw-dot:focus-visible { outline: 3px solid var(--dw-gold); outline-offset: 2px; }
.dw-prev, .dw-next { display: none; }
.dw-btn.dw-sound { width: auto; padding: 0 14px 0 10px; border-radius: 20px; gap: 6px; display: flex; font: 600 .9rem var(--sans, "Open Sans", system-ui, sans-serif); }
.dw-btn.dw-sound[aria-pressed="true"] { background: var(--dw-forest); color: #fff; }
@media (max-width: 420px) { .dw-btn.dw-sound { width: 40px; padding: 0; justify-content: center; } .dw-sound span { display: none; } }
.dw-reduced .dw-play, .dw-reduced .dw-replay { display: none; }
.dw-reduced .dw-prev, .dw-reduced .dw-next { display: grid; }

.dw-steps { position: relative; flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; height: 40px; margin: 0 4px; }
.dw-track { position: absolute; left: 16px; right: 16px; top: 50%; height: 3px; margin-top: -1.5px; background: var(--dw-line); border-radius: 2px; }
.dw-fill { height: 100%; width: 0; background: var(--dw-seaglass); border-radius: 2px; }
.dw-dot {
  position: relative; width: 32px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
}
.dw-dot::before {
  content: ""; position: absolute; inset: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--dw-seaglass); transition: transform .2s, background .2s;
}
.dw-dot.is-done::before { background: var(--dw-seaglass); }
.dw-dot.is-current::before { background: var(--dw-forest); border-color: var(--dw-gold); border-width: 3px; transform: scale(1.25); }
.dw-dot:hover::before { transform: scale(1.2); }

.dw .dw-credit { margin: 8px 0 0; font-size: .74rem; color: var(--dw-muted); line-height: 1.45; }
.dw-credit a { color: inherit; }

.dw-error { display: grid; place-items: center; }
.dw .dw-msg { margin: 0; color: var(--dw-muted); font-size: .9rem; }

/* ---- phones: taller crop, caption and legend move under the map ---- */
@container (max-width: 559px) {
  .dw-frame { aspect-ratio: 4 / 5; border-radius: 12px; }
  .dw-caption {
    position: static; width: auto; margin-top: 10px; min-height: 6.6em;
    box-shadow: none; background: var(--dw-ice); border-radius: 8px;
  }
  .dw-date { font-size: 1.05rem; }
  .dw .dw-legend {
    position: static; display: flex; flex-wrap: wrap; gap: 4px 14px;
    background: none; padding: 8px 2px 0;
  }
  .dw-scale { right: 8px; bottom: 8px; }
}

/* ---- words timed to the narration (wiel / wheel) ---- */
.dw-words { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.dw-word {
  background: rgba(255,255,255,.94); border-radius: 10px; padding: 6px 14px 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15);
  text-align: right; opacity: 0; transform: translateY(-6px); transition: opacity .45s, transform .45s;
}
.dw-word.is-on { opacity: 1; transform: none; }
.dw-word small { display: block; font: 700 .68rem var(--sans, "Open Sans", system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase; color: var(--dw-seaglass, #71897c); }
.dw-word b { font: italic 700 1.7rem/1.1 var(--serif, "Droid Serif", Georgia, serif); color: var(--dw-forest); }
@media (max-width: 520px) { .dw-words { top: 8px; right: 8px; gap: 5px; } .dw-word { padding: 4px 10px 5px; } .dw-word b { font-size: 1.2rem; } }
