/* ==========================================================================
   Wedding website styles
   Palette: rosé + soft olive on champagne (see VISION.md)
   ========================================================================== */

:root {
  --champagne: #F2E6D0;
  --champagne-light: #FBF5EA;
  --rose: #D89A9E;
  --raspberry: #8C3B4F;
  --wine-ink: #5A3440;
  --olive: #858A4E;
  --olive-leaf: #D6D3AE;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Josefin Sans", "Helvetica Neue", Arial, sans-serif;

  --page-width: 1040px;
  --text-width: 640px;
  --header-height: 64px;

  /* Home page background photo: set this to url("../images/your-photo.jpg") */
  --hero-image: url("../images/hero-full.jpg");
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--champagne);
  color: var(--wine-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

a { color: var(--raspberry); }
a:hover { color: var(--wine-ink); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--raspberry);
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.6rem, 8vw, 4.2rem); color: var(--wine-ink); }
h2 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
h3 { font-size: 1.6rem; }

/* --- Small caps label used above headings and for dates --- */
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--raspberry);
  margin: 0 0 0.75rem;
}

/* --- Thin olive divider --- */
.rule {
  width: 64px;
  height: 1px;
  background: var(--olive);
  border: 0;
  margin: 1.25rem auto;
}

/* ==========================================================================
   Header: transparent over the home photo, solid olive once scrolled
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  color: var(--champagne-light);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-solid { background: var(--olive); }

.nav {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.nav-monogram {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--champagne-light);
  text-decoration: none;
}
.nav-monogram:hover { color: var(--champagne-light); }

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Plain text links (e.g. Details): underline marks hover and the current page */
.nav-links a {
  display: inline-block;
  color: var(--champagne-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--champagne-light);
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* RSVP: outlined button that fills in on hover or when on the RSVP page */
.nav-links a.nav-cta {
  padding: 10px 18px;
  border-color: var(--champagne-light);
}
.nav-links a.nav-cta:hover,
.nav-links a.nav-cta[aria-current="page"] {
  background: var(--champagne-light);
  color: var(--wine-ink);
  text-decoration: none;
}

@media (max-width: 520px) {
  .nav { padding: 0 16px; }
  .nav-links { gap: 4px; }
  .nav-links a { letter-spacing: 0.14em; }
}

/* Pages other than home start below the fixed header */
.subpage main { padding-top: var(--header-height); }

/* ==========================================================================
   Home hero: full-screen photo with names, date, countdown
   ========================================================================== */

/* Phones and portrait tablets: the photo fills the screen. The faces are in
   the top quarter of the photo, so all the text sits together below them. */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: calc(var(--header-height) + 24px) 20px 80px;
  color: var(--champagne-light);
  background-color: #4A3A35;
  background-image:
    /* a little shade behind the header, clear over the faces, darker where the text is */
    linear-gradient(to bottom,
      rgba(40, 24, 28, 0.55) 0%,
      rgba(40, 24, 28, 0.10) 12%,
      rgba(40, 24, 28, 0.10) 30%,
      rgba(40, 24, 28, 0.50) 50%,
      rgba(40, 24, 28, 0.80) 100%),
    var(--hero-image),
    linear-gradient(160deg, #6B3A47 0%, #4A3A35 50%, #4F5230 100%);
  background-size: cover;
  /* The faces sit about 12-26% down the photo */
  background-position: center 12%;
}

.hero .eyebrow { color: var(--champagne-light); opacity: 0.9; }

.hero-names {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 11vw, 4.5rem);
  line-height: 1.05;
  color: var(--champagne-light);
  margin: 0.25rem 0;
}
.hero-names .amp {
  font-style: italic;
  font-size: 0.8em;
  color: var(--rose);
  margin: 0 0.1em;
}

/* Desktop and landscape screens: the photo fills the whole screen. The faces
   sit in the middle ~28% of the width, so the text goes either side of them:
   names upper-left (ending at the midline), date + countdown lower-right
   (starting at the midline). */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 28vw 1fr;
    grid-template-rows: 1fr 1fr;
    padding: calc(var(--header-height) + 24px) 32px 96px;
    background-image:
      /* darker at the sides where the text is, lighter over the faces */
      linear-gradient(to right,
        rgba(40, 24, 28, 0.60) 0%,
        rgba(40, 24, 28, 0.35) 30%,
        rgba(40, 24, 28, 0.15) 40%,
        rgba(40, 24, 28, 0.15) 60%,
        rgba(40, 24, 28, 0.35) 70%,
        rgba(40, 24, 28, 0.60) 100%),
      var(--hero-image),
      linear-gradient(160deg, #6B3A47 0%, #4A3A35 50%, #4F5230 100%);
  }
  .hero-top {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    padding-bottom: 12px;
  }
  .hero-bottom {
    grid-column: 3;
    grid-row: 2;
    align-self: start;
    /* hug the right edge so the countdown clears Gracie's shoulder */
    justify-self: end;
    padding-top: 12px;
  }
  /* no divider line above the date on desktop */
  .hero-bottom .rule { display: none; }
  .hero-names {
    font-size: clamp(3.4rem, 7vw, 6.5rem);
    line-height: 1;
  }
  .hero-names .amp {
    display: block;
    font-size: 0.45em;
    margin: 0.15em 0;
  }
}

/* Narrower desktops: a single row of four boxes would run into Gracie's
   shoulder, so the countdown becomes a compact 2x2 grid */
@media (min-width: 900px) and (max-width: 1199px) and (min-aspect-ratio: 1/1) {
  /* the taller 2x2 countdown gets the room it needs; names still end above it */
  .hero {
    grid-template-rows: 1fr auto;
    padding-bottom: 72px;
  }
  .hero .countdown {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    gap: 8px;
  }
}

.hero .rule { background: var(--champagne-light); opacity: 0.6; }

.hero-date {
  font-size: 1rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin: 0;
}
.hero-place {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  margin: 0.25rem 0 0;
}

/* --- Countdown --- */
.countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 2.5rem;
}
.countdown-unit {
  min-width: 78px;
  padding: 12px 8px 10px;
  border: 1px solid rgba(251, 245, 234, 0.55);
  border-radius: 2px;
}
.countdown-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.countdown-label {
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
}
.countdown-done {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.8rem;
  margin-top: 2rem;
}

/* --- "Scroll down" cue at the bottom of the hero --- */
.scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--champagne-light);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
}
.scroll-cue:hover { color: var(--champagne-light); opacity: 1; }
.scroll-cue::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 5px; }
}

@media (max-width: 520px) {
  .countdown { gap: 8px; }
  .countdown-unit { min-width: 66px; }
  .countdown-number { font-size: 2rem; }
}

/* ==========================================================================
   Sections, then Our Story: a scroll-driven scene (see js/story.js)
   ========================================================================== */

.section {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 88px 20px;
}

.section-narrow {
  max-width: var(--text-width);
  margin: 0 auto;
}

.center { text-align: center; }

.section-intro {
  text-align: center;
  margin-bottom: 64px;
}

.story-intro { padding-bottom: 8px; }
.story-intro .section-intro { margin-bottom: 0; }

/* Without JavaScript (or before it loads) this is just a normal block showing
   the finished classroom as a picture. js/story.js adds .is-scrolly to make it
   tall and pin the scene to the screen, or .is-static for visitors who prefer
   less motion. There is no frame: the page itself is the scene's background. */
.story-scroll { position: relative; }
/* js/story.js sets --story-units to the story's length; each unit is about
   ten screens of scrolling */
.story-scroll.is-scrolly { height: calc(100vh + var(--story-units, 1) * 1030vh); }

.story-sticky {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 20px;
  overflow: hidden;          /* people and props come in from past the screen edges */
}
.story-scroll.is-scrolly .story-sticky {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
}

.story-stage {
  width: min(100% - 32px, 960px);
  aspect-ratio: 480 / 330;
}
/* While scrolling, the scene uses the whole screen; js/story.js keeps the
   action centered and works out where the screen edges are */
.story-scroll.is-scrolly .story-stage {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.story-stage img,
.story-stage svg {
  display: block;
  width: 100%;
  height: 100%;
}
.story-stage svg { overflow: visible; }

/* ==========================================================================
   Home page walkthrough: an elevator tour of the website (see js/guide.js)
   ========================================================================== */

/* Without JavaScript (or with "reduce motion" on) this is a plain list of big
   links, each with its sentence. js/guide.js adds .is-scrolly to make the
   block tall and pin the elevator scene to the screen instead. */
.guide { position: relative; }
.guide-sticky { display: none; }
.guide.is-scrolly { height: calc(100vh + var(--guide-units, 1) * 100vh); }
.guide.is-scrolly .guide-sticky {
  display: block;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  overflow: hidden;          /* people and the elevator come in from past the screen edges */
}
.guide-stage { width: 100%; height: 100%; }
.guide-stage svg { display: block; width: 100%; height: 100%; overflow: visible; }
.guide.is-scrolly .guide-floors { display: none; }

.guide-floors {
  list-style: none;
  max-width: var(--text-width);
  margin: 0 auto;
  padding: 88px 20px;
  text-align: center;
}
.guide-floors li + li { margin-top: 56px; }
.guide-floors a {
  display: inline-block;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 4rem);
  line-height: 1.1;
  color: var(--raspberry);
  text-decoration: none;
  border-bottom: 1px solid var(--rose);
}
.guide-floors a:hover { border-bottom-color: var(--raspberry); }
.guide-floors p { margin: 12px 0 0; }

/* ==========================================================================
   Shared pieces used by RSVP and the other pages
   ========================================================================== */

.page-title {
  text-align: center;
  padding: 64px 20px 24px;
}

.button {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 12px 28px;
  background: var(--rose);
  color: var(--wine-ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.button:hover { background: var(--raspberry); color: var(--champagne-light); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
@media (max-width: 680px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  background: var(--champagne-light);
  border: 1px solid var(--olive-leaf);
  border-radius: 4px;
  padding: 24px;
  text-align: center;
}
.card h3 { margin-bottom: 0.25em; }
.card p { margin: 0; }
.card .meta { font-size: 0.9rem; opacity: 0.85; }

.schedule {
  list-style: none;
  margin: 0;
  padding: 0;
}
.schedule li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--olive-leaf);
}
.schedule .time {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--raspberry);
}
.schedule h3 { font-size: 1.25rem; margin: 0; }
.schedule p { margin: 0; }
@media (max-width: 520px) {
  .schedule li { grid-template-columns: 64px 1fr; }
}

.faq details {
  border-bottom: 1px solid var(--olive-leaf);
  padding: 16px 0;
}
.faq summary {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--raspberry);
  cursor: pointer;
}
.faq details p { margin: 0.75rem 0 0; }

/* --- Placeholder text we still need to fill in --- */
.todo {
  background: rgba(216, 154, 158, 0.25);
  border-radius: 2px;
  padding: 0 4px;
}

.rsvp-box {
  background: var(--champagne-light);
  border: 1px dashed var(--olive);
  border-radius: 4px;
  padding: 40px 24px;
  text-align: center;
}

/* --- Password screen in front of the RSVP page (see functions/_middleware.js) --- */
.lock { padding-top: 24px; }

.lock-form {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 1.5rem;
}
.lock-form input {
  width: 260px;
  max-width: 100%;
  min-height: 48px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--wine-ink);
  background: var(--champagne-light);
  border: 1px solid var(--olive);
  border-radius: 2px;
}
.lock-form input:focus {
  outline: 2px solid var(--raspberry);
  outline-offset: 1px;
}
.lock-form .button {
  margin-top: 0;
  min-height: 48px;
  border: 0;
  font-family: var(--font-body);
  cursor: pointer;
}
.lock-error {
  color: var(--raspberry);
  margin-top: 1rem;
}

@media (max-width: 520px) {
  .lock-form { flex-direction: column; align-items: stretch; }
  .lock-form input { width: 100%; }
}

/* Visible to screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.site-footer {
  background: var(--olive);
  color: var(--champagne-light);
  text-align: center;
  padding: 28px 20px;
}
.footer-monogram {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 0;
}
.footer-line {
  margin: 4px 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
