/* ==========================================================
   MULTIMEDIA TESTIMONY SEQUENCE — carousel.css
   Cinematic auto-advancing story component
   ========================================================== */

/* ---- Container ---- */
.mc-sequence {
    position: relative;
    height: clamp(480px, 82vh, 900px);
    overflow: hidden;
    background: #06090f;
    /* Break out of the 680px narrative column */
    margin-top: 72px;
    margin-bottom: 72px;
    margin-left: calc(-1 * max(0px, (100vw - 680px) / 2 + 24px));
    margin-right: calc(-1 * max(0px, (100vw - 680px) / 2 + 24px));
    isolation: isolate;
}

/* ---- Backdrop layers — two panels for crossfade ---- */
.mc-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.mc-backdrop.is-active {
    opacity: 1;
}

/* ---- Video backdrop ---- */
.mc-video-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.mc-video-backdrop.is-active {
    opacity: 1;
}

/* ---- Gradient scrim — readability over imagery ---- */
.mc-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    /* Strong gradient at bottom where text lives; very subtle at top */
    background:
        linear-gradient(
            to top,
            rgba(4, 8, 16, 0.90) 0%,
            rgba(4, 8, 16, 0.65) 28%,
            rgba(4, 8, 16, 0.22) 58%,
            rgba(4, 8, 16, 0.06) 100%
        ),
        /* Left-side vignette to anchor the text */
        linear-gradient(
            to right,
            rgba(4, 8, 16, 0.45) 0%,
            transparent 55%
        );
}

/* Transition slides use a heavier overall scrim */
.mc-sequence[data-slide-type="transition"] .mc-scrim {
    background: rgba(4, 8, 16, 0.52);
}

/* ---- Editorial content area ---- */
.mc-content {
    position: absolute;
    bottom: 108px; /* clears the controls bar */
    left: 0;
    right: 0;
    padding: 0 clamp(28px, 7vw, 88px);
    z-index: 3;
    max-width: 800px;
    transition:
        opacity 0.45s cubic-bezier(0.4, 0, 0.6, 1),
        transform 0.55s cubic-bezier(0.19, 1, 0.22, 1);
}

.mc-content.is-exiting {
    opacity: 0;
    transform: translateY(-14px);
    pointer-events: none;
}

.mc-content.is-entering {
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
}

.mc-content.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section label — small caps above content */
.mc-label {
    display: block;
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 14px;
}

/* Main title — used for transition slides */
.mc-title {
    font-family: var(--font-serif, Georgia, serif);
    font-size: clamp(30px, 5vw, 60px);
    font-weight: 300;
    line-height: 1.18;
    letter-spacing: -0.01em;
    color: #ffffff;
    margin: 0 0 20px;
}

/* Quote — large italic voice, used for portrait slides */
.mc-quote {
    font-family: var(--font-serif, Georgia, serif);
    font-size: clamp(17px, 2.6vw, 24px);
    font-style: italic;
    line-height: 1.60;
    color: rgba(255, 255, 255, 0.93);
    margin: 0 0 18px;
    max-width: 620px;
}

/* Narrative prose — narration and ambient slides */
.mc-narration {
    font-family: var(--font-serif, Georgia, serif);
    font-size: clamp(14px, 2vw, 17px);
    line-height: 1.78;
    color: rgba(255, 255, 255, 0.80);
    margin: 0 0 18px;
    max-width: 540px;
}

/* Attribution — speaker name and role */
.mc-attribution {
    display: block;
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

/* Inline caption / transcript snippet below attribution */
.mc-caption-inline {
    display: block;
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.42);
    margin-top: 10px;
    max-width: 480px;
    font-style: normal;
    border-left: 1.5px solid rgba(255, 255, 255, 0.18);
    padding-left: 12px;
}

/* ---- Controls bar ---- */
.mc-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 20px clamp(20px, 5vw, 64px) 22px;
    /* Softer gradient than scrim — controls sit on their own */
    background: linear-gradient(to top, rgba(4, 8, 16, 0.78) 0%, transparent 100%);
}

/* Progress track — thin line above the controls row */
.mc-progress-track {
    width: 100%;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 1px;
    margin-bottom: 14px;
    overflow: hidden;
}

.mc-progress-fill {
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 1px;
    /* Let JS drive width; transition only for smooth motion, not jumps */
    transition: width 0.08s linear;
}

/* Controls inner row: [dots · flex-1] [prev play next] [counter mute] */
.mc-controls-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Slide dots */
.mc-dots {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
}

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

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

.mc-dot:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.48);
}

/* Nav button group */
.mc-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Icon buttons */
.mc-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.62);
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}

.mc-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.10);
}

.mc-btn:focus-visible {
    outline: 1.5px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}

.mc-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Play button slightly larger */
.mc-btn-play svg {
    width: 17px;
    height: 17px;
}

/* Slide counter */
.mc-counter {
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 9.5px;
    letter-spacing: 0.10em;
    color: rgba(255, 255, 255, 0.32);
    white-space: nowrap;
    margin-right: 4px;
}

/* Mute button — rightmost */
.mc-btn-mute {
    margin-left: 2px;
}

/* ---- Sound unlock prompt — top-right ---- */
.mc-sound-prompt {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.mc-sound-prompt.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mc-sound-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.80);
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 9px 14px;
    cursor: pointer;
    border-radius: 2px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mc-sound-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.38);
    color: #ffffff;
}

.mc-sound-btn svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ---- Paused state dimming ---- */
.mc-sequence.is-user-paused .mc-scrim {
    /* Slightly deeper when user-paused — signals stopped state */
    background: rgba(4, 8, 16, 0.45);
}

/* ---- Mobile ---- */
@media (max-width: 700px) {
    .mc-sequence {
        height: 78vh;
        min-height: 400px;
        /* On small screens: flush to viewport edges */
        margin-left: calc(-1 * var(--spacing-unit, 24px));
        margin-right: calc(-1 * var(--spacing-unit, 24px));
    }

    .mc-content {
        bottom: 96px;
        padding: 0 22px;
    }

    .mc-controls {
        padding: 18px 18px 18px;
    }

    .mc-counter {
        display: none; /* saves space on small screens */
    }
}

/* ---- Reduced motion — respect system preference ---- */
@media (prefers-reduced-motion: reduce) {
    .mc-backdrop,
    .mc-video-backdrop,
    .mc-content,
    .mc-progress-fill {
        transition: opacity 0.2s ease !important;
        transform: none !important;
    }
}
