/* ---------- Section sheets ---------- */
.modal-layer {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: calc(14px + var(--safe-t)) 12px calc(14px + var(--safe-b));
  background: var(--dither);
  opacity: 0; transition: opacity 0.15s steps(3);
}
.modal-layer.show { opacity: 1; }
.sheet {
  width: 100%; max-width: 500px;
  max-height: calc(100vh - 28px - var(--safe-t) - var(--safe-b));
  max-height: calc(100dvh - 28px - var(--safe-t) - var(--safe-b));
  display: flex; flex-direction: column;
}
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 0 12px 2px;
  margin-bottom: 4px;
  background: linear-gradient(var(--tan), var(--tan)) 0 100% / 100% var(--u) no-repeat;
}
.sheet-head > span { flex: none; color: var(--text); }
.sheet h2 { flex: 1; font-size: 1.5rem; font-weight: 600; line-height: 1.15; }
.sheet h2.names { font-weight: 400; font-size: 48px; line-height: 1; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 6px 6px 2px;
  display: grid; gap: 18px;
}
.sheet-body::-webkit-scrollbar { width: 12px; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--tan); border: var(--u) solid var(--surface); }
.sheet h3 { font-size: 1.15rem; font-weight: 600; }
.soft { color: var(--text-soft); }
@media (max-width: 560px) {
  .modal-layer { align-items: flex-end; padding: calc(16px + var(--safe-t)) 0 0; }
  .sheet { max-width: none; max-height: calc(100vh - 32px - var(--safe-t)); max-height: calc(100dvh - 32px - var(--safe-t)); }
  .sheet-body { padding-bottom: calc(10px + var(--safe-b)); }
  .sheet h2.names { font-size: 36px; }
}

.photo { --u: 3px; display: block; border-image-source: var(--f-wood); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--line); }
.couple-photo { aspect-ratio: 4 / 3; }

.parents { list-style: none; display: grid; gap: 10px; }
.parents li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; }
.parents li > span:first-child { color: var(--rose); transform: translateY(2px); }
.parents strong { display: block; font-size: 1.15rem; font-weight: 600; }
.parents small { color: var(--text-soft); font-size: 0.95rem; }

.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.count div { --u: 2px; border-image-source: var(--f-inset); padding: 2px 0 4px; }
.count b { display: block; font-size: 1.7rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.count small { color: var(--text-soft); font-size: 0.8rem; }

blockquote { text-align: center; font-weight: 500; font-size: 1.1rem; line-height: 1.6; padding: 0 6px; }
blockquote cite { display: block; margin-top: 6px; font-style: normal; font-size: 0.9rem; color: var(--text-soft); }

.day { font-weight: 600; font-size: 1.1rem; }
/* One grid for the whole list: the time column fits the longest time, so every event lines up
   and a time like "10:00 AM" never runs into the marker */
.timeline { list-style: none; display: grid; grid-template-columns: max-content 1fr; column-gap: 24px; row-gap: 16px; }
.timeline li { display: contents; }
.timeline time { font-size: 1.3rem; font-weight: 600; text-align: right; white-space: nowrap; line-height: 1.3; }
.timeline div { position: relative; padding-left: 4px; }
.timeline div::before {
  content: ''; position: absolute; left: -12px; top: 6px; bottom: -22px; width: var(--u);
  background: repeating-linear-gradient(var(--tan) 0 6px, transparent 6px 12px);
}
.timeline li:last-child div::before { display: none; }
.timeline div::after {
  content: ''; position: absolute; left: -15px; top: 6px; width: 9px; height: 9px;
  background: var(--gold); box-shadow: 0 0 0 var(--u) var(--text);
}
.timeline strong { display: block; font-weight: 600; }
.venue { --u: 2px; padding: 4px 8px; }
.venue strong { display: block; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .pbtn { flex: 1 1 150px; white-space: nowrap; }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gallery .photo { aspect-ratio: 3 / 4; }
.gallery .photo:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }

.summary { --u: 2px; padding: 2px 8px; text-align: center; }
form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; font-weight: 600; }
.field em { font-style: normal; font-weight: 400; color: var(--text-soft); }
.field input, .field select, .field textarea {
  --u: 2px;
  width: 100%; min-height: 48px;
  padding: 4px 8px;
  border-image-source: var(--f-inset);
  font-size: 1.05rem; font-weight: 500;
  outline-offset: 0;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 34px; }
.select-field { position: relative; }
.select-field::after {
  content: ''; position: absolute; right: 14px; bottom: 19px;
  width: 14px; height: 10px;
  background: var(--i-arrow) 0 0 / 14px 10px no-repeat;
  image-rendering: pixelated; pointer-events: none;
}
.field textarea { resize: vertical; min-height: 104px; }
.field input[readonly] { color: var(--text-soft); cursor: not-allowed; }
fieldset.choice { border: 0; display: grid; gap: 8px; }
fieldset.choice legend { font-weight: 600; margin-bottom: 4px; }
.choice label { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  --u: 2px;
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 8px;
  font-weight: 500;
}
.choice span::before {
  content: ''; flex: none; width: 24px; height: 24px;
  background: var(--f-inset) 0 0 / 24px 24px no-repeat;
  image-rendering: pixelated;
}
.choice input:checked + span { border-image-source: var(--f-sand); font-weight: 600; }
.choice input:checked + span::before { background: var(--i-check) center / 18px 12px no-repeat, var(--f-inset) 0 0 / 24px 24px no-repeat; }
.choice input:focus-visible + span { outline: var(--u) solid var(--gold); outline-offset: 2px; }
.status { font-weight: 600; min-height: 1.5em; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.rsvp-gate { display: grid; gap: 12px; justify-items: start; }
.rsvp-gate p { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
