/* Additions on top of the original design (site.css).
   Colours and fonts follow the bride's palette: blue #103c70, deep #08294f, gold #b9a47f, ivory #faf7ef, ink #253c50. */
:root { --td-blue: #103c70; --td-deep: #08294f; --td-gold: #b9a47f; --td-gold-d: #8a6d3f; --td-ivory: #faf7ef; --td-ink: #253c50; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--td-gold); outline-offset: 3px; }

/* ---------- language switch ---------- */
.nav-tools { display: flex; align-items: center; gap: 6px; margin-left: clamp(8px, 1.4vw, 22px); }
.lang-switch { display: flex; }
.lang-switch button { min-width: 36px; height: 36px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: 500 11px 'DM Sans', sans-serif; letter-spacing: .12em; color: #6b7480; }
.lang-switch button[aria-pressed="true"] { color: var(--td-blue); text-decoration: underline; text-decoration-color: var(--td-gold); text-underline-offset: 6px; }
.cover-langs { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 30; }
.cover-langs button { color: #e9dcc3; min-width: 44px; height: 44px; text-shadow: 0 1px 6px #000; }
.cover-langs button[aria-pressed="true"] { color: #fff; text-decoration-color: #e3c78f; }

/* ---------- cover: second tap skips ---------- */
.cover-skip { position: absolute; left: 0; right: 0; bottom: calc(5% + env(safe-area-inset-bottom)); z-index: 9; text-align: center;
  color: #f4e7d0; font: 10px 'DM Sans', sans-serif; letter-spacing: .3em; text-transform: uppercase; text-shadow: 0 2px 10px #000;
  opacity: 0; pointer-events: none; transition: opacity .5s 1s; }
.cover.opened .cover-skip { opacity: .85; }

/* ---------- mobile menu ---------- */
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; position: relative; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { position: absolute; left: 11px; width: 22px; height: 1.5px; background: var(--td-blue); transition: transform .3s, opacity .3s; content: ""; }
.nav-toggle-bars { top: 21px; }
.nav-toggle-bars::before { top: -7px; left: 0; }
.nav-toggle-bars::after { top: 7px; left: 0; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  nav.refined-nav { position: fixed !important; top: 0; left: 0; right: 0; padding: calc(6px + env(safe-area-inset-top)) 10px 6px 14px !important;
    min-height: 58px; align-items: center !important; flex-wrap: nowrap !important; }
  .nav-toggle { display: block; }
  nav.refined-nav .navlinks { position: absolute; top: 100%; left: 0; right: 0; display: none !important; flex-direction: column !important;
    align-items: stretch !important; gap: 0 !important; padding: 8px 22px 18px; background: rgba(250,247,239,.98);
    border-bottom: 1px solid #c9bb9c66; box-shadow: 0 18px 30px rgba(8,41,79,.12); max-height: calc(100dvh - 60px); overflow: auto; }
  .nav-open nav.refined-nav .navlinks { display: flex !important; }
  nav.refined-nav .navlinks > a { display: block !important; font-size: 12px !important; padding: 14px 4px; border-bottom: 1px solid #e3d8c4; white-space: normal; }
  nav.refined-nav .navlinks > a.rsvp-pill { margin-top: 14px; text-align: center; border: 1px solid var(--td-blue) !important; padding: 13px !important; }
  .nav-tools { margin-left: auto; }
  main > section:first-child { padding-top: 96px !important; }
}

/* ---------- small layout fixes on phones ---------- */
@media (max-width: 760px) {
  main .section:not(.hero) { min-height: 0 !important; }
  #details.new-details-section { padding-top: 64px !important; }
  #details .details-new-intro { margin-bottom: 18px !important; }
  #wedding-day .romantic-event { grid-template-columns: 64px 74px minmax(0,1fr) !important; gap: 10px !important; align-items: start !important; padding: 16px 0 !important; }
  #wedding-day .event-illustration { display: block !important; width: 74px !important; height: 104px !important; flex-basis: 74px !important; border-radius: 6px; }
  #wedding-day .event-marker { display: none !important; }
  #wedding-day .event-time { padding-top: 6px; }
  #wedding-day .event-copy h4 { font-size: 22px !important; margin: 0 0 6px !important; }
}

/* ---------- FAQ: own open/close marker instead of the browser triangle ---------- */
.faq summary { list-style: none; position: relative; padding-right: 36px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--td-gold-d);
  font: 300 28px 'Cormorant Garamond', Georgia, serif; transition: transform .3s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

/* ---------- RSVP flow (inside the original .rsvp-panel) ---------- */
#rsvp .rsvp-flow { max-width: 560px; }
.rsvp-flow h3.rsvp-h { font: 400 clamp(28px, 4vw, 36px)/1.1 'Cormorant Garamond', Georgia, serif; color: var(--td-blue); text-align: center; margin: 6px 0 8px; outline: none; }
.rsvp-flow .rsvp-sub { text-align: center; font-size: 14px; line-height: 1.7; margin: 0 0 20px; color: var(--td-ink); }
.rsvp-flow .note { font-size: 12px; line-height: 1.7; }
.rsvp-progress { display: flex; gap: 6px; }
.rsvp-progress i { flex: 1; height: 2px; background: #e2d7c3; }
.rsvp-progress i.on { background: var(--td-blue); }
.rsvp-step { text-align: center; font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: #6b7480; margin: 10px 0 22px; }
.rsvp-flow label { display: block; font-size: 12px; margin: 18px 0 8px; }
.rsvp-flow input, .rsvp-flow textarea { width: 100%; padding: 13px; border: 1px solid #c6c4bd; background: #fff; font: inherit; font-size: 16px; color: var(--td-ink); border-radius: 0; }
.rsvp-flow #inviteCode { text-align: center; letter-spacing: .25em; text-transform: uppercase; font-size: 18px; }
.rsvp-flow button.primary, .rsvp-flow button.outline { width: auto; margin: 0; min-height: 50px; }
.rsvp-code button.primary { width: 100%; margin-top: 18px; }
.rsvp-flow button[disabled] { opacity: .55; cursor: default; }
.rsvp-excl { border-top: 1px solid #e2d7c3; padding-top: 14px; margin-top: 18px; font-style: italic; }
.rsvp-demo { border: 1px dashed var(--td-gold); padding: 8px; text-align: center; }
.rsvp-error { color: #9b2c2c; font-size: 13px; text-align: center; margin: 12px 0 0; min-height: 1px; }
.rsvp-error:empty { margin: 0; }
.rsvp-dear { font-size: 26px; text-align: center; margin: 0 0 4px; color: var(--td-gold-d); font-style: italic; }
.rsvp-info { text-align: center; background: #f6efe1; padding: 10px 12px; margin: 8px 0 14px; }
.rsvp-seats { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--td-blue); color: #f1e3c4;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding: 12px; margin: 4px 0 16px; text-align: center; }
.rsvp-seats span { color: #e3c78f; letter-spacing: .1em; }
.rsvp-guest { border: 1px solid #e2d7c3; background: #fff; padding: 16px; margin-bottom: 12px; }
.rsvp-guest-name { font: 500 23px 'Cormorant Garamond', Georgia, serif; color: var(--td-blue); margin-bottom: 12px; }
.rsvp-guest label { margin-top: 14px; }
.rsvp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rsvp-choice { min-height: 48px; padding: 8px 10px; border: 1px solid var(--td-blue); background: transparent; color: var(--td-blue);
  font: 400 13px/1.3 'DM Sans', sans-serif; letter-spacing: .04em; cursor: pointer; transition: background .2s, color .2s; }
.rsvp-choice[aria-pressed="true"] { background: var(--td-blue); color: #fff; }
.rsvp-choice[aria-pressed="true"]::before { content: "✓ "; color: #e3c78f; }
.rsvp-mg { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e2d7c3; }
.rsvp-mg > span, .rsvp-q > span { display: block; font-size: 12px; margin-bottom: 8px; color: var(--td-gold-d); letter-spacing: .04em; }
.rsvp-q { margin-top: 18px; }
.rsvp-count { text-align: center; font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--td-gold-d); margin: 16px 0 4px; }
.rsvp-only { text-align: center; font-style: italic; }
.rsvp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rsvp-chips .rsvp-choice { border-radius: 24px; padding: 8px 16px; min-height: 44px; }
.rsvp-chips .rsvp-choice[aria-pressed="true"]::before { content: ""; }
.rsvp-nav { display: flex; gap: 10px; margin-top: 24px; position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(255,253,248,0), #fffdf8 30%); z-index: 2; }
.rsvp-nav .primary { flex: 1; }
.rsvp-cal { border: 1px solid #e2d7c3; background: #fff; padding: 10px; }
.rsvp-cal-head { display: flex; align-items: center; justify-content: space-between; font: 500 20px 'Cormorant Garamond', Georgia, serif; color: var(--td-blue); text-transform: capitalize; }
.rsvp-cal-head button { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; color: var(--td-blue); cursor: pointer; }
.rsvp-cal-head button[disabled] { opacity: .25; cursor: default; }
.rsvp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.rsvp-wd { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #6b7480; padding: 6px 0; }
.rsvp-day { height: 44px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font: 15px 'DM Sans', sans-serif; color: var(--td-ink); }
.rsvp-day span { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.rsvp-day[disabled] { color: #c9c4ba; cursor: default; }
.rsvp-day.wed span { border: 1.5px solid var(--td-gold); color: var(--td-gold-d); font-weight: 600; }
.rsvp-day.sel span { background: var(--td-blue); color: #fff; }
.rsvp-legend { display: flex; justify-content: center; gap: 18px; font-size: 12px; padding: 6px 0 2px; }
.rsvp-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.rsvp-legend i.me { background: var(--td-blue); }
.rsvp-legend i.wed { border: 1.5px solid var(--td-gold); }
.rsvp-picked { text-align: center; font: italic 19px 'Cormorant Garamond', Georgia, serif; color: var(--td-blue); min-height: 1em; margin: 12px 0 0; }
.rsvp-home { font-size: 10px; letter-spacing: .25em; text-transform: uppercase; border-top: 1px solid #e2d7c3; padding-top: 16px; margin: 22px 0 -6px; color: var(--td-gold-d); }
.rsvp-fields label { margin-top: 18px; }
.rsvp-done { text-align: center; }
.rsvp-done .eyebrow { color: var(--td-gold-d); }
.rsvp-done.is-yes { background: var(--td-blue); color: var(--td-ivory); margin: -45px; padding: 50px 30px; }
.rsvp-done.is-yes h3.rsvp-h, .rsvp-done.is-yes .rsvp-sign { color: #f1e3c4; }
.rsvp-done.is-yes .eyebrow { color: #e3c78f; }
.rsvp-done.is-yes .outline { color: var(--td-ivory); border-color: #e3c78f; }
.rsvp-done p { font-size: 15px; line-height: 1.7; margin: 0 0 6px; }
.rsvp-done .rsvp-stars { font-size: 24px; margin: 4px 0 14px; }
.rsvp-sign { font: italic 36px 'Cormorant Garamond', Georgia, serif; color: var(--td-blue); margin: 0 0 18px !important; }
.rsvp-summary { text-align: left; border: 1px solid rgba(185,164,127,.6); padding: 14px 16px; margin: 6px 0 18px; }
.rsvp-summary p { font-size: 14px; margin: 0 0 4px; }
.rsvp-done .outline { width: auto; }
@media (max-width: 650px) {
  #rsvp .rsvp-flow { padding: 22px 16px !important; }
  .rsvp-done.is-yes { margin: -22px -16px; padding: 40px 20px; }
}
@media (prefers-reduced-motion: reduce) { .cover-skip { transition: none; } }

/* ---------- fixes after testing: the nav bar is blue ---------- */
nav.refined-nav .lang-switch button { color: #cbb98f; }
nav.refined-nav .lang-switch button[aria-pressed="true"] { color: #fff; text-decoration-color: #e3c78f; }
nav.refined-nav .nav-toggle-bars, nav.refined-nav .nav-toggle-bars::before, nav.refined-nav .nav-toggle-bars::after { background: #e3c78f; }
.nav-open nav.refined-nav .nav-toggle-bars { background: transparent; }
@media (max-width: 900px) {
  nav.refined-nav .navlinks { background: #0d3566 !important; border-bottom: 1px solid #c9a96e55; }
  nav.refined-nav .navlinks > a { color: #f3e7cc !important; border-bottom-color: rgba(227,199,143,.22) !important; }
  nav.refined-nav .navlinks > a.rsvp-pill { border-color: #e3c78f !important; color: #fff !important; background: transparent !important; }
  #wedding-day .romantic-events .romantic-event .event-illustration { display: block !important; width: 74px !important; height: 104px !important; min-width: 74px !important; flex: 0 0 74px !important; }
}
.rsvp-panel .rsvp-chips button.rsvp-choice { width: auto !important; margin: 0 !important; }
.rsvp-panel button.rsvp-choice, .rsvp-panel .rsvp-cal button, .rsvp-panel .lang-switch button { margin: 0 !important; }
.rsvp-panel .rsvp-cal button { width: auto !important; }
.rsvp-panel .rsvp-two button.rsvp-choice { width: 100% !important; }
.rsvp-panel .rsvp-nav button { margin: 0 !important; width: auto !important; }
.rsvp-panel .rsvp-done button.outline { width: auto !important; margin-top: 6px !important; }
.rsvp-panel p.rsvp-sign { font: italic 38px/1.1 'Cormorant Garamond', Georgia, serif !important; }
/* the generic "width:auto" above must not shrink the month arrows below a 44px touch target */
.rsvp-panel .rsvp-cal .rsvp-cal-head button { width: 44px !important; }

/* touch targets of at least 44px on phones: language buttons in the top bar and the FAQ questions */
@media (max-width: 900px) {
  nav.refined-nav .nav-tools .lang-switch button { min-width: 44px; height: 44px; }
  .faq summary { display: flex; align-items: center; min-height: 44px; }
}

/* ---------- cover: the envelope opens (choreography in js/cover.js) ----------
   The photo of the envelope is cut into layers that line up exactly like the photo while closed:
   lining (inside) < letter < front panel (pocket) < flap (with lace and seal), see tools/envelope-assets. */
.new-cover { transition: opacity .8s cubic-bezier(.22,1,.36,1), visibility .8s !important; }
.new-scene { perspective: none; container-type: size; }
.cv-stage {
  --sw: max(100cqw, calc(100cqh * 2 / 3));            /* the photo is 2:3 and covers the screen */
  --top: calc((100cqh - var(--sw) * 1.5) * .54);
  position: absolute; left: 50%; top: var(--top); width: var(--sw); height: calc(var(--sw) * 1.5); margin-left: calc(var(--sw) / -2);
  perspective: calc(var(--sw) * 2.4); perspective-origin: 50% calc(50cqh - var(--top));
  animation: coverArrival 1.3s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes coverArrival { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
.cv-inside { position: absolute; inset: 0; z-index: 1; background: radial-gradient(120% 70% at 50% 62%, #12365d, #0a2342 55%, #061527); }
.cv-front { position: absolute; inset: 0; z-index: 3; background: url("../img/envelope-front.webp") 0 0 / 100% 100% no-repeat; will-change: transform, opacity; }
.cv-flap { position: absolute; left: 0; top: 0; width: 100%; height: 80.4%; z-index: 4; transform-origin: 50% 0; transform-style: preserve-3d; will-change: transform; }
.flap-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flap-top { background: url("../img/envelope-flap.webp") 0 0 / 100% 100% no-repeat; }
.flap-shade, .flap-lining { position: absolute; inset: 0; -webkit-mask: url("../img/envelope-flap.webp") 0 0 / 100% 100% no-repeat; mask: url("../img/envelope-flap.webp") 0 0 / 100% 100% no-repeat; }
.flap-shade { background: #020a14; opacity: 0; }
.flap-under { transform: rotateX(180deg); }
.flap-lining { transform: scaleY(-1); background: linear-gradient(0deg, #0b2749 0%, #143a64 60%, #0d2c52 100%); }
.new-scene .cv-stage .letter {
  left: 50%; top: 57.4%; width: min(62%, 540px); height: auto; aspect-ratio: 5 / 6; padding: 0 20px; box-sizing: border-box;
  transform: translate(-50%, 0) scale(.94); opacity: 1; transition: none; z-index: 2; will-change: transform;
}
/* the page behind the cover does not animate until the cover is gone: its entrance plays as the cover fades */
body.cover-on main *, body.cover-on main *::before, body.cover-on main *::after, body.cover-on .nav * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .cv-stage { animation: none; } }

/* ---------- hero on phones: everything incl. "SCROLL TO EXPLORE" fits in the visible part of the screen ----------
   (100vh is taller than what iOS Safari shows while its bars are visible; svh is the visible part.)
   345px = padding, heading (Greek sometimes wraps one line more) and the line below the photos; the photos get the rest. */
@media (max-width: 760px) {
  #home.collage-hero { min-height: 100svh; }
  #home .wedding-collage { height: clamp(240px, calc(100svh - 345px), 610px); }
}
