/* Save the date: shared structure + one block per look (HANDOFF section 3).
   Colours are the 9 variables set inline on .std (from the colour set or the couple's own palette).
   Sizes respond to the page's own width (container queries), so the admin's phone-sized preview
   and a guest's real phone render the same. Desktop sizes start at 720px of page width. */

.std {
  container: std / inline-size;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
.std__in {
  --pad: 20px; --gap: 72px; --h1: 44px; --h2: 28px; --body: 16px; --small: 13px;
  --heading-font: Georgia, serif; --heading-weight: 400; --body-font: system-ui, sans-serif;
  --btn-radius: 0; --photo-radius: 0;
  font: 400 var(--body) / 1.55 var(--body-font);
  overflow-wrap: break-word;
}
.std h1, .std h2, .std p { margin: 0; }
.std h1, .std h2 { font-family: var(--heading-font); font-weight: var(--heading-weight); line-height: 1.05; }
.std em { font-style: italic; }

/* Header */
.std-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px var(--pad); font-size: var(--small);
}
.std-header__names { font-family: var(--heading-font); font-size: 1.15rem; color: var(--accent-text); }
.std-header__langs { white-space: nowrap; margin: 0; }
.std-header__langs [aria-current] { text-decoration: underline; text-underline-offset: 3px; }
.std-lang {
  min-height: 44px; padding: 0 2px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}

/* The guest page: the whole window is the page */
.std-guest { margin: 0; min-height: 100vh; }
.std-guest .std { min-height: 100vh; }
.std-foot { padding: 24px var(--pad) 40px; font-size: var(--small); text-align: center; }
.std-foot button {
  min-height: 44px; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer;
}

/* Photos: always cropped by the focal point (object-position), never by a crop tool */
.std-photo {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: var(--photo-radius);
  background: color-mix(in srgb, var(--ink) 22%, var(--bg));
}
.std-photo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.std-photo__empty {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center;
  font: 600 var(--small) / 1.3 var(--body-font); color: var(--ink);
}
.std-photo--framed { aspect-ratio: 4 / 5; outline: 1px solid var(--accent); outline-offset: 8px; margin: 8px; }

/* Buttons */
.std-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: var(--btn-radius); background: var(--btn); color: var(--btn-ink);
  font: 600 var(--body) / 1 var(--body-font); text-decoration: none;
}
.std--btn-outline .std-btn { box-shadow: inset 0 0 0 1px var(--ink); }

/* Hero */
.std-hero__media { position: relative; }
.std-hero { background: var(--hero); color: var(--hero-ink); }
.std-hero__names { font-family: var(--heading-font); font-weight: var(--heading-weight); line-height: 1.05; font-size: var(--h1); }
.std-hero__when { margin-top: 12px; }
.std-hero__strip { padding: 20px var(--pad) 28px; }
.std-hero--type { padding: 8px var(--pad) var(--gap); }
.std-hero--split { padding: 0 var(--pad) 8px; background: var(--bg); color: var(--ink); }
.std-hero__card { margin-top: 12px; padding: 24px; background: var(--hero); color: var(--hero-ink); border-radius: var(--photo-radius); }
.std-hero__eyebrow { font-weight: 600; margin-bottom: 8px; }

/* Message */
.std-message { padding: var(--gap) var(--pad); text-align: center; }
.std-message__in { max-width: 34em; margin: 0 auto; }
.std-message__greeting { font: var(--heading-weight) var(--h2) / 1.15 var(--heading-font); margin-bottom: 20px; }
.std-message__text { text-wrap: pretty; }
.std-message__signature { margin-top: 24px; font: var(--heading-weight) calc(var(--h2) * .8) / 1.2 var(--heading-font); color: var(--accent-text); }

/* Invitation to follow (layout B: band) */
.std-invite { padding: calc(var(--gap) * .75) var(--pad); background: var(--band); color: var(--band-ink); text-align: center; }
.std-invite__in { max-width: 34em; margin: 0 auto; display: grid; gap: 14px; justify-items: center; }
.std-invite__heading { font-size: var(--h2); }
/* On the band, buttons swap to the band's own pair so they always read (the band is often the button colour). */
.std-invite .std-btn { background: var(--band-ink); color: var(--band); box-shadow: none; }

/* Message layouts: B letter + photo, C card */
.std-message__photo { max-width: 34em; margin: 0 auto 28px; }
.std-message--C .std-message__in { padding: 32px 24px; background: var(--band); color: var(--band-ink); border-radius: var(--photo-radius); }
.std-message--C .std-message__signature { color: inherit; }
.std-invite--line { padding: calc(var(--gap) * .5) var(--pad); }
.std-invite--line p { max-width: 40em; margin: 0 auto; }
.std-invite--line .std-invite__heading { font-size: inherit; font-family: var(--heading-font); }

/* Countdown: A big number, B one sentence */
/* Who's coming? (kalas-save-the-date-flow-and-motion.md §3). Same HTML in every look; chips are real
   radio inputs inside labels. Selected = :has(:checked), no script. Radius follows the look's buttons. */
.std-interest { padding: calc(var(--gap) * .6) var(--pad); text-align: center; }
.std-interest__h { font-size: var(--h2); }
.std .std-interest__line { margin-top: 8px; font-size: var(--small); text-wrap: pretty; }
.std .std-interest__preview { margin-top: 12px; font-size: var(--small); font-weight: 600; }
.std-interest__form { max-width: 30rem; margin: 24px auto 0; text-align: start; }
.std-interest__person { margin: 0 0 16px; padding: 0; border: 0; }
.std-interest__person legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.std-interest__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.std-chip {
  position: relative; flex: 1 1 auto; display: grid; place-items: center; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--accent); border-radius: var(--btn-radius); color: var(--ink);
  font-size: var(--small); font-weight: 600; text-align: center; cursor: pointer;
}
.std-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.std-chip:has(input:checked) { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.std-chip:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .std-chip { transition: background-color 150ms ease-out, color 150ms ease-out; } }
.std-interest__more { display: grid; gap: 14px; margin-top: 8px; }
.std-interest__field { display: grid; gap: 6px; font-size: var(--small); font-weight: 600; }
.std-interest__field input, .std-interest__field textarea {
  box-sizing: border-box; width: 100%; min-height: 48px; padding: 10px 12px; border-radius: min(var(--btn-radius), 12px);
  border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); background: var(--bg); color: var(--ink);
  font: 400 16px / 1.4 var(--body-font);
}
.std-interest__field [aria-invalid="true"] { border: 2px solid var(--ink); }
.std .std-interest__error { display: block; margin-top: 12px; font-size: var(--small); font-weight: 600; }
.std-interest__send { box-sizing: border-box; width: 100%; margin-top: 16px; border: 0; cursor: pointer; }
.std-interest__summary { margin: 16px auto 0; padding: 0; list-style: none; max-width: 30rem; }
.std-interest__summary li { padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.std-interest__summary li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.std-interest__change {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; color: inherit;
  text-decoration: underline; text-underline-offset: 3px;
}
.std-interest__h:focus { outline: none; }
/* Help us plan (§3A): shown once someone might come; follow-ups appear with their answer. No JS. */
.std-interest__plan { margin: 8px 0 24px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.std-interest__h3 { font-size: var(--body); font-weight: 600; text-align: center; }
.std-interest__plan > .std-interest__line { text-align: center; margin-bottom: 8px; }
.std-interest__q { margin: 20px 0 0; padding: 0; border: 0; display: grid; gap: 10px; }
.std .std-interest__ask { padding: 0; margin: 0 0 2px; font-weight: 600; }
.std-interest__row { margin: 0; padding: 0; border: 0; }
.std-interest__row legend, .std-interest__follow legend { padding: 0; margin-bottom: 6px; font-size: var(--small); }
.std-interest__follow { margin: 0; padding: 0; border: 0; }
.std-interest__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 10px; }
.std-interest__field select {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; font-weight: 400;
  color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 0;
}
.std-interest__tick { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: var(--small); }
.std-interest__tick input { width: 20px; height: 20px; margin: 0; accent-color: var(--btn); }
.std .std-interest__small { margin: 0; font-size: var(--small); opacity: .8; }
@supports selector(:has(*)) {
  .std-interest__plan, .std-interest__follow { display: none; }
  .std-interest__form:has(input[name^="p_"][value="yes"]:checked, input[name^="p_"][value="maybe"]:checked) .std-interest__plan { display: block; }
  .std-interest__form:has(input[name="travel_mode"][value="fly"]:checked) .if-fly,
  .std-interest__form:has(input[name="help"][value="other"]:checked) .if-help-other,
  .std-interest__form:has(input[name^="p_"][value="maybe"]:checked) .if-maybe { display: grid; }
  .std-interest__form:has(input[name="stay"][value="hotel"]:checked) .if-hotel { display: grid; }
  @media (prefers-reduced-motion: no-preference) {
    .std-interest__plan, .std-interest__follow { transition: opacity 150ms ease-out; }
    @starting-style { .std-interest__plan, .std-interest__follow { opacity: 0; } }
  }
}

.std-countdown { padding: calc(var(--gap) * .6) var(--pad); text-align: center; }
.std-countdown__n { font: var(--heading-weight) calc(var(--h1) * 1.6) / 1 var(--heading-font); color: var(--accent-text); }
.std-countdown__label { margin-top: 6px; }
.std-countdown--B p { font: var(--heading-weight) var(--h2) / 1.2 var(--heading-font); }

/* Photo sections: A full width, B pair, C framed */
.std-photos { padding: calc(var(--gap) * .5) var(--pad); }
.std-photos__pair { display: grid; gap: 12px; }
.std-photos--C .std-photo { max-width: 28em; margin-inline: auto; }
.std-photos__caption { margin-top: 12px; text-align: center; font-size: var(--small); }

/* Dividers (the couple picks one per page; Kalas places them). They sit at the foot of the section
   above, so they take its background; the negative margin pulls them into the gap. */
.std-divider {
  display: flex; align-items: center; gap: 20px; box-sizing: border-box; width: min(100%, 720px);
  margin: calc(var(--gap) * -.35) auto 0; padding: 0 var(--pad) calc(var(--gap) * .35); color: var(--accent);
}
.std-divider--line::before, .std-divider--ornament::before, .std-divider--ornament::after {
  content: ""; flex: 1; height: 1px; background: currentColor; opacity: .55;
}
.std-divider__art { display: block; height: 36px; flex: none; background: var(--d) center / contain no-repeat; }
.std-divider--strip .std-divider__art { flex: 1; height: auto; max-height: 56px; }
.std-divider__art--mask {
  background: currentColor; -webkit-mask: var(--d) center / contain no-repeat; mask: var(--d) center / contain no-repeat;
}

/* The Illustration block: one picture, shown whole, centred. Wide pictures get more room. */
.std-illus { padding: calc(var(--gap) * .5) var(--pad); }
.std-illustration { box-sizing: border-box; width: min(100%, 360px); margin-inline: auto; }
.std-illustration--wide { width: min(100%, 720px); }
.std-illustration__art { display: block; width: 100%; height: auto; }
/* Line art that takes the palette: a mask filled with the accent (the ratio comes inline). */
.std-illustration__art--mask {
  background-color: var(--accent); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
/* An empty block, in the builder's preview only. */
.std-illustration--empty {
  aspect-ratio: 1; display: grid; place-items: center; padding: 1rem; text-align: center;
  border: 2px dashed var(--accent); color: var(--accent-text); font: 600 var(--small) / 1.3 var(--body-font);
}

@container std (min-width: 720px) {
  .std__in { --pad: 48px; }
  .std-hero--split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; padding-bottom: 24px; }
  .std-hero--split .std-hero__card { margin-top: 0; padding: 40px; }
  .std-photo--bleed { aspect-ratio: 16 / 9; }
  .std-photo--full { aspect-ratio: 3 / 2; }
  /* A portrait photo in a wide slot stays 4:5, centred, instead of losing its top and bottom. */
  .std-photo--portrait:is(.std-photo--full, .std-photo--wide) { aspect-ratio: 4 / 5; width: min(100%, 560px); margin-inline: auto; }
  .std-photos__pair { grid-template-columns: 1fr 1fr; }
  .std-message--B { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 40px; align-items: center; text-align: left; }
  .std-message--B .std-message__photo { margin: 0; }
}

/* Decorations on photos (HANDOFF 3b). Black-on-transparent art is a mask filled with a palette
   colour, so it follows the couple's colours, grit included. Sizes are shares of the photo width. */
.std-deco { position: absolute; inset: 0; pointer-events: none; container-type: size; }
.std-deco__piece, .std-deco__c, .std-deco__e, .std-deco__top, .std-deco__texture {
  position: absolute; display: block; background-color: var(--deco-colour, var(--accent));
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.std-deco__piece {
  -webkit-mask-image: var(--m); mask-image: var(--m);
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center;
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg)) scaleX(var(--flip, 1));
}
img.std-deco__piece { background: none; object-fit: contain; }
/* Art that isn't pure black is shown as drawn; "White" inverts it (drawn in black, so it turns white). */
img.std-deco__piece--invert { filter: invert(1); }
.std-deco__piece--s1 { left: 5%; top: 5%; }
.std-deco__piece--s2 { left: 50%; top: 5%; --tx: -50%; }
.std-deco__piece--s3 { right: 5%; top: 5%; }
.std-deco__piece--s4 { left: 5%; top: 50%; --ty: -50%; }
.std-deco__piece--s5 { left: 50%; top: 50%; --tx: -50%; --ty: -50%; }
.std-deco__piece--s6 { right: 5%; top: 50%; --ty: -50%; }
.std-deco__piece--s7 { left: 5%; bottom: 5%; }
.std-deco__piece--s8 { left: 50%; bottom: 5%; --tx: -50%; }
.std-deco__piece--s9 { right: 5%; bottom: 5%; }

/* Frame: four corners and four repeating edges, drawn at the corner's scale. */
.std-deco__frame { position: absolute; inset: 4cqmin; --c: 20cqmin; }
.std-deco__c {
  width: var(--c); height: var(--c);
  -webkit-mask-image: var(--m-corner); mask-image: var(--m-corner); -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
.std-deco__c--tl { top: 0; left: 0; }
.std-deco__c--tr { top: 0; right: 0; transform: scaleX(-1); }
.std-deco__c--bl { bottom: 0; left: 0; transform: scaleY(-1); }
.std-deco__c--br { bottom: 0; right: 0; transform: scale(-1, -1); }
.std-deco__e--t, .std-deco__e--b {
  left: var(--c); right: var(--c); height: calc(var(--c) * var(--edge));
  -webkit-mask-image: var(--m-edge); mask-image: var(--m-edge);
  -webkit-mask-size: auto 100%; mask-size: auto 100%; -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
}
.std-deco__e--t { top: 0; }
.std-deco__e--b { bottom: 0; transform: scaleY(-1); }
.std-deco__e--l, .std-deco__e--r {
  top: var(--c); bottom: var(--c); width: calc(var(--c) * var(--edge));
  -webkit-mask-image: var(--m-edge-v); mask-image: var(--m-edge-v);
  -webkit-mask-size: 100% auto; mask-size: 100% auto; -webkit-mask-repeat: repeat-y; mask-repeat: repeat-y;
}
.std-deco__e--l { left: 0; }
.std-deco__e--r { right: 0; transform: scaleX(-1); }
/* A strip along the top (Beach Club's awning). */
.std-deco__top {
  top: 0; left: 0; right: 0; height: 11cqw;
  -webkit-mask-image: var(--m); mask-image: var(--m);
  -webkit-mask-size: auto 100%; mask-size: auto 100%; -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
}
/* Texture over the whole photo. */
.std-deco__texture {
  inset: 0; background-color: var(--ink); opacity: .28; mix-blend-mode: multiply;
  -webkit-mask-image: var(--m); mask-image: var(--m); -webkit-mask-size: 30cqw; mask-size: 30cqw;
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
}

/* The artist's credit for Studio decorations (not on Pro weddings). */
.std-credit { margin: 0; padding: 1.5rem 1rem 2rem; text-align: center; font-size: .8rem; opacity: .7; }
.std-powered { margin: 0; padding: 1rem 1rem 1.5rem; text-align: center; font-size: .8rem; }
.std-powered a { color: inherit; opacity: .7; text-decoration: underline; text-underline-offset: .2em; }
.std-powered a:hover, .std-powered a:focus-visible { opacity: 1; }

/* --- The door: the code page, "on its way" and an expired link, in the page's look ------- */
.std-door { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.std-door__main { flex: 1; display: grid; place-items: center; padding: 24px var(--pad) 56px; }
.std-door__card { width: 100%; max-width: 26rem; text-align: center; }
.std-door__eyebrow {
  font-size: var(--small); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-text);
}
.std .std-door__names { margin-top: 12px; font-size: var(--h1); text-wrap: balance; }
.std-door__card > .std-door__names:first-child { margin-top: 0; font-size: var(--h2); }
.std-door__rule { display: block; width: 48px; height: 1px; margin: 24px auto; background: var(--accent); }
.std-door__lead { text-wrap: pretty; }
.std-door__form { margin-top: 32px; }
.std-door__label { display: block; font-size: var(--small); font-weight: 600; }
.std-door__code {
  display: block; box-sizing: border-box; width: 100%; min-height: 56px; margin-top: 8px; padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); border-radius: var(--btn-radius);
  background: var(--bg); color: var(--ink); font: 600 24px / 1 var(--body-font);
  letter-spacing: .2em; text-align: center; text-transform: uppercase;
}
.std-door__code::placeholder { color: color-mix(in srgb, var(--ink) 30%, transparent); }
.std-door__code:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.std-door__code[aria-invalid="true"] { border-color: var(--ink); border-width: 2px; }
.std .std-door__problem { margin-top: 10px; font-size: var(--small); font-weight: 600; }
.std-door__btn { box-sizing: border-box; width: 100%; margin-top: 12px; border: 0; cursor: pointer; }
.std-door__card > .std-door__btn { margin-top: 8px; }
.std .std-door__help { margin-top: 24px; font-size: var(--small); }
.std .std-door__when {
  margin-top: 8px; font-size: var(--small); font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent-text);
}
.std .std-door__title { font-size: var(--h3, 1.25rem); margin-bottom: 8px; }
.std .std-door__hint { margin-top: 8px; font-size: var(--small); color: color-mix(in srgb, var(--ink) 75%, transparent); }
.std-door__code:disabled, .std-door__btn:disabled { opacity: .5; cursor: not-allowed; }
.std-door__help summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.std-door__help summary::-webkit-details-marker { display: none; }
.std-door__help summary { list-style: none; }
.std .std-door__help p { margin-top: 8px; }
/* "You're now viewing the page for …": one line, this view only (§2.2). */
.std .std-notice { padding: 10px var(--pad); font-size: var(--small); text-align: center; background: var(--band); color: var(--band-ink); }

/* The guest's postal address form (Paper & post) */
.std-address { display: grid; gap: 14px; text-align: start; }
.std-address select, .std-address input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; font-weight: 400; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 0; }

/* Section tones (looks.json "tones"): a look alternates its sections' backgrounds in visible order.
   "bg" is the page colour; "band" uses the band pair. Accent text falls back to ink on the band, since
   --accent-text was checked against --bg only. */
.std-tone--band { background: var(--band); color: var(--band-ink); --accent-text: var(--band-ink); }
