/**
 * NDN Media Carousel — swipeable image/video strip.
 * Matches the NDN design-system palette (#1A1A1A + #A9834A) and the
 * empowering-cards aesthetic. Scroll-snap track, drag, arrows, scroll-into-view
 * video autoplay (muted).
 */

.mc-section {
    --mc-accent: var(--ndn-accent-dark, #A9834A);
    --mc-text: var(--ndn-text-main, #1A1A1A);
    --mc-muted: var(--ndn-text-secondary, #6B5E4B);
    --mc-surface: var(--ndn-surface, #ffffff);
    --mc-border: rgba(26, 26, 26, 0.10);

    position: relative;
    padding: 80px 0 90px;
    background: var(--mc-surface);
    font-family: var(--ndn-font-body, 'DM Sans', system-ui, sans-serif);
    color: var(--mc-text);
    overflow: hidden;
}
.mc-section *, .mc-section *::before, .mc-section *::after { box-sizing: border-box; }

.mc-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ─── Header ─── */
.mc-header {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mc-header .dc-eyebrow { margin-bottom: 14px; }
.mc-title {
    font-family: var(--ndn-font-heading, "Times New Roman", Times, serif);
    font-size: clamp(26px, 3.6vw, 40px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 12px;
    max-width: 760px;
}
.mc-subtitle {
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--mc-muted);
    max-width: 640px;
    margin: 0;
}

/* ─── Carousel shell ─── */
.mc-carousel { position: relative; }

.mc-track {
    display: flex;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 6px 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}
.mc-track::-webkit-scrollbar { display: none; }
.mc-track.is-dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; }
/* Continuous loop mode: no snap / no smooth so the marquee runs evenly */
.mc-track--marquee { scroll-snap-type: none; scroll-behavior: auto; }
.mc-track--marquee .mc-slide { scroll-snap-align: none; }

/* Center the strip when items don't overflow */
.mc-carousel[data-align="center"] .mc-track { justify-content: safe center; }

.mc-slide {
    scroll-snap-align: center;
    flex: 0 0 auto;
}

/* ─── Media card ─── */
.mc-media {
    position: relative;
    margin: 0;
    border-radius: var(--ndn-radius-lg, 22px);
    overflow: hidden;
    background: #0c0c0c;
    box-shadow: var(--ndn-shadow, 0 12px 30px rgba(0,0,0,0.08));
    width: 100%;
    height: 100%;
}
.mc-media .mc-img,
.mc-media .mc-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

/* Aspect ratios drive the slide width via the media box height */
.mc-track--portrait  .mc-slide { width: clamp(240px, 78vw, 300px); }
.mc-track--portrait  .mc-media { aspect-ratio: 9 / 16; }
.mc-track--square    .mc-slide { width: clamp(260px, 80vw, 360px); }
.mc-track--landscape .mc-slide { width: clamp(300px, 86vw, 460px); }
.mc-track--landscape .mc-media { aspect-ratio: 4 / 3; }
.mc-track--wide      .mc-slide { width: clamp(320px, 92vw, 680px); }
.mc-track--wide      .mc-media { aspect-ratio: 16 / 9; }
/* Wide format shows the FULL image (no cropping); the dark card frames it */
.mc-track--wide .mc-img,
.mc-track--wide .mc-video { object-fit: contain; }

/* ─── Grid mode (all-video) — vertical blocks side by side, no slider ─── */
.mc-carousel--grid { cursor: default; }
.mc-track--grid {
    display: grid;
    justify-content: center;
    gap: 18px;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
    cursor: default;
}
.mc-track--grid .mc-slide { width: auto; scroll-snap-align: none; }
.mc-track--grid .mc-video { object-fit: cover; }

/* Vertical (9:16) — narrow columns, capped so a single video isn't huge */
.mc-track--grid--vertical { grid-template-columns: repeat(auto-fit, minmax(220px, 300px)); }
.mc-track--grid--vertical .mc-media { aspect-ratio: 9 / 16; }

/* Horizontal (16:9) — wider columns */
.mc-track--grid--horizontal { grid-template-columns: repeat(auto-fit, minmax(300px, 460px)); }
.mc-track--grid--horizontal .mc-media { aspect-ratio: 16 / 9; }

@media (max-width: 560px) {
    .mc-track--grid--vertical { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .mc-track--grid--horizontal { grid-template-columns: 1fr; }
}

/* ─── Mute / unmute toggle on videos ─── */
.mc-mute {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 4;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.mc-mute:hover { background: rgba(0, 0, 0, 0.72); transform: scale(1.06); }
.mc-mute:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mc-mute__icon { width: 18px; height: 18px; }
.mc-mute__icon--on { display: none; }
.mc-mute.is-unmuted { background: var(--mc-accent, #A9834A); }
.mc-mute.is-unmuted .mc-mute__icon--muted { display: none; }
.mc-mute.is-unmuted .mc-mute__icon--on { display: block; }

/* ─── Caption ─── */
.mc-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 34px 16px 16px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
}

/* ─── Play badge on videos ─── */
.mc-badge {
    position: absolute;
    top: 12px; left: 12px;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 999px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    color: #fff;
    transition: opacity var(--ndn-transition, 0.3s ease);
}
.mc-badge svg { width: 16px; height: 16px; margin-left: 2px; }
.mc-slide--video.is-playing .mc-badge { opacity: 0; }

/* ─── Nav arrows ─── */
.mc-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 48px; height: 48px;
    display: grid; place-items: center;
    border: 1px solid var(--mc-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    color: var(--mc-text);
    box-shadow: var(--ndn-shadow-sm, 0 6px 16px rgba(0,0,0,0.05));
    cursor: pointer;
    transition: background var(--ndn-transition, 0.3s ease), transform var(--ndn-transition, 0.3s ease), opacity 0.2s ease;
}
.mc-nav svg { width: 22px; height: 22px; }
.mc-nav:hover { background: var(--mc-accent); color: #fff; }
.mc-nav--prev { left: 8px; }
.mc-nav--next { right: 8px; }
.mc-nav[hidden] { display: none; }

@media (max-width: 640px) {
    .mc-nav { width: 40px; height: 40px; }
    .mc-nav--prev { left: 2px; }
    .mc-nav--next { right: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .mc-track { scroll-behavior: auto; }
}
