/* Guest page layout. Colours, type, spacing and components come from the design system:
   tokens.css (generated) and components.css (copied from the design system). Use their tokens here. */

html { background: var(--ground); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
[hidden] { display: none !important; }
a { color: var(--rose-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 var(--space-3); }

.page { min-height: 100svh; overflow-x: clip; }
.page__main, .personal {
  display: flex; flex-direction: column; gap: var(--space-8);
}
.page__main { max-width: 34rem; margin: 0 auto; padding: var(--space-5) var(--space-5) 0; }

/* While loading, hide anything that depends on the phase or the invitation so nothing flashes:
   the photo and names stay hidden until the page knows whether the opening plays and whose names to show */
.is-loading [data-phase], .is-loading .hd-hero__actions,
.is-loading .hd-opening__frame, .is-loading .hd-hero__names { visibility: hidden; }

/* ---------- Hero ---------- */
.hero__photo { box-shadow: none; }
.hero .hd-hero__names { font-size: clamp(52px, 16vw, 96px); }
.hero__note { margin: 0 0 var(--space-2); white-space: pre-line; }
.hero__signoff { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.2; color: var(--ink-muted); margin: 0; }
.hero__aside { color: var(--ink-muted); font-size: 15px; margin: var(--space-4) 0 0; }

.hero__couple { margin: calc(-1 * var(--space-2)) 0 var(--space-4); padding: 0 var(--space-2); font-family: var(--font-display); font-weight: 300; font-size: 34px; line-height: 1.05; color: var(--ink); }
.hero__for { margin: 0 0 var(--space-3); color: var(--ink-muted); font-size: 16px; }

/* While the opening plays, the rest of the page waits and then fades in with the hero's text */
.is-opening .page__main > :not(.hero) { animation: hd-open-after 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.4s both; }
@media (prefers-reduced-motion: reduce) { .is-opening .page__main > :not(.hero) { animation: none; } }

/* Missing photo: keep the soft frame without a broken-image icon */
img.hd-photo.is-missing { content: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); }

/* ---------- Sections ---------- */
.section > .hd-heading { margin-bottom: var(--space-4); }
.photo-break { margin: 0; }

.facts { margin: 0 0 var(--space-5); display: grid; gap: var(--space-3); }
.facts > div { display: grid; grid-template-columns: 4.5rem 1fr; gap: var(--space-3); }
.facts dt { font-weight: 700; color: var(--sage-deep); }
.facts dd { margin: 0; }

.hd-panel .hd-tag + .hd-heading { margin-top: var(--space-3); }

/* ---------- Save the date ---------- */
.place > .hd-heading { margin-bottom: var(--space-3); }
.map { margin: var(--space-4) 0; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--sage-soft); }
.map iframe { display: block; width: 100%; height: 100%; border: 0; }
.place__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.place__getting-there { margin: var(--space-4) 0 0; color: var(--ink-muted); font-size: 16px; }

.tag-on-panel { background: var(--surface); }
/* The star on the night before and the room, and its footnote just below those cards */
.footnote-mark { color: var(--rose-deep); /* deeper on the lavender and sage cards, for 4.5:1 */ font-family: var(--font-text); font-weight: 700; font-size: 0.7em; vertical-align: super; line-height: 0; margin-left: 0.08em; }
.footnote { margin: calc(var(--space-4) - var(--space-8)) 0 0; padding: 0 var(--space-2); font-size: 14px; font-weight: 500; color: var(--ink-muted); }
.footnote__star { color: var(--rose); font-weight: 700; }
/* Save the date replies closed: answers stay visible but can't be changed */
.interest:disabled .hd-chip span { cursor: default; }
.interest:disabled .hd-chip input:not(:checked) + span { opacity: 0.55; }
.interest { margin-top: var(--space-4); }
.interest__question { padding: 0; margin-bottom: var(--space-3); font-size: 16px; font-weight: 600; }
.interest--stacked { flex-direction: column; align-items: flex-start; }
.saved-note { min-height: 1.45em; margin: var(--space-2) 0 0; font-size: 14px; font-weight: 500; color: var(--ink-muted); }
.saved-note.is-error { color: var(--rose-deep); font-weight: 600; }
.contribution { margin-top: var(--space-4); }
.contribution > p:first-child { margin-top: 0; }
.contribution .interest { margin-top: var(--space-3); }
.contribution__hint { margin: var(--space-2) 0 0; font-size: 14px; font-weight: 500; color: var(--ink-muted); }

.keep__state { position: relative; display: grid; gap: var(--space-3); }
.keep__state .hd-band__title, .keep__state .hd-band__text { margin: 0; }
.keep__state .hd-band__title:focus { outline: none; }
.keep__state .hd-field { margin-top: var(--space-2); }
.keep__state .hd-field__label { color: var(--on-colour); }
.keep__state > .hd-btn { justify-self: start; margin-top: var(--space-2); }
.keep__state > .hd-btn--block { justify-self: stretch; }
.keep__decline {
  justify-self: center; appearance: none; border: 0; background: transparent; cursor: pointer;
  min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-pill);
  font: inherit; font-size: 16px; font-weight: 600; color: var(--on-colour);
  text-decoration: underline; text-underline-offset: 0.2em;
}
.keep__decline:hover { text-decoration-thickness: 2px; }
.keep__decline[disabled], .keep__state .hd-btn[disabled] { opacity: 0.7; cursor: progress; }
.keep b { font-weight: 700; overflow-wrap: anywhere; }

/* ---------- Questions ---------- */
.faq { display: grid; gap: var(--space-2); }
.faq details { background: var(--surface); border-radius: var(--radius-md); padding: 0 var(--space-5); }
.faq summary {
  list-style: none; cursor: pointer; min-height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  font-weight: 650;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  border-right: 2px solid var(--sage-deep); border-bottom: 2px solid var(--sage-deep);
  transform: translateY(-3px) rotate(45deg); transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { padding-bottom: var(--space-4); margin: 0; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* ---------- Reply (inside the colour band) ---------- */
.reply { scroll-margin-top: var(--space-5); }
.reply:focus { outline: none; }
.reply__form, .reply__summary { position: relative; display: grid; gap: var(--space-3); }
.reply__people { display: grid; gap: var(--space-3); }
.reply__card {
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius-md); padding: var(--space-5) var(--space-4);
  display: grid; gap: var(--space-4);
}
.reply__card a { color: var(--rose-deep); }
.reply__name { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.05; color: var(--rose); }
.reply__question { padding: 0; margin-bottom: var(--space-2); font-size: 16px; font-weight: 600; }
.reply__error { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface); color: var(--rose-deep); font-weight: 600; }
.reply__send { margin-top: var(--space-3); min-height: 56px; font-size: 17px; }
.reply__sent { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 28px; line-height: 1.1; color: var(--rose); }
.reply__sent:focus { outline: none; }
.reply__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.reply__list li { padding-top: var(--space-2); border-top: 1px solid var(--line); }
.reply__list li:first-child { border-top: 0; padding-top: 0; }
.reply__list b { font-weight: 700; }
.reply__summary .hd-btn { justify-self: start; }

/* ---------- No code ---------- */
.code-form { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
#no-code .hd-field__label { font-size: 17px; }
.find__help { margin: calc(-1 * var(--space-2)) 0 0; font-size: 15px; }
.code-form .hd-btn { justify-self: start; }

/* ---------- Footer ---------- */
.footer { max-width: 34rem; margin: 0 auto; padding: var(--space-9) var(--space-5) var(--space-8); color: var(--ink-muted); font-size: 14px; text-align: center; }
.footer p { margin: 0; }
.footer .footer__contact { margin-bottom: var(--space-2); }

/* Larger screens: same single column, more air */
@media (min-width: 48rem) {
  .page__main { padding-top: var(--space-9); }
  .page__main, .personal { gap: var(--space-9); }
  .footnote { margin-top: calc(var(--space-4) - var(--space-9)); }
  .reply, .keep { padding: var(--space-8) var(--space-7); }
}
