/* ===== izzypenston.com — Shared Styles ===== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=Albert+Sans:wght@400;500;600&display=swap');

/* ===== Design Tokens ===== */
:root {
  --orange: #B34D18;
  --orange-hover: #973F0F;
  --amber: #E8A44A;
  --blue: #2D6494;
  --blue-hover: #245278;
  --bg: #FAF7F2;
  --bg-secondary: #F0EBE3;
  --text-primary: #1E1B18;
  --text-secondary: #6B6560;
  --text-tertiary: #6E6966;
  --border: #E0DBD4;
  --border-medium: #C9C3BA;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --orange: #E07A3A;
    --orange-hover: #C75D24;
    --amber: #EDB55A;
    --blue: #5A9BD5;
    --blue-hover: #3B7CB8;
    --bg: #141210;
    --bg-secondary: #1E1B18;
    --text-primary: #F2EDE6;
    --text-secondary: #A39E98;
    --text-tertiary: #908B85;
    --border: #2A2520;
    --border-medium: #3D3832;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);
  }

  .btn-primary {
    color: #1E1B18;
  }

  .btn-primary:hover {
    color: #1E1B18;
  }
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Albert Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--blue-hover); }

.section p a, .fa-section a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
  font-weight: 500;
}

.section p a:hover, .fa-section a:hover {
  text-decoration-thickness: 2.5px;
}

::selection {
  background: var(--orange);
  color: white;
}

*:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

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

/* ===== Layout ===== */
.container {
  max-width: clamp(720px, 75vw, 900px);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--orange);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  font-size: 14px;
}

.skip-link:focus {
  top: 0;
  color: white;
}

/* ===== Screen Reader Only ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 20px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.nav.is-scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-wordmark {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-wordmark span { color: var(--orange); }

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--orange); }

/* ===== Section ===== */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.section h2 {
  font-size: 26px;
  margin-bottom: 20px;
  max-width: 68ch;
}

.section p {
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 68ch;
  margin-bottom: 16px;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-block;
  background: var(--orange);
  color: white;
  font-family: 'Albert Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--orange-hover);
  color: white;
}

.btn-secondary {
  display: inline-block;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  font-family: 'Albert Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 24px;
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--blue);
  color: white;
}

/* ===== Parallax Story Breaks ===== */
.parallax-break {
  width: 100vw;
  height: 360px;
  overflow: hidden;
  margin: 48px 0;
  position: relative;
  left: 50%;
  margin-left: -50vw;
}

.parallax-img {
  width: 100%;
  height: 150%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}

@media (max-width: 600px) {
  .parallax-break {
    height: 260px;
    margin: 32px 0;
    margin-left: -50vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .parallax-img {
    height: 100%;
    transform: none !important;
  }
}

/* ===== Pull Quote ===== */
.pull-quote {
  border-left: 3px solid var(--blue);
  padding: 8px 0 8px 24px;
  margin: 28px 0;
  max-width: 68ch;
}

.pull-quote p {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}

.pull-quote cite {
  display: block;
  font-family: 'Albert Sans', sans-serif;
  font-style: normal;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* ===== Hero ===== */
.hero {
  padding: 80px 0 72px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.hero-photo {
  width: 180px;
  min-width: 180px;
  height: 220px;
  border-radius: 16px;
  object-fit: cover;
}

.hero-photo-placeholder {
  width: 180px;
  min-width: 180px;
  height: 220px;
  border-radius: 16px;
  background: linear-gradient(135deg, #E8D5C0 0%, #C9B8A5 50%, #B8A898 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #8B7D6E;
}

.hero-text { padding-top: 4px; }

.hero-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-dates {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.hero-intro {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== Timeline ===== */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-entry {
  position: relative;
  margin-bottom: 28px;
}

.timeline-entry:last-child { margin-bottom: 0; }

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--orange);
}

.timeline-entry.highlight::before {
  background: var(--orange);
}

.timeline-year {
  font-family: 'Albert Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.timeline-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}

.gallery-item:hover { transform: scale(1.02); }

.gallery-item.wide { grid-column: span 2; }

.gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.gallery-item.wide img {
  aspect-ratio: 2/1;
}

.gallery-caption-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-caption-text { opacity: 1; }

.gallery-footer {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 16px;
}

.load-more {
  display: block;
  margin: 24px auto 0;
  padding: 10px 24px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: 'Albert Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.load-more:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ===== Memory Cards ===== */
.memory-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.memory-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.memory-relation {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.memory-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg);
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.2s;
}

.modal-backdrop.is-open .modal {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-close:hover { color: var(--text-primary); }

.modal h2 {
  font-size: 22px;
  margin-bottom: 4px;
  padding-right: 32px;
}

.modal .modal-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ===== Form ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-family: 'Albert Sans', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-input:focus-visible,
.form-textarea:focus-visible {
  border-color: var(--orange);
  outline: 2px solid var(--orange);
  outline-offset: 0;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-note {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 16px;
  line-height: 1.5;
}

/* ===== Donate ===== */
.donate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.donate-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
}

.donate-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.donate-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.donate-card.primary { border-color: var(--orange); }
.donate-card.secondary { border-color: var(--blue); }

/* ===== FA Section ===== */
.fa-section {
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 32px;
  margin-bottom: 32px;
}

.fa-section h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.fa-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

/* Full-width prose overrides — these live inside cards/grids so should not be capped */
.donate-card p,
.memory-text,
.fa-section p,
.gallery-footer,
.modal-subtitle,
.form-hint,
.form-note {
  max-width: none;
}

/* ===== Footer ===== */
footer {
  padding: 56px 0;
  text-align: center;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.footer-quote {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.footer-quote-attr {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.footer-divider {
  height: 1px;
  background: var(--border);
  max-width: 120px;
  margin: 0 auto 24px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ===== Lightbox ===== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.lightbox-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  text-align: center;
  max-width: 500px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 40px;
  height: 40px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 16px;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

/* ===== Noscript fallback ===== */
/* Applied via <noscript> in index.html to prevent invisible content if JS fails */
.no-js [data-reveal],
.no-js [data-stagger] {
  opacity: 1;
  transform: none;
}

/* ===== Scroll-reveal & entrance animations ===== */
[data-reveal],
[data-stagger] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-stagger] {
  transition-delay: calc(var(--stagger-index, 0) * 0.15s);
}

[data-reveal].is-revealed,
[data-stagger].is-revealed {
  opacity: 1;
  transform: none;
}

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

  [data-reveal],
  [data-stagger] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gallery-item:hover {
    transform: none;
  }

  .modal-backdrop,
  .modal {
    transition: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-photo,
  .hero-photo-placeholder {
    width: 140px;
    min-width: 140px;
    height: 170px;
  }

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

  .gallery-item.wide {
    grid-column: span 2;
  }

  .donate-grid {
    grid-template-columns: 1fr;
  }

  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
}

@media (max-width: 400px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item.wide {
    grid-column: span 1;
  }
}
