/*
 * EBCL YouTube Carousel — Bleu & Or Classique
 * Loaded on the live ebc-l.fr site via functions.php
 * Renders a video carousel in the sidebar between searchform and Pages
 * Theme-aware via the social-magazine theme's CSS variables
 */

/* ============================================================
   CAROUSEL CONTAINER
   ============================================================ */
.ebcl-yt-carousel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin: 1.25rem 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ebcl-yt-carousel h3 {
    font-size: 1rem;
    color: var(--ebcl-primary, #245d99);
    margin: 0 0 0.6rem;
    padding-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    border-bottom: 2px solid var(--ebcl-border, #d4dbe4);
    font-family: var(--ebcl-font-heading, "Inter", -apple-system, sans-serif);
}

/* ============================================================
   VIDEO FRAME (16:9 with thumbnail + Play button)
   ============================================================ */
.ebcl-yt-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.6rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ebcl-yt-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ebcl-yt-play {
    position: absolute;
    inset: 0;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: background 150ms ease;
}

.ebcl-yt-play:hover {
    background: rgba(0, 0, 0, 0.15);
}

.ebcl-yt-play-icon {
    width: 54px;
    height: 54px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    padding-left: 4px;
    transition: background 150ms ease, transform 150ms ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ebcl-yt-play:hover .ebcl-yt-play-icon {
    background: rgba(196, 32, 38, 0.9);
    transform: scale(1.08);
}

.ebcl-yt-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ============================================================
   CAPTION (title + section)
   ============================================================ */
.ebcl-yt-caption {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    min-height: 2.5em;
    font-family: var(--ebcl-font-body, "Merriweather", Georgia, serif);
}

.ebcl-yt-badge {
    display: inline-block;
    background: var(--ebcl-accent, #c9a84c);
    color: #1a2533;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--ebcl-font-heading, "Inter", -apple-system, sans-serif);
    vertical-align: middle;
}

.ebcl-yt-badge[hidden] { display: none; }

.ebcl-yt-title {
    color: var(--ebcl-primary, #245d99);
    font-weight: 700;
    text-decoration: none;
    display: inline;
    font-family: var(--ebcl-font-heading, "Inter", -apple-system, sans-serif);
}

.ebcl-yt-title:hover {
    text-decoration: underline;
    color: var(--ebcl-primary, #245d99);
}

.ebcl-yt-section {
    color: var(--ebcl-text-muted, #64748b);
    font-style: italic;
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
}

/* ============================================================
   CONTROLS (prev / dots / next)
   ============================================================ */
.ebcl-yt-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.6rem 0;
}

.ebcl-yt-prev,
.ebcl-yt-next {
    background: var(--ebcl-primary-light, #e0ecf8);
    color: var(--ebcl-primary, #245d99);
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
    flex-shrink: 0;
}

.ebcl-yt-prev:hover,
.ebcl-yt-next:hover {
    background: var(--ebcl-primary, #245d99);
    color: #ffffff;
    transform: scale(1.1);
}

.ebcl-yt-dots {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.ebcl-yt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ebcl-border, #d4dbe4);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease;
}

.ebcl-yt-dot:hover {
    background: var(--ebcl-text-muted, #64748b);
}

.ebcl-yt-dot.active {
    background: var(--ebcl-primary, #245d99);
    transform: scale(1.4);
}

/* ============================================================
   SEE ALL LINK
   ============================================================ */
.ebcl-yt-see-all {
    display: block;
    text-align: center;
    font-size: 0.82rem;
    color: var(--ebcl-primary, #245d99);
    margin-top: 0.6rem;
    text-decoration: none;
    font-weight: 600;
    font-family: var(--ebcl-font-heading, "Inter", -apple-system, sans-serif);
    padding: 0.3rem 0;
    border-top: 1px solid var(--ebcl-border, #d4dbe4);
    padding-top: 0.5rem;
}

.ebcl-yt-see-all:hover {
    text-decoration: underline;
    color: var(--ebcl-primary, #245d99);
}

/* ============================================================
   DARK THEME OVERRIDES
   ============================================================ */
[data-theme="midnight"] .ebcl-yt-carousel,
[data-theme="obsidian"] .ebcl-yt-carousel,
[data-theme="twilight"] .ebcl-yt-carousel {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="midnight"] .ebcl-yt-section,
[data-theme="obsidian"] .ebcl-yt-section,
[data-theme="twilight"] .ebcl-yt-section {
    color: #cbd5e1;
}

/* ============================================================
   RESPONSIVE (smaller screens)
   ============================================================ */
@media (max-width: 768px) {
    .ebcl-yt-carousel {
        padding: 0.85rem;
        margin: 1rem 0;
    }

    .ebcl-yt-play-icon {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }
}
