/* ---------- indeling ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.main { padding-block: 1rem 5rem; min-height: 60vh; }

/* ---------- header ---------- */
.site-header { position: relative; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 50; }
.site-header.is-sticky { position: sticky; top: 0; }

.bar { display: flex; align-items: center; gap: 1.75rem; }
.site-header .bar { min-height: var(--header-h, 70px); }

.brand { display: flex; align-items: center; gap: .8rem; margin-right: auto; color: var(--fg); text-decoration: none; }
.brand img { display: block; height: var(--logo-h, 36px); width: auto; margin-block: 15px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-head); font-size: var(--name-size, 24px); line-height: 1.1; letter-spacing: .005em; }
.brand-tag { font-size: .82em; color: var(--muted); line-height: 1.3; }

.nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.6rem; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem 0; color: var(--fg); text-decoration: none;
  border-bottom: 1px solid transparent; font-size: var(--menu-size, 16px);
}
.nav a:hover { color: var(--link); }
.nav a[aria-current="page"] { border-bottom-color: var(--link); }

.tools { display: flex; align-items: center; gap: .15rem; }
.nav-toggle { display: none; }

@media (max-width: 780px) {
  .bar { gap: 1rem; }
  .site-header .bar { min-height: min(var(--header-h, 70px), 64px); }
  .nav-toggle { display: inline-flex; }
  .site-header .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem var(--pad) 1.1rem;
  }
  .site-header.open .nav { display: block; }
  .site-header .nav ul { flex-direction: column; gap: .1rem; }
  .site-header .nav a { padding: .6rem 0; width: 100%; }
  .brand-tag { display: none; }
}

/* ---------- kopteksten en tekst ---------- */
.page-head { margin: clamp(2rem, 5vw, 3.75rem) 0 1.6rem; }
.page-head h1 { margin: 0; }

/* Koppen: groottes uit de backoffice; grote koppen worden op smalle schermen vanzelf kleiner */
h1 { font-size: min(var(--size-h1, 56px), max(calc(var(--size-h1, 56px) * .6), 9vw)); }
h2 { font-size: min(var(--size-h2, 32px), max(calc(var(--size-h2, 32px) * .7), 7vw)); }
h3 { font-size: min(var(--size-h3, 24px), max(calc(var(--size-h3, 24px) * .8), 6vw)); }
h4 { font-size: var(--size-h4, 20px); }
h5 { font-size: var(--size-h5, 18px); }
h6 { font-size: var(--size-h6, 16px); }

.prose { max-width: 66ch; line-height: 1.75; }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { margin-top: 1.6em; }

.crumb { margin: 1.6rem 0 0; font-size: .95em; }
.crumb a { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--link); }

.empty { color: var(--muted); }

.album-block { margin-top: clamp(2rem, 4vw, 3.25rem); }
.album-block-title { margin-bottom: .6rem; }
.album-block-title a { color: var(--fg); text-decoration: none; }
.album-block-title a:hover { color: var(--link); }

/* ---------- albumkaarten (hoofdfoto + titel) ---------- */
.cards {
  /* afstand = ruimte tussen de kaders; het kader zelf (box-shadow) valt buiten de foto en telt dus 2x mee */
  display: grid; gap: calc(var(--photo-gap, 14px) * 1.6 + 2 * var(--frame-w, 0px)) calc(var(--photo-gap, 14px) + 2 * var(--frame-w, 0px));
  grid-template-columns: repeat(auto-fill, minmax(min(var(--cover-w, 320px), 100%), 1fr));
  list-style: none; margin: 0; padding: var(--frame-w, 0px);
}
.cards a { display: block; color: var(--fg); text-decoration: none; }
.cards .thumb { aspect-ratio: var(--ratio); background: var(--surface-2); overflow: hidden; border-radius: var(--photo-radius, 0); box-shadow: 0 0 0 var(--frame-w, 0px) var(--frame-color, transparent); }
.cards img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-title { display: block; margin-top: .65rem; font-family: var(--font-head); font-size: var(--size-card, 21px); line-height: 1.2; }
.card-meta { display: block; font-size: .875em; color: var(--muted); }
.cards a:hover .card-title { color: var(--link); text-decoration: underline; text-underline-offset: .2em; }


/* ---------- galerij: rijen die de beeldverhouding behouden ---------- */
.gallery { display: flex; flex-wrap: wrap; gap: calc(var(--photo-gap, 14px) + 2 * var(--frame-w, 0px)); padding: var(--frame-w, 0px); }
.gallery::after { content: ""; flex-grow: 1000000; }
.gallery a {
  position: relative; display: block; overflow: hidden; background: var(--surface-2);
  flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--rowh));
  cursor: zoom-in;
  border-radius: var(--photo-radius, 0);
  box-shadow: 0 0 0 var(--frame-w, 0px) var(--frame-color, transparent);
}
.gallery a::before { content: ""; display: block; padding-bottom: calc(100% / var(--ar)); }
.gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) { .gallery a { flex-basis: calc(var(--ar) * 120px); } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem 2.6rem; color: var(--muted); font-size: .95em; }
/* Zelfde indeling als de header: tekst links, menu rechts op dezelfde plek als het hoofdmenu */
.foot-bar { align-items: flex-start; }
.foot-left { margin-right: auto; }
.foot-nav ul { justify-content: flex-end; }
/* Pijl naar boven: staat op dezelfde plek als het thema-icoon in de header, zodat het menu even ver van de rand staat */
.to-top { flex: 0 0 auto; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.footer-text p { margin: 0 0 .6rem; max-width: 70ch; }
.copy { margin: 0; }
@media (max-width: 780px) {
  .foot-bar { flex-direction: column; gap: 1rem; }
  .foot-left { margin-right: 0; }
  .foot-nav ul { justify-content: flex-start; }
  .to-top { align-self: flex-end; }
}

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 9, 10, .95); color: #f1f2f3;
}
.lb.open { display: flex; }
.lb-figure { margin: 0; max-width: 100vw; max-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 3.5rem 4rem 3.2rem; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 7.5rem); object-fit: contain; display: block; }
.lb-cap { margin-top: .8rem; min-height: 1.4em; font-size: .95rem; text-align: center; color: #c8ccd0; }
.lb button {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: #f1f2f3; cursor: pointer;
}
.lb button:hover { background: rgba(255, 255, 255, .14); }
.lb-close { top: .75rem; right: .75rem; }
.lb-prev { left: .75rem; top: 50%; margin-top: -22px; }
.lb-next { right: .75rem; top: 50%; margin-top: -22px; }
.lb-count { position: absolute; top: 1.15rem; left: 1.25rem; font-size: .9rem; color: #c8ccd0; }
@media (max-width: 640px) {
  .lb-figure { padding: 3.5rem 0 3rem; }
  .lb-prev, .lb-next { top: auto; bottom: .6rem; margin-top: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .lb.open { animation: lbIn .18s ease-out; }
  @keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
}
body.lb-lock { overflow: hidden; }

/* ---------- albumteksten gecentreerd ---------- */
.cards a { text-align: center; }
.page-album .page-head, .page-album .crumb, .page-albums .page-head,
.album-block .album-block-title, .page-album .empty, .page-albums .empty { text-align: center; }
.page-album .prose, .page-albums .prose, .album-block .prose { text-align: center; margin-inline: auto; }

/* ---------- paginatitel: uitlijning en verbergen ---------- */
.page-head.align-left   { text-align: left; }
.page-head.align-center { text-align: center; }
.page-head.align-right  { text-align: right; }
.page.no-title { padding-top: clamp(1.5rem, 4vw, 2.75rem); }

/* ---------- ondertitel en omschrijving van een album ---------- */
.card-sub { display: block; margin-top: .15rem; font-size: .95em; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.album-subtitle { margin: .5rem 0 0; font-size: 1.15em; line-height: 1.4; color: var(--muted); text-align: center; }
.album-block-title + .album-subtitle { margin: -.25rem 0 1rem; }
/* de omschrijving is net zo breed als het album (de galerij eronder) */
.prose.album-desc { max-width: none; }

/* ---------- transparante header en headerfoto onder de header ---------- */
/* Achtergrond en lijn volgen de ingestelde transparantie (--header-opacity), ook tijdens het scrollen */
.site-header {
  background: color-mix(in srgb, var(--bg) var(--header-opacity, 100%), transparent);
  border-bottom-color: color-mix(in srgb, var(--line) var(--header-opacity, 100%), transparent);
}
@media (min-width: 781px) {
  .has-hero-under-d .site-header { position: absolute; left: 0; right: 0; top: 0; }
  .has-hero-under-d .site-header.is-sticky { position: fixed; }
  .has-hero-under-d .site-header.open { background: var(--bg); }
  /* Zolang de header over de foto ligt en vrij transparant is: lichte tekst met zachte schaduw */
  .has-hero-under-d .site-header.is-airy:not(.is-past-hero):not(.open) {
    --fg: #fff; --muted: rgba(255,255,255,.85); --link: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,.45);
  }
  .hero-under-d::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: min(60%, 220px);
    background: linear-gradient(rgba(0,0,0,.4), rgba(0,0,0,0)); pointer-events: none; z-index: 1;
  }
}
@media (max-width: 780px) {
  .has-hero-under-m .site-header { position: absolute; left: 0; right: 0; top: 0; }
  .has-hero-under-m .site-header.is-sticky { position: fixed; }
  .has-hero-under-m .site-header.open { background: var(--bg); }
  /* Zolang de header over de foto ligt en vrij transparant is: lichte tekst met zachte schaduw */
  .has-hero-under-m .site-header.is-airy:not(.is-past-hero):not(.open) {
    --fg: #fff; --muted: rgba(255,255,255,.85); --link: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,.45);
  }
  .hero-under-m::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: min(60%, 220px);
    background: linear-gradient(rgba(0,0,0,.4), rgba(0,0,0,0)); pointer-events: none; z-index: 1;
  }
}
.hero-under-d, .hero-under-m { position: relative; }

/* Logo / sitetitel apart voor breed scherm en mobiel */
@media (min-width: 781px) { .hide-d { display: none !important; } }
@media (max-width: 780px) { .hide-m { display: none !important; } }
