/* =====================================
   1. RESET & BASIS TYPOGRAFIE
   ===================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #222;
}

/* =====================================
   1B. GLOBALE TYPOGRAFIE — MERLIN STYLE
   ===================================== */

/* Algemene paragraafstijl */
p {
  line-height: 1.5;
  margin-bottom: 1rem;
  color: #776f67;
  /* zelfde kleur als area-detail */
  font-size: 1rem;
}

/* Hoofdtitels */
h1 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 2rem;
  font-weight: 600;
  color: #249bb7;
  /* zelfde accentkleur als h2 */
}

/* Sectietitels */
h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: #249bb7;
}

/* Subtitels */
h3 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #444;
}

/* dikker kopje inline */
h4 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 1.00rem;
  font-weight: 600;
  color: #249bb7;
}

/* Lijsten */
ul,
ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.4rem;
  color: #776f67;
}

/* Links */
a {
  color: #249bb7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


/* Subtiele toegankelijkheid: focus zichtbaar bij toetsenbordgebruik */
:focus-visible {
  outline: 2px solid rgba(36, 155, 183, 0.55);
  outline-offset: 2px;
}

/* =========================
       Factsheet: kopjes & labels
       ========================= */
.area-detail h4 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 1.00rem;
  font-weight: 600;
  color: #249bb7;
}

.area-detail .inline-kop {
  font-weight: 600;
  color: #249bb7;
  margin-right: 0.3rem;
}

.area-detail p {
  margin: 0.3rem 0;
}

/* Verminder animatie als de gebruiker dat aangeeft */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================
   2. HOOFDLAYOUT (LINKERPANEEL + KAART)
   ===================================== */

.layout {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* Linkerpaneel: lijst + tekst + foto's */
.left-panel {
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #ddd;
  min-width: 260px;
}

/* Rechterpaneel: kaart */
.map-panel {
  flex: 1;
  min-width: 0;
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
}

/* Scheidingsbalk om te resizen */
.divider {
  flex: 0 0 6px;
  cursor: col-resize;
  background: #ddd;
}

.divider:hover {
  background: #ccc;
}

/* =====================================
   3. LABELS OP DE KAART (TOOLTIPS)
   ===================================== */

.area-name-label {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #222;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 0 3px #ffffff;
  white-space: nowrap;
}

/* =====================================
   4. PROJECTGEBIEDEN DROPDOWN + LIJST
   ===================================== */

/* Sticky wrapper bovenin linkerpaneel */
.area-list-wrapper {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f7f7f7;
  border-bottom: 1px solid #ddd;
  padding: 0;
  /* geen extra padding rondom, dat doen we in de knop/menu */
}

/* Container voor dropdown */
.area-dropdown {
  position: relative;
  font-size: 1rem;
}

/* Smalle balk met "Projectgebieden" */
.area-dropdown-toggle {
  width: 100%;
  border: 0;
  background: #e9ecef;
  padding: 0.5rem 0.75rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* (optioneel) extra arrow-element in de knop */
.area-dropdown-toggle .arrow {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
  transform: translateY(1px);
}

/* Pijltje voor de knop (pseudo-element) */
.area-dropdown-toggle::before {
  content: "▾";
  font-size: 1.2rem;
  margin-right: 0.5rem;
  display: inline-block;
  transform: translateY(1px);
}

/* Eventuele ::after uitzetten */
.area-dropdown-toggle::after {
  content: none !important;
}

/* Uitklaplijst */
.area-dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #f7f7f7;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  padding: 0.4rem 0.75rem 0.5rem;
  display: none;
  max-height: 50vh;
  overflow-y: auto;

  /* animatie / hover-gedrag (lazy) */
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

/* Toon lijst bij hover of focus */
.area-dropdown:hover .area-dropdown-menu,
.area-dropdown:focus-within .area-dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Titel boven lijst (nu gebruik je ’m nog niet zichtbaar, maar laten staan) */
.area-list-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}

/* Grid van knoppen in de dropdown */
.area-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.5rem;
}

/* Knoppen voor elk gebied */
.area-button {
  display: block;
  width: 100%;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.area-button:hover {
  background: #e3f2fd;
}

.area-button.is-active {
  background: #007c92;
  color: #fff;
}

/* Basis voor alle area-titels */
.area-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 10px 0 6px;
  opacity: 0.9;
}

/* Specifiek groter in dropdown */
.area-dropdown-menu .area-group-title {
  font-size: 18px;
  line-height: 1.2;
}



/* =====================================
   5. DETAILPANEEL (TEKST PER GEBIED)
   ===================================== */

.detail-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.area-detail {
  display: none;
  max-width: 40rem;
}

.area-detail.active {
  display: block;
}

.area-detail h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  color: #249bb7;
}

.area-detail p {
  line-height: 1.5;
  margin-bottom: 1rem;
  color: #776f67;
}

/* =====================================
   6. FOTO-CAROUSEL ONDERIN LINKERPANEEL
   ===================================== */

.photo-panel {
  flex: 0 0 350px;
  border-top: 1px solid #ddd;
  padding: 0.5rem 0.75rem 0.75rem;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.photo-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 320px;
}

/* Navigatieknoppen (‹ ›) */
.photo-nav {
  border: none;
  background: #eee;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}

.photo-nav:hover:not(:disabled) {
  background: #ddd;
}

.photo-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

/* De kleine viewer-afbeelding */
#photo-viewer {
  cursor: zoom-in;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
  display: none;
  /* standaard verborgen tenzij er foto's zijn */
}

/* Teller onder de foto */
.photo-counter {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
}

/* =====================================
   7. LIGHTBOX (FULLSCREEN FOTO)
   ===================================== */

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.photo-lightbox .lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox .lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}

.photo-lightbox .lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.photo-lightbox .lightbox-nav {
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin: 0 0.75rem;
}

.photo-lightbox .lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* =====================================
   8. RESPONSIVE (MOBIEL / SMALLER VIEWPORTS)
   ===================================== */

@media (max-width: 900px) {

  /* Divider verbergen op mobiel */
  .divider {
    display: none;
  }

  /* Layout onder elkaar i.p.v. naast elkaar */
  .layout {
    flex-direction: column;
    height: auto;
    max-height: none;
  }

  .left-panel {
    flex: 0 0 auto;
    height: 50vh;
    max-height: 50vh;
  }

  .map-panel {
    height: 50vh;
    max-height: 50vh;
    position: relative;
  }

  #map {
    position: absolute;
    inset: 0;
  }

  .photo-panel {
    flex: 0 0 180px;
  }

  .photo-inner {
    height: 130px;
  }
}

/* =====================================
   9. PDF VIEWER
   ===================================== */

.doc-preview {
  margin-top: 1rem;
}

.doc-preview-link {
  display: inline-block;
  text-decoration: none;
  position: relative;
  cursor: pointer;
}

.doc-preview-link img {
  max-width: 65%;
  border-radius: 8px;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.doc-preview-link figcaption {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #555;
}

/* Hover-effect: lichte zoom, schaduw en overlay-tekst */
.doc-preview-link::after {
  content: "Klik om PDF te openen/downloaden";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0.4rem 0.8rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 999px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.doc-preview-link:hover img {
  transform: scale(1.02);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  filter: brightness(1.03);
}

.doc-preview-link:hover::after {
  opacity: 1;
}

/* =====================================
   9b. JPG VIEWER
   ===================================== */

.jpg-preview {
  margin-top: 1rem;
}

.jpg-preview-link {
  display: inline-block;
  text-decoration: none;
  position: relative;
  cursor: pointer;
}

.jpg-preview-link img {
  max-width: 65%;
  border-radius: 8px;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.jpg-preview-link figcaption {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #555;
}

/* Hover-effect: lichte zoom, schaduw en overlay-tekst */
.jpg-preview-link::after {
  content: "Klik om de afbeelding te vergroten";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0.4rem 0.8rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 999px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.jpg-preview-link:hover img {
  transform: scale(1.02);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  filter: brightness(1.03);
}

.jpg-preview-link:hover::after {
  opacity: 1;
}

/* =====================================
   10. LINKJES
   ===================================== */
.area-links {
  margin-top: 1.2rem;
  font-size: 0.95rem;
}

.area-links h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.area-links ul {
  list-style: disc;
  padding-left: 1.2rem;
  margin: 0;
}

.area-links a {
  text-decoration: underline;
}

/* =====================================
   11. VIDEO
   ===================================== */

.area-video {
  margin-top: 1.2rem;
}

.area-video h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.area-video video {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}

/* =====================================
   12. HOMEBUTTON
   ===================================== */
.merlin-home-control .merlin-home-btn {
  display: block;
  width: 30px;
  height: 30px;
  text-align: center;
  text-decoration: none;
  padding: 0;
}

.merlin-home-icon {
  width: 18px;
  height: 18px;
  margin-top: 6px;
  fill: currentColor;
}

.merlin-home-btn {
  color: #333;
  transition: box-shadow 200ms ease, transform 200ms ease, color 200ms ease;
}

.merlin-home-btn.is-glowing {
  box-shadow: 0 0 0 3px rgba(0, 140, 170, 0.25);
  transform: translateY(-1px);
  color: #005a6e;
}

/* =========================================
   Foto-bescherming (soft, client-side)
   ========================================= */
/* Soft protect: ontmoedigt opslaan via rechtsklik / slepen (niet waterdicht) */
.no-download {
  -webkit-touch-callout: none;
  /* iOS: voorkomt 'Bewaar afbeelding' */
  -webkit-user-select: none;
  user-select: none;
}

#img-protect-toast {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.2;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  max-width: min(320px, calc(100vw - 24px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#img-protect-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}