/* ============================================================
   Grandma's Stories — styles
   Cream + wine accent · serif titles · sans-serif body
   ============================================================ */

:root {
  --bg: #faf6ef;
  --bg-card: #ffffff;
  --text: #2a2520;
  --text-soft: #5d4f3d;
  --text-muted: #7a6f5e;
  --text-faint: #a39787;
  --border: #d8cfbf;
  --border-strong: #c9bda6;

  --accent: #8a3a4f;
  --accent-light: #a85b6e;
  --accent-on: #faf6ef;

  --tile-1: #d8cfbf;
  --tile-2: #c9bda6;
  --tile-3: #b8a890;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --max-width: 960px;
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-style: italic;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

hr {
  border: none;
  border-top: 0.5px solid var(--border);
  margin: 0;
}

.divider--header { margin: 0 2rem; }

img {
  max-width: 100%;
  display: block;
}

/* =========================
   Header (homepage)
   ========================= */

.site-header {
  text-align: center;
  padding: 2.75rem 2rem 2rem;
}

.site-title {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0;
  color: var(--text);
}

.site-accent-line {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 14px auto 0;
  border-radius: 2px;
}

.site-dates {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.site-tagline {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 16px;
  font-style: italic;
}

/* =========================
   Search bar
   ========================= */

.search-bar {
  margin: 1.75rem auto 0;
  max-width: 480px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 4px 4px 4px 18px;
  gap: 8px;
  position: relative;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 58, 79, 0.1);
}

.search-bar .search-icon {
  font-size: 16px;
  color: var(--accent);
  font-style: normal;
  font-weight: bold;
}

.search-bar input {
  border: none;
  background: transparent;
  flex: 1;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: var(--sans);
  min-width: 0;
}

.search-bar button {
  background: var(--accent);
  color: var(--accent-on);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}

.search-bar button:hover {
  background: #6f2c3f;
}

/* =========================
   Hero
   ========================= */

.hero {
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
}

.hero-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #2a2520;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #faf6ef;
}

.hero-video-poster {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #4a4138 0%, #2a2520 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background-size: cover;
  background-position: center;
}

/* When a hero photo is loaded, layer a subtle dark overlay so the play button stays readable */
.hero-video-poster--has-photo {
  position: relative;
}

.hero-video-poster--has-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}

.hero-video-poster--has-photo .play-button,
.hero-video-poster--has-photo .duration-pill {
  position: relative;
  z-index: 1;
}

.hero-video-poster--has-photo .play-button {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.play-button {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  font-size: 22px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  transition: transform 0.15s;
}

.play-button:hover {
  transform: scale(1.05);
}

.duration-pill {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.hero-meta {
  margin-top: 1rem;
}

.hero-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

.hero-frame {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  margin: 4px 0 0;
}

/* =========================
   Anchor cards
   ========================= */

.anchors {
  padding: 0 2rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.anchor-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
  display: block;
}

.anchor-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.anchor-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--tile-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.anchor-photo-placeholder {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.anchor-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.anchor-text {
  padding: 12px 14px;
}

.anchor-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}

.anchor-frame {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 0;
  line-height: 1.5;
}

.anchor-duration {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* =========================
   Section dividers + tile grid
   ========================= */

.section {
  padding: 0;
}

.section-header {
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--border);
}

.section-label {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  font-weight: 500;
  margin: 0;
}

.section-divider-line {
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

.section-count {
  font-size: 11px;
  color: var(--text-faint);
}

.section-grid {
  padding: 1.25rem 2rem 0.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 1.5rem;
}

.tile {
  cursor: pointer;
  display: block;
  transition: transform 0.15s;
}

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

.tile-photo {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
}

.tile-photo-placeholder {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.tile-title {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}

.tile-frame {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}

/* Cycle tile colors for variety until photos arrive */
.section-grid .tile:nth-child(3n+1) .tile-photo { background: var(--tile-1); }
.section-grid .tile:nth-child(3n+2) .tile-photo { background: var(--tile-2); }
.section-grid .tile:nth-child(3n+3) .tile-photo { background: var(--tile-3); }

/* =========================
   Footer
   ========================= */

.site-footer {
  padding: 2.5rem 2rem 3rem;
  text-align: center;
  border-top: 0.5px solid var(--border);
  margin-top: 1rem;
}

.site-footer .memorial {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 6px;
}

.site-footer .meta {
  font-size: 11px;
  color: var(--text-faint);
  margin: 0;
  font-style: italic;
}

/* =========================
   Story page
   ========================= */

.story-nav-top {
  padding: 1.25rem 2rem;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link, .search-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  transition: color 0.15s;
}

.back-link:hover, .search-link:hover {
  color: var(--accent);
}

.back-link .arrow,
.search-link .search-icon {
  color: var(--accent);
  font-size: 14px;
  font-weight: bold;
  font-style: normal;
}

.story {
  padding: 2rem 2rem 1.5rem;
}

.story-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #2a2520;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.story-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #2a2520;
}

.story-meta {
  text-align: center;
  margin-bottom: 1.5rem;
}

.story-section-label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 10px;
}

.story-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
  margin: 0;
}

.story-frame {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text-soft);
  font-style: italic;
  margin: 12px 0 0;
  line-height: 1.4;
}

.story-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.action-btn {
  background: transparent;
  color: var(--text);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  transition: border-color 0.15s, background 0.15s;
}

.action-btn:hover {
  border-color: var(--accent);
  background: rgba(138, 58, 79, 0.04);
}

.action-btn.is-active {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}

.action-icon {
  font-size: 14px;
  font-style: normal;
  display: inline-block;
}

.story-transcript {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-top: 1rem;
}

.transcript-label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 14px;
}

.transcript-body {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-soft);
}

.transcript-body p {
  margin: 0 0 0.9em;
}

.transcript-body p:last-child {
  margin-bottom: 0;
}

/* Prev / next nav */

.story-nav-bottom {
  border-top: 0.5px solid var(--border);
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.story-nav-card {
  padding: 14px 16px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s, transform 0.15s;
}

.story-nav-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.story-nav-next {
  flex-direction: row-reverse;
  text-align: right;
}

.story-nav-arrow {
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.story-nav-text {
  flex: 1;
}

.story-nav-label {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-nav-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  margin-top: 3px;
  color: var(--text);
}

.story-nav-card.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* =========================
   Search results page
   ========================= */

.search-header {
  padding: 2.5rem 2rem 1.5rem;
  text-align: center;
}

.search-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

.search-bar--page {
  margin-top: 1.5rem;
}

.search-results {
  padding: 1rem 2rem 2rem;
}

.search-results-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
}

.search-result {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 12px;
  display: block;
  transition: border-color 0.15s;
}

.search-result:hover {
  border-color: var(--accent);
}

.search-result-section {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 6px;
}

.search-result-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--text);
}

.search-result-frame {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 10px;
  font-family: var(--serif);
}

.search-result-snippet {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
  padding: 10px 14px;
  background: rgba(138, 58, 79, 0.04);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
}

.search-result-snippet mark {
  background: rgba(138, 58, 79, 0.18);
  color: var(--accent);
  font-weight: 500;
  padding: 1px 2px;
  border-radius: 2px;
}

.search-result-meta {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 8px;
  display: flex;
  gap: 12px;
}

.search-result.is-transcript-only .search-result-section::after {
  content: " · transcript only";
  font-style: italic;
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0;
}

.search-no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 720px) {
  :root {
    --max-width: 100%;
  }

  .site-title { font-size: 30px; }

  .site-header,
  .hero,
  .anchors,
  .section-header,
  .section-grid,
  .story,
  .story-nav-top,
  .story-nav-bottom,
  .search-header,
  .search-results,
  .site-footer { padding-left: 1.25rem; padding-right: 1.25rem; }

  .divider--header { margin: 0 1.25rem; }

  .anchors {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .story-title { font-size: 24px; }

  .story-nav-bottom {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .search-bar {
    flex-wrap: nowrap;
  }
}

@media (max-width: 420px) {
  .section-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .tile-title { font-size: 13px; }
  .tile-frame { font-size: 11px; }
}

/* =========================
   Password gate
   ========================= */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: var(--bg);
}

.gate-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.04);
}

.gate-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.01em;
}

.gate-card .site-accent-line {
  margin: 14px auto;
}

.gate-dates {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.gate-message {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text-soft);
  font-style: italic;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-form input {
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--text);
  text-align: center;
  outline: none;
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gate-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 58, 79, 0.1);
}

.gate-form button {
  background: var(--accent);
  color: var(--accent-on);
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.15s;
}

.gate-form button:hover {
  background: #6f2c3f;
}

.gate-error {
  font-size: 12px;
  color: var(--accent);
  font-style: italic;
  margin-top: 4px;
}

.gate-hint {
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
  margin-top: 8px;
}

/* =========================
   Photo placeholders (until real photos)
   Pseudo-illustration: a soft monogram on warm bg
   ========================= */

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--tile-1), var(--tile-2));
  font-family: var(--serif);
  font-size: 32px;
  color: rgba(0,0,0,0.18);
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Different-feel placeholders by section, just to break up monotony */
.photo-section-pillars { background: linear-gradient(135deg, #d4c4a8, #b89878); }
.photo-section-childhood { background: linear-gradient(135deg, #d8cfbf, #c9bda6); }
.photo-section-sisters { background: linear-gradient(135deg, #cdc1ad, #b8a890); }
.photo-section-businesses { background: linear-gradient(135deg, #c2b8a3, #a89776); }
.photo-section-war { background: linear-gradient(135deg, #b3a78c, #8c7c60); }
.photo-section-coming_of_age { background: linear-gradient(135deg, #d2c4ad, #b89e7e); }
.photo-section-eddie { background: linear-gradient(135deg, #b8a890, #9c8868); }
.photo-section-worst_times { background: linear-gradient(135deg, #968873, #6f6453); }
.photo-section-after_eddie { background: linear-gradient(135deg, #ad9d83, #84745b); }
.photo-section-girls { background: linear-gradient(135deg, #d3b8a8, #b8927a); }
.photo-section-independent { background: linear-gradient(135deg, #b8a890, #8b7659); }
.photo-section-late_life { background: linear-gradient(135deg, #c4b29a, #9d8669); }
