/* ========== BASIS OPMAAK ========== */
:root {
  --bg-page: #e5e5e5;
  --bg-pane: #f9f9f9;
  --border-color: #ccc;
  --text-main: #111;
  --text-muted: #555;
  --accent: #222;
  --radius: 12px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  --gap: 12px;
  --font-size-base: 18px;
  /* <— verhoogd van ±16px */
  --font-size-small: 0.95em;
  --font-size-note: 0.9em;
  --header-height: 126px;
  /* standaard desktophoogte */
}

html {
  scrollbar-gutter: stable both-edges;
}

body {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: 0.01em;
  line-height: 1.6;
  overflow-y: auto;
  overflow-x: hidden;
  /* voorkomt dubbele scroll */
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #222;
  /* iets zachter zwart */
  text-transform: none;
  margin-top: 0.8em;
  margin-bottom: 0.4em;
}

/* ========== PANELEN ========== */
.pane {
  background: var(--bg-pane);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-main);
}

/* Scrollbare gebieden binnen panelen */
.scroll-area {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}



/* ========== RESPONSIVE AANPASSINGEN ========== */

/* ?? Tablets */
@media (max-width: 900px) {
  :root {
    --header-height: 110px;
  }

  .site-header {
    padding: 1.3rem 1rem 1rem;
  }

  .site-header h1 {
    font-size: 1.7em;
  }

  .site-header .subtitle {
    font-size: 0.95em;
    max-width: 90%;
  }



  .container {
    grid-template-columns: 220px 1fr 280px;
  }
}

/* Verzamelingboom – hergebruik indexstijl */
.collection-tree {
  color: var(--text-main);
  font-size: 1em;
  text-align: left;
  padding-left: 0.2em;
}

.collection-tree ul {

  margin-left: 0.8em;
  padding-left: 1.4em;
}

.collection-tree li {
  position: relative;
  margin: 0.15em 0;
}

.collection-tree button.topicBtn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding-left: 1.1em;
  text-align: left;
  font: inherit;
  width: 100%;
}

.collection-tree a {
  text-decoration: none;
  color: var(--text-main);
}

.collection-tree a:hover {
  text-decoration: underline;
}

/* Datumkop bovenaan de dagboektekst */
.head {
  font-family: "EB Garamond", "Georgia", serif;
  font-size: 1.3em;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.8em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border-color);
}

h2,
h3 {
  margin: 0.5em 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 0.8em 0;
}

/* ========== VERZAMELING GRID (responsief 4–2–1) ========== */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 12px;
  justify-items: center;
}

.collection-text {
  grid-column: 1 / -1;
  /* 🟢 laat dit element over alle kolommen lopen */
  width: 100%;
  /* ✅ vult de breedte */
  max-width: none;
  text-align: left;
  margin: 1em auto;
  font-family: 'EB Garamond', serif;
  font-size: 1.05em;
  line-height: 1.6;
  color: #333;
  text-align: left;
}

.collection-text hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1.2em 0;
}

/* Herstel van overerfde opmaak uit .collection-grid div div */
.collection-grid div div {
  margin-top: 0;
  /* verwijdert onbedoelde marge */
  color: inherit;
  /* laat tekstkleur overnemen van parent */
  cursor: default;
  /* normaal gedrag */
}

/* Tablet: 2 kolommen */
@media (max-width: 1100px) {
  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobiel: 1 kolom */
@media (max-width: 600px) {
  :root {
    --header-height: 100px;
  }

  .site-header {
    padding: 1rem 0.8rem 0.8rem;
  }

  .site-header h1 {
    font-size: 1.4em;
  }

  .site-header .subtitle {
    font-size: 0.9em;
  }

  .collection-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== OVERLAY VIEWER ========== */
.viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}


.viewer-caption {
  color: #ddd;
  text-align: center;
  font-size: 1em;
  padding: 8px;
  background: #111;
}

/* kruisje – vast in hoek */
.viewer-close {
  position: fixed;
  /* ✅ niet meer binnen foto */
  top: 10px;
  right: 65px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 4.5rem;
  cursor: pointer;
  user-select: none;
  z-index: 1100;
  transition: color 0.2s ease;
}

.viewer-close:hover {
  color: #fff;
}

/* smalle schermen – dichterbij zetten */
@media (max-width: 800px) {
  .viewer-prev {
    left: 15px;
  }

  .viewer-next {
    right: 15px;
  }

  .viewer-close {
    top: 15px;
    right: 15px;
    font-size: 2.5rem;
  }
}

/* pijltjes vast t.o.v. het scherm */
.viewer-prev,
.viewer-next {
  position: fixed;
  /* ✅ vast in het venster */
  top: 50%;
  /* midden in beeld */
  transform: translateY(-50%);
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.8);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5em;
  transition: color 0.2s ease;
  user-select: none;
  z-index: 1100;
  /* boven foto */
}

/* plaatsing buiten de foto */
.viewer-prev {
  left: 40px;
}

/* afstand tot linker rand */
.viewer-next {
  right: 40px;
}

/* afstand tot rechter rand */

.viewer-prev:hover,
.viewer-next:hover {
  color: #fff;
}



/* ====== WEBSITE HEADER ====== */
.site-header {
  text-align: center;
  padding: 1.6rem 1rem 1.4rem;
  background: linear-gradient(#f9f9f9, #ececec);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.header-logo {
  position: absolute;
  top: 10px;
  /* afstand van boven */
  right: 10px;
  /* afstand van rechts */
  width: 32px;
  height: 32px;
  opacity: 0.9;
  /* mag je weglaten; zorgt voor subtiel effect */
}

.site-header h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.2em;
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.site-header .subtitle {
  font-family: "EB Garamond", serif;
  font-size: 1.1em;
  color: var(--text-muted);
  margin-top: 0.6em;
  line-height: 1.5;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

/* ====== RESPONSIVE HEADER ====== */
@media (max-width: 900px) {
  .site-header {
    padding: 2rem 1rem 1.5rem;
  }

  .site-header h1 {
    font-size: 1.8em;
  }

  .site-header .subtitle {
    font-size: 1em;
    max-width: 90%;
  }
}

@media (max-width: 600px) {
  .site-header h1 {
    font-size: 1.55em;
  }

  .site-header .subtitle {
    font-size: 0.95em;
  }
}

/* ========== ANNOTATIE-ELEMENTEN ========== */

/* Langere notitieblokken */
.annotation {
  background: #f2f2f2;
  border-left: 4px solid #999;
  padding: 0.8em 1.1em;
  border-radius: 6px;
  margin: 1em 0;
  font-size: 0.95em;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

/* Korte inline notitie of toevoeging */
.note {
  background: #e8e8e8;
  color: #333;
  border-radius: 2px;
  /*4px;*/
  padding: 0;
  /*0 0.35em;*/
  margin: 0;
  /*0 0.1em;*/
  font-size: 0.9em;
  font-style: italic;
}

/* Navigatieknoppen vast onderaan de tekstkolom */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  padding: 0.8em 1em;
  border-top: 1px solid var(--border-color);
  background: var(--bg-pane);
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.nav-buttons button {
  background: #ddd;
  border: none;
  padding: 0.4em 0.8em;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  transition: background 0.2s ease, color 0.2s ease;
  min-width: 90px;
}

.nav-buttons button:hover:not(:disabled) {
  background: #ccc;
}

.nav-buttons button:disabled {
  background: #eee;
  color: #999;
  cursor: default;
}

/* ???? Symbolen naast datum */
.loc-symbols {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
  vertical-align: middle;
  transform: translateY(-1px);
  /* optisch centreren bij tekst */
}

.sym-flag {
  width: 30px;
  /* kleiner dan eerst (was 28) */
  height: auto;
  border-radius: 2px;
  opacity: 0.9;
  filter: grayscale(10%);
}

.sym-shield {
  width: 28px;
  /* was 26 ? kleiner */
  height: auto;
  opacity: 0.9;
  filter: grayscale(10%);
}

/* ?? Bronvermelding – klikbare link met tooltip */
.source-ref {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-left: 4px;
  text-decoration: none;
}

/* zichtbaar icoontje */
.source-ref::after {
  content: "i";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #777;
  border-radius: 999px;
  font-size: 0.6rem;
  line-height: 1;
  color: #333;
  background: #e6e6e6;
  margin-left: 2px;
  font-style: normal;
  /* ? belangrijk tegen cursief */
}

/* tooltip */
.source-ref::before {
  content: attr(data-info);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #e6e6e6;
  color: #111;
  font-size: 0.8em;
  font-family: "EB Garamond", "Georgia", serif;
  padding: 6px 8px 7px;
  border-radius: 6px;
  border: 1px solid #999;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 20;
}

.source-ref:hover::before {
  opacity: 1;
}

/* === 🧭 INKLAPBARE INDEX === */
.container {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  /* evt 250 i.p.v. 220, wat jij mooi vindt */
  gap: var(--gap);
  flex: 1;
  padding: var(--gap);
  box-sizing: border-box;
  height: calc(100% - (var(--header-height) + 8px));
  overflow: hidden;
  transition: grid-template-columns 0.3s ease;
  /* ← erbij */
}

/* Wanneer de linkerindex is ingeklapt */
.container.collapsed-left {
  grid-template-columns: 20px 1fr 280px;
}

/* Linkerpane zelf */
.pane.left {
  position: relative;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.pane.left.collapsed {
  opacity: 0.3;
  overflow: visible;
  padding-right: 0.3rem;
  /* minder “kaart” zichtbaar */
}

/* Inhoud verbergen als hij ingeklapt is */
.pane.left.collapsed h2,
.pane.left.collapsed h3,
.pane.left.collapsed hr,
.pane.left.collapsed .tree,
.pane.left.collapsed .collections,
.pane.left.collapsed .menu-switch,
.pane.left.collapsed .menu-section {
  display: none !important;
}

/* === 📌 Vast pijltje dat midden op het scherm blijft === */
.toggle-index {
  position: fixed;
  left: 226px;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 42px;
  top: 50%;
  /* JS corrigeert dit naar zichtbare helft */
  border: 1px solid var(--border-color);
  background: var(--bg-pane);
  /* dezelfde kleur als panelen */
  cursor: pointer;
  z-index: 100;
  transition: left 0.3s ease, background 0.2s ease, border-radius 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px 0 0 6px;
  /* open: geen afgeronde kant rechts */
}

toggle-index:hover {
  background: #f0f0f0;
}

/* pijltje zelf (standaard: naar rechts) */
.toggle-index::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 8px 6px 0;
  border-color: transparent #666 transparent transparent;
  transition: transform 0.3s ease;
}

/* bij ingeklapt: pijl naar links */
.toggle-index.collapsed::before {
  transform: rotate(180deg);
  transform-origin: center;
}

/* bij ingeklapt: schuif naar links + geen afgeronde kant links */
.container.collapsed-left .toggle-index {
  left: 31px;
  /* afstemmen op jouw smalle strook */
  border-radius: 0 6px 6px 0;
  /* afgerond alleen rechts */
}

/* standaard: géén pijltje */
.topicBtn::before {
  content: "";
}

/* Alleen knoppen met submenu krijgen een pijltje */
.topicBtn.has-submenu::before {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 0.55em;

  /* Maak een driehoekje met borders */
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  /* hoogte, breedte van de punt */
  border-color: transparent transparent transparent var(--text-muted);

  transition: transform 0.25s ease;
  transform-origin: 25% 50%;
}

/* Draaien bij openklappen */
.topicBtn.open.has-submenu::before {
  transform: rotate(90deg);
}

a.streetview-link:hover {
  opacity: 1;
  transform: scale(1.12);
  background: #fff4f4;
}

a.streetview-link svg {
  width: 13px;
  height: 13px;
  fill: #d45a5a;
  /* 🌸 zacht rood */
}

/* 📅 Kalenderstijl */
#calendarContainer {
  font-size: 0.9em;
  font-family: 'EB Garamond', serif;
  color: #444;
  /* iets zachter dan zwart */
  text-align: center;
  margin-top: 0.5rem;
}

.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5em;
}

.calendar-controls button {
  background: none;
  border: none;
  color: #666;
  font-size: 1.2em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.calendar-controls button:hover {
  color: #000;
}

#calendarTitle {
  font-weight: 600;
}

.calendar-header-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 0.9em;
}

.calendar-header-row {
  font-weight: 600;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.calendar-day {
  padding: 6px 0;
  border-radius: 6px;
  user-select: none;
  color: #444;
  font-weight: 400;
}

.notice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.notice-box h3 {
  margin-top: 0;
}

.notice-box button {
  margin-top: 1em;
  padding: 0.5em 1.2em;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #fff;
  font-size: 0.95em;
  cursor: pointer;
}

.notice-box button:hover {
  background: #555;
}

.calendar-day.available {
  cursor: pointer;
  background: #f8f8f8;
  transition: background 0.2s ease;
}

.calendar-day.available:hover {
  background: #e6e6e6;
}

.calendar-day.unavailable {
  color: #bbb;
}

/* ✳️ Geselecteerde dag (actief dagboekblad) */
.calendar-day.selected {
  background: #555;
  /* lichter dan #333 voor rustiger contrast */
  color: #fff;
  font-weight: 600;
}

#calendar .calendar-day {
  -webkit-tap-highlight-color: transparent;
}

#calendarTitle select {
  font-family: 'EB Garamond', serif;
  font-size: 0.95em;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 2px 6px;
  background: #f8f8f8;
  color: #333;
  margin: 0 2px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#calendarTitle select:hover {
  background: #eee;
  border-color: #999;
}


.sidebar-separator {
  margin: 0.75rem 0 0.5rem;
  border: 0;
  border-top: 1px solid #ddd;
}

aside {
  font-size: 0.9rem;
  color: #555;
}

/* === Paneelkoppen: zelfde stijl als .head === */
.head,
.menu-section h2,
.pane.right h2 {
  font-family: "EB Garamond", "Georgia", serif;
  font-weight: 600;
  font-size: 1.3em;
  /* zelfde als .head */
  color: var(--accent);
  text-align: center;
  margin: 0.6em 0 0.8em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3em;
}

/* Middenkop (datum) — centreren zonder extra marge boven */
.head {
  margin-top: 0.4em;
  margin-bottom: 0.8em;
}

/* Linkerzijde (Kalender / Verzameling) */
.menu-section h2 {
  margin-top: 0.4em;
  /* zelfde als middenkop */
  margin-bottom: 0.8em;
  /* lijn op gelijke hoogte */
}

/* Rechterzijde (Foto's) */
.pane.right h2 {
  margin-top: 0.4em;
  margin-bottom: 0.8em;
}

.notice-box {
  background: #fff;
  padding: 1.5em 2em;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  text-align: center;
  line-height: 1.5;
}

.notice-box h3 {
  margin-top: 0;
}

.notice-box button {
  margin-top: 1em;
  padding: 0.5em 1.2em;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #fff;
  font-size: 0.95em;
  cursor: pointer;
}

.notice-box button:hover {
  background: #555;
}

.site-footer {
  text-align: center;
  font-size: 0.75em;
  /* iets kleiner font */
  color: #666;
  padding: 0.6em 0 0.8em;
  /* minder hoog */
  background: #f6f6f6;
  border-top: 1px solid #ddd;
  line-height: 1.4;
  /* compacte regelafstand */
}

.site-footer p {
  margin: 0 auto;
  max-width: 700px;
}

.footer-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  /* icoon + tekst op één lijn */
  align-items: center;
  gap: 4px;
}

.footer-link:hover {
  color: #0078d4;
  text-decoration: underline;
}

.mail-icon {
  width: 0.9em;
  /* iets kleiner dan tekst */
  height: 0.9em;
  fill: currentColor;
  vertical-align: middle;
}


/* === FOTO + CAPTION MET FIGURE === */


/* ===== 📸 Algemene foto-opmaak (buiten viewer) ===== */
.photo-figure {
  margin: 0;
  display: block;
  /* ✅ was inline-block → nu blok, vult breedte */
  text-align: center;
  max-width: 100%;
}

.photo-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 6px;
}

/* ===== 🪶 Onderschrift algemeen ===== */
.photo-caption {
  display: inline;
  /* één tekstregelblok */
  font-family: "EB Garamond", "Georgia", serif;
  font-size: 0.9rem;
  color: var(--text-main, #111);
  line-height: 1.4;
  text-align: center;
  margin-top: 6px;
  margin-bottom: 10px;
  max-width: 100%;
  white-space: normal;
  /* mag afbreken */
  word-wrap: break-word;
}

.photo-caption .cap-text {
  display: inline;
  white-space: normal;
  word-wrap: break-word;
}

/* Komma tussen captiontekst en datum */
.photo-caption .cap-text:not(:empty)+time.date-link::before {
  content: ", ";
  /* 🔹 de komma en spatie */
  color: inherit;
  /* zelfde kleur als tekst */
}

.photo-caption time.date-link {
  display: inline;
  white-space: nowrap;
  word-wrap: break-word;
  text-decoration: underline;
  color: inherit;
}

.photo-caption .streetview-inline {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
}

.photo-caption .streetview-inline svg {
  fill: #d45a5a;
  width: 13px;
  height: 13px;
  vertical-align: middle;
  position: relative;
  top: -4px;
  /* 1px omhoog voor optische correctie */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.photo-caption .streetview-inline:hover svg {
  transform: scale(1.1);
  opacity: 0.9;
}

/* ===== 🪟 Viewer specifieke aanpassingen ===== */
.viewer-content {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 95vw;
  max-height: 90vh;
  overflow: visible;
  /* 🔹 ruimte buiten de foto toestaan */
}



.viewer-content .photo-caption {
  background: rgba(0, 0, 0, 0.85);
  color: #eee;
  padding: 8px 12px;
  border-radius: 0 0 8px 8px;
  margin-top: 0;
  display: flex;
  /* was inline-block */
  width: 100%;
  /* was auto */
  max-width: none;
  /* was 95vw */
  box-sizing: border-box;
  text-align: center;
}

.viewer-img,
.viewer-frame {
  display: block;
  width: auto;
  height: auto;
  max-width: 95vw;
  max-height: 85vh;
  /* 🟢 iets ruimer */
  object-fit: contain;
  border-radius: 8px 8px 0 0;
  margin: 0 auto;
  box-sizing: border-box;
}

.home-button {
  position: absolute;
  top: 10px;
  /* exact gelijk aan .header-logo */
  left: 10px;
  /* spiegelpositie */
  width: 32px;
  /* zelfde maat als logo */
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: #333;
  /* sober, historisch */
  opacity: 0.85;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.home-button:hover {
  opacity: 1;
  transform: scale(1.08);
}

.home-button svg {
  width: 20px;
  height: 20px;
  display: block;
}

.pdf-link {
  display: inline-block;
  padding: 0.6em 0.9em;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: #f4f4f4;
  text-decoration: none;
  color: #222;
  font-family: "EB Garamond", serif;
  font-size: 0.95em;
}

.pdf-link:hover {
  background: #eaeaea;
}