/* ==========================================================================
   M & B wedding site
   Colours and fonts live in :root. Change them here and the whole site follows.
   ========================================================================== */

:root {
  --background: oklch(0.39 0.148 18);           /* base red, shown while the texture loads */
  --foreground: oklch(0.96 0.037 89);           /* cream text */
  --primary: oklch(0.86 0.12 88);               /* gold */
  --primary-foreground: oklch(0.32 0.12 19);    /* dark red text on gold buttons */
  --secondary: oklch(0.32 0.125 18 / 0.35);     /* translucent dark red for bands and inputs */
  --muted-foreground: oklch(0.85 0.048 76);     /* softer body text */
  --border: oklch(0.86 0.12 88 / 0.32);         /* faint gold lines */
  --destructive: oklch(0.9 0.09 50);            /* error text */

  --font-sans: "Wedding Body", Georgia, serif;                  /* body text  - fonts/body.ttf (IM Fell English) */
  --font-display: "Wedding Title", Georgia, serif;              /* headings   - fonts/title.ttf */

  --page-texture: url("assets/weddingsite-bg.webp");

  /* ---- Side vine ----
     --vine-w        how wide the vine is drawn
     --vine-overlap  how far the vine reaches into the text column (bigger = vine sits closer/over text)
     --vine-left     where the vine sits. On wide screens it hugs the left edge of the content column,
                     wherever that is, so it never feels stranded at the edge of a big monitor.
     --vine-gutter   extra space pushed in front of the content (only needed on narrower screens)
     --vine-gap-*    space between the vine and the very top / bottom of the page */
  --vine-w: clamp(100px, 10vw, 160px);
  --vine-overlap: 24px;
  --vine-left: max(calc(var(--vine-w) * -0.25),
                   calc(((100vw - 1080px) / 2 + 48px + var(--vine-overlap) - var(--vine-w)) * var(--vine-pull)));
  --vine-pull: 0.5;   /* 0 = vine at the screen edge, 1 = vine hugging the content column */
  --vine-gutter: 0px;
  --vine-gap-top: 56px;
  --vine-gap-bottom: 56px;
}

/* ---------- Fonts ----------
   Both self-hosted from site/fonts/. If .woff2 versions are added later with the same names
   (title.woff2, body.woff2), browsers will use those first - smaller and faster. */
@font-face {
  font-family: "Wedding Title";
  src: url("fonts/title.woff2") format("woff2"),
       url("fonts/title.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Wedding Body";
  src: url("fonts/body.woff2") format("woff2"),
       url("fonts/body.ttf") format("truetype");
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Wedding Body";
  src: url("fonts/body-italic.woff2") format("woff2"),
       url("fonts/body-italic.ttf") format("truetype");
  font-style: italic;
  font-display: swap;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; border-color: var(--border); }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  position: relative;   /* lets the vine stretch the full height of the page */
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;   /* IM Fell is small for its size, so the body text is set a little larger */
  -webkit-font-smoothing: antialiased;
}
/* Painted red texture, pinned behind the whole page.
   Done with a fixed pseudo-element (not background-attachment: fixed) so it also works on iPhone. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--background) var(--page-texture) center / cover no-repeat;
}
button, input, textarea { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; }
[hidden] { display: none !important; }

/* ---------- Icons ---------- */
.icon {
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; vertical-align: middle;
}
.icon:where(:not([width])) { width: 1em; height: 1em; }
.icon-thin { stroke-width: 1; }
.icon-sm { width: 13px; height: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; min-height: 36px;
  border: 1px solid transparent; border-radius: 2px;
  font-size: 13px; font-weight: 400; text-decoration: none;
  cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--primary-foreground); }
.btn-solid { background: var(--primary); color: var(--primary-foreground); }
.btn-solid:hover { background: oklch(0.9 0.1 88); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* ---------- Layout ---------- */
.wedding-page { padding-left: var(--vine-gutter); }
/* Content sits above the vine (so text stays readable where they overlap);
   the dark band backgrounds sit below it, so the vine passes over them. */
.section, .wedding-hero, .wedding-footer { position: relative; z-index: 3; }
/* ---------- Menu button + slide-in drawer ---------- */
.menu-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 30;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--primary);
  background: oklch(0.3 0.12 18 / .6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: 0 4px 14px rgb(0 0 0 / .25);
}
.menu-toggle .icon { width: 22px; height: 22px; }
.menu-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.menu-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 25;
  width: min(340px, 85vw); padding: 96px 32px 32px;
  display: flex; flex-direction: column;
  background: oklch(0.27 0.11 18 / .98); border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgb(0 0 0 / .35);
  transform: translateX(100%); visibility: hidden;
  transition: transform .35s ease, visibility 0s .35s;
}
.menu-drawer.is-open { transform: none; visibility: visible; transition: transform .35s ease; }
.menu-drawer a {
  font-family: var(--font-display); font-size: 30px; line-height: 1.2;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  color: var(--foreground); text-decoration: none;
}
.menu-drawer a:hover, .menu-drawer a:focus-visible { color: var(--primary); outline: none; }
.menu-drawer .menu-rsvp { color: var(--primary); }
.menu-backdrop {
  position: fixed; inset: 0; z-index: 24; background: rgb(0 0 0 / .4);
  opacity: 0; pointer-events: none; transition: opacity .35s;
}
.menu-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ---------- Hero ---------- */
/* The hero is transparent: the cut-out logo floats over the pinned page texture, so there is no seam. */
.wedding-hero {
  position: relative; min-height: 100svh; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px 64px;
}
/* Logo and names scale with the screen: bigger windows get a bigger logo and text.
   Logo: 64% of the screen height, but never wider than 60% of the screen width. */
.hero-art {
  height: min(64svh, 60vw);
  width: auto; max-width: 100%; object-fit: contain;
  filter: drop-shadow(0 12px 28px rgb(0 0 0 / .28));   /* soft shadow so it sits above the page; delete to remove */
}
.hero-copy { margin-top: 28px; }
.hero-copy h1 { font-size: clamp(37px, 4.2vw, 88px); line-height: 1.05; margin: 13px 0 17px; }
.hero-copy .eyebrow { font-size: clamp(12px, 0.95vw, 18px); }
/* Names always on three lines: Martha McKenna / & / Benjamin Stocker.
   Centred in the stacked layout; left-aligned in the wide side-by-side layout below. */
.hero-name, .hero-amp { display: block; }
.hero-name { white-space: nowrap; }

/* Wide, landscape screens: logo on the left, names on the right, so the hero fills the width.
   Phones, tablets and narrow windows keep the stacked layout above. */
@media (min-width: 1000px) and (min-aspect-ratio: 4/3) {
  .wedding-hero {
    flex-direction: row; gap: clamp(40px, 5vw, 120px);
    text-align: left; padding: 48px 64px 72px;
  }
  .hero-art { height: min(84svh, 48vw); }            /* logo size in this layout */
  .hero-copy { margin-top: 0; max-width: 46vw; }
  .hero-copy .eyebrow { font-size: clamp(12px, 1vw, 18px); }
  .hero-copy h1 { font-size: clamp(48px, 5vw, 116px); line-height: 1.08; margin: 18px 0 0; }
  .hero-amp { display: block; /*color: var(--primary)*/; }  /* gold ampersand on its own line between them */
}
.hero-copy p { font-size: 12px; color: var(--muted-foreground); }
.scroll-cue { position: absolute; z-index: 1; bottom: 23px; left: 50%; transform: translateX(-50%); color: var(--primary); }
.eyebrow { text-transform: uppercase; font-size: 12px; letter-spacing: 2px; color: var(--primary); line-height: 1.8; }

/* ---------- Sections ---------- */
.section { max-width: 1080px; margin: auto; padding: 92px 48px; }
.section-heading { text-align: center; margin-bottom: 44px; }
.section h2 { font-size: 54px; line-height: 1.1; margin: 10px 0 17px; }
.section p { line-height: 1.9; color: var(--muted-foreground); }
.welcome { text-align: center; max-width: 760px; padding-top: 68px; padding-bottom: 70px; }
.welcome h2 { font-size: 47px; }
.welcome p { max-width: 530px; margin: 0 auto 26px; }
.ornament { color: var(--primary); display: flex; justify-content: center; align-items: center; gap: 18px; margin: 32px auto 0; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 80px; background: var(--border); }
.band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--secondary); }
/* Bands and the footer line run the full width of the screen, underneath the vine */
.band, .wedding-footer { margin-left: calc(-1 * var(--vine-gutter)); padding-left: var(--vine-gutter); }
.band + .wedding-footer { border-top: 0; }     /* avoid a double line above the footer */

/* ---------- Welcome / guest gate page ---------- */
.gate {
  position: relative; z-index: 3;
  min-height: 100svh; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 20px;
}
/* Logo size on the welcome page: 62% of the screen height, up to 600px tall */
.gate-art { height: min(62svh, 600px); width: auto; max-width: 100%; margin-bottom: 28px;
  filter: drop-shadow(0 12px 28px rgb(0 0 0 / .28)); }
.gate-names { font-size: clamp(32px, 4vw, 52px); line-height: 1.05; margin: 10px 0 20px; }
.gate-intro { color: var(--muted-foreground); margin-bottom: 22px; }
.gate-form { width: 100%; text-align: left; }
.gate .form-status { text-align: center; }

/* ---------- Menu sign-out link ---------- */
.menu-drawer .menu-leave { margin-top: auto; border-bottom: 0; font-family: var(--font-sans); font-size: 15px; color: var(--muted-foreground); }

/* ---------- Key info ---------- */
/* Photo and text are both centred vertically, so they stay level however long the text gets */
.two-column.key-info { align-items: center; }
.key-info .section-intro { padding-top: 0; }
.key-info .section-intro > :last-child { margin-bottom: 0; }
.key-info .section-intro p { max-width: 440px; }
/* Venue photo with soft, feathered edges that fade into the background instead of a hard border.
   The 8% values control how wide the fade is - raise them for a softer, dreamier edge. */
.venue-photo { margin: 0; }
.venue-photo img {
  display: block; width: 100%; height: auto;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
          mask-composite: intersect;
}

/* ---------- Timeline ---------- */
/* A vertical "order of service": times on the left, a gold line with dots down the middle,
   events on the right. Copes with any number of moments - just add or remove timeline-items. */
.timeline {
  --tl-gap: 28px;    /* space between moments */
  --dot-y: 16px;     /* how far down each item its dot sits (half of the h3 line-height below) */
  display: flex; flex-direction: column; gap: var(--tl-gap);
  max-width: 760px; margin: 0 auto; padding-top: 8px;
}
.timeline-item {
  position: relative;
  display: grid; grid-template-columns: 1fr 32px 1fr; column-gap: 20px;
}
/* the gold line: runs from this item's dot down to the next item's dot */
.timeline-item::after {
  content: ""; position: absolute; left: 50%; width: 1px; transform: translateX(-50%);
  top: var(--dot-y); bottom: calc(-1 * (var(--tl-gap) + var(--dot-y)));
  background: var(--border);
}
.timeline-item:last-child::after { display: none; }
.timeline-dot {
  grid-column: 2; grid-row: 1; align-self: center; justify-self: center;
  position: relative; z-index: 1;
  width: 9px; height: 9px; background: var(--primary); border-radius: 50%;
}
.timeline-item .time { grid-column: 1; grid-row: 1; align-self: center; text-align: right; color: var(--primary); font-size: 16px; }
.timeline-item h3 { grid-column: 3; grid-row: 1; font-size: 26px; line-height: 32px; margin: 0; }
.timeline-item p { grid-column: 3; grid-row: 2; font-size: 15px; margin: 2px 0 0; }

/* ---------- Two-column (RSVP, songs) ---------- */
.two-column { display: grid; grid-template-columns: 1fr 1.15fr; gap: 85px; align-items: start; }
.section-intro { padding-top: 18px; }
.section-intro h2 { max-width: 380px; }
.section-intro p { max-width: 310px; }
.small-note { font-size: 14px; }
.music-mark { width: 80px; height: 80px; border: 1px solid var(--border); border-radius: 50%; display: grid; place-items: center; margin-bottom: 30px; color: var(--primary); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
.field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field legend { font-size: 14px; color: var(--foreground); }
.muted { color: var(--muted-foreground); }
.wedding-input {
  border: 1px solid var(--border); background: var(--secondary); color: var(--foreground);
  border-radius: 2px; padding: 13px 14px; width: 100%; outline: none; min-height: 46px;
}
.wedding-input::placeholder { color: var(--muted-foreground); opacity: .65; font-size: 15px; }
.wedding-input:focus { border-color: var(--primary); }
.wedding-input[aria-invalid="true"] { border-color: var(--destructive); }
textarea.wedding-input { resize: vertical; min-height: 90px; }
.attendance { border: 0; margin: 0; padding: 0; }
.attendance legend { margin-bottom: 12px; padding: 0; }
.radio-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-option { display: flex; align-items: center; gap: 8px; min-height: 46px; border: 1px solid var(--border); padding: 10px 12px; cursor: pointer; font-size: 15px; }
.radio-option:has(input:checked) { border-color: var(--primary); background: var(--secondary); }
.radio-option input { accent-color: var(--primary); }
.wedding-submit { width: 100%; min-height: 47px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-status { padding: 13px 0 0; font-size: 13px; }
.form-error { color: var(--destructive); }
.confirmation { min-height: 270px; padding: 48px 0; border-top: 1px solid var(--border); }
.confirmation > .icon { color: var(--primary); margin-bottom: 18px; display: block; }
.confirmation h3 { font-size: 36px; }
.preview-note { font-size: 13px; font-style: italic; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Details ---------- */
.details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 38px; text-align: center; }
.details .icon { color: var(--primary); margin: 0 auto 18px; display: block; }
.details h3 { font-size: 28px; margin-bottom: 12px; }
.details p { font-size: 15px; }

/* ---------- Footer ---------- */
.wedding-footer { text-align: center; padding-top: 28px; padding-right: 24px; padding-bottom: 24px; border-top: 1px solid var(--border); }
.wedding-footer { padding-left: calc(var(--vine-gutter) + 24px); }
.footer-conker { display: block; width: 90px; height: auto; margin: 0 auto 2px; }   /* conker size and gap to M & B */
.footer-monogram { font-family: var(--font-display); color: var(--primary); font-size: 40px; line-height: 1; }

/* ---------- Vine ---------- */
/* Runs from the very top of the page to the very bottom and scrolls with it.
   Top and bottom pieces appear once; the middle repeats to fill whatever length the page is.
   'round' squeezes or stretches the middle slightly so a whole number of repeats always fits,
   which keeps the stem lined up where the middle meets the bottom piece. */
.vine {
  position: absolute; top: var(--vine-gap-top); bottom: var(--vine-gap-bottom); left: var(--vine-left);
  width: var(--vine-w);
  display: flex; flex-direction: column;
  pointer-events: none; z-index: 2;
}
.vine img { display: block; width: 100%; height: auto; flex: none; }
.vine-middle {
  flex: 1 1 auto;
  background-image: url("assets/sidevine-middle.webp");
  background-size: 100% auto;
  background-position: center top;
  background-repeat: no-repeat round;
}

/* ---------- Mobile ---------- */
/* Below ~1100px there's no spare margin, so the vine sits at the screen edge and the content
   shifts right just enough that only the vine's outer leaves reach under the text. */
@media (max-width: 1099px) {
  :root { --vine-left: 0px; --vine-gutter: calc(var(--vine-w) - var(--vine-overlap) - 32px); }
}
@media (max-width: 960px) {
  .section { padding-left: 32px; padding-right: 32px; }
  .two-column { gap: 48px; }
}

@media (max-width: 700px) {
  /* Phone: vine drawn at 84px but shifted 20px off the left edge, so ~64px shows */
  :root { --vine-w: 84px; --vine-left: -20px; --vine-gutter: 38px; --vine-gap-top: 32px; --vine-gap-bottom: 32px; }
  .menu-toggle { top: 12px; right: 12px; width: 44px; height: 44px; }
  .wedding-hero { padding: 28px 20px 72px; }
  .hero-art { height: min(54svh, 520px); }
  .hero-copy { margin-top: 20px; }
  .hero-copy h1 { font-size: min(37px, 9.5vw); }   /* shrinks slightly on very narrow phones so the names never overflow */
  .section { padding: 65px 18px 65px 14px; }
  .section h2 { font-size: 43px; }
  .welcome h2 { font-size: 39px; }
  .two-column { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .section-intro { padding-top: 0; }
  .section-intro p { max-width: none; }
  /* Phone: line and dots move to the left; time sits above each event */
  .timeline { --tl-gap: 22px; --dot-y: 36px; padding-top: 0; }
  .timeline-item { grid-template-columns: 16px 1fr; column-gap: 14px; }
  .timeline-item::after { left: 8px; }
  .timeline-dot { grid-column: 1; grid-row: 2; }
  .timeline-item .time { grid-column: 2; grid-row: 1; text-align: left; line-height: 20px; }
  .timeline-item h3 { grid-column: 2; grid-row: 2; }
  .timeline-item p { grid-column: 2; grid-row: 3; }
  .details { grid-template-columns: 1fr; gap: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .radio-option { padding: 10px; font-size: 14px; }
  .music-mark { width: 60px; height: 60px; margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
