/* ── Style-5: Slider Layout ─────────────────────────────────────── */
.captfyt-s5-wrapper {
    position: relative;
    --s5-cols: 3;
    --s5-gap: 16px;
}

/* Track that slides - native horizontal scroll, clipped without clipping the nav arrows below */
.captfyt-s5-track {
    display: flex;
    box-sizing: border-box;
    gap: var(--s5-gap);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.captfyt-s5-track::-webkit-scrollbar { display: none; height: 0; }

/* Each slide = 1/cols width */
.captfyt-s5-slide {
    box-sizing: border-box;
    scroll-snap-align: start;
    flex: 0 0 calc((100% - var(--s5-gap) * (var(--s5-cols) - 1)) / var(--s5-cols));
    min-width: 0;
}

/* Arrow buttons */
.captfyt-s5-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    font: inherit;
    line-height: 1;
    position: absolute !important; top: 50% !important; transform: translateY(-50%) !important;
    width: 40px !important; height: 40px !important; min-width: 40px !important; min-height: 40px !important; border-radius: 50% !important;
    background: rgba(255,255,255,0.92) !important; border: 1.5px solid #e5e7eb !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    cursor: pointer; z-index: 10; transition: all 0.2s;
    color: #374151 !important;
}
.captfyt-s5-btn:hover { background: #fff !important; box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important; transform: translateY(-50%) scale(1.08) !important; }
.captfyt-s5-btn:focus-visible,
.captfyt-s5-dot:focus-visible,
.captfyt-inline-close:focus-visible { outline: 2px solid var(--captfyt-primary, #2271b1); outline-offset: 2px; }
.captfyt-s5-btn.disabled { opacity: 0.35; pointer-events: none; }
.captfyt-s5-btn svg { width: 18px !important; height: 18px !important; flex-shrink: 0; stroke: currentColor !important; fill: none !important; }
.captfyt-s5-prev { left: -16px; }
.captfyt-s5-next { right: -16px; }

/* Dots */
.captfyt-s5-dots {
    display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 14px;
    padding: 0; list-style: none;
}
.captfyt-s5-dot {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    display: block;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    font: inherit;
    line-height: 1;
    width: 7px; height: 7px; min-width: 7px; max-width: 7px; min-height: 7px;
    border-radius: 50%;
    background: #d1d5db; cursor: pointer; transition: all 0.2s; border: none;
}
.captfyt-s5-dot.active { background: var(--captfyt-primary, #2271b1); width: 20px; max-width: 20px; border-radius: 4px; }

/* Responsive */
@media (max-width: 1024px) { .captfyt-s5-wrapper { --s5-cols: 2; } }
@media (max-width: 600px)  { .captfyt-s5-wrapper { --s5-cols: 1; } }

/* ── "Carousel" toolbar variant (Shorts Style 2) ────────────────────────
 * A counter ("01 / 05") + inline prev/next buttons sit in a small toolbar
 * ABOVE the track, plus a scroll-progress bar below it, instead of the
 * default side-flanking arrows + dots. Purely additive via the
 * `captfyt-s5-wrapper--carousel` modifier class - every other slider on
 * the site (Grid styles, Reel Card) keeps the original side-arrow layout
 * untouched, since they never get this class or these extra elements. */
.captfyt-s5-wrapper--carousel { padding: 0 2px; }

.captfyt-s5-wrapper--carousel .captfyt-s5-prev,
.captfyt-s5-wrapper--carousel .captfyt-s5-next {
    position: static !important;
    top: auto !important; left: auto !important; right: auto !important;
    transform: none !important;
    width: 34px !important; height: 34px !important;
    min-width: 34px !important; min-height: 34px !important;
}
.captfyt-s5-wrapper--carousel .captfyt-s5-btn:hover {
    transform: none !important;
}

.captfyt-s5-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.captfyt-s5-counter {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--captfyt-s5-meta, #6b7280);
    margin-right: 6px;
}

.captfyt-s5-progress {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
    margin-top: 14px;
}
.captfyt-s5-progress-bar {
    height: 100%;
    border-radius: 999px;
    width: 20%;
    background: var(--captfyt-primary, #2271b1);
    transition: width 0.2s ease;
}

/* Inline play (added via Video Play Mode = "Play Inline on Page") */
.captfyt-inline-iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.captfyt-inline-close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 5; line-height: 0; }
.captfyt-inline-close:hover { background: rgba(0, 0, 0, 0.85); }
