/* De galerij: een raster van beelden, en het grote beeld dat eroverheen opent.
   Sober gehouden. In een galerij doet het beeld het werk; alles wat er omheen
   staat leidt af. */

.wsc-gal {
  display: grid;
  grid-template-columns: repeat(var(--wsc-gal-kolommen, 4), minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
  margin-top: clamp(18px, 2.6vw, 28px);
}

.wsc-gal__item { margin: 0; min-width: 0; }

.wsc-gal__tegel {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--wsc-bg, #eef1f5);
  border-radius: var(--wsc-radius-sm, 6px);
}
.wsc-gal__tegel img,
.wsc-gal__tegel video {
  width: 100%;
  /* height: auto zou de vaste verhouding hieronder tenietdoen; die zetten we
     per vorm. De middleware van seo-signaal zet width en height op elk beeld,
     en zonder deze regel wint dat van aspect-ratio. */
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

/* De vorm van de tegels. Vierkant is de veiligste keuze voor een raster: alles
   even hoog, en dan leest de reeks als een reeks. */
.wsc-gal--square .wsc-gal__tegel { aspect-ratio: 1; }
.wsc-gal--portrait .wsc-gal__tegel { aspect-ratio: 4 / 5; }
.wsc-gal--landscape .wsc-gal__tegel { aspect-ratio: 3 / 2; }

/* Zoals de foto zelf: metselwerk in kolommen, zodat staand en liggend naast
   elkaar kunnen zonder dat er iets wordt afgesneden. */
.wsc-gal--origineel {
  display: block;
  column-count: var(--wsc-gal-kolommen, 4);
  column-gap: clamp(10px, 1.4vw, 18px);
}
.wsc-gal--origineel .wsc-gal__item {
  break-inside: avoid;
  margin-bottom: clamp(10px, 1.4vw, 18px);
}
.wsc-gal--origineel .wsc-gal__tegel { aspect-ratio: auto; }
.wsc-gal--origineel .wsc-gal__tegel img,
.wsc-gal--origineel .wsc-gal__tegel video { height: auto; }

.wsc-gal--klikbaar .wsc-gal__tegel { cursor: zoom-in; }
.wsc-gal--klikbaar .wsc-gal__tegel:hover img,
.wsc-gal--klikbaar .wsc-gal__tegel:hover video { transform: scale(1.04); }
.wsc-gal__tegel:focus-visible { outline: 2px solid var(--wsc-accent, #2c7be5); outline-offset: 3px; }

/* Video's krijgen een driehoek, want anders is een stilstaand frame niet van
   een foto te onderscheiden. */
.wsc-gal__play {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #14161b;
  padding-left: 3px;
  pointer-events: none;
  transition: transform .2s ease, background .2s ease;
}
.wsc-gal__tegel:hover .wsc-gal__play { background: #fff; transform: translate(-50%, -50%) scale(1.08); }

.wsc-gal__bijschrift {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--wsc-ink-3, #6b7280);
}

@media (max-width: 900px) {
  .wsc-gal { grid-template-columns: repeat(min(var(--wsc-gal-kolommen, 4), 3), minmax(0, 1fr)); }
  .wsc-gal--origineel { column-count: min(var(--wsc-gal-kolommen, 4), 3); }
}
@media (max-width: 620px) {
  .wsc-gal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wsc-gal--origineel { column-count: 2; }
  .wsc-gal__play { width: 40px; height: 40px; }
}

/* --------------------------------------------------------------------------
   Het grote beeld. Eén laag over de pagina, met pijlen naar de vorige en de
   volgende. Geen bibliotheek: dit is honderd regels en dan weet je ook wat er
   gebeurt bij toetsenbordbediening.
   -------------------------------------------------------------------------- */
.wsc-gal-groot {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 14, .93);
  padding: clamp(16px, 4vw, 48px);
}
.wsc-gal-groot[hidden] { display: none; }

.wsc-gal-groot__beeld {
  max-width: min(1400px, 100%);
  max-height: 100%;
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center;
}
.wsc-gal-groot__beeld img,
.wsc-gal-groot__beeld video {
  max-width: 100%;
  max-height: calc(100vh - clamp(90px, 16vw, 170px));
  width: auto; height: auto;
  display: block;
  border-radius: 4px;
}
.wsc-gal-groot__tekst {
  color: rgba(255, 255, 255, .82);
  font-size: 14px; line-height: 1.5; text-align: center;
  max-width: 70ch; margin: 0;
}
.wsc-gal-groot__tekst strong { display: block; color: #fff; font-size: 15px; }

.wsc-gal-groot__knop {
  position: absolute;
  border: 0; background: rgba(255, 255, 255, .12); color: #fff;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer; font-size: 22px; line-height: 1;
  transition: background .15s ease;
}
.wsc-gal-groot__knop:hover { background: rgba(255, 255, 255, .26); }
.wsc-gal-groot__knop:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.wsc-gal-groot__sluit { top: clamp(12px, 2vw, 22px); right: clamp(12px, 2vw, 22px); }
.wsc-gal-groot__vorige { left: clamp(8px, 2vw, 22px); top: 50%; transform: translateY(-50%); }
.wsc-gal-groot__volgende { right: clamp(8px, 2vw, 22px); top: 50%; transform: translateY(-50%); }

.wsc-gal-groot__teller {
  position: absolute; left: 50%; bottom: clamp(10px, 2vw, 20px);
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .6); font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
  .wsc-gal-groot__knop { width: 40px; height: 40px; }
  .wsc-gal-groot__vorige { left: 6px; }
  .wsc-gal-groot__volgende { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .wsc-gal__tegel img,
  .wsc-gal__tegel video { transition: none; }
  .wsc-gal--klikbaar .wsc-gal__tegel:hover img,
  .wsc-gal--klikbaar .wsc-gal__tegel:hover video { transform: none; }
}
