/* --------------------
   Fonts
-------------------- */
@font-face {
  font-family: 'Kaikoura';
  src:
    url('../assets/fonts/kaikoura-regular-webfont.woff2') format('woff2'),
    url('../assets/fonts/kaikoura-regular-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --------------------
   Tokens
-------------------- */
:root{
  --bg: #fbf1dc;
  --ink: #1f2430;
  --sub: #5a4635;
  --accent: #e8773a;

  --maxw: 1200px;
  --gutter: 24px;

  --navy: #23283a;
  --navy-ink: #f6f0e4;

  /* Updated by JS to match sticky header height */
  --header-h: 78px;
}

/* --------------------
   Base
-------------------- */
*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-synthesis: none;
  background: var(--bg);
  color: var(--ink);
  transition: background-color 700ms ease, color 700ms ease;

  /* Critical: keeps stacking predictable so sticky header is never “lost” */
  isolation: isolate;
}

[hidden]{
  display: none !important;
}

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

p{
  font-size: 18px;
  line-height: 1.55;
  margin: 0 0 18px;
  color: rgba(31,36,48,0.92);
}

:is(.btn-outline, .code-wrap h1, .loading h1, .hero-title, .venue-title, .order-heading, .food-title, .music-title, .faqs-title, .gifts-title, .gift-name){
  font-weight: 400;
}

/* --------------------
   Single-screen routing
-------------------- */
.screen{ display: none; }
.screen--active{ display: block; }

/* Ensure screen content can never sit above the header */
.screen,
.page,
.section-full{
  position: relative;
  z-index: 0;
}

/* --------------------
   Sticky header (solid bg) - hardened
-------------------- */
.site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;

  /* Make this decisively above everything (including iframes) */
  z-index: 99999;

  background: var(--bg);
  transition: opacity 420ms ease, transform 420ms ease;
}

/* Optional: subtle separation when on dark sections */
.site-header{
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.header-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand img{
  width: 54px;
  height: auto;
}

.btn-outline{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 26px;
  min-width: 144px;
  text-decoration: none;
  color: var(--accent);
  background: transparent;
  border: 1.5px solid var(--accent);
  font-family: 'Kaikoura', Georgia, serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 16px;
  line-height: 1;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn-outline::after{
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(232,119,58,0.65);
  pointer-events: none;
}

.btn-outline:focus-visible{
  outline: 3px solid rgba(232,119,58,0.25);
  outline-offset: 4px;
}

.btn-outline:hover{
  background: rgba(232,119,58,0.12);
  transform: translateY(-1px);
  border-color: rgba(232,119,58,0.85);
}

/* --------------------
   Code entry screen
-------------------- */
.nav-hidden .site-header{
  display: none;
}

.nav-fade-hidden .site-header{
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

body.nav-fade-hidden .page{
  padding-top: 12px;
}

body.nav-fade-hidden .hero{
  align-items: flex-start;
  padding-top: 12px;
}

.code-wrap{
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 8vh) var(--gutter) 10vh;
  text-align: center;
}

.code-logo{
  width: 200px;
  height: auto;
  margin: 0 auto 18px;
}

.code-wrap h1{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 36px;
  margin: 0 0 8px;
  letter-spacing: 0.01em;
  line-height:1.1em;
}

.code-wrap h2{
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--sub);
  font-weight: 400;
}

.code-tagline{
  margin: 20px 0 20px;
  font-size: 16px;
  color: var(--sub);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.code-invite{
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--sub);
}

.hint{
  margin: 0 0 14px;
  color: var(--sub);
  font-size: 16px;
}

.error{
  min-height: 1.2em;
  margin-top: 10px;
  color: #b00020;
  font-size: 14px;
}

.lost-code-link{
  margin-top: 6px;
  background: none;
  border: none;
  color: var(--sub);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.lost-code-link:focus-visible{
  outline: 2px solid rgba(232,119,58,0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

.lost-code-message{
  margin: 8px 0 0;
  color: var(--sub);
  font-size: 14px;
}

.lost-code-message a{
  color: inherit;
}

.code-input-grid{
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 14px;
}

.code-digit{
  width: 56px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.6);
  text-align: center;
  font-size: 22px;
  font-family: 'Kaikoura', Georgia, serif;
  text-transform: uppercase;
}

.code-digit:focus{
  outline: 2px solid rgba(232,119,58,0.55);
  outline-offset: 2px;
}

.primary-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}

.primary-btn[disabled]{ opacity: 0.6; cursor: default; }

/* --------------------
   Loading screens
-------------------- */
.loading{
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
  padding: var(--header-h) var(--gutter) 6vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.loading h1{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 50px;
  line-height: 1.05;
  margin: 0 0 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.loading h2{
  margin: 0;
  font-size: 22px;
  color: var(--sub);
  font-weight: 400;
}

.loading-cta{ margin-top: 18px; }

.loading h1 .guest-name{
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.loading-dots::after{
  content: '';
  animation: dots 1.3s infinite steps(4);
}

@keyframes dots{
  0%{content:''}
  25%{content:'.'}
  50%{content:'..'}
  75%{content:'...'}
  100%{content:''}
}

/* --------------------
   Main page + Hero
-------------------- */
.page{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--header-h) 0 0;
}

.hero{
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 32px var(--gutter);
  position: relative;
}

.hero-grid{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  align-items: center;
}

/* Hero intro fade-in */
body.hero-animate .hero-media,
body.hero-animate .hero-copy > *{
  opacity: 0;
  transform: translateY(12px);
}

body.hero-animate.is-hero-ready .hero-media,
body.hero-animate.is-hero-ready .hero-copy > *{
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1100ms ease, transform 1100ms ease;
}

body.hero-animate.is-hero-ready .hero-copy > *:nth-child(1){ transition-delay: 140ms; }
body.hero-animate.is-hero-ready .hero-copy > *:nth-child(2){ transition-delay: 240ms; }
body.hero-animate.is-hero-ready .hero-copy > *:nth-child(3){ transition-delay: 340ms; }
body.hero-animate.is-hero-ready .hero-copy > *:nth-child(4){ transition-delay: 440ms; }
body.hero-animate.is-hero-ready .hero-copy > *:nth-child(5){ transition-delay: 540ms; }

@media (prefers-reduced-motion: reduce){
  body.hero-animate .hero-media,
  body.hero-animate .hero-copy > *{
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (min-width: 1024px){
  .hero-grid{
    grid-template-columns: 520px 1fr;
    gap: 52px;
    align-items: center;
  }
}

.hero-media{
  position: relative;
  display: grid;
  place-items: center;
  padding-left: 54px;
}

.hero-vertical{
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left top;
  font-family: 'Kaikoura', Georgia, serif;
  letter-spacing: 0.18em;
  font-size: 16px;
  color: #1c2230;
  white-space: nowrap;
}

.photo-card{
  width: min(520px, 100%);
  max-width: 520px;
  aspect-ratio: 4 / 5;
  border: 2px solid rgba(232,119,58,0.75);
  border-radius: 120px 120px 14px 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.35);
}

.photo-card img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy{
  text-align: left;
  max-width: 560px;
}

.kicker{
  font-style: italic;
  color: currentColor;
  opacity: 0.72;
  margin: 0 0 10px;
  font-size: 20px;
}

.hero-title{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 60px;
  line-height: 0.98;
  margin: 0 0 16px;
  letter-spacing: 0.01em;
  color: currentColor;
}

@media (max-width: 480px){
  .hero-title{ font-size: 46px; }
}

.meta{
  font-size: 14px;
  letter-spacing: 0.04em;
  color: currentColor;
  opacity: 0.78;
  margin: 0 0 18px;
}

.welcome{
  font-size: 18px;
  margin: 0 0 14px;
}

.intro{
  font-size: 18px;
  color: currentColor;
  opacity: 0.8;
  margin: 0;
  max-width: 60ch;
}

.intro a{
  color: inherit;
  text-decoration: underline;
}

.intro a:hover{
  color: inherit;
}

.intro a:focus-visible{
  outline: 2px solid rgba(240,108,40,0.45);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (max-width: 640px){
  .hero-media{ padding-left: 0; }
  .hero-vertical{ display: none; }
  .photo-card{ margin: 0 auto; }
  .hero-media{ padding-top: 30px; }
}

.guest-name{ white-space: nowrap; }

@media (max-width: 640px){
  .loading h1{
    font-size: clamp(34px, 10vw, 44px);
  }
}
/* --------------------
   Full-width section system
-------------------- */
.section-full{
  width: 100%;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 48px 0;
  background: transparent;
}

.section-inner{
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (max-width: 640px){
  .section-full{
    min-height: auto;
    padding: 30px 0;
  }

  .two-col-grid{
    gap: 20px;
  }
}

.two-col-grid{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  align-items: center;
}

@media (min-width: 1024px){
  .two-col-grid{
    grid-template-columns: 520px 1fr;
    gap: 52px;
  }
}

/* --------------------
   Venue section
-------------------- */
.section-venue{
  color: currentColor;
}

/* Ensure iframe cannot paint above header in odd browser cases */
.venue-map{
  position: relative;
  z-index: 0;
}

.venue-map iframe{
  width: 100%;
  height: clamp(320px, 46vh, 460px);
  border: 0;
  border-radius: 10px;
  display: block;

  position: relative;
  z-index: 0;
}

.venue-kicker,
.venue-title,
.venue-label,
.venue-address,
.venue-linkline,
.venue-funfact{
  color: currentColor;
}

.venue-kicker{
  margin: 0 0 10px;
  font-style: italic;
  opacity: 0.92;
  font-size: 18px;
}

.venue-title{
  margin: 0 0 22px;
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.venue-block{ margin: 0 0 20px; }

.venue-label{
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 16px;
  opacity: 0.95;
}

.venue-address{
  margin: 0;
  font-size: 18px;
  opacity: 0.95;
}

.venue-funfact{
  margin: 0;
  font-size: 18px;
  opacity: 0.92;
}

.venue-funfact a{
  color: inherit;
  text-decoration-color: rgba(246, 240, 228, 0.8);
  text-underline-offset: 2px;
}

.venue-linkline{
  margin: 0 0 14px;
  font-size: 18px;
  opacity: 0.95;
}

.venue-linkline a{
  color: inherit;
  text-underline-offset: 2px;
}

/* --------------------
   Order of the day section
-------------------- */
.section-order{
  color: #fbf1dc;
}

.order-copy{ max-width: 520px; }
.order-copy--center{
  margin: 0 auto;
  text-align: center;
}

.order-kicker{
  margin: 0 0 18px;
  font-size: 18px;
  opacity: 0.95;
}

.order-block{ margin: 0 0 22px; }

.order-heading{
  margin: 0 0 4px;
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.01em;
  color: #fbf1dc;
}

.order-line{
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  color: rgba(251,241,220,0.95);
}

.order-note{
  margin: 36px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(251,241,220,0.9);
  max-width: 56ch;
}

@media (max-width: 640px){
  .order-copy{ max-width: 100%; }
  .order-copy--center{ text-align: left; }
}

/* --------------------
   Food section
-------------------- */
.section-food{
  color: #1f2430;
}

.two-col-grid--food{
  grid-template-columns: 1fr;
}

@media (min-width: 1024px){
  .two-col-grid--food{
    grid-template-columns: 560px 1fr;
    gap: 72px;
    align-items: center;
  }
}

.food-media{
  display: grid;
  place-items: center;
}

.food-image{
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.food-copy{ max-width: 62ch; }

.food-title{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 52px;
  line-height: 1.02;
  margin: 0 0 18px;
  color: #111522;
}

.section-food p:last-child{ margin-bottom: 0; }

@media (max-width: 640px){
  .food-title{ font-size: 44px; }
  .section-food p{ font-size: 18px; }
}

/* --------------------
   Music section
-------------------- */
.section-music{
  color: #1f2430;
}

.music-image{
  width: 100%;
  height: auto;
  display: block;
}

.music-copy{ max-width: 520px; }

.music-title{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 44px;
  margin: 0 0 24px;
}

@media (min-width: 1024px){
  .two-col-grid--music{
    align-items: center;
  }
}

/* --------------------
   FAQs section
-------------------- */
.section-faqs{
  color: #1f2430;
}

.two-col-grid--faqs{
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 1024px){
  .two-col-grid--faqs{
    grid-template-columns: 0.9fr 1.1fr;
    gap: 72px;
    align-items: start;
  }
}

.faqs-title{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 44px;
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}

.faqs-subtitle{
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(31,36,48,0.88);
  max-width: 44ch;
}

.faqs-list{
  display: grid;
  gap: 14px;
}

.faq-item{
  border-top: 1px solid rgba(31,36,48,0.22);
  padding-top: 12px;
}

.faq-item:last-child{
  border-bottom: 1px solid rgba(31,36,48,0.22);
  padding-bottom: 12px;
}

.faq-question{
  list-style: none;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1.35;
  padding: 10px 44px 10px 0;
  position: relative;
  outline: none;
}

.faq-question::-webkit-details-marker{ display: none; }

.faq-question::after{
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 22px;
  line-height: 1;
  color: rgba(31,36,48,0.8);
}

.faq-item[open] > .faq-question::after{
  content: "–";
}

.faq-answer{
  padding: 6px 0 10px;
}

.faq-answer p{
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(31,36,48,0.9);
  max-width: 70ch;
}

.faq-question:focus-visible{
  outline: 2px solid rgba(240, 108, 40, 0.45);
  outline-offset: 6px;
  border-radius: 6px;
}

/* --------------------
   Gifts section
-------------------- */
.section-gifts{
  color: #1f2430;
}

.two-col-grid--gifts{
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 1024px){
  .two-col-grid--gifts{
    grid-template-columns: 0.95fr 1.05fr;
    gap: 72px;
    align-items: start;
  }
}

.gifts-title{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 44px;
  margin: 0 0 18px;
}

.section-gifts p{
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(31,36,48,0.92);
  max-width: 52ch;
}

.gifts-note{
  margin-top: 6px;
  font-size: 18px;
  color: rgba(31,36,48,0.85);
}

.gifts-carousel{
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 18px;
}

.carousel-viewport{
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.carousel-track{
  width: max-content;
  padding: 8px 2px 16px;
  display: flex;
  gap: 22px;
}

.carousel-btn{
  display: none;
}

.carousel-btn svg{
  width: 32px;
  height: 12px;
  stroke: rgba(31,36,48,0.7);
  stroke-width: 2;
  fill: none;
}

.carousel-btn--prev svg{
  transform: scaleX(-1);
}

.carousel-btn:hover{
  background: rgba(240,108,40,0.12);
  border-color: rgba(240,108,40,0.4);
}

.carousel-btn:focus-visible{
  outline: 2px solid rgba(240,108,40,0.45);
  outline-offset: 4px;
}

.carousel-btn:disabled{
  opacity: 0.4;
  cursor: default;
}

.gift-card{
  display: grid;
  gap: 10px;
  color: inherit;
  position: relative;
  flex: 0 0 min(320px, 80vw);
  scroll-snap-align: start;
}

.gift-image{
  width: 100%;
  aspect-ratio: 3 / 4;

  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  color: rgba(31,36,48,0.7);
  overflow: hidden;
  text-decoration: none;
}

.gift-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gift-meta{
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.gift-name{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.gift-price{
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.gift-desc{
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(31,36,48,0.78);
}

.gift-cta{
  justify-self: start;
  display: inline-grid;
  place-items: center;
  height: 30px;
  padding: 0 16px;
  border: 1px solid rgba(240,108,40,0.55);
  background: transparent;
  color: rgba(31,36,48,0.92);
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.gift-cta:hover{
  background: rgba(240,108,40,0.18);
}

.gift-cta:focus-visible{
  outline: 2px solid rgba(240,108,40,0.45);
  outline-offset: 6px;
  border-radius: 6px;
}

.site-footer{
  padding: 18px 0 28px;
  background: transparent;
}

.site-footer__inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-footer p{
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(31,36,48,0.58);
}

@media (max-width: 640px){
  .carousel-track{
    gap: 18px;
  }
}

/* --------------------
   Tablet portrait refinements
-------------------- */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait){
  :root{
    --gutter: 20px;
  }

  .header-inner{
    padding: 12px var(--gutter);
  }

  .brand img{
    width: 46px;
  }

  .btn-outline{
    min-width: 132px;
    padding: 10px 22px;
    font-size: 15px;
  }

  .page{
    padding-top: var(--header-h);
  }

  .hero{
    min-height: auto;
    padding: 20px var(--gutter) 24px;
  }

  .hero-media{
    padding-left: 0;
    padding-top: 20px;
    padding-bottom: 14px;
    justify-items: center;
  }

  .hero-vertical{
    display: none;
  }

  .hero-grid{
    gap: 18px;
  }

  .photo-card{
    width: min(500px, 100%);
    max-width: 500px;
    border-radius: 84px 84px 12px 12px;
    border-width: 1.5px;
  }

  .kicker{
    font-size: 16px;
    margin-bottom: 8px;
  }

  .hero-title{
    font-size: clamp(46px, 7vw, 56px);
    margin-bottom: 12px;
  }

  .meta{
    margin-bottom: 14px;
  }

  .welcome,
  .intro{
    font-size: 17px;
    line-height: 1.5;
  }

  .section-full{
    min-height: clamp(620px, 78vh, 860px);
    padding: 36px 0;
  }

  .two-col-grid{
    gap: 20px;
  }

  .venue-title,
  .food-title,
  .music-title,
  .faqs-title,
  .gifts-title{
    font-size: clamp(36px, 5.2vw, 42px);
    margin-bottom: 14px;
  }

  .section-full p,
  .faqs-subtitle,
  .faq-answer p{
    font-size: 17px;
    line-height: 1.5;
  }

  .venue-map iframe{
    height: clamp(280px, 35vh, 360px);
  }

  .order-heading{
    font-size: 20px;
  }

  .order-block{
    margin-bottom: 18px;
  }

  .order-note{
    margin-top: 24px;
  }

  .food-image,
  .music-image{
    width: min(500px, 100%);
    margin: 0 auto;
  }

  .gift-card{
    flex-basis: min(290px, 64vw);
  }
}
