/* ===== Tokens ===== */
:root {
  --bg: #f5f0e8;
  --olive: #4a5c3a;
  --olive-dark: #3a4a2e;
  --tan: #c8b89a;
  --tan-light: #e8dfd0;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --white: #ffffff;
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, sans-serif;
  --max-width: 1100px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== Base ===== */
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.7; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.3; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  background: var(--olive);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  z-index: 9999;
}
.skip-link:focus {
  left: 1rem;
}

/* ===== Header / Nav ===== */
.site-header { background: var(--olive); position: sticky; top: 0; z-index: 100; }
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo { color: var(--white); font-family: var(--font-heading); font-size: 1.15rem; }
.main-nav { display: flex; gap: 0.25rem; }
.main-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover, .main-nav a.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; }

/* ===== Hero ===== */
.hero { position: relative; width: 100%; height: 480px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-placeholder { width: 100%; height: 100%; background: var(--tan-light); }
.hero.sepia img { filter: sepia(0.45) contrast(1.05); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.55));
  display: flex;
  align-items: flex-end;
  padding: 3rem;
}
.hero-overlay h1 { color: var(--white); font-size: 3rem; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.hero-overlay p { color: rgba(255,255,255,0.9); font-size: 1.1rem; margin-top: 0.5rem; }

/* ===== Section Bar ===== */
.section-bar { background: var(--olive); color: var(--white); padding: 0.75rem 0; margin: 2.5rem 0 0; }
.section-bar .container { display: flex; align-items: center; }
.section-bar h2 { color: var(--white); font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* ===== Photo-Text Row ===== */
.photo-text-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 0;
}
.photo-text-row.reverse { direction: rtl; }
.photo-text-row.reverse > * { direction: ltr; }
.photo-text-row img { width: 100%; height: 300px; object-fit: cover; border-radius: 4px; }
.photo-text-row .img-placeholder { width: 100%; height: 300px; background: var(--tan-light); border-radius: 4px; }
.photo-text-row .text-block h2 { margin-bottom: 1rem; }

/* ===== Timeline ===== */
.timeline { position: relative; padding: 3rem 0; }
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--tan);
  transform: translateX(-50%);
}
.timeline-entry {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: start;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.timeline-entry .entry-left { text-align: right; }
.timeline-node { display: flex; flex-direction: column; align-items: center; }
.timeline-photo {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--tan);
}
.timeline-photo-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--tan-light);
  border: 3px solid var(--tan);
}
.timeline-year { font-size: 0.75rem; font-weight: 600; color: var(--olive); margin-top: 0.5rem; }
.timeline-entry h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.timeline-entry p { font-size: 0.9rem; color: var(--text-light); }

/* ===== Family Grid ===== */
.family-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; padding: 3rem 0; }
.family-card { text-align: center; }
.family-card-photo {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid var(--tan);
}
.family-card-photo-placeholder {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--tan-light);
  border: 3px solid var(--tan);
  margin: 0 auto 1rem;
}
.family-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.family-card p { font-size: 0.875rem; color: var(--text-light); }
.grandparents-feature {
  display: flex;
  gap: 4rem;
  justify-content: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--tan);
  margin-bottom: 2rem;
}
.grandparents-feature .family-card-photo,
.grandparents-feature .family-card-photo-placeholder { width: 160px; height: 160px; }

/* ===== Gallery ===== */
.gallery-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 2rem 0 1.5rem; }
.gallery-filter-btn {
  background: none;
  border: 2px solid var(--tan);
  color: var(--text);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.gallery-filter-btn:hover, .gallery-filter-btn.active {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--white);
}
.gallery-grid { columns: 2; column-gap: 1rem; padding-bottom: 3rem; }
.gallery-grid figure { break-inside: avoid; margin-bottom: 1rem; }
.gallery-grid img { width: 100%; border-radius: 4px; }
.gallery-grid .img-placeholder { width: 100%; height: 220px; background: var(--tan-light); border-radius: 4px; }
.gallery-grid figcaption { font-size: 0.8rem; color: var(--text-light); padding: 0.35rem 0; }

/* ===== Sub-Tab Nav ===== */
.sub-tab-nav { background: var(--tan-light); border-bottom: 2px solid var(--tan); margin-bottom: 2.5rem; }
.sub-tab-nav ul {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.sub-tab-nav a {
  display: block;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.sub-tab-nav a:hover { color: var(--text); }
.sub-tab-nav a.active { color: var(--olive); border-bottom-color: var(--olive); font-weight: 600; }

/* ===== Content Section ===== */
.content-section { padding: 2.5rem 0 3rem; }
.content-section h2 { margin-bottom: 1.25rem; }
.icon-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  background: var(--olive);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
}
.icon-card { text-align: center; color: var(--white); }
.icon-card svg { width: 40px; height: 40px; margin: 0 auto 0.75rem; }
.icon-card strong { display: block; margin-bottom: 0.4rem; }
.icon-card p { font-size: 0.875rem; opacity: 0.85; margin: 0; }

/* ===== What's New ===== */
.news-list { padding: 2rem 0 3rem; }
.news-card {
  background: var(--white);
  border: 1px solid var(--tan);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.news-date { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.4rem; }
.news-card h3 { margin-bottom: 0.5rem; }

/* ===== Footer ===== */
.site-footer {
  background: var(--olive);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.875rem;
  margin-top: 4rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }

  .hero { height: 320px; }
  .hero-overlay { padding: 1.5rem; }
  .hero-overlay h1 { font-size: 1.9rem; }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--olive);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.75rem 1rem; }
  .nav-toggle { display: flex; }

  .photo-text-row { grid-template-columns: 1fr; }
  .photo-text-row.reverse { direction: ltr; }

  .timeline::before { left: 36px; }
  .timeline-entry { grid-template-columns: 80px 1fr; }
  .timeline-entry .entry-left:not(.timeline-node),
  .timeline-entry .entry-right:not(.timeline-node) { display: none; }

  .family-grid { grid-template-columns: repeat(2, 1fr); }
  .grandparents-feature { flex-direction: column; gap: 2rem; }

  .gallery-grid { columns: 1; }

  .icon-row { grid-template-columns: 1fr; }

  .sub-tab-nav ul { overflow-x: auto; flex-wrap: nowrap; }
  .sub-tab-nav a { white-space: nowrap; padding: 0.75rem 1rem; }
}
