/* content.css — editable-content sections: hero, obituary, life & legacy, service.
   Builds on the tokens and utilities in style.css. */

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-6);
  max-width: 60rem;
  margin-inline: auto;
}

.hero__portrait {
  margin: 0;
  width: clamp(11rem, 52vw, 17rem);
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px var(--radius) var(--radius); /* soft arched top, like a memorial frame */
  overflow: hidden;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex: none;
}
.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transition: opacity 700ms var(--ease-out);
}
.hero__portrait.is-loading img { opacity: 0; }

.hero__text { max-width: 38rem; }

.hero__name {
  font-size: var(--step-hero);
  font-weight: 500;
  letter-spacing: 0.005em;
  margin-bottom: var(--space-3);
}
.hero__familiar {
  font-family: var(--font-text);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--ink-soft);
  margin-bottom: var(--space-4);
}
.hero__title {
  font-size: var(--step-0);
  color: var(--ink);
  margin-bottom: var(--space-4);
  text-wrap: balance;
}
.hero__date {
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--space-5);
}
.hero__epitaph {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--accent);
  margin: 0;
}
.hero__epitaph::before {
  content: "";
  display: block;
  width: 3rem;
  height: 1px;
  margin: 0 auto var(--space-5);
  background: var(--border-strong);
}
.hero__body {
  margin-top: var(--space-5);
  font-family: var(--font-text);
  font-size: var(--step-1);
  line-height: var(--leading-prose);
  color: var(--ink-soft);
}

.hero__cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap);
  padding: var(--space-2) var(--space-4);
  font-size: var(--step--1);
  color: var(--ink-soft);
  text-decoration: none;
}
.hero__cue:hover { color: var(--accent); text-decoration: none; }
.hero__cue-arrow {
  font-size: var(--step-1);
  line-height: 1;
  animation: hero-cue 2.8s ease-in-out infinite;
}
@keyframes hero-cue {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* Wider screens: portrait beside the text, cue centered beneath both.
   Without a portrait the hero stays a single centered column. */
@media (min-width: 860px) {
  .hero:not(.hero--no-portrait) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--space-8);
    row-gap: var(--space-6);
    align-items: center;
    text-align: left;
  }
  .hero:not(.hero--no-portrait) .hero__portrait { width: clamp(15rem, 24vw, 19rem); }
  .hero:not(.hero--no-portrait) .hero__epitaph::before { margin-left: 0; }
  .hero:not(.hero--no-portrait) .hero__cue { grid-column: 1 / -1; justify-self: center; }
}

/* ---------- Obituary: a letter on paper ---------- */
.obituary {
  font-family: var(--font-text);
  font-size: var(--step-1);
  line-height: var(--leading-prose);
  hyphens: manual;
}
.obituary p { margin-bottom: var(--space-5); }
.obituary > p:first-child::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 3.2em;
  line-height: 0.85;
  padding: 0.08em 0.1em 0 0;
  color: var(--accent);
}
.obituary__closing {
  margin-top: var(--space-7);
  font-style: italic;
}
.obituary__signature {
  text-align: right;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: var(--space-5);
}

/* ---------- Life & Legacy: a restrained vertical timeline ---------- */
.legacy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-7);
  position: relative;
}
.legacy-list::before {           /* the quiet thread connecting entries */
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 1px;
  background: var(--border-strong);
}
.legacy-item {
  position: relative;
  padding-left: var(--space-6);
}
.legacy-item + .legacy-item { margin-top: var(--space-6); }
.legacy-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.legacy-item__lead {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.3;
  margin-bottom: var(--space-1);
}
.legacy-item__text {
  color: var(--ink-soft);
  margin: 0;
}
.legacy__more {
  text-align: center;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

/* "His work online" — publication-profile links as a row of quiet pills */
.legacy h3 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  text-align: center;
  margin: var(--space-7) 0 var(--space-2);
}
.legacy-pubs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  padding: 0;
  margin: var(--space-4) 0 0;
}
.legacy-pubs li { margin: 0; }
.legacy-pubs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--step--1);
  transition: color var(--dur-ui) var(--ease-out), border-color var(--dur-ui) var(--ease-out);
}
.legacy-pubs a:hover,
.legacy-pubs a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Memorial service ---------- */
.service {
  text-align: center;
  font-family: var(--font-text);
  font-size: var(--step-1);
  line-height: var(--leading-prose);
}
.service p { margin-bottom: var(--space-5); }
.service > p:first-child {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__cue-arrow { animation: none; }
  .hero__portrait img { transition: none; }
}
