/* ===== Publieke gedenkpagina =====
   Kleuren/fonts komen als CSS-variabelen uit de gekozen paginastijl. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--m-bg);
  color: var(--m-ink);
  font: 17px/1.7 "Segoe UI", system-ui, sans-serif;
}
h1, h2, h3 { font-family: var(--m-head-font); font-weight: 600; line-height: 1.25; }
a { color: var(--m-accent); }
img { max-width: 100%; }

/* ===== Eigenaar-balk & meldingen ===== */
.owner-bar {
  position: fixed; top: 10px; right: 10px; z-index: 60;
  background: var(--m-card); color: var(--m-muted); border: 1px solid var(--m-line);
  border-radius: 999px; padding: 6px 14px; font-size: .82rem; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .25);
}
.owner-bar a { font-weight: 600; }
.m-toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 70;
  background: var(--m-card); border: 1px solid var(--m-line); color: var(--m-ink);
  padding: 10px 20px; border-radius: 12px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .35);
  max-width: min(560px, 92vw); font-size: .93rem; animation: toast-in .4s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }

/* ===== Hero ===== */
.m-hero { text-align: center; padding: 76px 20px 40px; position: relative; }
.m-hero-eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .76rem; color: var(--m-muted); margin-bottom: 26px; }
.m-portrait {
  width: 150px; height: 150px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--m-accent); padding: 4px; background: var(--m-card); margin-bottom: 18px;
}
.m-monogram {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 3.4rem var(--m-head-font); color: var(--m-accent);
}
.m-hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0 0 6px; }
.m-fullname { color: var(--m-muted); font-family: var(--m-head-font); font-style: italic; margin-bottom: 10px; }
.m-dates { color: var(--m-muted); font-size: .98rem; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.m-intro { max-width: 560px; margin: 22px auto 8px; font: italic 1.15rem/1.7 var(--m-head-font); color: var(--m-ink); }
.m-ringbtn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  background: transparent; color: var(--m-accent); border: 1px solid var(--m-accent);
  padding: 9px 20px; border-radius: 999px; font: inherit; font-size: .93rem; cursor: pointer;
  transition: background .15s, color .15s;
}
.m-ringbtn:hover { background: var(--m-accent); color: var(--m-bg); }
.m-scrollhint { margin: 34px auto 0; width: 26px; height: 42px; border: 2px solid var(--m-muted); border-radius: 999px; opacity: .6; position: relative; }
.m-scrollhint span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  background: var(--m-muted); border-radius: 4px; animation: scrollhint 1.8s infinite ease;
}
@keyframes scrollhint { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ===== Gedeelde onderdelen ===== */
.m-main { padding: 30px 20px 70px; }
.m-empty { text-align: center; color: var(--m-muted); font-style: italic; }
.m-date { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--m-accent); margin-bottom: 8px; }
.m-card { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 16px; padding: 22px; box-shadow: 0 8px 26px -18px rgba(0, 0, 0, .3); }
.mm-text p { margin: 0 0 .8em; }
.mm-text p:last-child { margin-bottom: 0; }
.m-item h3 { margin: 0 0 8px; font-size: 1.25rem; }
.mm-photo { margin: 0; }
.mm-photo img { width: 100%; border-radius: 10px; display: block; cursor: zoom-in; }
.mm-photo figcaption { font-size: .88rem; color: var(--m-muted); margin-top: 8px; font-style: italic; }
.mm-photo + .mm-text { margin-top: 12px; }
.mm-quote blockquote { margin: 0; font: italic 1.35rem/1.6 var(--m-head-font); }
.mm-quote blockquote::before { content: "\201C"; color: var(--m-accent); font-size: 1.6em; line-height: 0; vertical-align: -0.3em; margin-right: 4px; }
.mm-quote cite { display: block; margin-top: 10px; color: var(--m-muted); font-style: normal; font-size: .9rem; }
.mm-audio { display: flex; gap: 14px; align-items: flex-start; }
.mm-audio-icon {
  flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--m-soft);
  color: var(--m-accent); display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.mm-audio-body { flex: 1; min-width: 0; }
.mm-audio-body p { margin: 2px 0 8px; color: var(--m-muted); font-size: .92rem; }
.mm-audio audio { width: 100%; }
.mm-video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.mm-video iframe, .mm-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mm-caption { font-size: .88rem; color: var(--m-muted); margin-top: 8px; font-style: italic; }

/* Zachte binnenkomst bij het scrollen */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.vis { opacity: 1; transform: none; }

/* ===== Lay-out: tijdlijn ===== */
.layout-tijdlijn .tl { max-width: 860px; margin: 0 auto; position: relative; padding: 10px 0; }
.layout-tijdlijn .tl::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(var(--m-line), var(--m-accent), var(--m-line));
}
.layout-tijdlijn .m-item { position: relative; width: calc(50% - 34px); margin: 0 0 34px; }
.layout-tijdlijn .m-item:nth-child(odd) { left: 0; text-align: right; }
.layout-tijdlijn .m-item:nth-child(even) { left: calc(50% + 34px); }
.layout-tijdlijn .m-item:nth-child(odd) .m-card { text-align: left; }
.layout-tijdlijn .tl-dot {
  position: absolute; top: 26px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--m-accent); border: 3px solid var(--m-bg); box-shadow: 0 0 0 2px var(--m-accent);
}
.layout-tijdlijn .m-item:nth-child(odd) .tl-dot { right: -41px; }
.layout-tijdlijn .m-item:nth-child(even) .tl-dot { left: -41px; }
@media (max-width: 720px) {
  .layout-tijdlijn .tl::before { left: 10px; }
  .layout-tijdlijn .m-item, .layout-tijdlijn .m-item:nth-child(even) { width: auto; left: 0; margin-left: 34px; text-align: left; }
  .layout-tijdlijn .m-item .tl-dot, .layout-tijdlijn .m-item:nth-child(odd) .tl-dot, .layout-tijdlijn .m-item:nth-child(even) .tl-dot { left: -30px; right: auto; }
}

/* ===== Lay-out: verhaal ===== */
.layout-verhaal .story { max-width: 660px; margin: 0 auto; }
.layout-verhaal .m-item { margin-bottom: 48px; }
.layout-verhaal .m-date { text-align: center; }
.layout-verhaal .mi-text h3 { text-align: center; font-size: 1.5rem; }
.layout-verhaal .mi-text .mm-text, .layout-verhaal .mi-photo .mm-text { font-size: 1.06rem; }
.layout-verhaal .mi-quote { text-align: center; padding: 10px 0; }
.layout-verhaal .mi-quote blockquote { font-size: 1.6rem; }
.layout-verhaal .mm-photo img { border-radius: 14px; }
.layout-verhaal .mm-photo figcaption { text-align: center; }
.layout-verhaal .mi-audio .mm-audio, .layout-verhaal .mi-video .mm-video { background-clip: padding-box; }
.layout-verhaal .mi-audio { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 14px; padding: 18px; }

/* ===== Lay-out: album ===== */
.layout-album .album { max-width: 1020px; margin: 0 auto; columns: 3 280px; column-gap: 18px; }
.layout-album .m-item { break-inside: avoid; margin: 0 0 18px; }
@supports not (aspect-ratio: 1) { .layout-album .mm-video { height: 220px; } }

/* ===== Lay-out: mozaïek ===== */
.layout-mozaiek .mosaic {
  max-width: 1060px; margin: 0 auto; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-auto-rows: 120px; grid-auto-flow: dense;
}
.layout-mozaiek .m-item {
  background: var(--m-card); border: 1px solid var(--m-line); border-radius: 14px;
  padding: 18px; overflow: hidden; position: relative;
}
.layout-mozaiek .mi-photo { padding: 0; grid-row: span 2; }
.layout-mozaiek .mi-photo .mm-photo { height: 100%; }
.layout-mozaiek .mi-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.layout-mozaiek .mi-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 26px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62)); color: #fff; font-style: normal;
}
.layout-mozaiek .mi-photo .mm-text, .layout-mozaiek .mi-photo .m-date { display: none; }
.layout-mozaiek .mi-text, .layout-mozaiek .mi-audio { grid-row: span 2; }
.layout-mozaiek .mi-text { overflow: hidden; }
.layout-mozaiek .mi-text .mm-text { max-height: 150px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.layout-mozaiek .mi-quote { background: var(--m-soft); border-color: transparent; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
.layout-mozaiek .mi-quote blockquote { font-size: 1.15rem; }
.layout-mozaiek .mi-video { grid-column: span 2; grid-row: span 2; padding: 0; }
.layout-mozaiek .mi-video .mm-video { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.layout-mozaiek .mi-video .mm-caption { position: absolute; bottom: 6px; left: 12px; color: #fff; z-index: 2; }
.layout-mozaiek .mi-video .m-date { display: none; }
@media (max-width: 560px) { .layout-mozaiek .mi-video { grid-column: span 1; } }

/* ===== Gastenboek ===== */
.m-guestbook { max-width: 660px; margin: 0 auto; padding: 40px 20px 60px; border-top: 1px solid var(--m-line); }
.m-guestbook h2 { text-align: center; font-size: 1.7rem; margin-bottom: 26px; }
.gb-entry { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 14px; padding: 16px 20px; margin-bottom: 12px; }
.gb-entry p { margin: 0 0 8px; }
.gb-meta { color: var(--m-muted); font-size: .88rem; }
.gb-form { margin-top: 26px; display: grid; gap: 12px; }
.gb-form label span { display: block; font-size: .86rem; color: var(--m-muted); margin-bottom: 4px; }
.gb-form input, .gb-form textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--m-line); border-radius: 10px;
  font: inherit; background: var(--m-card); color: var(--m-ink);
}
.gb-form button {
  justify-self: start; background: var(--m-accent); color: var(--m-bg); border: none;
  padding: 10px 22px; border-radius: 999px; font: inherit; font-size: .95rem; cursor: pointer;
}
.gb-form button:hover { filter: brightness(1.08); }
.gb-note { color: var(--m-muted); font-size: .84rem; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ===== Voettekst ===== */
.m-footer { text-align: center; padding: 30px 20px 40px; color: var(--m-muted); font-size: .88rem; border-top: 1px solid var(--m-line); }
.m-footer svg { color: var(--m-muted); margin-bottom: 6px; }
.m-footer-url { margin-top: 4px; font-size: .8rem; letter-spacing: .04em; }

/* ===== Ring-modus ===== */
.ringmode {
  position: fixed; inset: 0; z-index: 100; background: var(--m-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ringmode[hidden] { display: none; }
.rm-close {
  position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--m-line); background: var(--m-card); color: var(--m-ink);
  font-size: 1.5rem; cursor: pointer; z-index: 3; line-height: 1;
}
.rm-stage { width: min(700px, 92vw); max-height: 74vh; overflow: hidden auto; padding: 8px; }
.rm-slide { animation: rm-in .5s ease; text-align: center; }
@keyframes rm-in { from { opacity: 0; transform: translateY(30px); } }
.rm-slide .m-card { text-align: left; max-width: 620px; margin: 0 auto; }
.rm-slide .m-date { text-align: center; margin-bottom: 12px; }
/* Neutraliseer lay-outspecifieke plaatsing van gekloonde items in de ring-modus */
.ringmode .rm-slide .m-item,
.ringmode .rm-slide .m-item:nth-child(odd),
.ringmode .rm-slide .m-item:nth-child(even) {
  position: static; width: auto; left: auto; margin: 0; padding: 0;
  text-align: center; background: none; border: none; overflow: visible; grid-row: auto; grid-column: auto;
}
.ringmode .rm-slide .mm-text { max-height: none; -webkit-mask-image: none; mask-image: none; text-align: left; }
.ringmode .rm-slide .mi-photo figcaption { position: static; background: none; color: var(--m-muted); padding: 8px 0 0; }
.ringmode .rm-slide .mi-photo img { height: auto; object-fit: contain; border-radius: 10px; }
.ringmode .rm-slide .m-date { display: block; }
.rm-slide .mm-photo img { max-height: 54vh; width: auto; max-width: 100%; margin: 0 auto; cursor: default; }
.rm-slide .mm-quote { padding: 20px 0; }
.rm-slide .mm-quote blockquote { font-size: 1.7rem; }
.rm-slide .mm-text { text-align: left; }
.rm-hero .m-portrait { width: 130px; height: 130px; }
.rm-progress { display: flex; gap: 7px; margin: 20px 0 6px; flex-wrap: wrap; justify-content: center; max-width: 90vw; }
.rm-progress span { width: 8px; height: 8px; border-radius: 50%; background: var(--m-line); cursor: pointer; transition: background .2s, transform .2s; }
.rm-progress span.on { background: var(--m-accent); transform: scale(1.35); }
.rm-hint { color: var(--m-muted); font-size: .84rem; padding: 0 20px 8px; text-align: center; }

/* ===== Lay-out: polaroid =====
   Donkere kop met polaroidstapel, licht "vel" met secties, donkere merk-voettekst. */
.layout-polaroid { background: var(--m-deep); }
.pol-brand {
  text-align: center; letter-spacing: .26em; text-transform: uppercase;
  font-size: .74rem; color: var(--m-accent); padding: 20px 12px 0;
}
.layout-polaroid .m-hero.pol-hero { padding: 12px 20px 34px; }
.pol-hero h1 { color: var(--m-deep-ink); }
.pol-hero .m-fullname { color: var(--m-deep-ink); opacity: .65; }
.pol-hero .m-dates { color: var(--m-accent); }
.pol-hero .m-intro { color: var(--m-deep-ink); opacity: .85; }
.pol-hero .m-ringbtn { border-color: var(--m-accent); color: var(--m-accent); }
.pol-hero .m-ringbtn:hover { background: var(--m-accent); color: var(--m-deep); }
.pol-stack { position: relative; height: 250px; max-width: 420px; margin: 8px auto 20px; }
.pol-card {
  position: absolute; background: #fdfdfb; padding: 10px 10px 30px;
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .55); border-radius: 3px;
}
.pol-card img { display: block; width: 132px; height: 132px; object-fit: cover; }
.pol-card-main { left: 50%; top: 4px; transform: translateX(-50%) rotate(-1.5deg); z-index: 3; }
.pol-card-main img, .pol-monogram { width: 168px; height: 168px; }
.pol-card-left  { left: 4%;  top: 34px; transform: rotate(-8deg); z-index: 1; }
.pol-card-right { right: 4%; top: 40px; transform: rotate(7deg);  z-index: 2; }
.pol-stack-single { height: 230px; }
.pol-monogram {
  display: flex; align-items: center; justify-content: center;
  font: 600 3.4rem var(--m-head-font); color: var(--m-accent); background: var(--m-soft);
}
.pol-sheet { background: var(--m-bg); border-radius: 26px 26px 0 0; max-width: 660px; margin: 0 auto; }
.layout-polaroid .m-main { padding: 26px 22px 34px; }
.layout-polaroid .m-guestbook { padding: 30px 22px 46px; }
.pol-label {
  display: flex; align-items: center; gap: 12px; margin: 32px 0 14px;
  letter-spacing: .18em; text-transform: uppercase; font-size: .76rem; font-weight: 600;
  color: var(--m-accent); font-family: "Segoe UI", system-ui, sans-serif;
}
.pol-label:first-child { margin-top: 0; }
.pol-label::after { content: ""; flex: 1; height: 1px; background: var(--m-line); }
.pol-quote { border-left: 4px solid var(--m-accent); }
.pol-quote blockquote { font-size: 1.1rem; }
.pol-quote blockquote::before { content: none; }
.pol-quote cite { font-style: normal; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; }
.pol-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pol-tile { margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: var(--m-soft); }
.pol-tile:nth-child(4n+1) { grid-column: span 2; aspect-ratio: 16 / 9.5; }
.pol-tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.pol-tile-cap { display: none; }
.pol-hint { text-align: center; font-size: .78rem; color: var(--m-muted); margin-top: 10px; }
.pol-audio { display: flex; gap: 14px; align-items: center; padding: 16px 18px; margin-bottom: 12px; }
.pol-audio audio { display: none; }
.pa-btn {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--m-accent); border: none; cursor: pointer; position: relative;
  transition: transform .1s;
}
.pa-btn:active { transform: scale(.94); }
.pa-btn::before {
  content: ""; position: absolute; left: 19px; top: 15px;
  border-left: 15px solid var(--m-card); border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.pol-audio.playing .pa-btn::before {
  border: none; left: 17px; top: 16px; width: 5px; height: 16px;
  background: var(--m-card); box-shadow: 9px 0 0 var(--m-card);
}
.pa-body { flex: 1; min-width: 0; }
.pa-meta { font-size: .85rem; color: var(--m-muted); margin-top: 2px; }
.pa-wave { display: flex; gap: 3px; align-items: center; height: 28px; flex: none; }
.pa-wave i { width: 3px; border-radius: 2px; background: var(--m-accent); opacity: .8; }
.pa-wave i:nth-child(1) { height: 10px; }
.pa-wave i:nth-child(2) { height: 18px; }
.pa-wave i:nth-child(3) { height: 13px; }
.pa-wave i:nth-child(4) { height: 22px; }
.pa-wave i:nth-child(5) { height: 11px; }
.pol-audio.playing .pa-wave i { animation: pa-bounce .9s ease-in-out infinite alternate; }
.pol-audio.playing .pa-wave i:nth-child(2) { animation-delay: .12s; }
.pol-audio.playing .pa-wave i:nth-child(3) { animation-delay: .24s; }
.pol-audio.playing .pa-wave i:nth-child(4) { animation-delay: .36s; }
.pol-audio.playing .pa-wave i:nth-child(5) { animation-delay: .48s; }
@keyframes pa-bounce { from { transform: scaleY(.45); } to { transform: scaleY(1.5); } }
.pol-video { padding: 14px; margin-bottom: 12px; }
.pol-life { position: relative; padding-left: 24px; }
.pol-life::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: var(--m-line); }
.pol-life-item { position: relative; margin-bottom: 20px; }
.pol-life-item::before {
  content: ""; position: absolute; left: -24px; top: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--m-accent); box-shadow: 0 0 0 3px var(--m-bg);
}
.pl-year { font-size: .78rem; font-weight: 700; letter-spacing: .12em; color: var(--m-accent); margin-bottom: 2px; }
.pl-text strong { font-family: var(--m-head-font); font-size: 1.02rem; }
.pl-text .mm-text { font-size: .96rem; }
.pl-text .mm-text p { margin: .25em 0 0; }
.pl-quote blockquote { font-size: 1.15rem; }
.pol-footer { border-top: none; background: var(--m-deep); color: var(--m-deep-ink); padding: 36px 20px 46px; }
.pol-footer .pf-brand {
  display: flex; gap: 9px; align-items: center; justify-content: center;
  letter-spacing: .24em; text-transform: uppercase; font-size: .8rem; color: var(--m-accent);
}
.pol-footer .pf-brand svg { color: var(--m-accent); margin: 0; }
.pol-footer .pf-tag { opacity: .75; margin-top: 8px; }
.pol-footer .m-footer-url { opacity: .5; margin-top: 10px; }
@media (max-width: 420px) {
  .pol-card img { width: 108px; height: 108px; }
  .pol-card-main img, .pol-monogram { width: 148px; height: 148px; }
  .pol-stack { height: 225px; }
}

/* Polaroid-items in de ring-modus: native speler en losse foto's */
.ringmode .rm-slide .pol-tile { aspect-ratio: auto; grid-column: auto; overflow: visible; background: none; }
.ringmode .rm-slide .pol-tile img { height: auto; max-height: 54vh; width: auto; max-width: 100%; border-radius: 10px; cursor: default; }
.ringmode .rm-slide .pol-tile-cap { display: block; color: var(--m-muted); font-style: italic; font-size: .9rem; margin-top: 10px; }
.ringmode .rm-slide .pol-audio { flex-direction: column; align-items: stretch; gap: 8px; }
.ringmode .rm-slide .pa-btn, .ringmode .rm-slide .pa-wave { display: none; }
.ringmode .rm-slide .pol-audio audio { display: block; width: 100%; }
.ringmode .rm-slide .pol-life-item::before { content: none; }
.ringmode .rm-slide .pl-year { margin-bottom: 6px; }

/* ===== Lightbox ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 120; background: rgba(12, 12, 14, .93);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 8px; }
.lb-cap { color: #ddd; font-size: .92rem; font-style: italic; }
