.md-slider {
    position: relative;
    width: 100%;
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    outline: none;
}

.md-slider:focus-visible {
    box-shadow: 0 0 0 2px rgb(85, 200, 255), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.md-slider:not(.md-slider-ready) > img:not(:first-child),
.md-slider:not(.md-slider-ready) > video:not(:first-child),
.md-slider:not(.md-slider-ready) > .md-compare:not(:first-child) {
    display: none;
}

.md-slider:not(.md-slider-ready) > img,
.md-slider:not(.md-slider-ready) > video,
.md-slider:not(.md-slider-ready) > .md-compare > img:first-child {
    width: 100%;
    display: block;
}

/* Before the slider builds, a comparison child would otherwise stack both of
   its images; show only the first so nothing flashes tall. */
.md-slider:not(.md-slider-ready) > .md-compare > img:not(:first-child),
.md-slider:not(.md-slider-ready) > .md-compare > video {
    display: none;
}

.md-slider-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* Optional corner tag on a slide (set via data-badge, e.g. "COMING SOON"). */
.md-slider-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 6;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgb(0, 183, 255);
    color: #04121a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

@media (max-width: 600px) {
    .md-slider-badge { font-size: 11px; padding: 4px 10px; }
}

.md-slider-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 700ms ease-in-out;
    pointer-events: none;
}

.md-slider-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.md-slider-slide img,
.md-slider-slide video {
    display: block;
    width: 100%;
    /* !important overrides the generic `#markdown img { height:auto; margin:16px 0 }`
       rule (higher ID specificity) that would otherwise defeat object-fit and offset
       the absolutely-positioned slides. */
    height: 100% !important;
    max-width: none;
    margin: 0 !important;
    border-radius: 0;
    object-fit: contain;
    user-select: none;
}

.md-slider-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 20px 16px;
    font-size: 18px;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.md-slider-caption-empty {
    display: none;
}

/* A YouTube-facade slide fills the stage; the injected iframe fills the facade. */
.md-slide-facade .yt-facade {
    position: absolute;
    inset: 0;
}

.md-slide-facade .yt-facade iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.md-slider-has-dots .md-slider-caption {
    padding-bottom: 34px;
}

.md-slider-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.md-slider-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}

.md-slider-dot:hover {
    transform: scale(1.2);
}

.md-slider-dot.active {
    background: #fff;
}

.md-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 200ms ease, background 200ms ease;
    z-index: 3;
}

.md-slider:hover .md-slider-arrow,
.md-slider:focus-within .md-slider-arrow {
    opacity: 1;
}

.md-slider-arrow:hover {
    background: rgba(0, 0, 0, 0.75);
}

.md-slider-prev { left: 12px; }
.md-slider-next { right: 12px; }

/* ── Before/after comparison (a .md-compare slide, or standalone) ──────────
   Two images stacked in the same box; a draggable divider wipes between them.
   Reuses .md-slider-stage / .md-slider-slide so it drops straight into the
   carousel and inherits the 16:9 letterboxing. */
.md-compare.md-compare-standalone {
    position: relative;
    width: 100%;
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.md-compare:not(.md-compare-ready) > img:not(:first-child),
.md-compare:not(.md-compare-ready) > video {
    display: none;
}

.md-compare:not(.md-compare-ready) > img {
    width: 100%;
    display: block;
}

.md-compare-reveal {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    cursor: ew-resize;
    user-select: none;
}

.md-compare-after,
.md-compare-before {
    position: absolute;
    inset: 0;
}

.md-compare-before {
    will-change: clip-path;
}

/* Carries the shared pan/zoom transform; both sides transform identically so
   they stay aligned under the divider. */
.md-compare-zoom {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.md-compare-after img,
.md-compare-before img,
.md-compare-after video,
.md-compare-before video {
    pointer-events: none;
}

/* Zoom cursor affordances (only when zoom is enabled on the widget). */
.md-compare-zoomable.md-compare-zoomed { cursor: grab; }
.md-compare-zoomable.md-compare-zoomed.panning { cursor: grabbing; }

.md-compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 44px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.md-compare-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.md-compare-grip {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: transform 150ms ease, background 150ms ease;
}

.md-compare-reveal:hover .md-compare-grip,
.md-compare-reveal.dragging .md-compare-grip {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.08);
}

.md-compare-label {
    position: absolute;
    top: 12px;
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 2;
}

.md-compare-label-before { left: 12px; }
.md-compare-label-after { right: 12px; }

/* Group selector for CompareTemplate.js (multiple named comparison sets). */
.md-compare-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px;
}

.md-compare-tab {
    padding: 6px 14px;
    border: 2px solid var(--border-color-2);
    border-radius: 12px;
    background: transparent;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, letter-spacing 0.2s ease;
}

.md-compare-tab:hover {
    border-color: rgb(0, 183, 255);
    letter-spacing: 0.4px;
}

.md-compare-tab.is-active {
    border-color: rgb(0, 183, 255);
    background: rgba(0, 183, 255, 0.18);
}

@media (max-width: 600px) {
    .md-compare-tab {
        font-size: 14px;
        padding: 5px 11px;
    }
}

/* Left/right image pickers for a selectable group. Positioned at the two edges
   so each dropdown lines up with the side of the divider it controls. */
.md-compare-selects {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
}

.md-compare-select {
    flex: 1 1 0;
    min-width: 0;
    max-width: 320px;
    padding: 7px 12px;
    border: 2px solid var(--border-color-2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.md-compare-select-right {
    text-align: right;
    text-align-last: right;
}

/* HTML-authored dropdown picker (patch notes): the two dropdowns sit directly
   above the comparison, so trim the standalone box's top margin. */
.md-compare-picker > .md-compare-standalone {
    margin-top: 0;
}

.md-compare-select:hover,
.md-compare-select:focus {
    border-color: rgb(0, 183, 255);
    outline: none;
}

.md-compare-select option {
    background: #1e1e2e;
    color: #fff;
    text-align: left;
}

@media (max-width: 600px) {
    .md-compare-select {
        font-size: 13px;
        padding: 6px 9px;
    }
}

@media (max-width: 600px) {
    .md-slider-caption {
        font-size: 15px;
        padding: 30px 12px 14px;
    }

    .md-slider-has-dots .md-slider-caption {
        padding-bottom: 30px;
    }

    .md-slider-arrow {
        display: none;
    }

    .md-compare-label {
        top: 8px;
        padding: 3px 9px;
        font-size: 11px;
    }

    .md-compare-label-before { left: 8px; }
    .md-compare-label-after { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .md-slider-slide {
        transition: none;
    }
}
