/* =========================================================
   ashtonhughes.com — memorial site stylesheet
   Design system: project-specific (warm & photographic).
   Deliberately NOT the Broken Arrow Group / GL-003 brand —
   per David's direction this personal site carries its own
   warm, honest, photo-first identity.
   ========================================================= */

:root {
  color-scheme: light dark;

  /* palette — warm cream / deep warm brown / muted amber-gold */
  --bg: #f8f3ea;
  --bg-soft: #f1e9db;
  --surface: #fffdf8;
  --ink: #2e241b;
  --ink-soft: #6b5d4e;
  --accent: #a9812e;
  --accent-soft: #c8a34f;
  --rule: rgba(90, 70, 40, 0.22);
  --chip-bg: #f6e7c3;
  --chip-ink: #6b4e0a;
  --chip-border: #d9b45c;
  --shadow: 0 2px 14px rgba(60, 42, 20, 0.10);

  /* type — system stacks only, no webfonts */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* spacing */
  --sp-xs: 8px;
  --sp-sm: 16px;
  --sp-md: 24px;
  --sp-lg: 48px;
  --sp-xl: 64px;
  --sp-2xl: 96px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* keep it warm: deep brown, never pure black */
    --bg: #221a12;
    --bg-soft: #2a2117;
    --surface: #2d241a;
    --ink: #ece2d0;
    --ink-soft: #b5a48c;
    --accent: #cfa758;
    --accent-soft: #b58e3f;
    --rule: rgba(232, 210, 170, 0.22);
    --chip-bg: #3e321a;
    --chip-ink: #ecd9a4;
    --chip-border: #8a6f31;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
a:hover { text-decoration-color: var(--accent); }

h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: 0.005em;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); margin: 0 0 var(--sp-md); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: var(--sp-lg) 0 var(--sp-sm); }
h3 { font-size: 1.2rem; margin: var(--sp-md) 0 var(--sp-xs); }

/* ---------- layout containers ---------- */

.wrap { width: min(1120px, 92vw); margin: 0 auto; }
.measure { width: min(65ch, 92vw); margin-inline: auto; }

main { padding-bottom: var(--sp-2xl); }
section + section { margin-top: var(--sp-xl); }

hr.gold-rule {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  margin: var(--sp-xl) auto;
  width: min(320px, 60%);
}

/* ---------- header / nav ---------- */

.site-header {
  width: 100%;
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.site-header .bar {
  width: min(1120px, 94vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}

.brand { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.brand-dates {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.nav-toggle {
  display: none;
  font: inherit;
  font-size: 0.95rem;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; align-items: center; }
.site-nav a {
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* transparent header floated over the homepage hero */
body.home .site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background: linear-gradient(rgba(20, 15, 10, 0.45), transparent);
  border-bottom: 0;
}
body.home .brand-name,
body.home .site-nav a { color: #f6efe2; }
body.home .brand-dates { color: rgba(246, 239, 226, 0.85); }
body.home .site-nav a[aria-current="page"] { border-bottom-color: #e5c46f; }
body.home .nav-toggle { background: rgba(30, 22, 14, 0.5); color: #f6efe2; border-color: rgba(246,239,226,0.4); }

@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: var(--sp-xs) 0;
  }
  .site-header.nav-open .site-nav { display: flex; }
  body.home .site-header.nav-open { background: rgba(24, 18, 12, 0.92); }
  .site-nav a { font-size: 1.02rem; padding: 8px 2px; width: 100%; }
}

/* ---------- homepage hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%; /* per Pixel's plan: eyes hold the upper third */
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 58%,
    rgba(20, 15, 10, 0.60) 100%
  ); /* warm bottom gradient per Pixel's plan */
}
.hero-title {
  position: relative;
  z-index: 5;
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding-bottom: clamp(48px, 9vh, 110px);
  color: #f9f3e6;
}
.hero-title h1 {
  color: #fbf6ea;
  font-size: clamp(2.2rem, 6vw, 4rem);
  margin: 0 0 6px;
  text-shadow: 0 2px 18px rgba(15, 10, 5, 0.55);
}
.hero-title p {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  margin: 0;
  color: rgba(250, 244, 230, 0.95);
  text-shadow: 0 1px 12px rgba(15, 10, 5, 0.55);
}

/* ---------- sub-page lead figure ---------- */

.lead-figure { position: relative; margin: 0; overflow: hidden; }
.lead-figure img {
  width: 100%;
  height: clamp(300px, 52vh, 560px);
  object-fit: cover;
}
.lead-figure .lead-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(20, 15, 10, 0.55) 100%);
}
.lead-figure figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding-bottom: var(--sp-md);
  color: #f9f3e6;
}
.lead-figure figcaption h1 {
  color: #fbf6ea;
  margin: 0;
  text-shadow: 0 2px 16px rgba(15, 10, 5, 0.55);
}
.lead-figure figcaption .lead-sub {
  font-size: 0.85rem;
  color: rgba(250, 244, 230, 0.9);
  text-shadow: 0 1px 8px rgba(15, 10, 5, 0.6);
}

.page-head { padding-top: var(--sp-lg); }

/* ---------- memorial passages ---------- */

.passage {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.85;
}
.passage p { margin: 0 0 1.35em; }

.dream-words {
  border-left: 3px solid var(--accent);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg-soft);
  border-radius: 0 12px 12px 0;
  margin: var(--sp-md) 0;
}

.signature {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin-top: var(--sp-lg);
}

.byline {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: -8px;
  margin-bottom: var(--sp-md);
}

/* ---------- life lessons ---------- */

.lesson {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: var(--sp-md) var(--sp-md) var(--sp-md) 84px;
  margin: var(--sp-md) 0;
}
.lesson .lesson-num {
  position: absolute;
  left: 22px;
  top: 18px;
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.lesson p { margin: 0 0 1.1em; }
.lesson p:last-child { margin-bottom: 0; }
@media (max-width: 560px) {
  .lesson { padding: 60px var(--sp-sm) var(--sp-sm); }
  .lesson .lesson-num { top: 14px; left: 16px; font-size: 2.1rem; }
}

/* ---------- video embed (16:9, privacy-enhanced) ---------- */

.video-embed {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: #000;
}

/* ---------- services ---------- */

.services-lead {
  position: relative;
  overflow: hidden;
  padding: var(--sp-xl) 0;
  background: var(--bg-soft);
}
.services-lead .poster-backdrop {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(0.7) saturate(0.9);
  transform: scale(1.15);
}
.services-lead .poster-card {
  position: relative;
  z-index: 5;
  margin: 0 auto;
  width: fit-content;
  background: var(--surface);
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(15, 10, 5, 0.4);
}
.services-lead .poster-card img {
  border-radius: 8px;
  /* native clip resolution — displayed at natural size, never stretched */
  width: 352px;
  max-width: 82vw;
}
.services-lead .poster-card figcaption {
  font-size: 0.82rem;
  color: var(--ink-soft);
  padding: 8px 4px 2px;
  max-width: 352px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 352px));
  justify-content: center;
  gap: var(--sp-md);
  margin-top: var(--sp-lg);
}
.video-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: var(--sp-sm);
}
.video-card h3 { margin: 0 0 10px; font-size: 1.05rem; }
.video-card video {
  width: 100%;
  max-width: 352px; /* posters are native clip resolution — never stretched */
  border-radius: 8px;
  background: #000;
}
.video-card .flag { margin-top: 8px; }

/* ---------- gallery ---------- */

.gallery-grid {
  columns: 4 240px;
  column-gap: 14px;
  margin-top: var(--sp-lg);
}
.gallery-grid a {
  display: block;
  margin-bottom: 14px;
  border-radius: 8px;
  overflow: hidden;
  break-inside: avoid;
  box-shadow: var(--shadow);
}
.gallery-grid img { width: 100%; border-radius: 8px; }

/* lightbox — vanilla, no libraries */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(24, 18, 12, 0.93); /* warm near-black backdrop */
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.lightbox button {
  position: absolute;
  z-index: 105;
  background: rgba(46, 36, 27, 0.65);
  color: #f6efe2;
  border: 1px solid rgba(246, 239, 226, 0.35);
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1;
  padding: 10px 16px;
  cursor: pointer;
}
.lightbox button:hover { background: rgba(46, 36, 27, 0.9); }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(246, 239, 226, 0.85);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* ---------- timeline ---------- */

.timeline {
  list-style: none;
  margin: var(--sp-lg) auto 0;
  padding: 0 0 0 34px;
  position: relative;
  width: min(760px, 92vw);
}
.timeline::before {
  /* the amber spine — a single straight vertical rule */
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-soft), var(--accent), var(--accent-soft));
  opacity: 0.65;
}
.tl-item { position: relative; margin-bottom: var(--sp-lg); }
.tl-milestone::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.tl-milestone h2 { margin: 0 0 8px; font-size: 1.35rem; }
.tl-milestone p { margin: 0; }
.tl-photo figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
}
.tl-photo img { border-radius: 8px; width: 100%; }
.tl-photo.portrait img { max-width: 440px; margin: 0 auto; } /* portrait frames never full-width */
.tl-photo figcaption {
  padding: 10px 6px 4px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.tl-photo .cap-fragment {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}

/* ---------- scholarship ---------- */

.scholarship-photos {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: var(--sp-md);
  align-items: start;
  margin-top: var(--sp-lg);
}
.scholarship-photos figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
}
.scholarship-photos img { border-radius: 8px; width: 100%; }
.scholarship-photos figcaption { font-size: 0.85rem; color: var(--ink-soft); padding: 8px 4px 2px; }
.scholarship-anchor { grid-row: span 2; max-width: 420px; } /* portrait anchor — never full-width */
@media (max-width: 720px) {
  .scholarship-photos { grid-template-columns: 1fr; }
  .scholarship-anchor { grid-row: auto; margin-inline: auto; }
}

/* ---------- buttons (nine lives donor links) ---------- */

.button-row { display: flex; gap: var(--sp-sm); flex-wrap: wrap; margin: var(--sp-md) 0; }
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: #fdf9f0;
  background: var(--accent);
  border-radius: 12px;
  padding: 14px 22px;
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--accent-soft); }
.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn.secondary:hover { color: var(--ink); border-color: var(--accent-soft); }

/* ---------- [CONFIRM] review chips ---------- */

.confirm {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.4;
  color: var(--chip-ink);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 6px;
  padding: 1px 8px;
  vertical-align: baseline;
}
a.confirm { text-decoration: underline dotted; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  padding: var(--sp-lg) 0;
  margin-top: var(--sp-2xl);
}
.site-footer p {
  width: min(1120px, 92vw);
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- gentle reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .lightbox img { transition: none; }
}

/* ---------- print ---------- */
@media print {
  .site-nav, .nav-toggle, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
}
