/* ── 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;
}

/* Card */
.captfyt-s5-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--captfyt-card-bg, #ffffff);
    border-radius: 10px;
    border: 1px solid var(--captfyt-card-border, #e5e7eb);
    box-shadow: var(--captfyt-card-shadow, 0 2px 8px rgba(0,0,0,0.07));
    transition: transform 0.2s, box-shadow 0.2s;
}
.captfyt-s5-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }

/* Thumbnail */
.captfyt-s5-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #b2bec3;
}
.captfyt-s5-thumbnail {
    width: 100% !important; height: 100% !important;
    object-fit: cover; display: block;
    transition: transform 0.3s;
}
.captfyt-s5-card:hover .captfyt-s5-thumbnail { transform: scale(1.04); }
.captfyt-s5-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.captfyt-s5-card:hover .captfyt-s5-play-overlay { opacity: 1; }
.captfyt-s5-play-overlay svg { width: 52px; height: 36px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }

.captfyt-s5-icon-pause { display: none; }
.captfyt-s5-card.captfyt-is-playing .captfyt-s5-icon-play { display: none; }
.captfyt-s5-card.captfyt-is-playing .captfyt-s5-icon-pause { display: block; }
.captfyt-s5-card.captfyt-is-playing .captfyt-s5-play-overlay { opacity: 1; }

.captfyt-s5-duration {
    position: absolute; right: 8px; bottom: 8px;
    background: rgba(0, 0, 0, 0.8); color: #fff;
    font-size: 11px; font-weight: 600; line-height: 1;
    padding: 3px 6px; border-radius: 4px; z-index: 2;
}

/* Body */
.captfyt-s5-body { padding: 12px 14px 14px; }
.captfyt-s5-title {
    font-size: 13px; font-weight: 700;
    color: var(--captfyt-s5-title, #0f0f0f);
    line-height: 1.4; margin: 0 0 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.captfyt-s5-stats {
    font-size: 11px; color: var(--captfyt-s5-meta, #6b7280);
    margin: -4px 0 8px;
}
.captfyt-s5-channel {
    display: flex; align-items: center; gap: 6px;
}
.captfyt-s5-ch-dot {
    width: 20px; height: 20px; border-radius: 50%;
    background: #ff0000; color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.captfyt-s5-ch-dot svg { width: 11px; height: 11px; fill: #fff; }
.captfyt-s5-ch-name {
    font-size: 11px; color: var(--captfyt-s5-meta, #6b7280);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 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.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); }
