/* ==========================================================================
   Split - split screen: a fixed photo on the left changes with the section
   Signature: the left half is a sticky panel of stacked photos; as each section
   on the right reaches the middle of the screen, the panel cross-fades (with a
   slow zoom) to the photo mapped to that section (script.js). A section number
   counts along in the corner. On phones it becomes one column.
   Palette: --inv-primary (ink), --inv-accent (stone), --inv-bg, --inv-text
   ========================================================================== */

.split {
    --sp-muted: color-mix(in srgb, var(--inv-text) 62%, var(--inv-bg));
    --sp-line: color-mix(in srgb, var(--inv-text) 16%, var(--inv-bg));
    --sp-soft: color-mix(in srgb, var(--inv-accent) 45%, var(--inv-bg));
    --kit-radius: 2px;
    font-family: var(--inv-font-body);
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--inv-text);
    background: var(--inv-bg);
    overflow-x: clip;
    counter-reset: sp;
}
.split h1, .split h2, .split h3 { font-family: var(--inv-font-heading); font-weight: 400; line-height: 1.08; letter-spacing: -.01em; }
/* zero specificity, so the template's own heading classes can set their spacing */
:where(.split) :is(h1, h2, h3) { margin: 0; }
.sp-kicker { font-size: .74rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--sp-muted); margin: 0 0 12px; }

/* ---------- Layout ---------- */
.sp-layout { display: grid; }
@media (min-width: 960px) { .sp-layout { grid-template-columns: 46% 1fr; } }
.sp-panel { display: none; }
@media (min-width: 960px) {
    .sp-panel { display: block; position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--inv-accent); }
    .sp-panel-photo { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.1s ease; }
    .sp-panel-photo img { width: 100%; height: 100%; object-fit: cover; scale: 1.08; transition: scale 6s ease-out; }
    .sp-panel-photo.is-active { opacity: 1; }
    .sp-panel-photo.is-active img { scale: 1; }
    .sp-panel-index { position: absolute; left: 28px; bottom: 22px; font-family: var(--inv-font-heading); font-size: 4rem; line-height: 1; color: #fff; mix-blend-mode: difference; }
    .sp-hero-mobile { display: none; }
}
.sp-content { min-width: 0; }

/* ---------- Navigation (over the content column) ---------- */
.sp-hero { position: relative; }
.sp-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding: 20px clamp(20px, 4vw, 56px); display: flex; justify-content: flex-end; }
.sp-nav .kit-nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 18px; }
.sp-nav a { text-decoration: none; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sp-muted); padding: 4px 0; }
.sp-nav a:hover, .sp-nav a.is-current { color: var(--inv-text); }
.sp-nav .kit-nav-brand { font-family: var(--inv-font-heading); font-size: 1.3rem; letter-spacing: 0; text-transform: none; color: var(--inv-text); margin-right: auto; }
.sp-nav.is-stuck { align-items: center; padding: 10px clamp(20px, 4vw, 56px); background: color-mix(in srgb, var(--inv-bg) 95%, transparent); box-shadow: 0 1px 0 var(--sp-line); }
@media (min-width: 960px) { .sp-nav.is-stuck { left: 46%; } }
.split .kit-to-top { background: var(--inv-text); color: var(--inv-bg); }
@media (max-width: 899px) {
    .sp-nav { padding: 12px 14px; }
    .sp-nav .kit-nav-toggle { color: var(--inv-text); font-size: 1.4rem; margin-left: auto; }
    .sp-nav .kit-nav-links { display: none; }
    .sp-nav.is-open .kit-nav-links { display: flex; flex-direction: column; gap: 12px; position: absolute; top: 56px; left: 12px; right: 12px; padding: 22px; background: var(--inv-bg); border: 1px solid var(--sp-line); }
}

/* ---------- Hero (right column) ---------- */
.sp-hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 110px clamp(22px, 6vw, 90px) 70px; }
.sp-names { font-size: clamp(3.4rem, 8vw, 6.6rem); line-height: .95; }
.sp-names span { display: block; }
.sp-names em { display: block; font-style: italic; font-size: .5em; color: var(--sp-muted); margin: .12em 0 .08em .1em; }
.sp-subtitle { max-width: 440px; margin: 28px 0 0; color: var(--sp-muted); font-size: 1.08rem; }
.sp-hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 0 40px; margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--inv-text); max-width: 520px; }
.sp-hero-facts dt { font-size: .7rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--sp-muted); }
.sp-hero-facts dd { margin: 4px 0 0; font-family: var(--inv-font-heading); font-size: 1.25rem; }
.sp-hero-mobile { margin: 40px 0 0; aspect-ratio: 4 / 5; overflow: hidden; }
.sp-hero-mobile img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Sections ---------- */
.sp-section { max-width: 760px; padding: clamp(70px, 10vw, 120px) clamp(22px, 6vw, 90px); border-top: 1px solid var(--sp-line); }
.sp-title { margin-bottom: 30px; counter-increment: sp; }
.sp-title-num::before { content: counter(sp, decimal-leading-zero); display: block; margin-bottom: 12px; font-size: .74rem; font-weight: 600; letter-spacing: .2em; color: var(--sp-muted); }
.sp-title h2 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); }
.sp-prose { font-size: 1.1rem; }
.sp-prose p { margin: 0 0 1em; }
.sp-prose p:first-child { font-family: var(--inv-font-heading); font-size: 1.5rem; line-height: 1.4; }
.sp-quote-author { font-style: italic; color: var(--sp-muted); }
.sp-lead { color: var(--sp-muted); margin: 0 0 24px; }

/* Couple */
.sp-couple-grid { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .sp-couple-grid { grid-template-columns: 1fr; } }
.sp-portrait { margin: 0 0 16px; aspect-ratio: 3 / 4; overflow: hidden; background: var(--sp-soft); }
.sp-portrait img, .sp-initial { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-initial { display: grid; place-items: center; font-family: var(--inv-font-heading); font-size: 5rem; }
.sp-person h3 { font-size: 1.6rem; margin-bottom: 6px; }
.sp-person p { color: var(--sp-muted); margin: 0; }

/* Family */
.sp-family-list { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--inv-text); }
.sp-family-list div { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--sp-line); }
.sp-family-list dt { font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--sp-muted); padding-top: 4px; }
.sp-family-list dd { margin: 0; font-family: var(--inv-font-heading); font-size: 1.25rem; }
@media (max-width: 560px) { .sp-family-list div { grid-template-columns: 1fr; gap: 2px; } }

/* Story (photos hidden on desktop: the panel shows them) */
.sp-story-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 50px; }
.sp-story-photo { margin: 0 0 18px; aspect-ratio: 5 / 4; overflow: hidden; }
.sp-story-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 960px) { .sp-story-photo { display: none; } }
.sp-story-text .sp-kicker { margin-bottom: 6px; }
.sp-story-text h3 { font-size: 1.8rem; margin-bottom: 8px; font-style: italic; }
.sp-story-text p { margin: 0 0 .6em; }

/* Events as a timetable */
.sp-event-list { border-top: 1px solid var(--inv-text); }
.sp-event { display: grid; grid-template-columns: 100px 1fr; gap: 4px 24px; padding: 22px 0; border-bottom: 1px solid var(--sp-line); }
.sp-event > *:not(.sp-event-time) { grid-column: 2; }
.sp-event-time { grid-row: 1 / span 6; font-family: var(--inv-font-heading); font-size: 1.8rem; line-height: 1; margin: 0; }
.sp-event h3 { font-size: 1.35rem; }
.sp-event .sp-kicker { margin: 2px 0 0; }
.sp-event-place { font-weight: 500; margin: 6px 0 0; }
.sp-event-address, .sp-event-notes { color: var(--sp-muted); margin: 2px 0 0; }
.split .kit-event-actions { justify-content: flex-start; margin-top: 12px; }
.split .kit-button { border-radius: 0; border: 1px solid var(--inv-text); color: var(--inv-text); background: transparent; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; }
.split .kit-button:hover { background: var(--inv-text); color: var(--inv-bg); }
@media (max-width: 560px) { .sp-event { grid-template-columns: 1fr; } .sp-event > * { grid-column: 1 !important; } .sp-event-time { grid-row: auto; } }

/* Countdown */
.sp-countdown .kit-countdown { justify-content: flex-start; gap: 0; border-top: 1px solid var(--inv-text); }
.sp-countdown .kit-countdown-unit { flex: 1; min-width: 0; padding: 18px 0; align-items: flex-start; justify-items: start; }
.sp-countdown .kit-countdown-value { font-size: clamp(2.4rem, 6vw, 4rem); }
.sp-countdown .kit-countdown-label { letter-spacing: .2em; }

/* Gallery */
.sp-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sp-gallery-grid a { aspect-ratio: 3 / 4; border-radius: 0; }
.sp-gallery-grid a:nth-child(3n+1) { grid-column: span 2; aspect-ratio: 16 / 10; }

/* RSVP */
.sp-rsvp-card { max-width: 560px; }
.split .inv-rsvp__submit { border-radius: 0; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }

/* Info */
.sp-info-grid { display: grid; gap: 28px; }
.sp-info-item h3 { font-size: 1.3rem; margin-bottom: 6px; }
.sp-info-item p { margin: 0 0 .5em; color: var(--sp-muted); }
.sp-faq { margin-top: 44px; }
.sp-faq details { border-top: 1px solid var(--sp-line); padding: 14px 0; }
.sp-faq summary { cursor: pointer; list-style: none; font-family: var(--inv-font-heading); font-size: 1.2rem; }
.sp-faq summary::-webkit-details-marker { display: none; }
.sp-faq summary::after { content: "+"; float: right; }
.sp-faq details[open] summary::after { content: "-"; }
.sp-faq details p { margin: 8px 0 0; color: var(--sp-muted); }

/* Contact */
.sp-contact-list { display: flex; flex-wrap: wrap; gap: 20px 60px; }
.sp-contact-name { font-family: var(--inv-font-heading); font-size: 1.7rem; margin: 0 0 4px; }
.sp-contact-person a { color: var(--inv-text); text-decoration: none; border-bottom: 1px solid var(--sp-line); }

/* Footer */
.sp-footer { padding: 80px clamp(22px, 6vw, 90px); border-top: 1px solid var(--inv-text); }
.sp-footer-message { color: var(--sp-muted); margin: 0 0 8px; }
.sp-footer-names { font-family: var(--inv-font-heading); font-size: clamp(2.6rem, 6vw, 4rem); margin: 0 0 8px; }
.sp-hashtag { margin: 0 0 8px; }
.sp-nav .kit-nav-brand { white-space: nowrap; }
