/*
 * Invitation kit - neutral base shared by all standard templates.
 * Loaded before the template's style.css; templates restyle everything through
 * the --inv-* palette variables, the --kit-* knobs below, or their own selectors.
 */

:root {
    --kit-radius: 12px;
    --kit-field-bg: color-mix(in srgb, var(--inv-bg) 85%, var(--inv-text) 4%);
    --kit-field-border: color-mix(in srgb, var(--inv-text) 18%, transparent);
    --kit-button-bg: var(--inv-primary);
    --kit-button-text: var(--inv-bg);
    --kit-overlay: rgba(10, 8, 12, .92);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--inv-bg); color: var(--inv-text); font-family: var(--inv-font-body); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
.kit-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Photo ---------- */
.kit-photo { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Navigation ---------- */
/* Sticky after scrolling (kit.js adds .is-stuck); templates restyle .kit-nav.is-stuck */
.kit-nav.is-stuck {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    background: color-mix(in srgb, var(--inv-bg) 94%, transparent);
    -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--inv-text) 12%, transparent), 0 10px 30px -18px rgba(0, 0, 0, .35);
    animation: kit-nav-in .35s ease;
}
@keyframes kit-nav-in { from { transform: translateY(-100%); } to { transform: none; } }
/* The stuck nav lives inside the hero: lift the hero above the sections, or a template that stacks its hero and
   sections (position + z-index) would paint the sections over the nav */
#hero:has(.kit-nav.is-stuck) { z-index: 50; }
.kit-nav-brand { display: none; text-decoration: none; }
.kit-nav.is-stuck .kit-nav-brand { display: inline-flex; }
.kit-nav a.is-current { color: var(--inv-primary); }
section[id], header[id] { scroll-margin-top: 84px; }

/* Back to top (markup from invitation.scripts; kit.js toggles .is-visible) */
.kit-to-top {
    position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 950;
    width: 48px; height: 48px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--inv-primary) 40%, transparent);
    background: var(--inv-bg); color: var(--inv-primary); cursor: pointer;
    display: grid; place-items: center; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .35);
    opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .3s, transform .3s, visibility .3s;
}
.kit-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.kit-to-top:hover { background: var(--inv-primary); color: var(--inv-bg); }
.kit-to-top svg { width: 20px; height: 20px; }

.kit-nav-toggle { display: none; }
@media (max-width: 760px) {
    .kit-nav-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; }
    .kit-nav-links { display: none; }
    .kit-nav.is-open .kit-nav-links { display: flex; flex-direction: column; }
}

/* ---------- Countdown ---------- */
.kit-countdown { display: flex; justify-content: center; gap: clamp(12px, 4vw, 36px); flex-wrap: wrap; }
.kit-countdown-unit { display: grid; justify-items: center; min-width: 64px; }
.kit-countdown-value { font-family: var(--inv-font-heading); font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.kit-countdown-label { font-size: clamp(.66rem, 2.6vw, .8rem); letter-spacing: .12em; text-transform: uppercase; opacity: .75; margin-top: 6px; max-width: 100%; overflow-wrap: anywhere; }

/* ---------- Events ---------- */
.kit-events { display: grid; gap: 20px; }
@media (min-width: 760px) { .kit-events { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); } }
.kit-event-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.kit-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px; border-radius: 999px;
    border: 1px solid currentColor; background: transparent; color: inherit;
    text-decoration: none; font-size: .92rem; cursor: pointer;
}
.kit-button--solid { background: var(--kit-button-bg); color: var(--kit-button-text); border-color: var(--kit-button-bg); }

/* ---------- Gallery + lightbox ---------- */
.kit-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 220px), 1fr)); gap: 8px; }
.kit-gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: calc(var(--kit-radius) / 2); }
.kit-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.kit-gallery a:hover img { transform: scale(1.04); }

.kit-lightbox { position: fixed; inset: 0; z-index: 1000; background: var(--kit-overlay); display: grid; place-items: center; padding: 56px 12px; }
.kit-lightbox[hidden] { display: none; }
.kit-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.kit-lightbox button { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.4rem; cursor: pointer; }
.kit-lightbox .kit-lb-close { top: 10px; right: 10px; }
.kit-lightbox .kit-lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.kit-lightbox .kit-lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- RSVP (platform component .inv-rsvp) ---------- */
.inv-rsvp { max-width: 560px; margin: 0 auto; min-width: 0; }
.inv-rsvp__intro, .inv-rsvp__deadline { text-align: center; }
.inv-rsvp__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; text-align: left; }
/* Grid items may shrink below their content, so a long label or option never widens the form past its card */
.inv-rsvp__form > * { min-width: 0; max-width: 100%; }
/* Side by side when there is room, one under the other on narrow screens */
.inv-rsvp__choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 10px; }
.inv-rsvp__choice label {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 12px;
    border: 1px solid var(--kit-field-border); border-radius: var(--kit-radius); cursor: pointer; text-align: center;
    min-width: 0; overflow-wrap: anywhere;
}
/* Drawn rather than native: on a dark page the browser paints an unchecked radio as a solid white dot that reads as selected */
.inv-rsvp__choice input {
    -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0; flex-shrink: 0;
    color: inherit; border: 1.5px solid currentColor; border-radius: 50%; background: transparent; opacity: .6;
}
.inv-rsvp__choice input:checked { opacity: 1; border-color: var(--inv-primary); background: radial-gradient(circle, var(--inv-primary) 0 3.5px, transparent 4px); }
.inv-rsvp__choice input:focus-visible { outline: 2px solid var(--inv-primary); outline-offset: 2px; }
.inv-rsvp__choice label:has(input:checked) { border-color: var(--inv-primary); background: var(--inv-primary-soft); }
.inv-rsvp__field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.inv-rsvp__field label, .inv-rsvp__field legend { font-size: .9rem; font-weight: 600; }
.inv-rsvp__field input:not([type=checkbox]):not([type=radio]), .inv-rsvp__field select, .inv-rsvp__field textarea {
    width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 50px; padding: 10px 14px; border: 1px solid var(--kit-field-border);
    border-radius: var(--kit-radius); background: var(--kit-field-bg); color: var(--inv-text); font: inherit;
}
.inv-rsvp__field textarea { min-height: 110px; resize: vertical; }
.inv-rsvp__field :focus { outline: 2px solid var(--inv-primary); outline-offset: 1px; }
.inv-rsvp__events label { display: flex; gap: 10px; align-items: center; font-weight: 400; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.inv-rsvp__events input { width: 18px; height: 18px; margin: 0; accent-color: var(--inv-primary); flex-shrink: 0; }
.inv-rsvp__optional { font-weight: 400; opacity: .7; }
.inv-rsvp__submit {
    min-height: 54px; border: 0; border-radius: 999px; background: var(--kit-button-bg); color: var(--kit-button-text);
    font-weight: 600; font-size: 1rem; letter-spacing: .04em; cursor: pointer; max-width: 100%; padding: 8px 18px;
}
.inv-rsvp__submit:disabled { opacity: .6; cursor: default; }
.inv-rsvp__message { padding: 14px 16px; border-radius: var(--kit-radius); text-align: center; background: var(--inv-primary-soft); }
.inv-rsvp__message.is-error { background: color-mix(in srgb, #C2413B 14%, var(--inv-bg)); }
.inv-rsvp__demo { font-size: .85rem; text-align: center; opacity: .7; margin: 0; }
.inv-rsvp__privacy { font-size: .78rem; text-align: center; opacity: .65; margin: 0; }
.inv-rsvp__privacy a { color: inherit; text-decoration: underline; }

/* ---------- Reveal on scroll ---------- */
.kit-reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.kit-reveal.is-visible { opacity: 1; transform: none; }
html:not(.kit-js) .kit-reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .kit-reveal { opacity: 1; transform: none; }
}

/* "Made with eInvite" line under the template footer (Silver). Neutral on purpose, same on every template. */
.kit-powered {
    display: block; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #FBF7F2; color: #463F4C; border-top: 1px solid #EAE1D8;
    font: 400 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0;
    text-align: center; text-decoration: none; text-transform: none;
}
.kit-powered strong { color: #8E2F4E; font-weight: 700; }
.kit-powered:hover strong { text-decoration: underline; }
/* Report this invitation (invitation/scripts.blade.php): small and quiet, under everything */
.kit-report {
    display: block; margin: 0; padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
    background: #FBF7F2; color: #7A7280;
    font: 400 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0;
    text-align: center; text-decoration: underline; text-transform: none;
}
.kit-powered + .kit-report { padding-top: 0; margin-top: -4px; }
.kit-report:hover { color: #463F4C; }

/* Language switch (invitation/scripts.blade.php): small, bottom-left, away from the back-to-top button */
.kit-lang {
    position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 950;
    display: flex; gap: 2px; padding: 3px; border-radius: 999px;
    background: color-mix(in srgb, var(--inv-bg, #fff) 88%, transparent); color: var(--inv-text, #1E1A22);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .14); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    font: 600 12px/1 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: .06em;
}
.kit-lang a { display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 8px; border-radius: 999px; color: inherit; text-decoration: none; opacity: .7; }
.kit-lang a:hover { opacity: 1; }
.kit-lang a[aria-current] { background: var(--inv-primary, #8E2F4E); color: var(--inv-bg, #fff); opacity: 1; }
@media print { .kit-lang { display: none; } }

/* Demo pages only: colour palette switch (invitation/scripts.blade.php, kit.js). Neutral, readable on any palette. */
.kit-palettes {
    position: fixed; right: max(12px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); z-index: 960;
    display: flex; flex-direction: row-reverse; align-items: center; gap: 10px;
    font: 400 14px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; letter-spacing: 0; text-transform: none; color: #1E1A22;
}
.kit-palettes__toggle {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border: 0; border-radius: 16px; cursor: pointer;
    background: rgba(255, 255, 255, .94); color: #1E1A22; box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font: inherit;
}
.kit-palettes__toggle svg { width: 24px; height: 24px; color: var(--inv-primary, #8E2F4E); }
.kit-palettes__toggle-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.kit-palettes__toggle:hover, .kit-palettes__toggle[aria-expanded="true"] { background: #fff; }
.kit-palettes__toggle:focus-visible, .kit-palettes__option:focus-visible { outline: 2px solid #8E2F4E; outline-offset: 2px; }
.kit-palettes__panel {
    width: min(250px, calc(100vw - 96px)); max-height: min(70vh, 460px); overflow-y: auto; padding: 14px; border-radius: 16px;
    background: #fff; box-shadow: 0 10px 34px rgba(0, 0, 0, .22); animation: kit-palettes-in .18s ease;
}
.kit-palettes__panel[hidden] { display: none; }
@keyframes kit-palettes-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.kit-palettes__title { margin: 0; font-weight: 700; font-size: 14px; }
.kit-palettes__hint { margin: 2px 0 10px; font-size: 12px; color: #6B6470; }
.kit-palettes__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.kit-palettes__option {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 12px;
    background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.kit-palettes__option:hover { background: #F6F1EC; }
.kit-palettes__option[aria-pressed="true"] { border-color: #E4D6CB; background: #FBF7F2; font-weight: 600; }
.kit-palettes__swatches { display: flex; flex: none; }
.kit-palettes__swatches span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.kit-palettes__swatches span + span { margin-left: -7px; }
.kit-palettes__name { flex: 1; min-width: 0; }
.kit-palettes__check { width: 18px; height: 18px; flex: none; color: #8E2F4E; visibility: hidden; }
.kit-palettes__option[aria-pressed="true"] .kit-palettes__check { visibility: visible; }
@media (max-width: 520px) {
    .kit-palettes { top: auto; bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px)); transform: none; align-items: flex-end; }
    .kit-palettes__toggle { padding: 8px 7px; }
    .kit-palettes__toggle-label { display: none; }
}
@media print { .kit-palettes { display: none; } }
