/* therundquists.org — shared styles */
:root {
  --bg: #f7f4ee;
  --surface: #fffdf9;
  --ink: #2b2925;
  --ink-soft: #5d5850;
  --muted: #8a8378;
  --rule: #e2dccf;
  --accent: #6b5a3e;
  --accent-ink: #4e4029;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1a18;
    --surface: #23211e;
    --ink: #ece7dd;
    --ink-soft: #c4bdb0;
    --muted: #958d80;
    --rule: #3a3631;
    --accent: #c9ad7c;
    --accent-ink: #e0c899;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1a18; --surface: #23211e; --ink: #ece7dd; --ink-soft: #c4bdb0;
  --muted: #958d80; --rule: #3a3631; --accent: #c9ad7c; --accent-ink: #e0c899;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 16px; }

/* Header / footer */
.site-header { padding: 1.5rem 0 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.wordmark { font-family: var(--serif); font-size: 1.35rem; letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.site-header nav a { font-size: .95rem; color: var(--ink-soft); text-decoration: none; }
.site-header nav a:hover { color: var(--accent-ink); text-decoration: underline; }
.site-footer { margin-top: 5rem; padding: 2rem 0 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .875rem; text-align: center; }

/* Typography */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 7vw, 3.4rem); margin: 0; letter-spacing: .005em; }
h2 { font-size: 2rem; margin: 0 0 1.25rem; }
h3 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
.eyebrow { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .75rem; }
.lede { font-size: 1.2rem; color: var(--ink-soft); }

/* Photo frame with graceful placeholder */
.photo {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
}
.photo img { width: 100%; }
.photo.missing { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--muted); font-size: .9rem; text-align: center; }
.photo.missing img { display: none; }
.photo.missing::after { content: attr(data-placeholder); padding: 1rem; }

/* Home */
.home-hero { padding: 4rem 0 2rem; text-align: center; }
.home-hero .photo { margin: 2.5rem auto 0; max-width: 36rem; }
.home-hero .lede { margin: 1rem auto 0; max-width: 30rem; }
.memorial-card {
  display: grid; grid-template-columns: 7rem 1fr; gap: 1.25rem; align-items: center;
  margin-top: 3rem; padding: 1.25rem; background: var(--surface);
  border: 1px solid var(--rule); text-decoration: none; color: inherit;
  transition: border-color .15s ease;
}
.memorial-card:hover { border-color: var(--accent); }
.memorial-card img, .memorial-card .thumb { width: 7rem; height: 7rem; object-fit: cover; background: var(--rule); }
.memorial-card h2 { font-size: 1.5rem; margin: 0 0 .25rem; }
.memorial-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.memorial-card .more { display: inline-block; margin-top: .5rem; color: var(--accent-ink); font-size: .95rem; }
@media (max-width: 30rem) {
  .memorial-card { grid-template-columns: 1fr; text-align: center; }
  .memorial-card img, .memorial-card .thumb { margin: 0 auto; }
}

/* Memorial */
.memorial-hero { padding: 3.5rem 0 1rem; text-align: center; }
.memorial-hero .photo { max-width: 22rem; margin: 0 auto 2rem; }
.dates { font-family: var(--serif); font-size: 1.3rem; color: var(--ink-soft); margin: .5rem 0 0; }
.epitaph { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ink-soft); margin: 1.5rem auto 0; max-width: 28rem; }

.toc { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin: 2.5rem 0 0; padding: 1rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: .95rem; }
.toc a { text-decoration: none; color: var(--ink-soft); }
.toc a:hover { color: var(--accent-ink); }

section { padding-top: 4rem; scroll-margin-top: 1rem; }
.ornament { text-align: center; color: var(--muted); letter-spacing: .5em; margin: 0 0 2rem; }

.obit .photo { float: right; width: 42%; margin: .35rem 0 1rem 1.5rem; }
@media (max-width: 34rem) { .obit .photo { float: none; width: 70%; margin: 0 auto 1.5rem; } }
.obit::after { content: ""; display: block; clear: both; }

/* Funeral program */
.program-date { color: var(--muted); margin-top: -.75rem; }
.program { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 1rem; }
.program td { padding: .55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.program td:last-child { text-align: right; color: var(--ink-soft); padding-left: 1rem; }
.program tr.music td:first-child { font-style: italic; }
.program-notes p { color: var(--ink-soft); }
.names { columns: 2; padding: 0; list-style: none; margin: .5rem 0 0; }
@media (max-width: 30rem) { .names { columns: 1; } }
.verse { font-family: var(--serif); font-size: 1.15rem; line-height: 1.6; white-space: pre-line; padding-left: 1.25rem; border-left: 2px solid var(--rule); color: var(--ink-soft); }
.verse.placeholder { font-family: var(--sans); font-size: .9rem; font-style: italic; color: var(--muted); }

/* Remembrances */
.memories-intro { color: var(--ink-soft); }
.memory { margin: 0; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.memory:last-child { border-bottom: 0; }
.memory p { margin: 0 0 .9rem; }
.memory footer { margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.memory footer strong { color: var(--ink); font-weight: 600; }
.memory.signature-only { padding: 1.25rem 0; }

.back-top { display: block; text-align: center; margin-top: 3rem; font-size: .9rem; }

@media print {
  .site-header nav, .toc, .back-top { display: none; }
  body { background: #fff; color: #000; }
  .memory { break-inside: avoid; }
}
