:root {
  --bg-main: #ddf;
  --bg-panel: #eef;
  --bg-card: #ccf;
  --bg-note: #eee;
  --border-light: #fff;
  --border-subtle: #ccf;
  --font-ui: "Trebuchet MS", Tahoma, Verdana, Arial, sans-serif;
  --font-title: Verdana, Geneva, Arial, Helvetica, sans-serif;
  --header-h: 36px;
}

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

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  font-family: var(--font-ui);
  font-size: 15px;
  color: #111;
}

/* =========================
   DESKTOP DEFAULT (> 900px)
   ========================= */
body {
  overflow: hidden;
}

#titel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  padding: 4px 12px 4px 102px;
  background-color: var(--bg-main);
  border-bottom: 2px solid var(--border-light);
  font-family: var(--font-title);
  font-size: 1.2rem;
  line-height: 26px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 10;
}

#directories {
  position: fixed;
  top: var(--header-h);
  bottom: 88px;
  left: 0;
  width: 160px;
  padding: 6px 4px;
  border-right: 2px solid var(--border-light);
  overflow-y: auto;
  z-index: 4;
}

.directorie {
  margin: 2px 8px;
}

.dir_item {
  display: block;
  padding: 4px 6px;
  margin-left: 2px;
  border-bottom: 1px solid var(--border-subtle);
}

#w3 {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 160px;
  height: 88px;
  padding: 4px;
  border-top: 2px solid var(--border-light);
  border-right: 2px solid var(--border-light);
  background-color: var(--bg-main);
  overflow: hidden;
  z-index: 4;
}

#klein_nav {
  position: fixed;
  top: var(--header-h);
  left: 160px;
  width: 260px;
  height: 28px;
  padding: 4px;
  text-align: center;
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 4;
}

#kleine_fotos {
  position: fixed;
  top: calc(var(--header-h) + 28px);
  bottom: 0;
  left: 160px;
  width: 260px;
  padding: 6px;
  overflow-y: auto;
  z-index: 4;
}

.klein_totaal {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px;
  margin: 0 2px 6px;
}

.klein_totaal img {
  flex: 0 0 auto;
  max-width: 80px;
  height: auto;
}

#middel_foto {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 420px;
  right: 0;
  padding: 16px;
  overflow-y: auto;
  background-color: var(--bg-panel);
  border-left: 2px solid var(--border-light);
  z-index: 3;
}

.dag,
.tekst {
  max-width: 650px;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 4px;
}

.dag {
  background-color: var(--bg-card);
  font-size: 1.35rem;
  font-weight: bold;
}

.tekst {
  background-color: var(--bg-note);
  font-size: 1.05rem;
  line-height: 1.5;
}

img {
  border: 0;
  max-width: 100%;
  height: auto;
}

a:link {
  color: #222;
  text-decoration: none;
}
a:visited {
  color: #444;
  text-decoration: none;
}
a:hover,
a:focus-visible {
  background: #666;
  color: #ffc;
  text-decoration: none;
}
a:active {
  color: #77f;
}

.lijst {
  font-size: 1.4rem;
  color: #f03;
}
.keuze {
  background-color: var(--bg-main);
  color: #000;
}
.selektie {
  background-color: var(--bg-panel);
  color: #000;
  font-weight: bold;
}

/* =========================
   TABLET (601px – 900px)
   ========================= */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  #titel {
    position: sticky;
    padding-left: 16px;
  }

  /* Directories become a horizontal pill bar below the title */
  #directories {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 2px solid var(--border-light);
  }

  .directorie,
  .dir_item {
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    background-color: var(--bg-panel);
    white-space: nowrap;
  }

  #klein_nav {
    position: static;
    width: 100%;
    height: auto;
    padding: 6px 12px;
  }

  /* Thumbnails become a horizontal filmstrip */
  #kleine_fotos {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border-light);
  }

  .klein_totaal {
    flex: 0 0 180px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0;
    background-color: rgba(255, 255, 255, 0.45);
    border-radius: 4px;
  }

  #middel_foto {
    position: static;
    width: 100%;
    min-height: 60vh;
    border-left: 0;
    padding: 16px;
  }

  #w3 {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    padding: 10px 16px;
    text-align: center;
  }
}

/* =========================
   MOBILE (<= 600px)
   ========================= */
@media (max-width: 600px) {
  #titel {
    font-size: 1.05rem;
    padding: 4px 10px;
  }

  /* Larger touch targets for finger scrolling */
  .dir_item {
    padding: 8px 12px;
  }

  .klein_totaal {
    flex: 0 0 140px;
    padding: 6px;
  }

  #middel_foto {
    padding: 12px;
  }

  .dag {
    font-size: 1.2rem;
  }

  .tekst {
    font-size: 1rem;
  }
}
