/* ════════════════════════════════════════════════════
   Foto Archief – SC Muiderberg
   ════════════════════════════════════════════════════ */

:root {
  --geel:         #F7E922;
  --blauw:        #1B47C1;
  --groen:        #1a6b30;
  --groen-donker: #124a20;
  --groen-licht:  #e8f4ec;
  --accent:       #f5a623;
  --tekst:        #1e1e1e;
  --licht-grijs:  #f4f4f4;
  --rand:         #dde5de;
  --wit:          #ffffff;
  --schaduw:      0 2px 8px rgba(0,0,0,.12);
  --radius:       8px;
  --font:         'Segoe UI', Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--licht-grijs);
  color: var(--tekst);
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────── */
.site-header {
  background: var(--geel);
  color: var(--blauw);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.site-header .logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1;
  color: var(--blauw);
}
.site-header .ondertitel {
  font-size: .85rem;
  color: var(--blauw);
  margin-top: .2rem;
  font-weight: 600;
}

/* ── Navigatiebalk ────────────────────────────────── */
.filter-bar {
  background: var(--wit);
  border-bottom: 2px solid var(--groen);
  padding: .65rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.filter-bar label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--groen-donker);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.filter-bar input[type="search"] {
  border: 1.5px solid var(--rand);
  border-radius: 5px;
  padding: .35rem .7rem;
  font-size: .9rem;
  font-family: var(--font);
  min-width: 200px;
  outline: none;
  transition: border-color .2s;
}
.filter-bar input[type="search"]:focus {
  border-color: var(--groen);
}
#teller {
  font-size: .8rem;
  color: #666;
  margin-left: auto;
}

/* ── Terugknop ─────────────────────────────────────── */
.terug-knop-archief {
  background: none;
  border: 1.5px solid var(--groen);
  color: var(--groen-donker);
  padding: .35rem .8rem;
  border-radius: 5px;
  font-size: .85rem;
  font-family: var(--font);
  cursor: pointer;
  font-weight: 600;
  transition: background .15s, color .15s;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.terug-knop-archief:hover {
  background: var(--groen-licht);
}

/* ── Sectie-titels ────────────────────────────────── */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 3rem;
}
.sectie-titel {
  font-size: 1rem;
  font-weight: 700;
  color: var(--groen-donker);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 1.5rem 0 .8rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--groen-licht);
}
.detail-titel {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--tekst);
  margin: 1rem 0 .5rem;
}

/* ── Categorie-tegel-grid ─────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cat-tegel {
  background: var(--wit);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
}
.cat-tegel:hover,
.cat-tegel:focus {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  border-color: var(--groen);
  outline: none;
}
.cat-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: #e0e0e0;
}
.cat-thumb-leeg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--groen-licht);
}
.cat-info {
  padding: .6rem .75rem .75rem;
}
.cat-naam {
  font-size: .9rem;
  font-weight: 700;
  color: var(--tekst);
  line-height: 1.2;
}
.cat-aantal {
  font-size: .78rem;
  color: #666;
  margin-top: .2rem;
}

/* ── Sub-header (event-naam binnen categorie) ─────── */
.sub-header {
  font-size: .95rem;
  font-weight: 700;
  color: var(--groen-donker);
  margin: 1.5rem 0 .6rem;
  padding: .3rem .6rem;
  background: var(--groen-licht);
  border-left: 4px solid var(--groen);
  border-radius: 0 4px 4px 0;
}

/* ── Foto-grid ────────────────────────────────────── */
.foto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .6rem;
  margin-bottom: 1.5rem;
}
.foto-kaartje {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: #ccc;
  aspect-ratio: 4/3;
  position: relative;
  transition: transform .12s, box-shadow .12s;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  text-decoration: none;
}
.foto-kaartje:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  z-index: 1;
}
.foto-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.foto-titel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff;
  font-size: .72rem;
  padding: 1rem .4rem .3rem;
  line-height: 1.3;
}
.leeg-bericht {
  color: #888;
  font-style: italic;
  padding: 2rem 0;
}

/* ── Foto-viewer (foto.html) ───────────────────────── */
.viewer-layout {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 3rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .viewer-layout {
    grid-template-columns: 1fr;
  }
}
.foto-groot {
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  position: relative;
  touch-action: none;
}
.foto-groot img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}

/* ── Zoom-knoppen (overlay op de foto) ──────────────── */
.zoom-controls {
  position: absolute;
  bottom: .75rem;
  right: .75rem;
  display: flex;
  align-items: center;
  gap: .3rem;
  z-index: 10;
}
.zoom-knop {
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 5px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
  user-select: none;
}
.zoom-knop:hover:not(:disabled) { background: rgba(0,0,0,.9); }
.zoom-knop:disabled { opacity: .3; cursor: default; }
.zoom-niveau {
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 5px;
  min-width: 3.2rem;
  text-align: center;
  font-family: var(--font);
}

/* ── Navigatie-knoppen ───────────────────────────── */
.nav-knop {
  background: none;
  border: 1.5px solid var(--rand);
  color: var(--tekst);
  padding: .35rem .75rem;
  border-radius: 5px;
  font-size: .9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.nav-knop:hover:not(:disabled) {
  background: var(--groen-licht);
  border-color: var(--groen);
}
.nav-knop:disabled {
  opacity: .35;
  cursor: default;
}
#nav-teller {
  font-size: .82rem;
  color: #666;
  min-width: 60px;
  text-align: center;
}

/* ── Annotatie-panel ──────────────────────────────── */
.annotatie-panel {
  background: var(--wit);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.annot-titel {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tekst);
}
.annot-datum {
  font-size: .85rem;
  color: var(--groen-donker);
  font-weight: 600;
}
.annot-beschrijving {
  font-size: .9rem;
  line-height: 1.5;
  color: #333;
}
.annot-personen {
  font-size: .85rem;
  color: #555;
  border-top: 1px solid var(--rand);
  padding-top: .5rem;
}
.annot-leeg {
  font-size: .88rem;
  color: #999;
  font-style: italic;
}
.knop-edit {
  margin-top: .5rem;
  background: var(--groen);
  color: #fff;
  border: none;
  padding: .5rem 1rem;
  border-radius: 5px;
  font-size: .85rem;
  font-family: var(--font);
  cursor: pointer;
  font-weight: 600;
  transition: background .15s;
  align-self: flex-start;
}
.knop-edit:hover { background: var(--groen-donker); }

/* ── Edit-modal ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-inhoud {
  background: var(--wit);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  padding: 1.8rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-inhoud h3 {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  color: var(--groen-donker);
}
.modal-inhoud label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .9rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--tekst);
}
.modal-inhoud input,
.modal-inhoud textarea {
  border: 1.5px solid var(--rand);
  border-radius: 5px;
  padding: .45rem .7rem;
  font-size: .9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
  resize: vertical;
}
.modal-inhoud input:focus,
.modal-inhoud textarea:focus {
  border-color: var(--groen);
}
.form-knoppen {
  display: flex;
  gap: .7rem;
  margin-top: .5rem;
}
.knop-opslaan {
  background: var(--groen);
  color: #fff;
  border: none;
  padding: .55rem 1.2rem;
  border-radius: 5px;
  font-size: .9rem;
  font-family: var(--font);
  cursor: pointer;
  font-weight: 600;
  transition: background .15s;
}
.knop-opslaan:hover { background: var(--groen-donker); }
.knop-annuleer {
  background: none;
  border: 1.5px solid var(--rand);
  color: #555;
  padding: .55rem 1rem;
  border-radius: 5px;
  font-size: .9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s;
}
.knop-annuleer:hover { background: var(--licht-grijs); }
#form-status {
  margin-top: .6rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--groen-donker);
  min-height: 1.2em;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .foto-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  .filter-bar input[type="search"] {
    min-width: 130px;
    flex: 1;
  }
}
