/* =============================================================================
   Shared stylesheet for the first-party invitation designs: Fiesta (birthday),
   DateNight (date invitation), Noel and Fitri (holiday greetings).

   Every design gets its palette and type scale from custom properties declared
   here and overridden in templates/{code}/theme.css, so a new occasion is a
   dozen lines of CSS rather than another full stylesheet.

   Mobile first without exception. These invitations are opened on a phone, from
   WhatsApp, one-handed — so nothing depends on hover, nothing needs a minimum
   width, and tap targets stay at 44px.

   No @import, no web fonts, no external origins.
   ============================================================================= */

:root {
    /* Overridden per design in theme.css */
    --c-ink: #1c1917;
    --c-muted: #6b6560;
    --c-bg: #fdfcfb;
    --c-surface: #ffffff;
    --c-accent: #b45309;
    --c-accent-soft: #fef3c7;
    --c-line: rgba(28, 25, 23, .12);
    --c-on-accent: #ffffff;

    --font-display: ui-serif, Georgia, "Times New Roman", serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius: 14px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
    --band: clamp(3rem, 9vw, 5.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

body.celebration {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

.celebration img { max-width: 100%; height: auto; display: block; }
.celebration a { color: var(--c-accent); }

/* One column, always. The width cap is the readable measure, not a breakpoint. */
.cb-wrap { width: min(100% - 2.5rem, 40rem); margin-inline: auto; }
.cb-wrap--wide { width: min(100% - 2.5rem, 56rem); margin-inline: auto; }

.cb-band { padding-block: var(--band); }
.cb-band--tint { background: var(--c-accent-soft); }
.cb-band--surface { background: var(--c-surface); }

/* ── Type ─────────────────────────────────────────────────────────────────── */
.cb-display {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -.01em;
    margin: 0;
    font-size: clamp(2.4rem, 11vw, 4.5rem);
}
.cb-h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    line-height: 1.2;
    margin: 0 0 .5rem;
}
.cb-h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .25rem; }

.cb-eyebrow {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .72rem;
    font-weight: 600;
    color: var(--c-accent);
    margin: 0 0 .75rem;
}
.cb-lede { color: var(--c-muted); margin: 0 0 1.5rem; }
.cb-muted { color: var(--c-muted); }
.cb-center { text-align: center; }

/* Host-authored rich text: preserve their line breaks without letting a long
   pasted URL blow the layout out sideways. */
.cb-prose { white-space: pre-line; overflow-wrap: anywhere; }

/* ── Cover ────────────────────────────────────────────────────────────────── */
.cb-cover {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 3rem 1.25rem;
    background: var(--c-accent-soft);
    overflow: hidden;
}
/* .celebration img sets height:auto with higher specificity; the cover photo must fill the cover. */
.celebration .cb-cover__img,
.cb-cover__img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
/* Only drawn when there is a photo behind it — see the view. Without the scrim,
   pale artwork makes the names unreadable. */
.cb-cover__scrim {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,.55));
}
.cb-cover__body { position: relative; }
.cb-cover--photo { color: #fff; }
.cb-cover--photo .cb-eyebrow, .cb-cover--photo .cb-lede, .cb-cover--photo .cb-muted { color: rgba(255,255,255,.86); }

.cb-scroll-cue {
    position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    font-size: .75rem; letter-spacing: .16em; text-transform: uppercase;
    opacity: .7;
}

/* ── Cards, lists, details ────────────────────────────────────────────────── */
.cb-card {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.cb-card + .cb-card { margin-top: 1rem; }

.cb-facts { display: grid; gap: .9rem; margin: 0; }
.cb-fact { display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem; align-items: baseline; }
.cb-fact dt { color: var(--c-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.cb-fact dd { margin: 0; }
@media (max-width: 30rem) {
    .cb-fact { grid-template-columns: 1fr; gap: .1rem; }
}

.cb-portrait {
    width: clamp(7rem, 34vw, 11rem); aspect-ratio: 1;
    border-radius: 50%; object-fit: cover;
    margin-inline: auto;
    border: 4px solid var(--c-surface);
    box-shadow: var(--shadow);
}

.cb-timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--c-line); }
.cb-timeline li { position: relative; padding: 0 0 1.75rem 1.5rem; }
.cb-timeline li::before {
    content: ""; position: absolute; left: -7px; top: .55rem;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--c-accent); border: 2px solid var(--c-bg);
}
.cb-timeline li:last-child { padding-bottom: 0; }
.cb-timeline__year { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-accent); }
.cb-timeline__img { border-radius: 10px; margin-top: .6rem; }

.cb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 40rem) { .cb-grid { grid-template-columns: repeat(3, 1fr); } }
.cb-grid img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; width: 100%; }

.cb-names { display: flex; flex-wrap: wrap; gap: .4rem .9rem; justify-content: center; list-style: none; padding: 0; margin: 1rem 0 0; }
.cb-names li::after { content: "·"; margin-left: .9rem; color: var(--c-muted); }
.cb-names li:last-child::after { content: ""; margin: 0; }

/* ── Controls ─────────────────────────────────────────────────────────────── */
.cb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 44px; padding: .7rem 1.4rem;
    border-radius: 999px; border: 1px solid var(--c-accent);
    background: var(--c-accent); color: var(--c-on-accent);
    font: inherit; font-weight: 600; text-decoration: none;
    cursor: pointer;
}
.cb-btn--ghost { background: transparent; color: var(--c-accent); }
.cb-btn:disabled { opacity: .5; cursor: not-allowed; }
.cb-btn-row { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

.cb-field { display: block; margin-bottom: 1rem; }
.cb-field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.cb-field input, .cb-field select, .cb-field textarea {
    width: 100%; min-height: 44px; padding: .6rem .8rem;
    font: inherit; color: inherit;
    background: var(--c-surface);
    border: 1px solid var(--c-line); border-radius: 10px;
}
.cb-field textarea { min-height: 6.5rem; resize: vertical; }
.cb-field input:focus-visible, .cb-field select:focus-visible, .cb-field textarea:focus-visible,
.cb-btn:focus-visible, .celebration a:focus-visible {
    outline: 2px solid var(--c-accent); outline-offset: 2px;
}

.cb-choice { display: grid; gap: .5rem; }
.cb-choice label {
    display: flex; align-items: center; gap: .65rem;
    min-height: 44px; padding: .6rem .9rem;
    border: 1px solid var(--c-line); border-radius: 10px;
    background: var(--c-surface); cursor: pointer;
}
.cb-choice input { accent-color: var(--c-accent); width: 1.15rem; height: 1.15rem; }
.cb-choice label:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-soft); }

.cb-notice {
    padding: .8rem 1rem; border-radius: 10px;
    background: var(--c-accent-soft); border: 1px solid var(--c-line);
    margin-bottom: 1rem;
}
.cb-notice--error {
    background: #fef2f2; border-color: #fecaca; color: #991b1b;
}

.cb-copy {
    display: inline-flex; align-items: center; gap: .4rem;
    font: inherit; font-size: .85rem;
    background: none; border: 0; padding: .35rem .5rem; margin-left: .25rem;
    color: var(--c-accent); cursor: pointer; min-height: 32px;
}

.cb-footer { padding: 2.5rem 1.25rem 3.5rem; text-align: center; color: var(--c-muted); font-size: .9rem; }

/* Draft preview badge. Fixed so it survives the whole scroll — the point is that
   the owner cannot forget they are looking at unpublished work. */
.cb-preview-badge {
    position: fixed; z-index: 50; left: 50%; bottom: 1rem; transform: translateX(-50%);
    /* Fixed dark pill: --c-ink is light on dark designs (DateNight), which made it white on white. */
    background: #1f1b18; color: #fff;
    padding: .5rem 1rem; border-radius: 999px;
    font-size: .8rem; letter-spacing: .04em;
    box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
    .celebration *, .celebration *::before, .celebration *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
