/* --------------------
   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;
}

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

a{ color: inherit; }

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

:is(.btn-outline, .primary-btn, .code-wrap h1, .loading h1, .hero-title, .rsvp-title, .review-card__title, .guest-card__name){
  font-weight: 400;
}

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

/* --------------------
   Sticky header (solid bg)
-------------------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
}

.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
-------------------- */
.code-wrap{
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 8vh) var(--gutter) 10vh;
  text-align: center;
}
.code-wrap h1{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 40px;
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}
.code-wrap h2{
  margin: 0 0 18px;
  font-size: 20px;
  color: var(--sub);
  font-weight: 400;
}
.hint{
  margin: 0 0 14px;
  color: var(--sub);
  font-size: 16px;
}
.error{
  min-height: 1.2em;
  margin-top: 10px;
  color: #b00020;
  font-size: 14px;
}

.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: 11px 26px;
  min-width: 144px;
  border-radius: 0;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 6px;
  position: relative;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

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

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

.primary-btn:focus-visible{
  outline: 3px solid rgba(232,119,58,0.25);
  outline-offset: 4px;
}
.primary-btn[disabled]{ opacity: 0.6; cursor: default; }

/* --------------------
   Loading screens
-------------------- */
.loading{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--header-h) + 14vh) var(--gutter) 10vh;
  text-align: center;
}
.loading h1{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 46px;
  margin: 0 0 12px;
}
.loading h2{
  margin: 0;
  font-size: 22px;
  color: var(--sub);
  font-weight: 400;
}
.loading-cta{ margin-top: 18px; }

.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: 0 var(--gutter) 0;
}

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

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

@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: var(--sub);
  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: #1c2230;
}

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

.meta{
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #1c2230;
  opacity: 0.8;
  margin: 0 0 18px;
}

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

.intro{
  font-size: 18px;
  color: var(--sub);
  margin: 0;
  max-width: 60ch;
}

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

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

/* --------------------
   Full-width sections (index.html)
-------------------- */
.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);
}

.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;
  }
}

/* --------------------
   RSVP page styles
-------------------- */
.rsvp-body{
  background: var(--navy);
  color: var(--navy-ink);
}

/* Make header solid navy on RSVP page */
.rsvp-body .site-header{
  background: #fcf1db;
}

.rsvp-body .header-inner{
  background: #fcf1db;
}

/* RSVP layout container */
.rsvp-page{
  min-height: calc(100vh - var(--header-h));
  padding: 22px 0 48px;
}

/* Constrain to same max width as site */
.rsvp-grid{
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

@media (min-width: 1024px){
  .rsvp-grid{
    grid-template-columns: 0.9fr 1.1fr;
    gap: 72px;
  }
}

/* LEFT intro column */
.rsvp-intro{
  padding-top: 22px;
}

.rsvp-title{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 56px;
  line-height: 1;
  margin: 0 0 8px;
  color: var(--navy-ink);
}

.rsvp-subtitle{
  margin: 0 0 22px;
  font-size: 20px;
  color: rgba(246,240,228,0.92);
}

.rsvp-help{
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(246,240,228,0.85);
}

.rsvp-email{
  text-decoration: none;
  border-bottom: 1px solid rgba(246,240,228,0.45);
}
.rsvp-email:hover{
  border-bottom-color: rgba(246,240,228,0.85);
}

/* RIGHT column */
.rsvp-cards{
  display: grid;
  gap: 16px;
  align-content: start;
}

.rsvp-status{
  min-height: 1.2em;
  font-size: 14px;
  color: rgba(246,240,228,0.85);
}

.rsvp-already-card{
  background: #f6ecd6;
  color: #1f2430;
  padding: 26px 28px;
  border-radius: 0;
  box-shadow: 0 18px 40px rgba(0,0,0,0.20);
  font-size: 22px;
  line-height: 1.45;
  max-width: 560px;
}

.rsvp-already-card p{
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.review-card .rsvp-status{
  color: rgba(31,36,48,0.9);
}

.rsvp-status.is-loading::after{
  content: "...";
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  animation: rsvp-ellipsis 1.1s steps(4, end) infinite;
}

.rsvp-status.is-success{
  color: rgba(0, 0, 0, 0.95);
}

@keyframes rsvp-ellipsis{
  to{
    width: 1.2em;
  }
}

.rsvp-form{
  display: grid;
  gap: 18px;
}

.guest-cards{
  display: grid;
  gap: 18px;
}

.is-hidden{
  display: none;
}

.review-card{
  background: var(--bg);
  color: var(--ink);
  border-radius: 40px 0 0 0;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.20);
  display: grid;
  gap: 16px;
}

.review-card.is-hidden{
  display: none;
}

.review-card__title{
  margin: 0 0 6px;
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 22px;
}

.review-card__subtitle{
  margin: 0;
  font-size: 14px;
  color: rgba(31,36,48,0.75);
}

.review-card__list{
  display: grid;
  gap: 14px;
}

.review-card__row{
  padding-top: 10px;
  border-top: 1px solid rgba(31,36,48,0.12);
}

.review-card__row:first-child{
  border-top: none;
  padding-top: 0;
}

.review-card__name{
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.review-card__attending{
  font-size: 14px;
  color: rgba(31,36,48,0.9);
}

.review-card__extras{
  margin-top: 6px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: rgba(31,36,48,0.7);
}

.review-card__notes{
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(31,36,48,0.12);
}

.review-card__notes-label{
  font-size: 14px;
  color: rgba(31,36,48,0.85);
}

.review-card__notes-input{
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid rgba(31,36,48,0.22);
  border-radius: 6px;
  font-family: inherit;
  font-size: 16px;
  background: #fff;
  color: #1f2430;
  resize: vertical;
}

.review-card__notes-input:focus-visible{
  outline: 2px solid rgba(240,108,40,0.45);
  outline-offset: 2px;
}

.review-card__email{
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(31,36,48,0.12);
}

.review-card__email-label{
  font-size: 14px;
  color: rgba(31,36,48,0.85);
}

.review-card__email-input{
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(31,36,48,0.22);
  border-radius: 6px;
  font-family: inherit;
  font-size: 16px;
  background: #fff;
  color: #1f2430;
}

.review-card__email-input:focus-visible{
  outline: 2px solid rgba(240,108,40,0.45);
  outline-offset: 2px;
}

.review-card__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.review-change-link{
  background: none;
  border: none;
  padding: 0;
  margin-right: auto;
  color: rgba(31,36,48,0.8);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.review-change-link:hover{
  color: rgba(31,36,48,1);
}

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


/* Card base */
.guest-card{
  background: var(--bg);
  color: var(--ink);
  border-radius: 40px 0 0 0;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.20);
  position: relative;
}

.guest-card__status{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 18px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 160ms ease, transform 160ms ease;
}

.guest-card.attending-yes .guest-card__status{
  opacity: 1;
  transform: scale(1);
}

.guest-card.attending-no .guest-card__status{
  opacity: 1;
  transform: scale(1);
}

/* Guest name */
.guest-card__name{
  font-family: 'Kaikoura', Georgia, serif;
  font-size: 26px;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

/* Question label */
.guest-card__label{
  font-size: 14px;
  color: rgba(31,36,48,0.82);
  margin: 0 0 8px;
}

/* Yes/No row */
.attending-row{
  display: flex;
  gap: 22px;
  align-items: center;
  margin-bottom: 10px;
}

.radio{
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: rgba(31,36,48,0.92);
}

.radio input{
  width: 18px;
  height: 18px;
}

/* Expandable content area */
.guest-card__extra{
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(31,36,48,0.12);
}

/* When attending=yes */
.guest-card.is-expanded .guest-card__extra{
  display: block;
}

.dietary-heading{
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(31,36,48,0.86);
}

.dietary-copy{
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(31,36,48,0.82);
}

/* Checkboxes */
.check-row{
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.checkbox{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: rgba(31,36,48,0.92);
}

.checkbox input{
  width: 18px;
  height: 18px;
}

@media (max-width: 640px){
  .radio input,
  .checkbox input{
    width: 20px;
    height: 20px;
  }
}

/* Textarea */
.textarea-label{
  display: block;
  font-size: 14px;
  color: rgba(31,36,48,0.92);
  margin: 0 0 8px;
}

textarea{
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(31,36,48,0.22);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  background: rgba(255,255,255,0.75);
}

textarea:focus{
  outline: 2px solid rgba(232,119,58,0.45);
  outline-offset: 2px;
}

/* Prevent iOS focus zoom by keeping interactive field text at 16px+ */
.rsvp-page input[type="text"],
.rsvp-page input[type="email"],
.rsvp-page input[type="tel"],
.rsvp-page textarea,
.rsvp-page select{
  font-size: 16px;
}

/* Submit area */
.rsvp-actions{
  display: grid;
  gap: 10px;
  justify-items: start;
}

.rsvp-error{
  margin: 0;
  min-height: 1.3em;
  color: #ffb3b3;
  font-size: 14px;
}

.rsvp-submit{
  margin-top: 0;
}

/* Mobile tuning */
@media (max-width: 640px){
  .rsvp-title{ font-size: 46px; }
  .guest-card{ padding: 18px 18px 14px; }
}
