/* ============================================================================
   Esther & Asmé — faire-part. Editorial / champagne. Legible in light & dark.
   Chrome (header, language dropdown, theme toggle) follows the Beeons system.
   ========================================================================== */

/* Self-hosted Beeons fonts for the UI; an elegant serif (Google) for the names. */
@font-face { font-family: "Jost"; src: url("/fonts/jost-latin-wght-normal-928f4210aa4859fcfdb853d2c6329589.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/plus-jakarta-sans-latin-wght-normal-7660bd9909fb097989b19471a75f1b7a.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
    --paper:    #F7F2E8;
    --panel:    #FCF8F0;
    --card:     #FCF8F0;
    --ink:      #2C2114;   /* strong, legible */
    --ink-soft: #6A5940;
    --muted:    #9A8A73;
    --gold:     #9A7A2C;
    --gold-2:   #B9962F;
    --line:     rgba(44, 33, 20, .14);
    --line-2:   rgba(154, 122, 44, .30);
    --tint:     154, 122, 44;
    --shadow:   0 30px 70px -40px rgba(60, 45, 15, .45);
    --maxw:     1140px;
    --ease:     cubic-bezier(.22, .61, .36, 1);
    --serif:    "Cormorant Garamond", Georgia, serif;
    --sans:     "Jost", "Plus Jakarta Sans", system-ui, sans-serif;
}
[data-theme="dark"] {
    --paper:#161108; --panel:#1F1810; --card:#211A11;
    --ink:#F2E7CF; --ink-soft:#CBB895; --muted:#9F8C6E;
    --gold:#D7B65C; --gold-2:#E7C977;
    --line:rgba(215,182,92,.18); --line-2:rgba(215,182,92,.34); --tint:215,182,92;
    --shadow:0 30px 70px -40px rgba(0,0,0,.7);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper:#161108; --panel:#1F1810; --card:#211A11;
        --ink:#F2E7CF; --ink-soft:#CBB895; --muted:#9F8C6E;
        --gold:#D7B65C; --gold-2:#E7C977;
        --line:rgba(215,182,92,.18); --line-2:rgba(215,182,92,.34); --tint:215,182,92;
        --shadow:0 30px 70px -40px rgba(0,0,0,.7);
    }
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--paper); color: var(--ink);
    font-family: var(--serif); font-size: clamp(17px, .5vw + 15px, 19px); line-height: 1.7;
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; }
svg { fill: none; }

/* Small-caps UI type */
.kicker, .chapter, .lang summary, .btn, .cd-lab, .footer-sign, .optional, .section-head .chapter,
.venue-time, .choice, .chip-check, .field > label, .field legend {
    font-family: var(--sans); font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
}

/* ---------- Header (Beeons chrome) ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem clamp(1rem, 4vw, 2.4rem);
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brandmark { text-decoration: none; }
.monogram { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; letter-spacing: .08em; color: var(--ink); }
.topbar-tools { display: flex; align-items: center; gap: .5rem; }

.icon-btn, .lang summary {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink);
    cursor: pointer; transition: background .2s;
}
.icon-btn:hover, .lang summary:hover { background: rgba(var(--tint), .10); }
.icon-btn svg, .lang summary svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .theme-icon-moon, :root:not([data-theme]) .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
#soundToggle .snd-off { display: none; }
#soundToggle[aria-pressed="true"] .snd-on { display: none; }
#soundToggle[aria-pressed="true"] .snd-off { display: block; }

.lang { position: relative; }
.lang summary { list-style: none; width: auto; min-width: 40px; padding: 0 .8rem; font: 500 .72rem/1 var(--sans); letter-spacing: .14em; }
.lang summary::-webkit-details-marker { display: none; }
.lang ul {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; list-style: none; margin: 0; padding: 6px; min-width: 160px;
    background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
}
.lang a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font: 500 .95rem/1 var(--sans); }
.lang a:hover { background: rgba(var(--tint), .10); }
.lang a[aria-current="true"] { color: var(--gold); }
.lang a[aria-current="true"]::after { content: " ✓"; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .55rem; padding: .72em 1.3em; border-radius: 999px;
    font-size: .66rem; cursor: pointer; border: 1px solid transparent; text-decoration: none;
    transition: transform .4s var(--ease), background .3s, color .3s, border-color .3s;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost { color: var(--gold); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(var(--tint), .10); }
.btn-gold { color: #fff8e9; background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
[data-theme="dark"] .btn-gold { color: #1c1406; }
.btn-gold:hover { transform: translateY(-2px); }

/* ---------- Layout ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem, 9vw, 7rem) clamp(1.25rem, 5vw, 2rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: clamp(2.2rem, 5vw, 3.2rem); }
.chapter { font-size: .68rem; color: var(--gold); margin-bottom: .6rem; }
.section-head h2 { font-size: clamp(2rem, 5vw, 3rem); }
.section-lead { color: var(--ink-soft); font-style: italic; max-width: 42ch; margin: .7rem auto 0; }

/* ---------- Hero ---------- */
.hero {
    max-width: var(--maxw); margin: 0 auto; min-height: calc(100vh - 70px);
    display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(1.5rem, 5vw, 4.5rem);
    padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 2rem);
}
.hero-text { max-width: 30ch; }
.kicker { font-size: .72rem; color: var(--gold); margin-bottom: 1.4rem; }
.kicker::after { content: ""; display: block; width: 46px; height: 1px; background: var(--gold); margin-top: 1rem; opacity: .7; }
.greeting { font-style: italic; color: var(--gold); font-size: 1.1rem; margin-bottom: .4rem; }
.hero-invite { color: var(--ink-soft); font-size: 1.08rem; line-height: 1.5; margin-bottom: 1.2rem; }
.hero-names { font-size: clamp(3.4rem, 8vw, 5.6rem); font-weight: 500; letter-spacing: .005em; line-height: 1; }
.hero-names .amp { font-style: italic; color: var(--gold); font-weight: 400; }
.hero-meta { margin-top: 1.6rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .2em; font-size: .72rem; color: var(--muted); }
.hero-meta .dot { margin: 0 .5rem; color: var(--gold); }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; max-height: 82vh; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow); }

/* ---------- Programme / venue cards ---------- */
.venues { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 1.6rem); }
.venue-card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.venue-photo { position: relative; margin: 0; aspect-ratio: 4/3; }
.venue-photo img { width: 100%; height: 100%; object-fit: cover; }
.venue-time {
    position: absolute; left: 12px; bottom: 12px; padding: .4rem .8rem; border-radius: 999px;
    background: color-mix(in srgb, var(--paper) 88%, transparent); color: var(--gold); font-size: .72rem; letter-spacing: .14em;
    border: 1px solid var(--line-2); backdrop-filter: blur(4px);
}
.venue-body { padding: clamp(1.1rem, 2.5vw, 1.6rem); display: flex; flex-direction: column; flex: 1; }
.venue-title { font-size: 1.5rem; margin-bottom: .4rem; }
.venue-desc { color: var(--ink-soft); font-style: italic; font-size: .98rem; margin-bottom: .9rem; }
.venue-place { font-weight: 600; }
.venue-addr { color: var(--muted); font-size: .92rem; margin-bottom: 1.1rem; }
.venue-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }

/* ---------- Thème / palette ---------- */
.theme-inner { text-align: center; max-width: 760px; margin: 0 auto; }
.theme-name { font-size: clamp(2rem, 5vw, 2.8rem); font-style: italic; color: var(--ink); }
.theme-intro { color: var(--ink-soft); margin: .8rem auto 2.4rem; max-width: 48ch; }
.palette { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: clamp(1rem, 2.5vw, 1.6rem); }
.palette li { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.swatch { width: 100%; aspect-ratio: 1; max-width: 128px; border-radius: 10px; background: var(--c); border: 1px solid var(--line-2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.swatch-name { font-style: italic; font-size: 1.02rem; color: var(--ink); }

/* ---------- Verse ---------- */
.verse { text-align: center; max-width: 44ch; margin: 0 auto clamp(2rem, 5vw, 3rem); }
.verse blockquote { margin: 0; font-size: clamp(1.3rem, 3vw, 1.7rem); font-style: italic; }
.verse figcaption { font-family: var(--sans); text-transform: uppercase; letter-spacing: .2em; font-size: .66rem; color: var(--gold); margin-top: 1rem; }
.verse.closing { margin: clamp(2.5rem, 6vw, 3.5rem) auto 0; }

/* ---------- RSVP ---------- */
.rsvp-form { max-width: 620px; margin: 0 auto; display: grid; gap: 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: clamp(1.6rem, 4vw, 2.6rem); box-shadow: var(--shadow); }
.field { display: grid; gap: .45rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field legend { font-size: .66rem; color: var(--ink-soft); padding: 0; }
.optional { color: var(--muted); letter-spacing: .1em; margin-left: .4rem; }
.rsvp-form input, .rsvp-form textarea {
    width: 100%; font-family: var(--serif); font-size: 1.04rem; color: var(--ink);
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .72rem .9rem; transition: border-color .25s, box-shadow .25s;
}
.rsvp-form input:focus, .rsvp-form textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--tint), .16); }
.rsvp-form textarea { resize: vertical; }
.guests-field { max-width: 220px; }
.choices, .chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.choice, .chip-check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: .64rem; }
.choice input, .chip-check input { accent-color: var(--gold); }
.choice:has(input:checked), .chip-check:has(input:checked) { border-color: var(--gold); background: rgba(var(--tint), .14); color: var(--gold); }
.btn-submit { justify-self: center; justify-content: center; padding: .9em 2.4em; font-size: .7rem; }
.flash { text-align: center; font-style: italic; color: var(--ink-soft); }
.flash.err { color: #b4454f; }
.rsvp-done { max-width: 620px; margin: 0 auto; text-align: center; }
.rsvp-done[hidden] { display: none; }
.done-title { font-family: var(--serif); font-size: 2rem; font-style: italic; color: var(--gold); }
.done-desc { color: var(--ink-soft); margin-top: .4rem; }

/* ---------- About ---------- */
.about-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(1.6rem, 5vw, 3.5rem); align-items: center; }
.about-photo { margin: 0; }
.about-photo img { width: 100%; max-height: 62vh; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow); }
.about-text .chapter { text-align: left; }
.about-text h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.about-text p { color: var(--ink-soft); margin-top: 1rem; font-size: 1.1rem; }

/* ---------- Souvenirs ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.6rem, 1.5vw, 1rem); }
.shot { padding: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; cursor: zoom-in; background: var(--card); aspect-ratio: 3/4; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.shot:hover img { transform: scale(1.05); }
.shot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Countdown ---------- */
.countdown { text-align: center; }
.countdown h2 { font-size: clamp(1.8rem, 4.5vw, 2.5rem); margin-bottom: 2rem; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, minmax(64px, 1fr)); gap: clamp(.6rem, 2vw, 1.4rem); max-width: 560px; margin: 0 auto; }
.cd-cell { display: grid; gap: .35rem; padding: 1.2rem .4rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.cd-num { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 6vw, 2.9rem); color: var(--gold); font-variant-numeric: tabular-nums; }
.cd-lab { font-family: var(--sans); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 3rem 1.25rem 3.5rem; border-top: 1px solid var(--line); }
.footer-names { font-family: var(--serif); font-style: italic; font-size: 1.5rem; }
.footer-sign { font-size: .62rem; color: var(--muted); margin-top: .5rem; }
.footer-credit { font-family: var(--sans); font-size: .62rem; color: var(--muted); max-width: 56ch; margin: 1rem auto 0; opacity: .85; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 4vw; background: rgba(20,15,8,.9); backdrop-filter: blur(4px); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 6px; box-shadow: 0 30px 80px -30px #000; }
.lb-close { position: absolute; top: 1.2rem; right: 1.6rem; width: 46px; height: 46px; border-radius: 999px; background: transparent; color: #f3e7cf; border: 1px solid rgba(243,231,207,.4); font-size: 1.6rem; cursor: pointer; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; min-height: 0; text-align: center; }
    .hero-text { max-width: none; }
    .kicker::after { margin-left: auto; margin-right: auto; }
    .hero-photo { order: -1; max-width: 440px; margin: 0 auto; }
    .venues { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
    .about-inner { grid-template-columns: 1fr; }
    .about-photo { order: -1; max-width: 440px; margin: 0 auto; }
    .about-text .chapter, .about-text { text-align: center; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) { .countdown-grid { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

/* ============================================================================
   Admin (guest management)
   ========================================================================== */
.admin-body { background: var(--paper); color: var(--ink); font-family: var(--serif); }
.admin { max-width: 1040px; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 1.2rem; }
.admin h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.admin-count { font-family: var(--sans); text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; color: var(--ink-soft); margin: .6rem 0 2rem; }
.admin-count strong { color: var(--gold); font-size: 1.4rem; }
.admin table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.admin th, .admin td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .94rem; }
.admin th { font-family: var(--sans); text-transform: uppercase; letter-spacing: .1em; font-size: .64rem; color: var(--gold); background: rgba(var(--tint), .10); }
.admin tr:last-child td { border-bottom: 0; }
