/* ============================================================
   In Memory of Andrei Rogers — shared stylesheet
   ============================================================ */

:root {
  --cream: #FBF5E9;
  --cream-card: #FFFDF8;
  --ink: #2E2A24;
  --ink-soft: #5A5346;
  --gold: #C9972F;
  --gold-deep: #A5781F;
  --teal: #2F6F6F;
  --teal-deep: #1F4D4D;
  --navy: #223A5E;
  --border: #E9DFC9;
  --shadow: 0 8px 24px rgba(46, 42, 36, 0.08);
  --radius: 16px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color: var(--navy);
  line-height: 1.25;
  margin-top: 0;
}

a { color: var(--teal-deep); }
a:hover { color: var(--gold-deep); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.site-header {
  background: var(--cream-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--teal);
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #FBF5E9 0%, #F3E7C9 55%, #ECDCB0 100%);
  padding: 72px 24px 56px;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--gold) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: 0.12;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.hero-dates {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.hero-photos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 24px);
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-dates {
  margin-top: 4px;
}

.hero-photo {
  width: clamp(88px, 12vw, 140px);
  height: clamp(88px, 12vw, 140px);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--cream-card);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 14px;
}

.hero p.tagline {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.98rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 111, 111, 0.3);
}
.btn-primary:hover { color: #fff; background: var(--teal-deep); }

.btn-gold {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 6px 16px rgba(201, 151, 47, 0.3);
}
.btn-gold:hover { color: #fff; background: var(--gold-deep); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--teal);
  color: var(--teal-deep);
}
.btn-outline:hover { background: var(--teal); color: #fff; }

/* ---------- Sections ---------- */
section.content {
  padding: 56px 24px;
}

section.content.alt {
  background: var(--cream-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  text-align: center;
  margin-bottom: 8px;
}

.section-sub {
  text-align: center;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 40px;
}

.obituary {
  max-width: 720px;
  margin: 0 auto;
  background: var(--cream-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
}

.obituary p { margin: 0 0 18px; }
.obituary p:last-child { margin-bottom: 0; }

/* ---------- Journey timeline ---------- */
.journey {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 4px 20px;
  scroll-snap-type: x proximity;
}

.journey-stop {
  scroll-snap-align: start;
  flex: 0 0 200px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  position: relative;
}

.journey-stop::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  margin-bottom: 12px;
}

.journey-stop .year {
  font-weight: 700;
  color: var(--teal-deep);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.journey-stop h4 {
  margin: 6px 0 8px;
  font-size: 1.05rem;
}

.journey-stop p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Cards grid (links, book/film) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.card-grid-2x2 {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  max-width: 720px;
}

@media (max-width: 640px) {
  .card-grid-2x2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--cream-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}

.card .icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.card .icon-svg {
  color: var(--teal-deep);
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); margin-bottom: 18px; }

/* ---------- Forms / filters ---------- */
.filter-bar {
  max-width: var(--max-width);
  margin: 0 auto 32px;
  background: var(--cream-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}

.filter-field label {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal-deep);
  margin-bottom: 6px;
}

.filter-field input,
.filter-field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.filter-field input:focus,
.filter-field select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.filter-clear {
  align-self: end;
}

/* ---------- Memory cards ---------- */
.memories-meta {
  max-width: var(--max-width);
  margin: 0 auto 18px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.memories-list {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.memory-card {
  background: var(--cream-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
}

.memory-card .memory-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.memory-card .memory-author {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
}

.memory-card .memory-relationship {
  color: var(--gold-deep);
  font-weight: 600;
  font-size: 0.85rem;
}

.memory-card .memory-date {
  color: var(--ink-soft);
  font-size: 0.85rem;
  white-space: nowrap;
}

.memory-card .memory-text {
  margin: 0;
  white-space: pre-wrap;
}

.memory-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.memory-photos a img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.state-msg {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 20px;
}

.notice {
  max-width: var(--max-width);
  margin: 0 auto 28px;
  background: #FFF6DF;
  border: 1px solid #E9CE8C;
  border-radius: var(--radius);
  padding: 18px 24px;
  font-size: 0.92rem;
  color: #6B4E10;
}

.notice code {
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- Gallery ---------- */
.photo-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.photo-tile {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--cream-card);
  transition: transform 0.15s ease;
}

.photo-tile:hover {
  transform: scale(1.03);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Share form ---------- */
.form-frame-wrap {
  max-width: 760px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--cream-card);
}

.form-frame-wrap iframe {
  width: 100%;
  height: 1500px;
  border: none;
  display: block;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.site-footer .heart { color: var(--gold-deep); }

@media (max-width: 640px) {
  .obituary { padding: 28px 24px; }
  .nav { justify-content: center; text-align: center; }
}
