/* ============================================================
   SECTION FOUR — THE COST
   2×2 grid of tiles + modal carousel
   ============================================================ */

/* ── Intro text block ──────────────────────────────────────── */
.costs-intro {
    /* inherits from .narrative-text — no extra rules needed */
}

/* ── 2×2 grid ──────────────────────────────────────────────── */
.costs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1px;
    height: auto;
    min-height: 0;
    margin-left:  -64px;
    margin-right: -64px;
    margin-top: 48px;
    margin-bottom: 56px;
    background: #e0e0e0;
}

/* ── Tile ──────────────────────────────────────────────────── */
.costs-tile {
    position: relative;
    overflow: hidden;
    border: none;
    padding: 0;
    margin: 0;
    background: #111;
    cursor: pointer;
    display: block;
    text-align: left;
    width: 100%;
    min-height: 240px;
    transition: none;
}

/* tile cover image — fills the tile */
.costs-tile-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s;
}

.costs-tile:hover .costs-tile-img {
    transform: scale(1.035);
}

/* dark gradient veil over the image */
.costs-tile-veil {
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.70) 0%, rgba(0,0,0,0.22) 55%, rgba(0,0,0,0.06) 100%);
    transition: background 0.3s;
}

.costs-tile:hover .costs-tile-veil,
.costs-tile:focus-visible .costs-tile-veil {
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.32) 55%, rgba(0,0,0,0.10) 100%);
}

/* hide unused elements */
.costs-tile-stat,
.costs-tile-desc,
.costs-tile-caret {
    display: none;
}

/* text block pinned to bottom-left */
.costs-tile-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: clamp(14px, 2.5vw, 24px) clamp(18px, 3vw, 28px);
}

.costs-tile-eyebrow {
    display: block;
    font-family: var(--font-sans);
    font-size: clamp(8px, 0.9vw, 10px);
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 6px;
}

.costs-tile:hover .costs-tile-eyebrow {
    color: #ffffff;
}

.costs-tile-name {
    display: block;
    font-family: var(--font-sans);
    font-size: clamp(18px, 2.4vw, 30px);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: #ffffff;
    line-height: 1.1;
}

.costs-tile:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: -2px;
}

/* ── Post-grid closing prose ────────────────────────────────── */
.costs-closing {
    margin-top: 12px;
    padding-top: 8px;
}


/* ============================================================
   MODAL OVERLAY
   ============================================================ */

/* Outer overlay — semi-transparent, clicking it closes the modal */
.costs-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(2, 4, 9, 0.60);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vh, 36px) clamp(16px, 2vw, 36px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.costs-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Inner dialog panel — dark */
.costs-modal-inner {
    position: relative;
    width: 92vw;
    max-width: 1240px;
    height: 88vh;
    background: #0e1319;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 48px rgba(0,0,0,0.55);
    pointer-events: inherit;
}

/* When modal is closed, force ALL descendants to be non-interactive.
   .cost-slide.is-active has pointer-events:auto which would otherwise
   create an invisible full-viewport blocker. */
.costs-modal:not(.is-open) * {
    pointer-events: none !important;
}

/* Close button */
.costs-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 20;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.22);
    color: rgba(255,255,255,0.75);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.costs-modal-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.50);
}

.costs-modal-close:focus-visible {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}

/* Header strip */
.costs-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 18px clamp(24px, 5vw, 60px);
    display: flex;
    align-items: baseline;
    gap: 14px;
    background: transparent;
    pointer-events: none;
    border-radius: 6px 6px 0 0;
}

.costs-modal-eyebrow {
    font-family: var(--font-sans);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

.costs-modal-name {
    font-family: var(--font-sans);
    font-size: clamp(13px, 1.6vw, 17px);
    font-weight: 300;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.01em;
}


/* ============================================================
   CAROUSEL
   ============================================================ */
.costs-modal-inner .costs-carousel {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0 0 6px 6px;
}

.costs-carousel-track {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* ── Category groups: only the active group shows ───────────── */
.costs-slides-group {
    display: none;
    position: absolute;
    inset: 0;
}

.costs-slides-group.is-active {
    display: block;
}

/* ── Individual slide ──────────────────────────────────────── */
.cost-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(80px,10vh,110px) clamp(36px, 8vw, 130px) clamp(90px,11vh,120px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease, transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(28px);
    overflow-y: auto;
}

.cost-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.cost-slide.is-out-left {
    opacity: 0;
    transform: translateX(-28px);
}

.cost-slide.is-out-right {
    opacity: 0;
    transform: translateX(28px);
}


/* ============================================================
   SLIDE TYPES
   ============================================================ */

/* ── COMPARE — before / after ─────────────────────────────── */
.cost-slide--compare {
    /* no extra flex needed */
}

.csl-compare-row {
    display: flex;
    align-items: flex-start;
    gap: clamp(20px, 4vw, 60px);
}

.csl-compare-col {
    flex: 1;
    min-width: 0;
}

.csl-compare-label {
    font-family: var(--font-sans);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(0,0,0,0.35);
    margin-bottom: 14px;
    display: block;
}

.csl-compare-value {
    font-family: var(--font-sans);
    font-size: clamp(38px, 6.5vw, 82px);
    font-weight: 700;
    color: rgba(0,0,0,0.88);
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
    display: block;
}

.csl-compare-value.is-after {
    color: rgba(0,0,0,0.95);
}

.csl-compare-sub {
    font-family: var(--font-serif);
    font-size: clamp(12px, 1.5vw, 15px);
    font-style: italic;
    color: rgba(0,0,0,0.45);
    line-height: 1.5;
    display: block;
}

.csl-compare-sep {
    width: 1px;
    background: rgba(0,0,0,0.10);
    align-self: stretch;
    margin-top: 8px;
    flex-shrink: 0;
}

.csl-compare-arrow {
    align-self: center;
    font-size: 20px;
    color: rgba(0,0,0,0.20);
    flex-shrink: 0;
    padding-bottom: 24px; /* align with values */
}

.csl-compare-note {
    font-family: var(--font-serif);
    font-size: clamp(13px, 1.5vw, 15px);
    font-style: italic;
    color: rgba(0,0,0,0.45);
    line-height: 1.65;
    margin-top: clamp(24px, 3vw, 36px);
    max-width: 520px;
    padding-top: clamp(24px, 3vw, 36px);
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* ── STAT — single large number ──────────────────────────── */
.cost-slide--stat {}

.csl-stat-num {
    font-family: var(--font-sans);
    font-size: clamp(72px, 14vw, 160px);
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    line-height: 0.88;
    letter-spacing: -0.045em;
    margin-bottom: 20px;
    display: block;
}

.csl-stat-num .unit {
    font-size: 0.44em;
    font-weight: 300;
    letter-spacing: -0.01em;
    vertical-align: baseline;
}

.csl-stat-label {
    font-family: var(--font-serif);
    font-size: clamp(16px, 2.2vw, 22px);
    font-style: italic;
    color: rgba(255,255,255,0.65);
    line-height: 1.50;
    max-width: 480px;
    margin-bottom: 14px;
    display: block;
}

.csl-stat-context {
    font-family: var(--font-sans);
    font-size: 9.5px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    display: block;
}

/* ── FORMULA — compensation calc block ──────────────────── */
.cost-slide--formula {}

.csl-formula-row {
    display: flex;
    gap: clamp(16px, 3vw, 40px);
    align-items: flex-start;
    flex-wrap: wrap;
}

.csl-formula-item {
    flex: 1;
    min-width: 160px;
    padding: clamp(14px, 2.5vw, 24px) clamp(16px, 2.5vw, 28px);
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(0,0,0,0.02);
}

.csl-formula-val {
    font-family: var(--font-sans);
    font-size: clamp(28px, 4.5vw, 52px);
    font-weight: 700;
    color: rgba(0,0,0,0.85);
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    display: block;
}

.csl-formula-desc {
    font-family: var(--font-serif);
    font-size: clamp(12px, 1.4vw, 14px);
    font-style: italic;
    color: rgba(0,0,0,0.45);
    line-height: 1.5;
    display: block;
}

.csl-formula-note {
    font-family: var(--font-sans);
    font-size: clamp(11px, 1.2vw, 12.5px);
    letter-spacing: 0.03em;
    color: rgba(0,0,0,0.38);
    line-height: 1.65;
    margin-top: clamp(20px, 2.5vw, 32px);
    padding-top: clamp(20px, 2.5vw, 32px);
    border-top: 1px solid rgba(0,0,0,0.08);
    max-width: 540px;
}

/* ── TEXT — narrative prose ──────────────────────────────── */
.cost-slide--text {}

.csl-eyebrow {
    font-family: var(--font-sans);
    font-size: clamp(13px, 1.4vw, 15px);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.90);
    margin-bottom: 22px;
    display: block;
}

.csl-prose {
    font-family: var(--font-serif);
    font-size: clamp(15px, 1.9vw, 19px);
    line-height: 1.80;
    color: rgba(255,255,255,0.80);
    margin-bottom: 16px;
    max-width: 600px;
}

.csl-prose:last-child {
    margin-bottom: 0;
}

/* ── QUOTE — pull-quote style ────────────────────────────── */
.cost-slide--quote {}

.csl-quote-wrap {
    max-width: 660px;
    position: relative;
    padding-left: 28px;
}

.csl-quote-wrap::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: rgba(255,255,255,0.22);
}

.csl-quote-text {
    font-family: var(--font-serif);
    font-size: clamp(18px, 2.8vw, 28px);
    font-style: italic;
    line-height: 1.58;
    color: rgba(255,255,255,0.90);
    margin-bottom: 22px;
}

.csl-quote-attr {
    font-family: var(--font-sans);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.40);
    display: block;
}

/* ── AUDIO — audio player wrapper inside modal ───────────── */
.cost-slide--audio {}

.csl-audio-label {
    font-family: var(--font-sans);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(0,0,0,0.35);
    margin-bottom: 18px;
    display: block;
}

.csl-audio-quote {
    font-family: var(--font-serif);
    font-size: clamp(15px, 1.8vw, 18px);
    font-style: italic;
    line-height: 1.70;
    color: rgba(0,0,0,0.65);
    margin-bottom: 24px;
    max-width: 580px;
}

/* Restyle audio-player for dark modal background */
.costs-modal-inner .audio-player {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
    max-width: 560px;
}

.costs-modal-inner .audio-play-button {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.70);
    border-color: rgba(255,255,255,0.18);
}

.costs-modal-inner .audio-play-button:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.costs-modal-inner .audio-transcript p {
    color: rgba(255,255,255,0.55);
}

.costs-modal-inner .audio-caption {
    color: rgba(255,255,255,0.35);
}

/* ── HAS-BG — existing slide with a background image ────────── */
.cost-slide.has-bg {
    background-size: cover;
    background-position: center;
}

/* ── HAS-GRID-BG — subtle line-grid on dark background ─────── */
.cost-slide.has-grid-bg {
    background-color: #0e1319;
    background-image:
        repeating-linear-gradient(0deg,   transparent, transparent 39px, rgba(255,255,255,0.055) 39px, rgba(255,255,255,0.055) 40px),
        repeating-linear-gradient(90deg,  transparent, transparent 39px, rgba(255,255,255,0.055) 39px, rgba(255,255,255,0.055) 40px);
}

.csl-bg-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.78) 100%);
    pointer-events: none;
}

/* content sits above the veil */
.cost-slide.has-bg > *:not(.csl-bg-veil) {
    position: relative;
    z-index: 1;
}

/* invert text colors for dark background */
.cost-slide.has-bg .csl-stat-num     { color: rgba(255,255,255,0.92); }
.cost-slide.has-bg .csl-stat-label   { color: rgba(255,255,255,0.68); }
.cost-slide.has-bg .csl-stat-context { color: rgba(255,255,255,0.40); }
.cost-slide.has-bg .csl-eyebrow      { color: rgba(255,255,255,0.50); }
.cost-slide.has-bg .csl-prose        { color: rgba(255,255,255,0.82); }
.cost-slide.has-bg .csl-quote-text   { color: rgba(255,255,255,0.90); }
.cost-slide.has-bg .csl-quote-attr   { color: rgba(255,255,255,0.45); }
.cost-slide.has-bg .csl-quote-wrap::before { background: rgba(255,255,255,0.28); }

/* ── COVER — full-bleed image opening slide ──────────────── */
.cost-slide--cover {
    background-size: cover;
    background-position: center;
    padding: 0;
    justify-content: flex-end;
}

.csl-cover-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.20) 55%, rgba(0,0,0,0.08) 100%);
    pointer-events: none;
}

.csl-cover-content {
    position: relative;
    z-index: 1;
    padding: clamp(32px, 4vw, 56px) clamp(36px, 8vw, 130px);
}

.csl-cover-eyebrow {
    display: block;
    font-family: var(--font-sans);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 10px;
}

.csl-cover-title {
    display: block;
    font-family: var(--font-sans);
    font-size: clamp(40px, 7.5vw, 88px);
    font-weight: 300;
    letter-spacing: -0.025em;
    color: #ffffff;
    line-height: 1.0;
}

/* ── IMAGE — full-bleed photo slide ──────────────────────── */
.cost-slide--image {
    background-size: cover;
    background-position: center;
    padding: 0;
}

/* ── CLOSING — heavy text ending ────────────────────────── */
.cost-slide--closing {
    background: transparent;
}

.csl-closing-line {
    font-family: var(--font-serif);
    font-size: clamp(13px, 1.7vw, 17px);
    font-style: italic;
    line-height: 1.80;
    color: rgba(255,255,255,0.55);
    margin-bottom: 14px;
    max-width: 580px;
    padding-left: 20px;
    border-left: 1.5px solid rgba(255,255,255,0.15);
}


/* ============================================================
   CAROUSEL CONTROLS — dots/counter bar at bottom
   ============================================================ */
.costs-carousel-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(36px, 8vw, 130px);
    gap: 14px;
    background: transparent;
    z-index: 10;
}

/* ── Side navigation arrows ─────────────────────────────────── */
.costs-carousel-prev,
.costs-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.22);
    color: rgba(255,255,255,0.75);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.costs-carousel-prev { left: 16px; }
.costs-carousel-next { right: 16px; }

.costs-carousel-prev:hover,
.costs-carousel-next:hover {
    border-color: rgba(255,255,255,0.55);
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.costs-carousel-prev:disabled,
.costs-carousel-next:disabled {
    opacity: 0.20;
    cursor: default;
    pointer-events: none;
}

.costs-carousel-prev:focus-visible,
.costs-carousel-next:focus-visible {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}

.costs-carousel-dots {
    display: flex;
    align-items: center;
    gap: 7px;
}

.costs-carousel-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, width 0.28s, border-radius 0.28s;
    flex-shrink: 0;
}

.costs-carousel-dot.is-active {
    background: rgba(255,255,255,0.85);
    width: 18px;
    border-radius: 3px;
}

.costs-carousel-dot:hover:not(.is-active) {
    background: rgba(255,255,255,0.45);
}

.costs-carousel-counter {
    font-family: var(--font-sans);
    font-size: 9.5px;
    letter-spacing: 0.10em;
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
    flex-shrink: 0;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 800px) {
    .costs-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 44vw);
        height: auto;
        min-height: 0;
    }

    .csl-compare-row {
        flex-direction: column;
        gap: 14px;
    }

    .csl-compare-sep,
    .csl-compare-arrow {
        display: none;
    }

    .cost-slide {
        padding: 70px 24px 80px;
    }

    .costs-carousel-controls {
        padding: 0 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .costs-tile-img,
    .cost-slide,
    .costs-modal {
        transition: opacity 0.15s ease !important;
        transform: none !important;
    }
}

/* Video background for carousel slides */
.slide-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
