/* ═══════════════════════════════════════════════════════════════════════
   KATHLEEN LAURA MAE KEEZER — MEMORIAL WEBSITE
   Design: Warm editorial, Playfair Display + Lora + Inter
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Lora:ital,wght@0,400;0,500;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --cream:      #FAF8F3;
  --blush:      #E8C7CF;
  --rose:       #C9939E;
  --rose-deep:  #A3707A;
  --sage:       #8FA888;
  --sage-light: #C4D4C0;
  --warm-gray:  #D8D3CC;
  --stone:      #9B9590;
  --charcoal:   #3D3935;
  --ink:        #1E1C1A;
  --white:      #FFFFFF;

  --ff-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ff-body:    'Lora', Georgia, serif;
  --ff-ui:      'Inter', system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 1px 6px rgba(30,28,26,.07);
  --shadow-md: 0 4px 20px rgba(30,28,26,.10);
  --shadow-lg: 0 8px 40px rgba(30,28,26,.14);
  --ease:      cubic-bezier(.25,.46,.45,.94);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--ff-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
main { flex: 1; }

/* ── Navigation ─────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 64px;
  display: flex; align-items: center;
  padding: 0 2rem;
  background: rgba(250,248,243,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(216,211,204,.5);
  transition: box-shadow .3s var(--ease);
}
.nav.scrolled { box-shadow: var(--shadow-sm); }

.nav-logo {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--charcoal);
  flex-shrink: 0;
  letter-spacing: .01em;
}
.nav-logo .accent { color: var(--rose); font-style: normal; }

.nav-links {
  display: flex; align-items: center; gap: 2.25rem;
  margin-left: auto; list-style: none;
}
.nav-links a {
  font-family: var(--ff-ui);
  font-size: .75rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--stone);
  transition: color .2s;
  position: relative; padding-bottom: 2px;
}
.nav-links a:hover, .nav-links a.active { color: var(--charcoal); }
.nav-links a.active::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 1.5px; background: var(--rose);
}

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--charcoal); padding: 4px;
}

.nav-drawer {
  display: none;
  position: fixed; top: 64px; left: 0; right: 0; z-index: 199;
  background: var(--cream);
  border-bottom: 1px solid var(--warm-gray);
  padding: 1rem 2rem 1.5rem;
}
.nav-drawer.open { display: block; }
.nav-drawer a {
  display: block;
  font-family: var(--ff-ui); font-size: .875rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--charcoal);
  padding: .75rem 0;
  border-bottom: 1px solid rgba(216,211,204,.5);
  transition: color .2s;
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { color: var(--rose); }

@media (max-width: 780px) {
  .nav-links  { display: none; }
  .nav-toggle { display: block; }
}

/* ── Layout helpers ─────────────────────────────────────────────────── */
.page { padding-top: 64px; }
.container    { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width:  720px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 6rem 1.5rem; }
.section-white { background: var(--white); }
.section-tinted { background: rgba(196,212,192,.08); }

/* ── Typography ─────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--ff-ui); font-size: .6875rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--rose);
}
.display {
  font-family: var(--ff-display);
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-weight: 400; line-height: 1.1;
  color: var(--charcoal);
}
.heading-lg {
  font-family: var(--ff-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400; line-height: 1.2;
  color: var(--charcoal);
}
.heading-md {
  font-family: var(--ff-display);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 400; color: var(--charcoal);
}
.body-text {
  font-family: var(--ff-body);
  font-size: 1.0625rem; line-height: 1.85;
  color: rgba(61,57,53,.82);
}
.body-text + .body-text { margin-top: 1.25rem; }
.meta {
  font-family: var(--ff-ui); font-size: .8125rem;
  color: var(--stone); letter-spacing: .04em;
}

/* ── Ornament / divider ─────────────────────────────────────────────── */
.ornament {
  display: flex; align-items: center; gap: 1rem;
  justify-content: center; margin: 1.5rem 0;
}
.ornament::before, .ornament::after {
  content: ''; flex: 0 0 40px; height: 1px; background: var(--blush);
}
.ornament span { color: var(--blush); font-size: .875rem; line-height: 1; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--ff-ui); font-size: .8125rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  padding: .875rem 2rem; border-radius: 100px;
  border: none; cursor: pointer;
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--rose); color: var(--white);
  box-shadow: 0 3px 16px rgba(201,147,158,.38);
}
.btn-primary:hover {
  background: var(--rose-deep);
  box-shadow: 0 5px 24px rgba(201,147,158,.50);
  transform: translateY(-2px);
}
.btn-secondary {
  background: var(--sage); color: var(--white);
  box-shadow: 0 3px 16px rgba(143,168,136,.35);
}
.btn-secondary:hover {
  background: #7a9673;
  box-shadow: 0 5px 24px rgba(143,168,136,.45);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent; color: var(--charcoal);
  border: 1.5px solid var(--warm-gray);
}
.btn-outline:hover {
  border-color: var(--sage); color: var(--sage);
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────────────────────
   HERO  — full-bleed split layout
   ───────────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 55% 45%;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Left panel — photo */
.hero-photo {
  position: relative;
  overflow: hidden;
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
/* Gradient vignette — right edge blends into cream content panel */
.hero-photo-vignette {
  position: absolute; inset: 0;
  background: linear-gradient(
    to right,
    transparent 60%,
    rgba(250,248,243,.55) 85%,
    rgba(250,248,243,.92) 100%
  );
  pointer-events: none;
}

/* Right panel — text */
.hero-content {
  display: flex; flex-direction: column; justify-content: center;
  padding: 6rem 4rem 5rem 3.5rem;
  background: var(--cream);
  position: relative;
}
/* Subtle top-right bloom */
.hero-content::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 320px; height: 320px; pointer-events: none;
  background: radial-gradient(circle at top right, rgba(232,199,207,.35) 0%, transparent 65%);
}

/* Hero text */
.hero-name {
  font-family: var(--ff-display);
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  font-weight: 400; line-height: 1.05;
  color: var(--charcoal);
  margin: .5rem 0 .5rem;
  position: relative; z-index: 1;
}
.hero-name .surname {
  display: block;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-style: italic; color: var(--rose);
  margin-top: .25rem;
}
.hero-dates {
  font-family: var(--ff-ui);
  font-size: .8125rem; font-weight: 300;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 0;
  position: relative; z-index: 1;
}
.hero-intro {
  font-family: var(--ff-body);
  font-style: italic; font-size: 1.0625rem;
  line-height: 1.85; color: rgba(61,57,53,.72);
  max-width: 42ch; margin: 0 0 2.5rem;
  position: relative; z-index: 1;
}
.hero-actions {
  display: flex; gap: 1rem;
  justify-content: flex-start; flex-wrap: wrap;
  position: relative; z-index: 1;
}

/* Left-aligned ornament variant (hero content panel) */
.ornament-left {
  justify-content: flex-start;
  gap: .6rem;
  margin: 1.25rem 0 1.5rem;
  position: relative; z-index: 1;
}
.ornament-left span { font-size: 1rem; }
/* Remove the left line that .ornament normally draws */
.ornament-left::before { display: none; }
/* Override right line: shorter, warmer */
.ornament-left::after {
  flex: 0 0 48px;
  background: var(--warm-gray);
}

/* ── Mobile: stack vertically ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: 65vh auto;
    min-height: auto;
  }
  .hero-photo { height: 65vh; }
  .hero-content {
    padding: 3rem 1.75rem 4rem;
    text-align: center;
  }
  .hero-actions { justify-content: center; }
  .ornament-left { justify-content: center; }
  .ornament-left::after { display: none; }
  .hero-intro { max-width: 100%; margin: 0 0 2rem; }
}

/* ── About ─────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 5rem; align-items: start;
  margin-top: 3.5rem;
}
.about-quote {
  font-family: var(--ff-display);
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  font-style: italic; line-height: 1.4;
  color: var(--charcoal);
  padding: 2rem 0 2rem 2rem;
  border-left: 2px solid var(--blush);
  position: sticky; top: 80px;
}
.about-quote cite {
  display: block;
  font-family: var(--ff-ui);
  font-style: normal; font-size: .75rem;
  font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rose);
  margin-top: 1.25rem;
}
@media (max-width: 780px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-quote { position: static; }
}

/* ── Quick-link cards ───────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem; margin-top: 3.5rem;
}
.card {
  display: block;
  background: var(--white);
  border: 1px solid var(--warm-gray);
  border-radius: 20px; padding: 2rem 1.75rem;
  transition: all .3s var(--ease);
}
.card:hover {
  border-color: var(--blush);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.card-icon {
  margin-bottom: 1.375rem;
  color: var(--rose);
  opacity: .85;
}
.card-icon svg { width: 30px; height: 30px; display: block; }
.card-title {
  font-family: var(--ff-display); font-size: 1.1875rem;
  color: var(--charcoal); margin-bottom: .5rem;
  transition: color .2s;
}
.card:hover .card-title { color: var(--rose); }
.card-desc {
  font-family: var(--ff-ui); font-size: .875rem;
  color: var(--stone); line-height: 1.65;
}

/* ─────────────────────────────────────────────────────────────────────
   GALLERY PAGE
   ───────────────────────────────────────────────────────────────────── */
.gallery-bar {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap;
  gap: 1rem; margin-bottom: 2.5rem;
}
.gallery-meta { font-family: var(--ff-ui); font-size: .8125rem; color: var(--stone); }

/* Play Slideshow button */
.btn-play {
  display: inline-flex; align-items: center; gap: .625rem;
  font-family: var(--ff-ui); font-size: .8125rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--white);
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  padding: .9375rem 2.25rem; border-radius: 100px; border: none; cursor: pointer;
  box-shadow: 0 4px 22px rgba(201,147,158,.42);
  transition: all .3s var(--ease);
}
.btn-play:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 30px rgba(201,147,158,.55);
}
.btn-play svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }

/* Photo grid — CSS Grid avoids the column-count reflow-on-append problem */
.masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;   /* rows size to content, not tallest cell */
}
@media (min-width: 1100px) { .masonry { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px)  { .masonry { grid-template-columns: repeat(2, 1fr); gap: .625rem; } }

.masonry-item {
  position: relative; overflow: hidden;
  border-radius: 12px; background: var(--warm-gray);
  cursor: pointer;
  /* Item visible immediately so skeleton shimmer shows while photo loads.
     Photo fades in separately via img opacity transition below. */
}
.masonry-item img {
  width: 100%; height: auto; display: block;
  border-radius: 12px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .55s var(--ease), transform .55s var(--ease), filter .3s;
}
.masonry-item.visible img { opacity: 1; transform: translateY(0); }
.masonry-item:hover img { transform: scale(1.04) !important; filter: brightness(.88); }

.photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,18,16,.55) 0%, transparent 55%);
  opacity: 0; transition: opacity .3s;
  border-radius: 12px;
  display: flex; align-items: flex-end; padding: .875rem;
  pointer-events: none;
}
.masonry-item.visible:hover .photo-overlay { opacity: 1; }
.photo-name {
  font-family: var(--ff-ui); font-size: .75rem; font-weight: 400;
  color: rgba(255,255,255,.85); letter-spacing: .03em;
  text-transform: capitalize; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, var(--warm-gray) 25%, rgba(250,248,243,.7) 50%, var(--warm-gray) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  min-height: 160px; border-radius: 12px;
}
@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.gallery-empty {
  grid-column: 1/-1; text-align: center;
  padding: 4rem 2rem; color: var(--stone);
  font-family: var(--ff-body); font-style: italic;
}

.gallery-sentinel { height: 1px; }

.gallery-more-btn {
  display: block;
  margin: 2.5rem auto 1rem;
  font-size: .8125rem; letter-spacing: .06em;
}

/* ─────────────────────────────────────────────────────────────────────
   SLIDESHOW OVERLAY
   ───────────────────────────────────────────────────────────────────── */
.slideshow {
  position: fixed; inset: 0; z-index: 1000;
  background: #090807;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
}
.slideshow.active { display: flex; }

/* Two image layers for crossfade */
.ss-layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.6s cubic-bezier(.4,0,.2,1);
}
.ss-layer.visible  { opacity: 1; z-index: 2; }
.ss-layer.offstage { opacity: 0; z-index: 1; }

.ss-layer img {
  max-width: 100vw; max-height: 100vh;
  width: auto; height: auto;
  object-fit: contain; display: block;
  user-select: none;
  will-change: transform;
}

/* Ken Burns animations — 3 variants picked randomly */
@keyframes kb1 { from{transform:scale(1) translate(0,0)}    to{transform:scale(1.08) translate(-1%,-.5%)} }
@keyframes kb2 { from{transform:scale(1.05) translate(-1%,1%)}  to{transform:scale(1) translate(.5%,-.5%)} }
@keyframes kb3 { from{transform:scale(1) translate(.5%,-.5%)} to{transform:scale(1.07) translate(-.5%,.5%)} }
.kb1 { animation: kb1 8s ease-out forwards; }
.kb2 { animation: kb2 8s ease-out forwards; }
.kb3 { animation: kb3 8s ease-out forwards; }

/* ── HUD ─────────────────────────────────────────────────────────────── */
.ss-hud {
  position: absolute; inset: 0; z-index: 10;
  pointer-events: none;
  transition: opacity .45s;
}
.ss-hud.fade { opacity: 0; }

/* Close — top right */
.ss-close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15); cursor: pointer;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
  pointer-events: auto;
}
.ss-close:hover { background: rgba(255,255,255,.18); transform: scale(1.08); }

/* ── Now Playing card — bottom left ──────────────────────────────── */
/* NOTE: .ss-np is a direct child of .slideshow (not inside .ss-hud)
   so it stays visible even when the HUD auto-fades */
.ss-np {
  position: absolute; bottom: 2rem; left: 2rem;
  z-index: 11;          /* above .ss-hud (z-index:10) */
  width: 256px;
  background: rgba(10,8,7,.75);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 1.125rem 1.25rem 1rem;
  pointer-events: auto;
}
.ss-np-header {
  display: flex; align-items: center; gap: .625rem;
  margin-bottom: .75rem;
}
.ss-np-label {
  font-family: var(--ff-ui); font-size: .5625rem;
  font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.38);
}

/* Animated equalizer bars */
.ss-eq {
  display: flex; align-items: flex-end;
  gap: 2.5px; height: 14px; flex-shrink: 0;
}
.ss-eq-bar {
  display: block; width: 3px; border-radius: 2px;
  background: var(--rose);
  animation: eq-dance .9s ease-in-out infinite;
  transform-origin: bottom;
}
.ss-eq-bar:nth-child(1) { height: 4px;  animation-duration: .72s; }
.ss-eq-bar:nth-child(2) { height: 11px; animation-duration: .88s; animation-delay: .18s; }
.ss-eq-bar:nth-child(3) { height: 6px;  animation-duration: .65s; animation-delay: .32s; }
.ss-eq-bar:nth-child(4) { height: 9px;  animation-duration: .80s; animation-delay: .08s; }
@keyframes eq-dance {
  0%,100% { transform: scaleY(.2);  opacity: .6; }
  50%      { transform: scaleY(1);   opacity: 1;  }
}
.ss-eq.paused .ss-eq-bar { animation-play-state: paused; opacity: .3; transform: scaleY(.2); }

.ss-np-title {
  font-family: var(--ff-display); font-size: 1rem; font-weight: 400;
  color: rgba(255,255,255,.95); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .9rem;
}

/* Progress bar */
.ss-np-progress { margin-bottom: .75rem; }
.ss-progress-track {
  height: 3px; background: rgba(255,255,255,.14);
  border-radius: 3px; cursor: pointer;
  margin-bottom: .375rem; position: relative; overflow: hidden;
}
.ss-progress-track:hover { height: 5px; margin-bottom: calc(.375rem - 1px); }
.ss-progress-fill {
  height: 100%; background: var(--rose);
  border-radius: 3px; width: 0%;
  transition: width .8s linear;
  pointer-events: none;
}
.ss-np-times {
  display: flex; justify-content: space-between;
  font-family: var(--ff-ui); font-size: .5625rem;
  color: rgba(255,255,255,.32); letter-spacing: .06em;
}

/* Track prev/next controls */
.ss-np-track-controls {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  margin-bottom: .75rem;
}
.ss-track-btn {
  background: rgba(255,255,255,.1); border: none; border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,.75);
  transition: background .2s, color .2s;
}
.ss-track-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.ss-track-pos {
  font-family: var(--ff-ui); font-size: .5625rem;
  letter-spacing: .12em; color: rgba(255,255,255,.45);
  min-width: 2.5rem; text-align: center;
}

/* Volume row */
.ss-np-vol {
  display: flex; align-items: center; gap: .5rem;
  color: rgba(255,255,255,.32);
}
input[type=range].ss-volume-range {
  flex: 1; height: 3px; cursor: pointer; outline: none;
  accent-color: var(--rose);
}

/* ── Controls pill — bottom center ──────────────────────────────── */
.ss-controls-pill {
  position: absolute; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: .5rem;
  background: rgba(10,8,7,.75);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 100px;
  padding: .75rem 1.25rem;
  pointer-events: auto;
  white-space: nowrap;
}
.ss-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
  flex-shrink: 0;
}
.ss-btn:hover { background: rgba(255,255,255,.2); transform: scale(1.08); }
.ss-btn-main {
  width: 50px; height: 50px;
  background: rgba(232,199,207,.18);
  border: 1px solid rgba(232,199,207,.38);
}
.ss-btn-main:hover { background: rgba(232,199,207,.36); border-color: rgba(232,199,207,.7); }
.ss-pill-divider {
  width: 1px; height: 26px;
  background: rgba(255,255,255,.12); flex-shrink: 0;
}
.ss-counter {
  font-family: var(--ff-ui); font-size: .6875rem;
  color: rgba(255,255,255,.38); letter-spacing: .06em;
  padding: 0 .25rem;
}

@media (max-width: 560px) {
  .ss-np { left: 1rem; right: 1rem; bottom: 1rem; width: auto; }
  .ss-controls-pill { bottom: 1rem; padding: .625rem 1rem; }
}

/* ─────────────────────────────────────────────────────────────────────
   FAMILY PAGE
   ───────────────────────────────────────────────────────────────────── */
.family-block { margin-bottom: 2rem; }

.family-panel {
  background: var(--white);
  border: 1px solid var(--warm-gray);
  border-radius: 20px; padding: 2.5rem;
}
.family-panel-tinted {
  background: linear-gradient(135deg, rgba(232,199,207,.08), rgba(196,212,192,.08));
}

/* Family hero: landscape photo with Wilfred info overlay */
.family-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(61,57,53,.14);
  /* No aspect-ratio — let the photo determine its own height */
}
.family-hero img {
  width: 100%; height: auto;
  display: block;
  /* object-fit not needed — natural dimensions show the full photo */
}
.family-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(24,18,16,.45) 62%,
    rgba(24,18,16,.82) 100%
  );
  display: flex;
  align-items: flex-end;
}
.family-hero-text {
  padding: 2rem 2.5rem;
  max-width: 560px;
}
.family-hero-name {
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 3vw, 2.375rem);
  font-weight: 500;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
  margin-bottom: .625rem;
}
.family-hero-desc {
  font-family: var(--ff-body);
  font-size: clamp(.8125rem, 1.4vw, .9375rem);
  color: rgba(255,255,255,.8);
  line-height: 1.7;
  font-style: italic;
}
@media (max-width: 640px) {
  .family-hero-text { padding: 1.25rem 1.25rem; }
}

/* Children grid */
.children-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .children-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (max-width: 480px) {
  .children-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
}

.child-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: default;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
  box-shadow: 0 4px 18px rgba(61,57,53,.1);
}
.child-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 48px rgba(61,57,53,.22);
}
.child-photo {
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}
.child-photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block;
  transition: transform .7s var(--ease), filter .5s var(--ease);
  filter: sepia(8%) saturate(88%);
}
.child-card:hover .child-photo img {
  transform: scale(1.08);
  filter: sepia(0%) saturate(100%);
}
/* Deep gradient overlay */
.child-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 35%,
    rgba(28,20,18,.42) 65%,
    rgba(28,20,18,.88) 100%
  );
  pointer-events: none;
  border-radius: 14px;
}
/* Birth order badge */
.child-order {
  position: absolute;
  top: .75rem; left: .75rem;
  z-index: 2;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display);
  font-size: .625rem;
  color: rgba(255,255,255,.9);
  letter-spacing: .04em;
  transition: background .3s, opacity .3s;
}
.child-card:hover .child-order {
  background: rgba(201,147,158,.45);
  border-color: rgba(255,255,255,.55);
}
.child-name-wrap {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1.5rem 1rem 1rem;
  z-index: 1;
  text-align: center;
}
.child-name {
  font-family: var(--ff-display);
  font-size: clamp(.9375rem, 1.4vw, 1.125rem);
  font-weight: 500;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.child-relation {
  display: block;
  font-family: var(--ff-ui);
  font-size: .625rem; font-weight: 400;
  letter-spacing: .13em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-top: .3rem;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.tag {
  font-family: var(--ff-ui); font-size: .875rem;
  color: var(--charcoal);
  background: var(--cream); border: 1px solid var(--warm-gray);
  border-radius: 100px; padding: .3125rem .9375rem;
}
.tag-step { border-color: var(--sage-light); background: rgba(196,212,192,.12); color: var(--charcoal); }

.great-grands {
  text-align: center; padding: 3.5rem 2rem;
  border-radius: 20px;
}
.great-grands .big-number {
  font-family: var(--ff-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 400; color: var(--blush);
  line-height: 1; margin-bottom: .25rem;
  letter-spacing: -.02em;
}
.great-grands h3 { font-family: var(--ff-display); font-size: 1.5rem; color: var(--charcoal); margin-bottom: 1rem; }
.great-grands p  { color: var(--stone); font-style: italic; max-width: 44ch; margin: 0 auto; line-height: 1.75; }

/* ─────────────────────────────────────────────────────────────────────
   TIMELINE PAGE
   ───────────────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: .5rem 0 3rem;
}
/* Center spine */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom,
    transparent 0%, var(--blush) 5%, var(--blush) 95%, transparent 100%);
}

/* Each item: 3-column grid  [card | node | card]  */
.tl-item {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  align-items: start;
  margin-bottom: 2.25rem;
  cursor: pointer;
}
.tl-item:last-child { margin-bottom: 0; }

/* Node — center column */
.tl-node {
  grid-column: 2; grid-row: 1;
  display: flex; justify-content: center;
  padding-top: .875rem;
  position: relative; z-index: 1;
}
.tl-node-inner {
  width: 32px; height: 32px;
  background: var(--cream);
  border: 1.5px solid var(--blush);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--rose); font-size: .5rem;
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.tl-item:hover .tl-node-inner,
.tl-item.tl-open .tl-node-inner { background: var(--blush); border-color: var(--rose); transform: scale(1.18); }
.tl-item:last-child .tl-node-inner { background: var(--blush); border-color: var(--rose-deep); }

/* Card */
.tl-card {
  background: var(--white);
  border: 1px solid var(--warm-gray);
  border-radius: 14px;
  padding: 1.25rem 1.5rem 1.125rem;
  transition: border-color .25s, box-shadow .25s;
  position: relative;
}
.tl-item:hover .tl-card,
.tl-item.tl-open .tl-card {
  border-color: var(--blush);
  box-shadow: 0 4px 20px rgba(201,147,158,.13);
}

/* Card placement */
.tl-right .tl-card { grid-column: 3; grid-row: 1; }
.tl-left  .tl-card { grid-column: 1; grid-row: 1; text-align: right; }

/* Arrow nub pointing toward center spine */
.tl-right .tl-card::before {
  content: ''; position: absolute;
  left: -5px; top: 1.125rem;
  width: 8px; height: 8px;
  background: var(--white);
  border-left: 1px solid var(--warm-gray);
  border-bottom: 1px solid var(--warm-gray);
  transform: rotate(45deg);
  transition: border-color .25s;
}
.tl-left .tl-card::after {
  content: ''; position: absolute;
  right: -5px; top: 1.125rem;
  width: 8px; height: 8px;
  background: var(--white);
  border-top: 1px solid var(--warm-gray);
  border-right: 1px solid var(--warm-gray);
  transform: rotate(45deg);
  transition: border-color .25s;
}
.tl-item:hover .tl-right .tl-card::before,
.tl-item.tl-open .tl-right .tl-card::before { border-color: var(--blush); }
.tl-item:hover .tl-left .tl-card::after,
.tl-item.tl-open .tl-left .tl-card::after { border-color: var(--blush); }

/* Text */
.tl-year {
  font-family: var(--ff-ui); font-size: .625rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--rose); margin-bottom: .3rem;
}
.tl-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: .5rem;
}
.tl-left .tl-header { flex-direction: row-reverse; }
.tl-title {
  font-family: var(--ff-display);
  font-size: 1.0625rem; font-weight: 400;
  color: var(--charcoal); line-height: 1.3; margin: 0;
}
.tl-chevron {
  flex-shrink: 0; margin-top: .15rem;
  color: var(--stone);
  transition: transform .35s ease, color .2s;
}
.tl-item.tl-open .tl-chevron { transform: rotate(180deg); color: var(--rose); }

/* Expand / collapse */
.tl-body {
  overflow: hidden;
  max-height: 0; opacity: 0;
  transition: max-height .45s ease, opacity .35s ease, margin-top .3s;
  margin-top: 0;
}
.tl-item.tl-open .tl-body { max-height: 300px; opacity: 1; margin-top: .75rem; }
.tl-desc {
  font-family: var(--ff-body); font-size: .9375rem;
  color: var(--stone); line-height: 1.75;
}

/* Slide-in from sides on scroll */
.tl-left.fade-in  { transform: translateX(-36px); }
.tl-right.fade-in { transform: translateX(36px); }
.tl-left.fade-in.visible,
.tl-right.fade-in.visible { opacity: 1; transform: translateX(0); }

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .timeline::before { left: 16px; transform: none; }
  .tl-item { grid-template-columns: 40px 1fr; }
  .tl-node  { grid-column: 1; }
  .tl-left .tl-card,
  .tl-right .tl-card { grid-column: 2; grid-row: 1; text-align: left; }
  .tl-left .tl-header { flex-direction: row; }
  .tl-left .tl-card::after { display: none; }
  .tl-left .tl-card::before {
    content: ''; position: absolute;
    left: -5px; top: 1.125rem;
    width: 8px; height: 8px;
    background: var(--white);
    border-left: 1px solid var(--warm-gray);
    border-bottom: 1px solid var(--warm-gray);
    transform: rotate(45deg);
  }
  .tl-left.fade-in, .tl-right.fade-in { transform: translateY(18px); }
  .tl-left.fade-in.visible, .tl-right.fade-in.visible { transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────────
   POEMS PAGE
   ───────────────────────────────────────────────────────────────────── */

/* Quick-jump index */
.poem-index {
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: center;
  margin: 2.5rem 0 3rem;
}
.poem-index a {
  font-family: var(--ff-ui); font-size: .75rem;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--rose-deep);
  background: var(--white); border: 1px solid var(--blush);
  border-radius: 100px; padding: .35rem 1rem;
  text-decoration: none;
  transition: background .2s, border-color .2s, color .2s;
}
.poem-index a:hover,
.poem-index a.active {
  background: var(--blush); border-color: var(--rose); color: var(--charcoal);
}

/* ── Accordion ─────────────────────────────────────────────────────── */
.poem-accord {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.poem-accord-item {
  background: var(--white);
  border: 1px solid var(--warm-gray);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
  scroll-margin-top: 5rem;
}
.poem-accord-item.open {
  border-color: var(--blush);
  box-shadow: var(--shadow-md);
}

/* Header button */
.poem-accord-hdr {
  width: 100%;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.75rem;
  background: none; border: none; cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--charcoal);
  transition: background .2s;
}
.poem-accord-hdr:hover { background: rgba(232,199,207,.12); }
.poem-accord-item.open .poem-accord-hdr { background: rgba(232,199,207,.18); }

.poem-accord-ornament {
  color: var(--blush);
  font-size: .9rem;
  flex-shrink: 0;
  line-height: 1;
}

.poem-accord-titles {
  flex: 1;
  min-width: 0;
}
.poem-accord-name {
  font-family: var(--ff-display);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--charcoal);
}
.poem-accord-by {
  font-family: var(--ff-ui);
  font-size: .625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: .2rem;
}

.poem-accord-chevron {
  flex-shrink: 0;
  color: var(--rose);
  transition: transform .35s var(--ease);
}
.poem-accord-item.open .poem-accord-chevron {
  transform: rotate(180deg);
}

/* Collapsible body — CSS Grid trick for smooth height animation */
.poem-accord-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s var(--ease);
}
.poem-accord-item.open .poem-accord-body {
  grid-template-rows: 1fr;
}
.poem-accord-inner {
  overflow: hidden;
}

/* Poem content inside accordion */
.poem-content {
  padding: 0 1.75rem 1.75rem;
}
.poem-divider {
  height: 1px;
  background: var(--warm-gray);
  margin-bottom: 1.75rem;
}
.poem-text {
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--charcoal);
}
.poem-text p {
  margin-bottom: 1.5rem;
}
.poem-text p:last-child { margin-bottom: 0; }
.poem-closing {
  font-style: italic;
  color: var(--stone);
  border-top: 1px solid var(--warm-gray);
  padding-top: 1.25rem;
  margin-top: 1.75rem;
}

/* Back to top link */
.poem-back-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--warm-gray);
  font-family: var(--ff-ui);
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rose-deep);
  text-decoration: none;
  transition: color .2s;
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
}
.poem-back-top:hover { color: var(--rose); }

@media (max-width: 560px) {
  .poem-accord-hdr { padding: 1rem 1.25rem; }
  .poem-content { padding: 0 1.25rem 1.5rem; }
}

/* ─────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────── */
footer {
  background: var(--charcoal); color: var(--warm-gray);
  text-align: center; padding: 3.5rem 1.5rem;
}
.footer-accent { color: var(--blush); font-size: 1.375rem; margin-bottom: 1rem; }
.footer-name { font-family: var(--ff-display); font-size: 1.25rem; color: var(--white); margin-bottom: .25rem; }
.footer-years {
  font-family: var(--ff-ui); font-size: .6875rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 1.25rem;
}
.footer-quote {
  font-family: var(--ff-body); font-style: italic; font-size: .9375rem;
  color: rgba(216,211,204,.65); max-width: 38ch; margin: 0 auto; line-height: 1.75;
}

/* ─────────────────────────────────────────────────────────────────────
   UTILITIES & ANIMATIONS
   ───────────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-sm  { margin-top: .75rem; }
.mt-md  { margin-top: 1.5rem; }
.mt-lg  { margin-top: 3rem; }
.mb-md  { margin-bottom: 1.5rem; }

.fade-in {
  opacity: 0; transform: translateY(18px);
  transition: opacity .75s var(--ease), transform .75s var(--ease);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Stagger siblings */
.fade-in:nth-child(2) { transition-delay: .1s; }
.fade-in:nth-child(3) { transition-delay: .2s; }
.fade-in:nth-child(4) { transition-delay: .3s; }
