/* Lucie & Daniel – v0.16. Tokens first, then the shared .frame, then sections, then breakpoints. */
:root {
  color-scheme: only light; /* the paper design has no dark variant, Chrome must not auto-darken it */
  --page-bg: #c8ae8c;
  --paper: #f5eee3;
  --ink: #4e3f33;
  --ink-soft: #6f6256;
  --ink-muted: #8a7e72;
  --line: rgba(110, 88, 66, .28);
  --olive: #62694c;
  --olive-dark: #545c41;
  --wine: #5e2a33;
  --wine-ink: #f3e7da;
  --terra: #934128;

  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --script: 'Pinyon Script', 'Segoe Script', cursive;

  --w: min(1180px, 100%);
  --title: clamp(21px, 2.4vw, 30px);
  --body: clamp(17px, 1.5vw, 20px);

  --kraft: #d6bf9f;
  /* torn paper edges, drawn at ~0.8 of their native height so they stay sharp */
  --edge-top: 88px;
  --edge-bottom: 90px;
  /* sections below another one: a tear without kraft (paper-tear.webp) laid over the previous section's kraft */
  --tear: 81px;
  --tear-overlap: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page-bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--body);
  line-height: 1.5;
  color: var(--ink);
  background: radial-gradient(circle at 50% 8%, #decbb1 0, #c3a27d 60%, #b99570 100%) fixed, var(--page-bg);
}
img { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.page {
  width: var(--w);
  margin: 0 auto;
  display: grid;
  background: var(--kraft);
  box-shadow: 0 0 42px rgba(53, 38, 26, .22);
}

/* ---------- shared frame: kraft + torn cream card + side florals ----------
   Every section has its own transparent floral strip per side (--fl/--fr, see "florals per section"), so no
   bouquet repeats down the page. Strips keep their aspect at --fh of the section height, shifted down by --fy
   (50% = centred); per side --flh/--frh, --fly/--fry override them and --flx/--frx push a strip past the edge.
   Extra garland pieces (--fl2/--fr2 tucked 70px under the top strip, --fl3/--fr3 at the bottom, heights --gh2/--gh3)
   fill tall tablet sections. The paper is sliced so the torn edges keep
   their shape: top/bottom edges are one unmirrored piece stretched to the section width at a fixed height
   (no visible repeat), the middle tile repeats along y.
   Florals and the top edge are drawn from the border box, the paper only from the padding box, so a
   transparent top border (see the overlap rule below) stays free for kraft. */
.frame {
  --fl: none;
  --fr: none;
  --fh: 100%;
  --fy: 0px;
  --flh: var(--fh);
  --frh: var(--fh);
  --fly: var(--fy);
  --fry: var(--fy);
  /* -1px: strip widths come from the height, rounding could otherwise leave a 1px line of paper at the edge */
  --flx: -1px;
  --frx: -1px;
  --gx: -1px;
  --fl2: none;
  --fr2: none;
  --fl3: none;
  --fr3: none;
  --gh2: 0px;
  --gh3: 0px;
  --inset: clamp(70px, 13%, 170px);
  --top-edge: url('assets/paper-top.webp') center top / 100% var(--edge-top) no-repeat border-box;
  position: relative;
  isolation: isolate;
  /* vertical minimums keep content clear of the fixed-height torn edges */
  padding: clamp(60px, 6vw, 80px) var(--inset) clamp(76px, 6vw, 80px);
  background:
    var(--fl) left var(--flx) top var(--fly) / auto var(--flh) no-repeat border-box,
    var(--fr) right var(--frx) top var(--fry) / auto var(--frh) no-repeat border-box,
    var(--fl2) left var(--gx) top calc(var(--fh) - 70px) / auto var(--gh2) no-repeat border-box,
    var(--fr2) right var(--gx) top calc(var(--fh) - 70px) / auto var(--gh2) no-repeat border-box,
    var(--fl3) left var(--gx) bottom 0 / auto var(--gh3) no-repeat border-box,
    var(--fr3) right var(--gx) bottom 0 / auto var(--gh3) no-repeat border-box,
    var(--top-edge),
    url('assets/paper-bottom.webp') center bottom / 100% var(--edge-bottom) no-repeat,
    url('assets/paper-middle.webp') center top / 100% auto repeat-y padding-box var(--kraft);
}
.frame--b { --inset: clamp(90px, 17%, 220px); }
.frame--c { --inset: clamp(60px, 10%, 130px); }
/* tall sections: the bouquet stays at the top at a capped height, the rest is plain paper */
.frame--tall { --inset: clamp(70px, 12%, 150px); --fh: min(100%, 760px); }

/* florals per section: bouquets on the big sections, slim sprigs on the short ones */
/* hero: one bouquet on the left like the inspiration, nothing on the right next to the photo; it starts on the
   paper below the torn top edge instead of on the kraft */
.hero__card { --fl: url('assets/flowers-hero-left.webp'); --fh: 92%; --fy: 50%; }
.practical { --fl: url('assets/flowers-practical-left.webp'); --fr: url('assets/flowers-practical-right.webp'); }
.friday { --fl: url('assets/flowers-friday-left.webp'); --fr: url('assets/flowers-friday-right.webp'); }
.program { --fl: url('assets/flowers-program-left.webp'); --fr: url('assets/flowers-program-right.webp'); }
.sunday { --fl: url('assets/flowers-sunday-left.webp'); --fr: url('assets/flowers-sunday-right.webp'); }
.dress { --fl: url('assets/flowers-dress-left.webp'); --fr: url('assets/flowers-dress-right.webp'); }
.accommodation { --fl: url('assets/flowers-accommodation-left.webp'); --fr: url('assets/flowers-accommodation-right.webp'); }
.missions { --fl: url('assets/flowers-missions-left.webp'); --fr: url('assets/flowers-missions-right.webp'); }
.adults { --fl: url('assets/flowers-adults-left.webp'); --fr: url('assets/flowers-adults-right.webp'); }
.gifts { --fl: url('assets/flowers-gifts-left.webp'); --fr: url('assets/flowers-gifts-right.webp'); }
.rsvp { --fl: url('assets/flowers-rsvp-left.webp'); --fr: url('assets/flowers-rsvp-right.webp'); }

/* kraft tags as small accents hanging over a corner (desktop + tablet); they only overlap padding, never text */
@media (min-width: 701px) {
  .practical__map, #rsvp-form { position: relative; }
  .practical__map::before, #rsvp-form::before {
    content: "";
    position: absolute;
    z-index: 1;
    pointer-events: none;
    background: center / contain no-repeat;
    filter: drop-shadow(0 3px 4px rgba(60, 40, 22, .22));
  }
  .practical__map::before { top: -34px; left: -44px; width: 96px; aspect-ratio: 420 / 379; background-image: url('assets/tag-2.webp'); transform: rotate(-14deg); }
  #rsvp-form::before { top: -76px; right: 36px; width: 112px; aspect-ratio: 420 / 381; background-image: url('assets/tag-1.webp'); transform: rotate(9deg); }
}

.title {
  margin: 0;
  font-weight: 500;
  font-size: var(--title);
  line-height: 1.2;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
}
.divider {
  width: min(260px, 70%);
  height: 14px;
  margin: 12px auto 22px;
  background:
    linear-gradient(var(--line), var(--line)) left center / calc(50% - 16px) 1px no-repeat,
    linear-gradient(var(--line), var(--line)) right center / calc(50% - 16px) 1px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6256' stroke-width='2'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.lead { margin: 0 auto 8px; text-align: center; color: var(--ink-soft); }
.script { font-family: var(--script); font-weight: 400; }

.btn, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .15s, border-color .15s;
}
.btn { border: 0; background: var(--olive); color: #fffaf2; box-shadow: 0 3px 7px rgba(66, 62, 45, .14); }
.btn:hover:not(:disabled) { background: var(--olive-dark); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-outline { border: 1px solid rgba(110, 88, 66, .35); background: rgba(255, 252, 246, .55); color: var(--ink); }
.btn-outline:hover { border-color: rgba(110, 88, 66, .6); background: rgba(255, 252, 246, .85); }
.link-btn { border: 0; background: none; padding: 6px 2px; font-size: 15px; color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  --card-w: min(630px, 54%);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: clamp(380px, 40vw, 520px);
  background: var(--kraft);
}
/* the photo starts just under the card's edge instead of 40% in: a narrower box crops a portrait photo less.
   Left and right edges stay sharp; top and bottom end in the same torn paper edge as the card next to it */
.hero__photo {
  margin: 0;
  position: absolute;
  inset: 0 0 0 calc(var(--card-w) - 20px);
  overflow: hidden;
}
/* kraft + torn rim cut out of paper-top/bottom.webp (the paper part is transparent), sized like the card's edges
   so the tears sit at the same height */
.hero__photo::before, .hero__photo::after { content: ""; position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; }
.hero__photo::before { top: 0; height: var(--edge-top); background: url('assets/photo-edge-top.webp') center top / 100% 100% no-repeat; }
.hero__photo::after { bottom: 0; height: var(--edge-bottom); background: url('assets/photo-edge-bottom.webp') center bottom / 100% 100% no-repeat; }
/* a touch warmer so the summer greens sit with the autumn palette */
.hero__photo img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.12) saturate(.92); }
.hero__card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: var(--card-w);
  padding: clamp(40px, 5vw, 64px) clamp(20px, 3vw, 44px) clamp(40px, 5vw, 64px) clamp(130px, 15vw, 200px);
  text-align: center;
  filter: drop-shadow(8px 0 14px rgba(60, 40, 22, .25));
}
/* desktop: the bouquet is big, the text moves right (the card is a bit wider so the names stay on one line) */
@media (min-width: 1001px) {
  .hero { --card-w: min(660px, 56%); }
  .hero__card { padding-left: clamp(160px, 18vw, 245px); padding-right: clamp(16px, 2vw, 28px); }
}
.hero__kicker { margin: 0 0 10px; font-size: clamp(13px, 1.1vw, 15px); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); line-height: 1.7; }
.hero__names { margin: 0; font-weight: 400; font-size: clamp(38px, 5vw, 64px); line-height: 1.1; color: var(--ink); }
.hero__card .divider { margin: 16px auto 14px; }
.hero__date { margin: 0; font-size: clamp(21px, 2vw, 27px); letter-spacing: .04em; }
.hero__place { margin: 4px 0 0; font-size: clamp(17px, 1.4vw, 20px); letter-spacing: .08em; color: var(--ink-soft); }
.hero__kicker:empty { display: none; }

/* ---------- practical ---------- */
.practical { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.practical .title { letter-spacing: .14em; }
.practical__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.practical__list li { display: grid; grid-template-columns: 52px 1fr; gap: 18px; align-items: start; }
.practical__icon { display: grid; place-items: center; height: 52px; border-right: 1px solid var(--line); }
.practical__icon svg { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.practical__list h3 { margin: 0; font-size: 1.15em; font-weight: 500; }
.practical__list p { margin: 2px 0 0; color: var(--ink-soft); line-height: 1.4; }
.map-frame { aspect-ratio: 4 / 3; padding: 8px; background: rgba(255, 252, 246, .7); border: 1px solid rgba(110, 88, 66, .18); box-shadow: 0 4px 14px rgba(75, 54, 34, .08); }
.map-frame iframe { display: block; width: 100%; height: 100%; border: 0; color-scheme: only light; } /* attempt to keep Chrome from auto-darkening the map too */
.map-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
/* desktop: slim sprigs left, big bouquet right fading out towards the map and running under it; the map gets the
   wider column and grows into the gap next to the list, no tag on it, slightly lower buttons */
@media (min-width: 1001px) {
  .practical {
    --fr: url('assets/flowers-practical-right-fade.webp');
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    padding-left: calc(var(--inset) - clamp(0px, 3vw, 40px));
    padding-right: calc(var(--inset) - clamp(10px, 3vw, 40px));
  }
  .practical__map { margin: 0 0 0 calc(-1 * clamp(0px, 5vw, 70px)); }
  .practical__map::before { content: none; }
  .map-links .btn-outline { min-height: 38px; padding: 6px 16px; }
}

/* ---------- friday / sunday ---------- */
.day { display: grid; grid-template-columns: minmax(0, 1fr) clamp(160px, 24vw, 300px); gap: clamp(20px, 3vw, 40px); align-items: center; }
.day__text { max-width: 640px; }
@media (min-width: 701px) and (max-width: 1000px) {
  .day__text { padding-left: clamp(20px, 4vw, 36px); }
}
.day .title, .day .divider { text-align: left; margin-left: 0; }
.day .divider { margin-top: 10px; margin-bottom: 14px; width: 180px; }
.day__text p { margin: 0; }
.day__art { width: 100%; max-height: 210px; object-fit: contain; mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent); mask-image: radial-gradient(closest-side, #000 72%, transparent); }
.day__art[src*='friday'] { -webkit-mask-image: none; mask-image: none; }

/* ---------- saturday timeline ---------- */
.timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  /* --n = number of points, set by app.js; the line runs from the first dot to the last one */
  grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
  position: relative;
}
.timeline::before { content: ""; position: absolute; left: calc(100% / (2 * var(--n, 6))); right: calc(100% / (2 * var(--n, 6))); top: 74px; height: 1.5px; background: var(--ink-soft); opacity: .7; }
.timeline li { display: grid; justify-items: center; text-align: center; grid-template-rows: 56px 36px auto auto; }
.timeline img { width: 48px; height: 48px; align-self: end; opacity: .9; }
.timeline__dot { width: 13px; height: 13px; margin-top: 12px; border-radius: 50%; background: var(--ink); position: relative; }
.timeline time { font-size: 1.15em; letter-spacing: .04em; white-space: nowrap; }
.timeline p { margin: 4px 0 0; color: var(--ink-soft); line-height: 1.35; }
.program__note { margin: 28px 0 0; text-align: center; font-style: italic; color: var(--ink-soft); }
.program__note:empty { display: none; }

/* ---------- dress code + accommodation ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.split .frame { --inset: clamp(80px, 18%, 120px); }
/* one row of equal columns for any number of colours (content.js) */
.swatches { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; text-align: center; font-size: .92em; color: var(--ink-soft); }
/* two-word labels wrap between the words instead of running into the neighbours */
.swatches li { display: flex; flex-direction: column; align-items: center; line-height: 1.25; text-wrap: balance; overflow-wrap: normal; }
.swatch { display: block; width: min(100%, 70px); aspect-ratio: 1; margin: 0 auto 8px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 0 0 3px rgba(255, 252, 246, .85), 0 3px 8px rgba(75, 54, 34, .18); }
/* the left floral reaches further into the paper than the right one */
.accommodation { padding-left: calc(var(--inset) + 10px); padding-right: var(--inset); }
/* desktop: no florals between dress code and accommodation, only a thin line like between the two items in
   "Důležité"; the inner paddings shrink accordingly */
@media (min-width: 1001px) {
  .dress { --fr: none; padding-right: clamp(28px, 3vw, 44px); }
  .accommodation { --fl: none; padding-left: clamp(28px, 3vw, 44px); }
  .accommodation::before { content: ""; position: absolute; left: 0; top: clamp(70px, 24%, 110px); bottom: clamp(80px, 26%, 120px); border-left: 1px solid var(--line); }
}
.accommodation p { margin: 0 auto; max-width: 290px; text-align: center; }

/* ---------- gifts ---------- */
.gifts p { margin: 0 auto; max-width: 640px; text-align: center; }
.gifts strong { font-weight: 600; }

/* ---------- missions ---------- */
.missions__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 2vw, 28px); }
.mission { display: grid; grid-template-columns: clamp(100px, 11vw, 150px) 1fr; gap: 16px; align-items: center; }
.mission img { width: 100%; height: auto; }
.mission h3 { margin: 0 0 6px; font-weight: 500; font-size: 1.35em; }
.mission p { margin: 0; color: var(--ink-soft); line-height: 1.45; }
/* desktop: both headings start at the same height; the left bouquet reaches past the edge, so the grid starts
   further left and the mission pictures get bigger */
@media (min-width: 1001px) {
  .missions { --flx: calc(-1 * clamp(30px, 4vw, 55px)); padding-left: calc(var(--inset) - clamp(20px, 3vw, 45px)); }
  .missions__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin: 0; }
  .mission { grid-template-columns: clamp(120px, 13vw, 165px) minmax(0, 1fr); align-items: start; }
  .mission img { align-self: center; }
}

/* ---------- adults ---------- */
.adults { padding-top: clamp(58px, 5vw, 62px); padding-bottom: 76px; }
.adults__grid { display: grid; grid-template-columns: 1fr 1fr; }
.adults__item { display: grid; grid-template-columns: 64px 1fr; gap: 20px; align-items: center; padding: 0 clamp(16px, 3vw, 40px); }
.adults__item + .adults__item { border-left: 1px solid var(--line); }
.adults__icon svg { width: 56px; height: 56px; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.adults__item h3 { margin: 0 0 4px; font-weight: 500; font-size: 1.05em; letter-spacing: .2em; text-transform: uppercase; }
.adults__item p { margin: 0; color: var(--ink-soft); line-height: 1.4; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- RSVP + landscape ---------- */
/* RSVP has no torn bottom edge: its paper runs straight into the landscape, which lies on the same paper.
   The tile is anchored to the RSVP bottom and the landscape top, so the texture continues without a seam. */
.rsvp {
  padding-bottom: clamp(40px, 4vw, 56px);
  background:
    var(--fl) left var(--flx) top var(--fly) / auto var(--flh) no-repeat border-box,
    var(--fr) right var(--frx) top var(--fry) / auto var(--frh) no-repeat border-box,
    var(--top-edge),
    url('assets/paper-middle.webp') center bottom / 100% auto repeat-y padding-box var(--kraft);
}
.landscape { position: relative; background: url('assets/paper-middle.webp') center top / 100% auto repeat-y var(--kraft); }
/* the landscape closes the page right after RSVP; its top dissolves into the paper below the form */
.landscape img { display: block; width: 100%; height: auto; -webkit-mask-image: linear-gradient(transparent, #000 26%); mask-image: linear-gradient(transparent, #000 26%); }
.landscape__text { position: absolute; z-index: 1; left: 0; right: 0; top: 6%; margin: 0; text-align: center; font-size: clamp(14px, 1.5vw, 19px); letter-spacing: .06em; color: var(--ink); }
.landscape__text .dot { margin: 0 .4em; opacity: .6; }

.rsvp { text-align: left; }
.rsvp__deadline { margin: 0 0 24px; text-align: center; font-style: italic; color: var(--ink-muted); }
#rsvp-form { max-width: 820px; margin: 0 auto; padding: clamp(18px, 3vw, 32px); background: rgba(250, 245, 236, .9); border: 1px solid rgba(137, 118, 96, .16); box-shadow: 0 8px 22px rgba(83, 64, 45, .12); }

.person-card { margin-bottom: 16px; padding: clamp(16px, 2.4vw, 24px); background: rgba(255, 252, 246, .75); border: 1px solid rgba(110, 88, 66, .14); box-shadow: 0 3px 10px rgba(83, 64, 45, .05); }
.person-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.person-title-row h3 { margin: 0; font-size: 1.3em; font-weight: 500; }
.person-actions { display: flex; gap: 14px; }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.add-guest-row { margin: -2px 0 18px; text-align: center; }
.add-guest-row .btn-outline { min-height: 40px; padding: 6px 18px; font-size: 15px; }
/* honeypot for bots, out of sight and out of the tab order */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
label { display: block; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
label span { font-weight: 400; color: var(--ink-muted); }
input, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #cbc1b5; border-radius: 3px; background: rgba(255, 253, 249, .92); font-size: 17px; font-weight: 400; color: var(--ink); outline: none; }
input:focus, textarea:focus { border-color: #8d816f; box-shadow: 0 0 0 3px rgba(98, 105, 76, .12); }
textarea { resize: vertical; min-height: 88px; line-height: 1.4; }

.question-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.q-label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { min-height: 44px; padding: 8px 18px; border: 1px solid rgba(110, 88, 66, .3); border-radius: 22px; background: rgba(255, 252, 246, .8); font-size: 16px; cursor: pointer; transition: background .15s, border-color .15s; }
.seg button:hover:not(:disabled) { border-color: rgba(110, 88, 66, .6); }
.seg button.active { background: var(--olive); border-color: var(--olive); color: #fffaf2; }
.seg button:disabled { opacity: .4; cursor: default; }

.person-tag { margin-left: 6px; font-size: 14px; font-style: italic; color: var(--ink-muted); }
/* the sleeping question carries a note, so it gets the full width */
.question[data-q="bed"] { grid-column: 1 / -1; }
/* "own camper / car" checkbox under the room choice; overrides the full-width input style */
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; font-weight: 400; line-height: 1.45; color: var(--ink); cursor: pointer; }
.check[hidden] { display: none; }
.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; padding: 0; accent-color: var(--olive); cursor: pointer; }
.check input:disabled { cursor: default; }
.check span { color: var(--ink); }
.q-note { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-muted); }
.q-note:empty, .rsvp__note:empty { display: none; }
.rsvp__note { margin: 16px 0 0; text-align: center; font-style: italic; color: var(--ink-soft); }
/* Turnstile stays a zero-height box until Cloudflare asks for the checkbox (app.js adds .is-visible) */
.turnstile { display: flex; justify-content: center; }
.turnstile.is-visible { margin-top: 16px; }
.shared-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; }
.lock-note { margin: 0; max-width: 520px; font-size: 15px; line-height: 1.45; color: var(--ink-muted); }
#send { min-width: 210px; }
.status { margin-top: 12px; min-height: 1.4em; text-align: center; font-size: 16px; color: var(--ink-soft); }
.status.ok { color: #4f5a3a; font-size: 18px; }
.status.error { color: var(--terra); }
.locked .person-card, .locked .shared-fields { opacity: .75; }

/* ---------- section overlap (desktop + tablet) ----------
   Every section below another one moves up by --tear-overlap onto the cracked kraft at the bottom of the
   previous edge. That strip is a transparent top border (no paper drawn there) holding the kraft-less tear,
   so the band between two papers gets thinner while both tear layers of the previous edge stay visible.
   The tear's valleys must stay inside the border, otherwise the paper shows through them. */
@media (min-width: 701px) {
  .page > section.frame:not(.practical), .split > .frame {
    --top-edge: url('assets/paper-tear.webp') center top / 100% var(--tear) no-repeat border-box;
    margin-top: calc(-1 * var(--tear-overlap));
    border-top: var(--tear-overlap) solid transparent;
    padding-top: clamp(26px, 3vw, 40px);
  }
  .page > section.adults { padding-top: clamp(22px, 2vw, 26px); }
}

/* ---------- tablet ---------- */
@media (max-width: 1000px) {
  .practical { grid-template-columns: 1fr; }
  .practical__map { max-width: 620px; width: 100%; margin: 0 auto; }
  /* stacked content makes these sections tall: full-height bouquets would grow into the text, so their height is capped.
     Practical and program continue below the bouquet with garland pieces down to the bottom edge (upper, tagless
     halves of strips from distant sections; their cut ends fade out). The heights split the rest of the section
     so neighbouring pieces always overlap by 70px, whatever the section height. */
  .practical, .program, .missions { --fh: min(100%, 380px); }
  .rsvp { --fh: min(100%, 480px); }
  .practical {
    --gx: -30px;
    --gh2: calc((100% - var(--fh)) / 2 + 70px);
    --gh3: calc((100% - var(--fh)) / 2 + 70px);
    --fl: url('assets/flowers-practical-left-t.webp');
    --fl2: url('assets/flowers-practical-left-2.webp');
    --fr2: url('assets/flowers-practical-right-2.webp');
    --fl3: url('assets/flowers-practical-left-3.webp');
    --fr3: url('assets/flowers-practical-right-3.webp');
  }
  .program { --gh3: calc(100% - var(--fh) + 70px); --fl3: url('assets/flowers-program-left-3.webp'); --fr3: url('assets/flowers-program-right-3.webp'); }
  .practical__list { width: fit-content; margin: 0 auto; }
  .split { grid-template-columns: 1fr; }
  .adults__grid { grid-template-columns: 1fr; gap: 22px; }
  .adults__item + .adults__item { border-left: 0; }
  .missions__grid { grid-template-columns: 1fr; gap: clamp(24px, 3vw, 40px); }
  /* missions: bouquets centred on the section height, the left one partly past the edge so the text gets room */
  .missions { --fy: 50%; --flx: -40px; }
  .accommodation { padding-left: var(--inset); padding-right: var(--inset); }
  .accommodation p { max-width: 600px; }
  .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; }
  .timeline::before { display: none; }
}

/* ---------- phone ---------- */
@media (max-width: 700px) {
  :root { --w: 100%; }
  .hero { display: block; min-height: 0; }
  /* square instead of 4:3 so the portrait photo is less cropped; smaller torn edges. The photo lies over the card's
     top kraft strip and its own kraft fades into it, otherwise the strip's straight top edge shows as a seam */
  .hero__photo {
    position: relative;
    inset: auto;
    aspect-ratio: 1 / 1;
    z-index: 1;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 10px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 10px), transparent);
  }
  .hero__photo::before { height: 54px; }
  .hero__photo::after { height: 60px; }
  /* edge images reach 2px past the section so a sub-pixel row of the middle paper can't show at the seam */
  .frame, .frame--tall {
    --inset: 32px;
    padding: 56px 32px 60px;
    background:
      url('assets/frame-a-top.webp') center top -2px / 100% auto no-repeat,
      url('assets/frame-a-bottom.webp') center bottom -2px / 100% auto no-repeat,
      url('assets/frame-a-middle.webp') center / 100% auto repeat-y,
      var(--kraft);
  }
  .rsvp {
    padding-bottom: 36px;
    background:
      url('assets/frame-a-top.webp') center top -2px / 100% auto no-repeat,
      url('assets/frame-a-middle.webp') center bottom / 100% auto repeat-y,
      var(--kraft);
  }
  .landscape { background: url('assets/frame-a-middle.webp') center top / 100% auto repeat-y var(--kraft); }
  /* side garlands over the whole section height, only peeking in from the screen edge beside the text; they stop
     before the torn edges and fade out at both ends. One long tile per side (tools/mobile-flowers.py), each section
     starts it elsewhere (--mo) so neighbours don't look the same. Drawn under the content (.frame isolates). */
  .frame::before, .frame::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 24px;
    bottom: 46px;
    width: var(--mfw);
    pointer-events: none;
    background: url('assets/garland-left-m.webp') left 0 top var(--mo) / 100% auto repeat-y;
    -webkit-mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 28px), transparent);
  }
  .frame::before { left: 0; }
  .frame::after { right: 0; background-image: url('assets/garland-right-m.webp'); background-position: right 0 top calc(var(--mo) - 400px); }
  .frame { --mfw: 30px; --mo: 0px; }
  /* the names card: one whole bouquet per side, ending naturally without a fade and reaching a bit into the torn edges;
     its text is short and centred, so the bouquets reach further in (about 90px) */
  .hero__card::before, .hero__card::after {
    top: 6px;
    bottom: 26px;
    width: 100px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  /* the centred names come closer to the edges on narrow phones, so the bouquets move out past the edge as well */
  .hero__card { --hx: min(0px, calc((100vw - 400px) / 2)); }
  .hero__card::before { background: url('assets/hero-flowers-left-m.webp') left var(--hx) center / auto 100% no-repeat; }
  .hero__card::after { background: url('assets/hero-flowers-right-m.webp') right var(--hx) center / auto 100% no-repeat; }
  .rsvp::before, .rsvp::after { bottom: 40px; }
  .practical { --mo: -250px; }
  .friday { --mo: -520px; }
  .program { --mo: -800px; }
  .sunday { --mo: -1060px; }
  .adults { --mo: -330px; }
  .dress { --mo: -640px; }
  .accommodation { --mo: -900px; }
  .missions { --mo: -150px; }
  .gifts { --mo: -720px; }
  .rsvp { --mo: -440px; }
  .hero__card { width: auto; margin-top: -10px; padding: 56px 32px 60px; filter: none; }
  .day { grid-template-columns: 1fr; text-align: center; }
  .day .title, .day .divider { text-align: center; margin-left: auto; }
  .day__text { max-width: 300px; justify-self: center; }
  .day__art { order: -1; width: min(150px, 45%); margin: 0 auto -6px; }
  /* extra bottom room: the torn edge otherwise covers the last lines */
  .day, .program, .missions, .adults { padding-bottom: 92px; }
  .timeline { grid-template-columns: 1fr; row-gap: 0; padding-left: 8px; width: fit-content; margin: 8px auto 0; }
  .timeline::before { display: block; left: calc(8px + 44px + 12px - .75px); right: auto; top: 30px; bottom: 30px; width: 1.5px; height: auto; }
  .timeline li { grid-template-columns: 44px 24px 100px 1fr; grid-template-rows: auto; column-gap: 0; justify-items: start; align-items: center; text-align: left; padding: 10px 0; }
  .timeline img { width: 36px; height: 36px; align-self: center; }
  .timeline__dot { margin: 0; justify-self: center; }
  .timeline time { padding-left: 12px; }
  .timeline p { margin: 0; line-height: 1.3; }
  .title { letter-spacing: .16em; font-size: 21px; }
  /* rows of three, the last row centred */
  .swatches { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 12px; row-gap: 14px; }
  .swatches li { width: 76px; }
  .swatch { width: 50px; margin-bottom: 6px; }
  .missions__grid { margin: 0; }
  .mission { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .mission img { width: 120px; margin: 0 auto; }
  .mission p { max-width: 300px; margin: 0 auto; }
  .map-links, .identity-grid, .question-grid, .shared-fields { grid-template-columns: 1fr; }
  .form-bottom { flex-direction: column; align-items: stretch; text-align: center; }
  #send { width: 100%; }
  .landscape__text { position: static; padding: 4px 0 10px; color: var(--ink); }
  .landscape__text .dot:first-of-type { display: none; }
  .landscape__text > span:first-child { display: block; }
}
