/* ==========================================================================
   Leida - modern, like an Instagram story
   Signature: the hero is a phone-shaped story viewer. Photos advance on their own
   under progress bars, each frame carrying one line of the invitation (announcement,
   date, place); tapping the sides goes back or forward, and the reply bar leads to
   the RSVP. Names are written as a hashtag, titles are hashtag stickers and the
   countdown is a story countdown sticker.
   Palette: --inv-primary (raspberry / indigo / sage), --inv-accent (warm), --inv-bg, --inv-text
   ========================================================================== */

.leida {
    --ld-grad: linear-gradient(45deg, var(--inv-accent), var(--inv-primary) 60%, color-mix(in srgb, var(--inv-primary) 60%, #4b2a8a));
    --ld-soft: color-mix(in srgb, var(--inv-primary) 6%, var(--inv-bg));
    --ld-muted: color-mix(in srgb, var(--inv-text) 64%, var(--inv-bg));
    --kit-radius: 14px;
    font-family: var(--inv-font-body);
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--inv-text);
    background: var(--inv-bg);
    overflow-x: clip;
}
.leida h1, .leida h2, .leida h3 { font-family: var(--inv-font-heading); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
/* zero specificity, so the template's own heading classes can set their spacing */
:where(.leida) :is(h1, h2, h3) { margin: 0; }
.ld-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--inv-primary); margin: 0 0 8px; }
.ld-hash { background: var(--ld-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-right: .04em; }

/* ---------- Navigation ---------- */
.ld-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding: 16px clamp(16px, 4vw, 44px); display: flex; align-items: center; justify-content: flex-end; }
.ld-nav .kit-nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; }
.ld-nav a { text-decoration: none; font-size: .9rem; font-weight: 500; color: var(--inv-text); padding: 4px 0; }
.ld-nav a:hover, .ld-nav a.is-current { color: var(--inv-primary); }
.ld-nav .kit-nav-brand { margin-right: auto; font-family: var(--inv-font-heading); font-weight: 800; font-size: 1.3rem; color: var(--inv-primary); }
.ld-nav.is-stuck { padding: 8px clamp(16px, 4vw, 44px); background: color-mix(in srgb, var(--inv-bg) 94%, transparent); backdrop-filter: blur(8px); box-shadow: 0 1px 0 color-mix(in srgb, var(--inv-text) 10%, transparent); }
.leida .kit-to-top { background: var(--ld-grad); color: #fff; }
@media (max-width: 899px) {
    .ld-nav { padding: 10px 14px; }
    .ld-nav .kit-nav-toggle { margin-left: auto; font-size: 1.5rem; color: var(--inv-text); }
    .ld-nav .kit-nav-links { display: none; }
    .ld-nav.is-open .kit-nav-links { display: flex; flex-direction: column; gap: 12px; position: absolute; top: 58px; left: 12px; right: 12px; padding: 22px; background: var(--inv-bg); border-radius: 18px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .3); }
}

/* ---------- Hero ---------- */
.ld-hero { position: relative; min-height: 100svh; padding: 100px clamp(18px, 5vw, 60px) 60px; display: grid; align-items: center; overflow: clip; }
.ld-hero::before { content: ""; position: absolute; width: 60vmax; aspect-ratio: 1; right: -18vmax; top: -30vmax; border-radius: 50%; background: var(--ld-grad); opacity: .14; filter: blur(40px); }
.ld-hero-grid { position: relative; max-width: 1120px; width: 100%; margin: 0 auto; display: grid; gap: 44px; align-items: center; }
@media (min-width: 900px) { .ld-hero-grid { grid-template-columns: 1fr 380px; gap: 70px; } }
.ld-names { font-size: clamp(3rem, 9vw, 6.4rem); overflow-wrap: anywhere; }
.ld-names em { font-style: normal; color: var(--inv-primary); margin: 0 .06em; }
.ld-subtitle { max-width: 480px; margin: 20px 0 0; font-size: 1.1rem; color: var(--ld-muted); }
.ld-hero-date { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; }
.ld-hero-date span { padding: 8px 18px; border-radius: 999px; background: #fff; box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .3); font-weight: 700; font-size: .92rem; }

/* Story viewer */
.ld-viewer { position: relative; width: min(380px, 86vw); margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 26px; overflow: hidden; background: #111; box-shadow: 0 0 0 4px #fff, 0 0 0 7px transparent, 0 40px 70px -30px rgba(0, 0, 0, .55); isolation: isolate; }
.ld-viewer::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, .45), transparent 20%, transparent 62%, rgba(0, 0, 0, .55)); }
.ld-bars { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 4; display: flex; gap: 4px; }
.ld-bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0)); }
.ld-story-head { position: absolute; top: 22px; left: 12px; right: 12px; z-index: 4; display: flex; align-items: center; gap: 8px; color: #fff; font-size: .86rem; }
.ld-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--inv-primary); font-size: .72rem; font-weight: 700; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--inv-accent); }
.ld-now { opacity: .7; }
.ld-frames, .ld-frame { position: absolute; inset: 0; margin: 0; }
.ld-frame { opacity: 0; transition: opacity .45s ease; }
.ld-frame.is-on { opacity: 1; }
.ld-frame img { width: 100%; height: 100%; object-fit: cover; }
.ld-frame.is-on img { animation: ld-zoom 6s ease-out both; }
@keyframes ld-zoom { from { scale: 1.08; } to { scale: 1; } }
.ld-frame figcaption { position: absolute; z-index: 3; left: 50%; bottom: 96px; translate: -50% 0; max-width: 84%; padding: 8px 16px; border-radius: 10px; background: #fff; color: var(--inv-text); font-family: var(--inv-font-heading); font-weight: 800; font-size: 1.3rem; line-height: 1.2; text-align: center; rotate: -3deg; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); }
.ld-frame.is-on figcaption { animation: ld-pop .5s .2s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes ld-pop { from { scale: .4; opacity: 0; } }
.ld-tap { position: absolute; top: 70px; bottom: 80px; z-index: 3; width: 36%; border: 0; background: transparent; cursor: pointer; }
.ld-tap--prev { left: 0; }
.ld-tap--next { right: 0; width: 64%; }
.ld-tap:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }
.ld-reply { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 18px; border: 1.5px solid rgba(255, 255, 255, .8); border-radius: 999px; color: #fff; text-decoration: none; font-size: .92rem; }
.ld-reply svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; }
.ld-reply:hover svg { fill: var(--inv-accent); stroke: var(--inv-accent); }

/* ---------- Sections ---------- */
.ld-section { max-width: 1080px; margin: 0 auto; padding: clamp(64px, 9vw, 104px) 22px; }
.ld-welcome, .ld-family, .ld-countdown, .ld-contact { text-align: center; }
.ld-title { margin-bottom: 30px; text-align: center; }
.ld-title h2 { display: inline-block; padding: 6px 18px 10px; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .35); font-size: clamp(1.9rem, 4.6vw, 2.9rem); rotate: -1.5deg; }
.ld-section:nth-of-type(even) .ld-title h2 { rotate: 1.5deg; }
.ld-prose { max-width: 640px; margin: 0 auto; font-size: 1.1rem; }
.ld-prose p { margin: 0 0 1em; }
.ld-quote-author { font-style: italic; }
.ld-lead { color: var(--ld-muted); margin: 0 0 22px; }

/* Couple: profile cards with a story ring */
.ld-couple-grid { display: grid; gap: 26px; }
@media (min-width: 760px) { .ld-couple-grid { grid-template-columns: 1fr 1fr; } }
.ld-person { padding: 34px 26px; border-radius: 26px; background: #fff; text-align: center; box-shadow: 0 20px 40px -30px rgba(0, 0, 0, .4); }
.ld-portrait { margin: 0 auto 18px; width: 180px; aspect-ratio: 1; padding: 5px; border-radius: 50%; background: var(--ld-grad); }
.ld-portrait img, .ld-initial { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid #fff; display: block; }
.ld-initial { display: grid; place-items: center; background: var(--ld-soft); font-family: var(--inv-font-heading); font-weight: 800; font-size: 4rem; color: var(--inv-primary); }
.ld-person h3 { font-size: 1.6rem; margin-bottom: 8px; }
.ld-person p { color: var(--ld-muted); margin: 0; }

/* Family */
.ld-family-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; }
.ld-family-list div { padding: 14px 24px; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px -20px rgba(0, 0, 0, .35); }
.ld-family-list dt { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--inv-primary); }
.ld-family-list dd { margin: 2px 0 0; font-weight: 700; font-size: 1.1rem; }

/* Story: highlights */
.ld-story-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 30px; }
@media (min-width: 760px) { .ld-story-list { grid-template-columns: 1fr 1fr; } }
.ld-story-item { padding: 26px; border-radius: 26px; background: #fff; box-shadow: 0 20px 40px -30px rgba(0, 0, 0, .4); }
.ld-story-photo { margin: 0 0 18px; width: 120px; aspect-ratio: 1; padding: 4px; border-radius: 50%; background: var(--ld-grad); }
.ld-story-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid #fff; }
.ld-story-text h3 { font-size: 1.45rem; margin-bottom: 8px; }
.ld-story-text p { margin: 0 0 .5em; }

/* Events: post cards */
.ld-event-list { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.ld-event { position: relative; padding: 26px 24px; border-radius: 22px; background: #fff; box-shadow: 0 20px 40px -30px rgba(0, 0, 0, .4); }
.ld-event-num { margin: 0 0 14px; width: 48px; height: 48px; padding: 3px; border-radius: 50%; background: var(--ld-grad); }
.ld-event-num span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; background: var(--inv-primary); color: #fff; font-weight: 700; }
.ld-event-time { font-family: var(--inv-font-heading); font-weight: 800; font-size: 2.4rem; line-height: 1; margin: 0 0 4px; color: var(--inv-primary); }
.ld-event h3 { font-size: 1.35rem; margin-bottom: 6px; }
.ld-event-place { font-weight: 700; margin: 10px 0 0; }
.ld-event-address, .ld-event-notes { margin: 2px 0 0; color: var(--ld-muted); font-size: .95rem; }
.leida .kit-event-actions { justify-content: flex-start; margin-top: 14px; }
.leida .kit-button { border-radius: 999px; background: var(--ld-soft); color: var(--inv-primary); border: 0; font-weight: 700; }
.leida .kit-button:hover { background: var(--inv-primary); color: #fff; }

/* Countdown sticker */
.ld-sticker { display: inline-block; max-width: 100%; padding: 22px clamp(16px, 4vw, 34px) 20px; border-radius: 24px; background: #fff; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .45); rotate: -2deg; }
.ld-sticker-title { margin: 0 0 10px; font-family: var(--inv-font-heading); font-weight: 800; font-size: 1.3rem; background: var(--ld-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld-sticker .kit-countdown { gap: clamp(6px, 2vw, 12px); }
.ld-sticker .kit-countdown-unit { min-width: 0; width: clamp(62px, 16vw, 92px); padding: 10px 4px; border-radius: 12px; background: var(--ld-grad); color: #fff; }
.ld-sticker .kit-countdown-value { font-family: var(--inv-font-heading); font-weight: 800; font-size: clamp(1.7rem, 5vw, 2.6rem); }
.ld-sticker .kit-countdown-label { font-size: clamp(.58rem, 1.6vw, .72rem); opacity: .9; }
.ld-sticker-date { margin: 12px 0 0; font-weight: 700; color: var(--ld-muted); font-size: .9rem; }

/* Gallery: profile grid */
.ld-gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ld-gallery-grid a { aspect-ratio: 4 / 5; border-radius: 0; }
.ld-gallery-grid a:first-child { border-top-left-radius: 18px; }
.ld-gallery-grid a:nth-child(3) { border-top-right-radius: 18px; }
.ld-gallery-grid a:nth-last-child(3) { border-bottom-left-radius: 18px; }
.ld-gallery-grid a:last-child { border-bottom-right-radius: 18px; }

/* RSVP */
.ld-rsvp-card { max-width: 660px; margin: 0 auto; padding: clamp(26px, 5vw, 48px); border-radius: 28px; background: #fff; box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .5); text-align: center; }
.leida .inv-rsvp__submit { border-radius: 999px; background: var(--ld-grad); font-weight: 700; }

/* Info */
.ld-info-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.ld-info-item { padding: 24px; border-radius: 22px; background: #fff; box-shadow: 0 20px 40px -30px rgba(0, 0, 0, .4); }
.ld-info-item h3 { font-size: 1.25rem; margin-bottom: 6px; color: var(--inv-primary); }
.ld-info-item p { margin: 0 0 .5em; }
.ld-faq { max-width: 720px; margin: 44px auto 0; }
.ld-faq details { margin-top: 10px; padding: 14px 20px; border-radius: 16px; background: var(--ld-soft); }
.ld-faq summary { cursor: pointer; font-weight: 700; }
.ld-faq details p { margin: 8px 0 0; color: var(--ld-muted); }

/* Contact */
.ld-contact-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.ld-contact-person { min-width: 220px; padding: 20px 26px; border-radius: 20px; background: #fff; box-shadow: 0 20px 40px -30px rgba(0, 0, 0, .4); }
.ld-contact-name { font-family: var(--inv-font-heading); font-weight: 800; font-size: 1.5rem; margin: 0; }
.ld-contact-person a { color: var(--inv-primary); font-weight: 700; text-decoration: none; }

/* Footer */
.ld-footer { padding: 64px 22px; text-align: center; background: var(--ld-grad); color: #fff; }
.ld-footer-message { margin: 0 0 6px; opacity: .9; }
.ld-footer-names { font-family: var(--inv-font-heading); font-weight: 800; font-size: clamp(2.4rem, 7vw, 4rem); letter-spacing: -.02em; margin: 0 0 8px; }
.ld-hashtag { display: inline-block; margin: 0 0 12px; padding: 6px 16px; border-radius: 999px; background: #fff; color: var(--inv-primary); font-weight: 700; }
.ld-footer .ld-kicker { color: rgba(255, 255, 255, .85); }

@media (prefers-reduced-motion: reduce) { .ld-frame, .ld-frame img, .ld-frame figcaption { transition: none; animation: none !important; } }
