/* Lindsay & Adi: Save the Date. Every color is sampled from the artwork (pencil on warm paper, red accents). */

:root {
  /* build:paper (written by `npm run images`; set "paperColor" in site.config.json to override) */
  --paper: #f6f2ee;
  --std-ratio: 0.7500;
  /* /build:paper */
  --paper-light: #faf8f5;
  --ink: #363332;
  --muted: #6b6461;
  --line: rgba(54, 51, 50, .2);
  --line-strong: rgba(54, 51, 50, .36);
  --field-bg: rgba(255, 255, 255, .6);
  --red: #b35946;
  --red-deep: #a34a37;
  --red-dark: #8c3d2d;
  --red-tint: rgba(179, 89, 70, .08);
  --error: #9c2f22;
  --cream: #fbf8f4;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "Jost", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root { --paper-light: color-mix(in srgb, var(--paper), #fff 45%); }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 1.0625rem/1.6 var(--body);
  color: var(--ink);
  background-color: var(--paper);
  /* Faint paper grain, so the page reads as the same paper as the artwork. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .3 0 0 0 0 .28 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  overflow-x: hidden; /* fallback for iOS < 16 */
  overflow-x: clip;
  font-variant-numeric: lining-nums;
  /* iPhones in landscape: keep content clear of the notch / Dynamic Island (viewport-fit=cover). */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a { color: var(--red-deep); text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
/* No grey flash when tapping on iPhone; the controls have their own pressed states. */
a, button, .choice { -webkit-tap-highlight-color: transparent; }

/* Hover effects only on devices that really hover; on phones they'd "stick" after a tap. */
@media (hover: hover) {
  a:hover { color: var(--red-dark); }
  input:hover, textarea:hover { border-color: rgba(54, 51, 50, .55); }
  .choice:hover span { border-color: rgba(54, 51, 50, .6); }
  .btn:hover { color: var(--cream); background: var(--red-dark); border-color: var(--red-dark); box-shadow: inset 0 0 0 3px var(--red-dark), inset 0 0 0 4px rgba(251, 248, 244, .5); }
  .link-btn:hover { color: var(--red-dark); }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: .6rem 1rem; background: var(--paper-light); border: 1px solid var(--line-strong); }
.skip:focus { top: 1rem; }

.heart { display: block; color: var(--red); overflow: visible; }

/* ---------- Save the date artwork ---------- */
.std { display: flex; justify-content: center; padding-top: clamp(0rem, 2vw, 1.5rem); }
.std picture { display: block; }
.std img {
  display: block;
  width: min(100vw, 600px);
  height: auto;
  /* Feather the edges so the drawing sits on the page itself rather than in a box. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect;
}
/* On larger screens, size the artwork to the window so the reply heading peeks above the fold. */
@media (min-width: 700px) and (min-height: 560px) {
  .std img { width: clamp(440px, calc((100vh - 6rem) * var(--std-ratio)), 600px); }
  @supports (height: 100svh) {
    .std img { width: clamp(440px, calc((100svh - 6rem) * var(--std-ratio)), 600px); }
  }
}

/* ---------- Reply section ---------- */
.reply {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.75rem 1rem 4rem;
  text-align: center;
}
.heart--divider { width: 46px; height: auto; margin: 0 auto 1.1rem; }
.reply h2,
.stay h2 {
  margin: 0;
  font: 500 clamp(1.6rem, 1.15rem + 2vw, 2.25rem)/1.15 var(--display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  padding-left: .14em; /* balances the trailing letter-spacing */
  text-wrap: balance; /* no lonely "US?" on narrow phones */
}

/* The form card: one thin line around it (no double frame) and a soft shadow. */
.card {
  margin-top: 2.2rem;
  text-align: left;
  background: var(--paper-light);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(54, 51, 50, .04), 0 12px 32px -18px rgba(54, 51, 50, .18);
  padding: clamp(1.5rem, 5vw, 2.75rem) clamp(1.25rem, 5vw, 2.75rem);
}

/* ---------- Form ---------- */
.field { margin: 0 0 1.5rem; padding: 0; border: 0; min-width: 0; }
.field > label,
.field > legend {
  display: block;
  margin: 0 0 .5rem;
  padding: 0;
  font: 500 .75rem/1.4 var(--body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
}
.req { color: var(--red-deep); }
.legend-note {
  font: italic 400 1rem/1 var(--display);
  letter-spacing: .01em;
  text-transform: none;
  color: var(--muted);
}
.hint { margin: -.15rem 0 .6rem; font-size: .9rem; line-height: 1.45; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"], textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: .7rem .85rem;
  font: 400 1.0625rem/1.4 var(--body); /* ≥16px so iOS doesn't zoom in */
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
textarea { resize: vertical; min-height: 6rem; }
input:focus, textarea:focus { outline: none; border-color: var(--red-deep); background: #fff; box-shadow: 0 0 0 3px rgba(179, 89, 70, .16); }
/* Autofill (iPhone contacts / passwords, Chrome): keep the field on-palette instead of yellow or blue. */
input:-webkit-autofill { -webkit-text-fill-color: var(--ink); caret-color: var(--ink); box-shadow: 0 0 0 100px #fdfcfa inset; transition: background-color 600000s 0s; }
input:-webkit-autofill:focus { box-shadow: 0 0 0 100px #fff inset, 0 0 0 3px rgba(179, 89, 70, .16); }

.has-error input[type="text"], .has-error input[type="email"], .has-error input[type="tel"], .has-error textarea { border-color: var(--error); }
.field-error { margin: .45rem 0 0; font-size: .9rem; line-height: 1.4; color: var(--error); }
.field-error:empty { display: none; }

/* Pill-shaped radio choices (real radio buttons underneath, so keyboards and screen readers just work). */
.choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.choice { position: relative; display: inline-flex; cursor: pointer; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 46px;
  padding: .5rem 1.3rem .5rem 1rem;
  font: 400 1.0625rem/1 var(--body);
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color .2s, background-color .2s, color .2s;
}
.choice span::before {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  transition: border-color .2s, background-color .2s;
}
.choice:active span { background: var(--red-tint); }
.choice input:checked + span { color: var(--red-deep); background: var(--red-tint); border-color: var(--red-deep); }
.choice input:checked + span::before { border-color: var(--red-deep); background: radial-gradient(circle, var(--red-deep) 0 3.5px, transparent 4px); }
.choice input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.has-error .choice span { border-color: var(--error); }

.choices--count { display: grid; grid-template-columns: repeat(6, minmax(0, 50px)); gap: .55rem; }
.choice--num { display: block; }
.choice--num span { justify-content: center; width: 100%; aspect-ratio: 1; min-height: 0; padding: 0; font-size: 1.15rem; border-radius: 50%; }
.choice--num span::before { display: none; }

.guest-names { display: grid; gap: .6rem; }
.guest-name { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); align-items: center; gap: .75rem; }
.guest-name label { font: 500 .72rem/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form-actions { margin-top: 2rem; text-align: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 13rem;
  padding: .9rem 2.4rem;
  font: 500 .8rem/1 var(--body);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--red-deep);
  border: 1px solid var(--red-deep);
  border-radius: 0;
  box-shadow: inset 0 0 0 3px var(--red-deep), inset 0 0 0 4px rgba(251, 248, 244, .45);
  cursor: pointer;
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.btn:active { background: var(--red-dark); border-color: var(--red-dark); box-shadow: inset 0 0 0 3px var(--red-dark), inset 0 0 0 4px rgba(251, 248, 244, .5); }
.btn:disabled { cursor: progress; opacity: .75; }
.form-status { margin: 1rem 0 0; text-align: center; font-size: .95rem; color: var(--error); }
.form-status:empty { display: none; }

/* ---------- Thank you ---------- */
.thanks { padding: 1rem 0 .25rem; text-align: center; outline: none; }
.thanks__title { margin: 0; font: 500 clamp(1.9rem, 1.5rem + 1.6vw, 2.4rem)/1.15 var(--display); color: var(--ink); }
.thanks__msg { margin: .6rem auto 0; max-width: 26em; font: italic 400 1.3rem/1.45 var(--display); color: var(--muted); }
.thanks__again { margin: 2rem 0 0; font-size: .95rem; color: var(--muted); }
.link-btn { padding: .35rem 0; font: inherit; color: var(--red-deep); background: none; border: 0; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; cursor: pointer; }

/* ---------- Footer ---------- */
.footer { padding: 1.75rem 1rem calc(2rem + env(safe-area-inset-bottom)); text-align: center; border-top: 1px solid var(--line); }
.footer p { margin: .2rem 0; }
.footer__contact { font-size: .95rem; color: var(--muted); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal:not([hidden]), .guest-name:not([hidden]) { animation: fade-in .35s ease-out both; }
  .thanks:not([hidden]) { animation: rise .6s ease-out both; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Where to stay (US version only) ---------- */
.stay {
  max-width: 640px;
  margin: 0 auto;
  padding: .5rem 1rem 2.5rem; /* same as the space above the last line, so it sits centered */
  text-align: center;
}
.stay__lede {
  margin: .8rem auto 0;
  max-width: 30em;
  font: italic 400 clamp(1.15rem, 1rem + .6vw, 1.35rem)/1.45 var(--display);
  color: var(--muted);
  text-wrap: balance;
}
.stay__photo { margin: 2rem 0 0; }
.stay__photo img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.stay__photo figcaption { margin-top: .5rem; font-size: .75rem; color: var(--muted); }
.stay__photo figcaption a { color: inherit; }
.stay__book { margin: 2rem 0 0; }
.stay__book .btn { text-decoration: none; }
/* Same voice as the line under "Where to stay". */
.stay__deadline { margin: .9rem auto 0; max-width: 30em; font: italic 400 clamp(1.15rem, 1rem + .6vw, 1.35rem)/1.45 var(--display); color: var(--muted); text-wrap: balance; }
.nowrap { white-space: nowrap; }

.hotels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 2.25rem 0 0; padding: 0; list-style: none; text-align: left; }
.hotel {
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.4rem 1.25rem;
  background: var(--paper-light);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(54, 51, 50, .04), 0 12px 32px -22px rgba(54, 51, 50, .18);
}
.hotel p { margin: 0; }
.hotel__name { margin: 0 0 .35rem; font: 500 1.45rem/1.2 var(--display); color: var(--ink); }
.hotel__where { font: italic 400 1.1rem/1.4 var(--display); color: var(--muted); }
.hotel__address { margin-top: .6rem !important; font-size: .9rem; color: var(--muted); }
.hotel__links { display: flex; gap: 1.1rem; margin-top: auto !important; padding-top: .9rem; font-size: .9rem; } /* pinned to the bottom so both cards line up */
.hotel__links a { display: inline-block; padding: .2rem 0; }

.stay__other { margin: 2.5rem auto 0; max-width: 30em; font-size: .95rem; line-height: 1.55; color: var(--muted); text-wrap: balance; }
.stay__other a { overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .hotels { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Page not found (404.html) ---------- */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 11rem);
  padding: 3rem 1.25rem;
  text-align: center;
}
@supports (height: 100svh) { .not-found { min-height: calc(100svh - 11rem); } }
.not-found__kicker { margin: 0 0 .6rem; font: 500 .75rem/1.4 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.not-found h1 { margin: 0; font: 500 clamp(2rem, 1.4rem + 3vw, 3rem)/1.1 var(--display); color: var(--ink); text-wrap: balance; }
.not-found__text { margin: .8rem auto 2rem; max-width: 24em; font: italic 400 clamp(1.15rem, 1rem + .6vw, 1.35rem)/1.45 var(--display); color: var(--muted); text-wrap: balance; }
.not-found .btn { text-decoration: none; }
.not-found__hint { margin: 1.5rem 0 0; font-size: .95rem; color: var(--muted); }

/* ---------- Phones ---------- */
@media (max-width: 480px) {
  .btn { width: 100%; } /* a full-width button is easier to hit with a thumb */
}
@media (max-width: 380px) {
  .reply { padding-left: .75rem; padding-right: .75rem; }
  .card { padding-left: 1rem; padding-right: 1rem; }
  .choices { gap: .45rem; }
  .choice span { padding-right: 1rem; padding-left: .85rem; }
  .choices--count { gap: .4rem; }
  .guest-name { grid-template-columns: 4.25rem minmax(0, 1fr); gap: .5rem; }
}
@media (max-width: 360px) {
  /* Keep Yes / Maybe / No on one row on the narrowest phones. */
  .choices:not(.choices--count) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
  .choices:not(.choices--count) .choice span { justify-content: center; width: 100%; gap: .4rem; padding: .5rem; font-size: 1rem; }
  .choices:not(.choices--count) .choice span::before { width: 13px; height: 13px; }
}
