/* ------------------------------------------------------------------
   Adriaan Johannes Passano — memorial page
   One stylesheet, no frameworks, no web fonts.
   Afrikaans is the primary voice; English sits beneath it, quieter.
   ------------------------------------------------------------------ */

:root {
  --bg:          #15130f;
  --bg-lift:     #1e1b16;
  --ink:         #efe9de;
  --ink-muted:   #a99e8d;
  --ink-faint:   #7d7365;
  --rule:        rgba(239, 233, 222, 0.13);
  --rule-strong: rgba(239, 233, 222, 0.30);
  --focus:       #d9c7a3;

  --serif: ui-serif, "New York", Georgia, "Noto Serif", "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 38rem;   /* ~608px — a comfortable single column */
  --gutter:  1.375rem;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.1875rem;          /* 19px — the audience is older */
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img { max-width: 100%; }

a { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Keyboard-only shortcut to the thing most people came for. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 1rem 1.25rem;
  background: var(--bg-lift);
  color: var(--ink);
  text-decoration: none;
}
.skip:focus { left: 0; }

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--measure));
  margin-inline: auto;
}


/* ------------------------------------------------------------------
   Portrait — full bleed on a phone, contained on a wide screen so a
   vertical photograph never gets cropped into a letterbox.
   ------------------------------------------------------------------ */

.hero { margin: 0; }

.hero__media {
  position: relative;
  width: 100%;
}

.hero__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 76vh;
  object-fit: cover;
  object-position: center 28%;
}

/* The photograph dissolves into the page rather than stopping at a hard edge. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 38%;
  background: linear-gradient(to bottom, rgba(21, 19, 15, 0), var(--bg) 92%);
  pointer-events: none;
}

@media (min-width: 52em) {
  .hero__media {
    max-width: 46rem;
    margin-inline: auto;
  }
}


/* ------------------------------------------------------------------
   Name and dates — lifted into the bottom of the photograph's fade
   ------------------------------------------------------------------ */

.identity {
  position: relative;
  margin-top: -2.75rem;
  padding-bottom: 0.5rem;
}

.eyebrow {
  margin: 0 0 1.1rem;
  font-size: 0.75rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.5;
}
.eyebrow__en {
  display: block;
  color: var(--ink-faint);
  letter-spacing: 0.15em;
}

.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.02;
}
.name__given {
  display: block;
  font-size: clamp(1.5rem, 5.6vw, 2rem);
  color: var(--ink-muted);
  letter-spacing: 0.005em;
}
.name__family {
  display: block;
  margin-top: 0.22em;
  font-size: clamp(2.9rem, 12.5vw, 4.4rem);
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dates {
  margin: 1.5rem 0 0;
  font-size: 0.8125rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.9;
}
.dates__dash { margin: 0 0.45em; color: var(--ink-faint); }

.epigraph {
  margin: 1.9rem 0 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-muted);
}
.epigraph__en {
  display: block;
  margin-top: 0.45rem;
  font-size: 1rem;
  color: var(--ink-faint);
}


/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */

.section { padding: 3.25rem 0; }
.section + .section { border-top: 1px solid var(--rule); }

.label {
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.5;
}
.label__en {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.label--sub { margin-top: 3rem; }

.muted { color: var(--ink-faint); }


/* ------------------------------------------------------------------
   Stream status
   ------------------------------------------------------------------ */

.status p { margin: 0 0 1.5rem; }
.status strong { font-weight: 600; color: #fff; }
.status__en {
  font-size: 1rem;
  color: var(--ink-muted);
}

/* Set live by app.js while the service is being broadcast. */
.status--live {
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--focus);
  background: var(--bg-lift);
  border-radius: 2px;
}
.status--live p:last-child { margin-bottom: 0; }

.status__local {
  margin: -0.5rem 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink-faint);
}


/* ------------------------------------------------------------------
   Video — a still image and a play button. The YouTube iframe is only
   fetched when someone taps, which saves about a megabyte per embed.
   ------------------------------------------------------------------ */

.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-lift);
  border-radius: 3px;
  overflow: hidden;
}

@supports not (aspect-ratio: 16 / 9) {
  .video { height: 0; padding-bottom: 56.25%; }
}

.video > button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: block;
}

.video > button > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 50%;
  background: rgba(21, 19, 15, 0.72);
  border: 1px solid rgba(239, 233, 222, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;             /* optically centre the triangle */
}

.video__cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  text-align: center;
  font-size: 0.9375rem;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.video__cta-en {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}


/* The slideshow is square, so it gets its own frame rather than the 16:9
   one. Native controls here: a <video> element is more dependable inside
   WhatsApp's in-app browser than anything scripted. */
.slideshow {
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
  background: #000;
  border-radius: 3px;
  overflow: hidden;
}

.slideshow video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}


/* ------------------------------------------------------------------
   Buttons and links
   ------------------------------------------------------------------ */

.fallback { margin: 1.15rem 0 0; }

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;            /* 56px — comfortable for an older hand */
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  font-size: 1rem;
  line-height: 1.35;
}
.btn__en {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.btn:hover, .btn:active { background: var(--bg-lift); }


/* ------------------------------------------------------------------
   Service details
   ------------------------------------------------------------------ */

.details { margin: 0; }

.details > div {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}
.details > div:first-child { border-top: 1px solid var(--rule); }

.details dt {
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.6;
}
.dt__en { margin-left: 0.6em; opacity: 0.7; }

.details dd {
  margin: 0.2rem 0 0;
  font-size: 1.0625rem;
}
.dd__en {
  display: block;
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

.maplink {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;                    /* flex layout drops the whitespace between spans */
  min-height: 2.75rem;
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  color: var(--focus);
  text-underline-offset: 4px;
}


/* ------------------------------------------------------------------
   Tribute
   ------------------------------------------------------------------ */

.prose {
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.75;
}
.prose p { margin: 0 0 1.35rem; }
.prose p:last-child { margin-bottom: 0; }

.prose--en {
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-size: 1.0625rem;
  color: var(--ink-muted);
}


/* ------------------------------------------------------------------
   Order of service
   ------------------------------------------------------------------ */

.reading {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.125rem;
}

.quote {
  margin: 0;
  padding-left: 1.15rem;
  border-left: 1px solid var(--rule-strong);
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink-muted);
}
.quote p { margin: 0; }
.quote strong { font-style: normal; color: var(--ink); }

/* Small caps used for relationships and stage directions. */
.rel {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.bearers {
  display: grid;
  gap: 2rem;
}
@media (min-width: 34em) {
  .bearers { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

.bearers h4 {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--ink-muted);
}

.bearers ul { margin: 0; padding: 0; list-style: none; }

.bearers li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.4;
}
.bearers li .rel { display: block; margin-top: 0.1rem; }

.thanks { margin: 2.25rem 0 0; font-size: 1rem; }
.thanks .rel { margin-right: 0.5em; }


/* ------------------------------------------------------------------
   Hymns — centred verse, so people can follow from wherever they are
   ------------------------------------------------------------------ */

.hymn + .hymn {
  margin-top: 2.75rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
}

.hymn__title {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.375rem;
  text-align: center;
  color: var(--ink);
}

/* On a phone the long lines wrap, and centring a wrapped line makes it hard
   to tell a continuation from the next line of the hymn. Set it as verse
   instead: left aligned with the runover indented. Once there is room for a
   full line, centre it the way a hymn sheet would. */
.hymn__verse {
  margin: 0 0 1.6rem;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink-muted);
  text-align: left;
}
.hymn__verse:last-child { margin-bottom: 0; }

/* Each line is its own block so the hanging indent applies to every one of
   them — text-indent only ever affects the first line of a block. */
.hymn__verse .ln {
  display: block;
  padding-left: 1.4em;
  text-indent: -1.4em;
}

@media (min-width: 34em) {
  .hymn__verse { text-align: center; }
  .hymn__verse .ln { padding-left: 0; text-indent: 0; }
}


/* ------------------------------------------------------------------
   Tributes — kept in Afrikaans, as they were written
   ------------------------------------------------------------------ */

.tribute + .tribute {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.tribute__title {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--ink);
}

.tribute .prose { font-size: 1.0625rem; }

.tribute__by {
  margin: 1.4rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-faint);
}
.tribute__by::before { content: "— "; }


/* ------------------------------------------------------------------
   Gallery — two uncropped columns. A square grid cuts faces in half;
   a column flow lets every photograph keep its own shape.
   ------------------------------------------------------------------ */

.hint {
  margin: -0.5rem 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink-faint);
}
.hint__en { display: block; }

.gallery {
  columns: 2;
  column-gap: 0.5rem;
}

@media (min-width: 46em) {
  .gallery { columns: 3; column-gap: 0.75rem; }
}

.gallery a {
  display: block;
  break-inside: avoid;
  page-break-inside: avoid;       /* older WebKit */
  margin-bottom: 0.5rem;
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg-lift);
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
}


/* ------------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------------ */

#lightbox {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}
#lightbox::backdrop { background: rgba(8, 7, 5, 0.97); }

.lb__figure {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 0.75rem 5rem;
}

#lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
}

#lb-cap {
  margin-top: 0.9rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  text-align: center;
}

.lb__close,
.lb__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: rgba(21, 19, 15, 0.85);
  color: var(--ink);
  cursor: pointer;
}

.lb__close { top: 0.85rem; right: 0.85rem; }
.lb__nav   { top: 50%; transform: translateY(-50%); }
.lb__prev  { left: 0.6rem; }
.lb__next  { right: 0.6rem; }

.lb__nav[disabled] { opacity: 0.3; }

.lb__count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.5rem;
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}


/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */

.footer {
  margin-top: 1rem;
  padding: 3.25rem 0 4.5rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}
.footer p { margin: 0; }
.footer__en { color: var(--ink-faint); font-size: 0.875rem; }
.footer__dates {
  margin-top: 1.1rem !important;
  font-family: var(--serif);
  font-size: 0.875rem;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
}


/* ------------------------------------------------------------------
   Motion
   ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
