/* ==========================================================
   YT Video Carousel — Front-End Styles
   ========================================================== */

:root {
    --ytvc-accent:      #ff0000;
    --ytvc-arrow-bg:    #ff0000;
    --ytvc-arrow-color: #ffffff;
    --ytvc-card-bg:     #ffffff;
    --ytvc-card-radius: 12px;
    --ytvc-gap:         16px;
    --ytvc-transition:  0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wrapper */
.ytvc-carousel-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.ytvc-carousel-title {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
}

/* Stage — holds arrows + track */
.ytvc-carousel-stage {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Track container — clips overflow */
.ytvc-track-container {
    flex: 1;
    overflow: hidden;
    border-radius: var(--ytvc-card-radius);
}

/* Track — slides sit here */
.ytvc-track {
    display: flex;
    gap: var(--ytvc-gap);
    transition: transform var(--ytvc-transition);
    will-change: transform;
}

/* Individual slide */
.ytvc-slide {
    flex: 0 0 calc(
        (100% - (var(--ytvc-visible, 3) - 1) * var(--ytvc-gap)) / var(--ytvc-visible, 3)
    );
    min-width: 0;
}

/* Card */
.ytvc-card {
    background: var(--ytvc-card-bg);
    border-radius: var(--ytvc-card-radius);
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.10);
    transition: box-shadow var(--ytvc-transition), transform var(--ytvc-transition);
    cursor: pointer;
}

.ytvc-card:hover {
    box-shadow: 0 6px 28px rgba(0,0,0,.18);
    transform: translateY(-2px);
}

/* Thumbnail */
.ytvc-thumbnail-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.ytvc-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--ytvc-transition), opacity var(--ytvc-transition);
}

.ytvc-card:hover .ytvc-thumbnail {
    transform: scale(1.04);
    opacity: 0.85;
}

/* Play overlay */
.ytvc-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity var(--ytvc-transition);
}

.ytvc-play-overlay svg {
    width: 64px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
    transition: transform var(--ytvc-transition);
}

.ytvc-card:hover .ytvc-play-overlay svg {
    transform: scale(1.12);
}

.ytvc-play-bg  { fill: var(--ytvc-accent); opacity: .92; }
.ytvc-play-icon{ fill: #fff; }

/* Hide overlay when video is playing */
.ytvc-card.is-playing .ytvc-play-overlay,
.ytvc-card.is-playing .ytvc-thumbnail {
    opacity: 0;
    pointer-events: none;
}

/* Inline player container */
.ytvc-player-container {
    position: absolute;
    inset: 0;
    background: #000;
}

.ytvc-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Card info */
.ytvc-card-info {
    padding: 12px 14px 14px;
}

.ytvc-card-title {
    margin: 0 0 4px;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.35;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ytvc-card-channel {
    margin: 0;
    font-size: .78rem;
    color: #666;
}

/* =====================
   Navigation arrows
   ===================== */
.ytvc-nav {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--ytvc-arrow-bg, #ff0000);
    color: var(--ytvc-arrow-color, #fff);
    cursor: pointer;
    z-index: 10;
    transition: background var(--ytvc-transition), transform var(--ytvc-transition), opacity var(--ytvc-transition);
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    padding: 0;
    outline-offset: 3px;
}

.ytvc-nav:hover {
    filter: brightness(1.12);
    transform: scale(1.08);
}

.ytvc-nav:focus-visible {
    outline: 3px solid var(--ytvc-accent);
}

.ytvc-nav:disabled,
.ytvc-nav.is-hidden {
    opacity: 0.3;
    pointer-events: none;
}

.ytvc-nav svg {
    width: 52%;
    height: 52%;
    display: block;
    flex-shrink: 0;
    overflow: visible;
}

/* Dots */
.ytvc-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.ytvc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background var(--ytvc-transition), transform var(--ytvc-transition);
}

.ytvc-dot.is-active {
    background: var(--ytvc-accent);
    transform: scale(1.3);
}

/* Error */
.ytvc-error {
    padding: 16px;
    background: #fff3f3;
    border-left: 4px solid #cc0000;
    color: #cc0000;
    border-radius: 6px;
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 900px) {
    .ytvc-slide {
        flex-basis: calc(
            (100% - (var(--ytvc-visible-md, 2) - 1) * var(--ytvc-gap)) / var(--ytvc-visible-md, 2)
        );
    }
}

@media (max-width: 560px) {
    .ytvc-slide {
        flex-basis: 100%;
    }
    .ytvc-nav {
        width: 36px;
        height: 36px;
    }
}
