/* =========================================================================
   WEDDING SITE STYLES
   -------------------------------------------------------------------------
   COLOR THEMES live in this first block. To change the whole site's colors,
   either:
     (A) try a sample live with the little palette button (bottom-right), or
     (B) lock one in permanently: in index.html find <html data-theme="sage">
         and change "sage" to one of: sage | dusty | blush | terracotta
   To invent your own, copy a theme block below and change the hex values.
   ========================================================================= */

:root,
[data-theme="sage"] {
  /* ---- THEME 1: Sage & Cream (soft, botanical) ---- */
  --color-bg:        #f3f1e8;  /* page background        */
  --color-surface:   #fffdf8;  /* cards / panels         */
  --color-text:      #3a3b32;  /* body text              */
  --color-muted:     #7c7d6f;  /* secondary text         */
  --color-primary:   #8a9a7b;  /* main accent (sage)     */
  --color-primary-d: #6d7c5f;  /* darker accent (hover)  */
  --color-accent:    #b9794f;  /* warm secondary accent  */
  --color-line:      #e3ded2;  /* borders / hairlines    */
}

[data-theme="dusty"] {
  /* ---- THEME 2: Dusty Blue & Sand ---- */
  --color-bg:        #eceff2;
  --color-surface:   #fbfcfd;
  --color-text:      #343a40;
  --color-muted:     #6e7880;
  --color-primary:   #7b94a3;
  --color-primary-d: #5f7886;
  --color-accent:    #c0a378;
  --color-line:      #e2ddd3;
}

[data-theme="blush"] {
  /* ---- THEME 3: Blush & Burgundy (romantic) ---- */
  --color-bg:        #f8eceC;
  --color-surface:   #fef7f7;
  --color-text:      #40312f;
  --color-muted:     #8a706d;
  --color-primary:   #9e5a63;
  --color-primary-d: #7d434b;
  --color-accent:    #c99a86;
  --color-line:      #ecdcd7;
}

[data-theme="terracotta"] {
  /* ---- THEME 4: Terracotta & Olive (earthy, warm) ---- */
  --color-bg:        #f5ece0;
  --color-surface:   #fffaf2;
  --color-text:      #3d352b;
  --color-muted:     #857765;
  --color-primary:   #b9794f;
  --color-primary-d: #9a6039;
  --color-accent:    #7d8560;
  --color-line:      #e8ddcc;
}

/* === VIBRANT THEMES (bolder, higher-saturation) ======================= */

[data-theme="coral"] {
  /* ---- THEME 5: Coral & Teal (bright, summery) ---- */
  --color-bg:        #ffeee8;
  --color-surface:   #fff8f5;
  --color-text:      #30302f;
  --color-muted:     #7b7673;
  --color-primary:   #ef5b4c;
  --color-primary-d: #d13f31;
  --color-accent:    #16a89a;
  --color-line:      #f4ddd6;
}

[data-theme="marigold"] {
  /* ---- THEME 6: Marigold & Plum (rich, festive) ---- */
  --color-bg:        #faf0db;
  --color-surface:   #fffaef;
  --color-text:      #352a33;
  --color-muted:     #7f6f7b;
  --color-primary:   #8a3d78;
  --color-primary-d: #6e2f5f;
  --color-accent:    #eaa417;
  --color-line:      #efe3d4;
}

[data-theme="fuchsia"] {
  /* ---- THEME 7: Fuchsia & Emerald (bold, modern) ---- */
  --color-bg:        #fbe9f3;
  --color-surface:   #fef5fb;
  --color-text:      #2f2730;
  --color-muted:     #80707c;
  --color-primary:   #cf3690;
  --color-primary-d: #ad2676;
  --color-accent:    #17a06c;
  --color-line:      #f2dcea;
}

[data-theme="cobalt"] {
  /* ---- THEME 8: Cobalt & Coral (electric, fresh) ---- */
  --color-bg:        #e9eefb;
  --color-surface:   #f5f8fe;
  --color-text:      #262b35;
  --color-muted:     #6b7280;
  --color-primary:   #2f5bd6;
  --color-primary-d: #2246ad;
  --color-accent:    #ff6b4a;
  --color-line:      #dce4f5;
}

[data-theme="sunset"] {
  /* ---- THEME 9: Sunset (burnt orange + pink) ---- */
  --color-bg:        #ffe9e1;
  --color-surface:   #fff5f1;
  --color-text:      #3a2a26;
  --color-muted:     #8a6f68;
  --color-primary:   #e14d8a;
  --color-primary-d: #c23770;
  --color-accent:    #f08a3c;
  --color-line:      #f6dccf;
}

/* ---- Typography & spacing tokens (shared across themes) ---- */
:root {
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body:    "Jost", "Helvetica Neue", Arial, sans-serif;
  --maxw: 1100px;
  --radius: 4px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.3);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========================= BASE ========================= */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: 0.5px;
}

h2 { font-size: clamp(2.1rem, 4.5vw, 3.2rem); }
h3 { font-size: 1.5rem; }

a { color: var(--color-primary-d); }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.container { width: 90%; max-width: var(--maxw); margin: 0 auto; }

/* Love-story subtitle */
.story-sub {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-style: italic;
  font-weight: 600;
  color: var(--color-accent);
  margin: -0.3rem 0 1.5rem;
  line-height: 1.2;
}

.section { padding: clamp(4rem, 10vw, 8rem) 0; }
.section--tint { background: var(--color-surface); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.9em 2.2em;
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-decoration: none;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
              transform 0.3s var(--ease), color 0.3s var(--ease);
}
.btn:hover { background: var(--color-primary-d); border-color: var(--color-primary-d); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--color-accent); border-color: var(--color-accent); }
.btn--ghost:hover { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

/* ========================= NAV ========================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 5%;
  background: var(--color-surface);            /* solid bar — always legible */
  box-shadow: 0 1px 0 var(--color-line);
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav.is-scrolled {
  background: var(--color-surface);
  box-shadow: 0 6px 22px -14px rgba(0,0,0,0.35);
}
.nav__brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.4s var(--ease);
}
.nav.is-scrolled .nav__brand { color: var(--color-text); }

.nav__links { display: flex; gap: 1.8rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  position: relative;
  transition: color 0.4s var(--ease);
}
.nav.is-scrolled .nav__links a { color: var(--color-text); }
.nav__links a::after {
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--color-accent);
  transition: width 0.3s var(--ease);
}
.nav__links a:hover::after { width: 100%; }

.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0.4rem; }
.nav__toggle span { display: block; width: 26px; height: 2px; margin: 5px 0; background: var(--color-text); transition: 0.3s; }
.nav.is-scrolled .nav__toggle span { background: var(--color-text); }

/* ============ PHOTO PANELS (two panels: photo beside text) =================
   Both the top hero and the Our Story section are TWO PANELS side by side:
   a photo panel and a text panel. The photo is shown WHOLE — never cropped by
   CSS, never covered by the text — so the couple is always fully visible. The
   framing for each screen size is baked into separate image crops by
   scripts/build-images.sh and swapped with <picture>; CSS only places them.
   Below a breakpoint the panels stack (photo on top, text below). */
.photohero {
  display: grid;
  grid-template-columns: 3fr 2fr;   /* ~60% photo / 40% text */
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  /* extra top padding clears the fixed nav bar */
  padding: clamp(5rem, 8vw, 8rem) clamp(1.5rem, 6vw, 6rem) clamp(3.5rem, 7vw, 7rem);
  overflow: visible;
}
.photohero picture { display: block; }
.photohero__img {
  display: block;
  width: 100%;
  height: auto;                   /* whole photo at its natural (baked-in) ratio */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.photohero__card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.photohero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  line-height: 1.02;
  margin: 0;
  color: var(--color-text);
}
.photohero__title--sm { font-size: clamp(2rem, 3.6vw, 2.9rem); }
.photohero__title .amp { color: var(--color-accent); font-style: italic; }
.nav__brand .amp { color: var(--color-accent); font-style: italic; }
.photohero__meta {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.82rem; font-weight: 500;
  color: var(--color-text); margin: 1.2rem 0 0.4rem; line-height: 1.9;
}
.photohero__blurb { color: var(--color-muted); margin: 0.6rem 0 1.6rem; }
.photohero__scroll { display: none; }   /* no scroll cue needed in the panel layout */

/* Our Story variant — same two-panel idea, but the text panel is a wider,
   LEFT-aligned card of copy on the right, photo on the left. */
.photohero--story {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 480px);
  gap: clamp(2rem, 4vw, 4.5rem);
  align-items: start;          /* photo anchors to the top, not floating centered */
  perspective: 1500px;
}
/* The story copy is long, so the (shorter) photo would leave a big empty gap
   beside it. Pin the whole left column — title + photo — so it stays anchored
   in view as the text scrolls past on the right. */
.photohero--story .photohero__media {
  position: sticky;
  top: calc(4.75rem + 1rem);
  align-self: start;
}
.photohero--story .photohero__card {
  max-width: none;
  text-align: left;
}
.photohero--story .photohero__card .eyebrow { margin-bottom: 0.5rem; }
/* Title sits left-justified above the photo, in the left column. */
.photohero--story .photohero__head {
  text-align: left;
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}
.photohero--story .photohero__head .story-sub { margin-bottom: 0; }

/* Classy flip-in: the card tilts up from its top edge as it enters view */
.reveal-flip {
  transform: rotateX(26deg) translateY(44px);
  transform-origin: center top;
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
}
.reveal-flip.is-visible { transform: none; }

/* ========================= SPLIT (photo + text) ========================= */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split--reverse .split__media { order: 2; }
.split__media { overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.split__media img { width: 100%; height: 100%; min-height: 340px; object-fit: cover; transition: transform 1.2s var(--ease); }
.split__media:hover img { transform: scale(1.05); }

/* ========================= EVENTS ========================= */
.events { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2.5rem; }
/* One shared RSVP button above and below the event cards */
.events-rsvp { text-align: center; margin: 0 0 2.5rem; }
.events-rsvp--below { margin: 2.75rem 0 0; }
.event-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-top: 3px solid var(--color-accent);   /* coral accent stripe */
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.event-card__img { aspect-ratio: 16 / 10; overflow: hidden; }
.event-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.event-card:hover .event-card__img img { transform: scale(1.06); }
.event-card__body { padding: 2rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.event-card__meta { color: var(--color-muted); font-size: 0.95rem; }
.event-card__meta strong { color: var(--color-text); font-weight: 400; }
.event-card .btn { margin-top: 1.4rem; align-self: flex-start; }

/* ========================= INFO CARDS (lodging / transport) ========================= */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-accent);   /* coral accent edge */
  border-radius: var(--radius);
  padding: 2rem;
}
.card h3 { color: var(--color-primary-d); }
.card p { color: var(--color-muted); margin: 0.3rem 0; }

/* ========================= FAQ ========================= */
.faq { max-width: 760px; margin: 0 auto; }
.faq__item { border-bottom: 1px solid var(--color-line); }
.faq__q {
  width: 100%;
  text-align: left;
  background: none; border: 0; cursor: pointer;
  padding: 1.4rem 2.5rem 1.4rem 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-text);
  position: relative;
}
.faq__q::after {
  content: "+";
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 1.6rem; color: var(--color-accent);
  transition: transform 0.3s var(--ease);
}
.faq__item.is-open .faq__q::after { transform: translateY(-50%) rotate(45deg); }
.faq__a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s var(--ease);
  color: var(--color-muted);
}
.faq__a p { margin: 0 0 1.4rem; }

/* ========================= RSVP BANNER ========================= */
.rsvp { text-align: center; }
.rsvp .btn { margin: 0.4rem; }

/* ========================= FOOTER ========================= */
.footer { text-align: center; padding: 4rem 1rem; background: var(--color-surface); border-top: 1px solid var(--color-line); }
.footer__names { font-family: var(--font-display); font-size: 2rem; margin-bottom: 0.3rem; }
.footer p { color: var(--color-muted); font-size: 0.9rem; margin: 0.2rem 0; }

/* ========================= SECTION HEADERS ========================= */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3.5rem; }
.section-head p { color: var(--color-muted); }
.divider { width: 64px; height: 2px; background: var(--color-accent); margin: 1.2rem auto; opacity: 0.9; border-radius: 2px; }

/* ========================= SCROLL ANIMATIONS ========================= */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll { animation: none; }
}

/* ========================= THEME SWITCHER WIDGET ========================= */
.theme-switch { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 60; font-family: var(--font-body); }
.theme-switch__btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: none; cursor: pointer; color: #fff; font-size: 1.3rem;
  background: var(--color-primary); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease);
}
.theme-switch__btn:hover { transform: rotate(45deg); }
.theme-switch__panel {
  position: absolute; right: 0; bottom: 60px;
  background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem; width: 220px;
  max-height: 70vh; overflow-y: auto;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.theme-switch.is-open .theme-switch__panel { opacity: 1; pointer-events: auto; transform: none; }
.theme-switch__panel h4 { margin: 0 0 0.8rem; font-family: var(--font-body); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-muted); }
.theme-opt { display: flex; align-items: center; gap: 0.6rem; width: 100%; background: none; border: 0; cursor: pointer; padding: 0.5rem; border-radius: var(--radius); font-size: 0.85rem; color: var(--color-text); }
.theme-opt:hover { background: var(--color-bg); }
.theme-opt .swatch { width: 26px; height: 16px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.12); flex: 0 0 auto; }

/* ========================= RESPONSIVE ========================= */

/* PHOTO PANELS stack at narrow widths. The <picture> in the markup swaps to a
   crop that suits each layout (see scripts/build-images.sh), so CSS here only
   switches grid -> block and drops the panel rounding/shadow for the banner.

   Our Story has a long text card, so it stacks earlier (<=1150). */
@media (max-width: 1150px) {
  .photohero--story { display: block; padding: 0; }
  /* Stacked: the photo sits above the text and scrolls with it — the sticky
     pin only makes sense in the side-by-side layout. */
  /* Stacked: nothing pins — the media column scrolls with the text. */
  .photohero--story .photohero__media { position: static; }
  .photohero--story .photohero__img { border-radius: 0; box-shadow: none; }
  .photohero--story .photohero__head {
    padding: clamp(2rem, 6vw, 3.5rem) clamp(2rem, 6vw, 3.5rem) 0;
    margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
  }
  .photohero--story .photohero__card {
    max-width: none; padding: clamp(2rem, 6vw, 3.5rem);
  }
  .reveal-flip { transform: translateY(32px); }   /* no 3D flip when stacked */
}

/* Hero is two panels on desktop; at/below 1024 the photo gets too small beside
   the text, so it becomes a full-width banner and the text stacks beneath it. */
@media (max-width: 1023px) {
  header.photohero { display: block; padding: 4.75rem clamp(1.5rem, 6vw, 4rem) 0; }  /* top clears nav; sides inset the banner */
  header.photohero picture { display: block; max-width: 860px; margin: 0 auto; }  /* a little less wide than full-bleed */
  /* banner keeps the base rounded corners + shadow */
  header.photohero .photohero__card {
    max-width: 640px; margin: 2.2rem auto 0;
  }
}

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: 70%; max-width: 320px;
    background: var(--color-surface); flex-direction: column; justify-content: center;
    padding: 2rem; gap: 1.6rem; transform: translateX(100%); transition: transform 0.4s var(--ease);
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { color: var(--color-text); font-size: 1rem; }
  .nav__toggle { display: block; z-index: 55; }
}

