/**
 * Home Section: Médiathèque (Videos)
 * ===================================
 * Design based on Figma specifications
 * - Background: Blurred image with green overlay (#0E8040E5)
 * - Live video indicator on top right
 * - Video play buttons with auto-sliding carousel
 */

/* Section Container */
.mediatheque-section {
    position: relative;
    padding: 0;
    overflow: visible;
}

.mediatheque-section__live-area {
    position: relative;
    padding: var(--mediatheque-live-padding-bottom, 80px) 0 var(--mediatheque-live-padding-bottom, 80px);
    margin-bottom: calc(var(--mediatheque-overlap, 40px) * -1);
    overflow: hidden;
}

/* Background Image with Blur */
.mediatheque-section__background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(5px);
    transform: scale(1.1);
    /* Prevent blur edges from showing */
    z-index: 0;
}

/* Green Overlay */
.mediatheque-section__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(14, 128, 64, 0.9);
    /* #0E8040 with 90% opacity */
    z-index: 1;
}

/* Container */
.mediatheque-section__container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 3;
}

/* Main Content Layout - Two columns */
.mediatheque-section__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Left Column - Text Content */
.mediatheque-section__text {
    color: #FFFFFF;
    padding-top: 20px;
    min-width: 0; /* Prevent grid blowout */
}

/* Play Icon (Top left corner) */
.mediatheque-section__play-icon {
    width: auto;
    height: auto;
    background-color: transparent;
    border-radius: 0;
    display: block;
    margin-bottom: 30px;
}

.mediatheque-section__play-icon svg {
    display: block;
}

.mediatheque-section__play-icon i {
    display: none;
}

/* Title */
.mediatheque-section__title {
    font-family: 'Lato', 'Roboto', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

/* Description */
.mediatheque-section__description {
    font-family: 'Lato', 'Roboto', sans-serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    max-width: 500px;
}

/* Right Column - Live Video */
.mediatheque-section__live-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0; /* Prevent grid blowout */
}

/* Live Badge */
.mediatheque-section__live-badge {
    display: inline-block;
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin-bottom: 0; /* Removed margin-bottom for flex alignment */
    flex-shrink: 0; /* Prevent shrinking */
}

.mediatheque-section__live-badge svg {
    display: block;
    height: auto;
    max-width: 100%;
}

.mediatheque-section__live-badge::before {
    display: none;
}

/* Live Video Card */
.mediatheque-section__live-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    background: #FFFFFF;
    border: none !important;
    display: block; /* Changed from flex to block to simplify layout */
    width: 100%;
}

.mediatheque-section__live-header {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.mediatheque-section__live-video-wrapper {
    padding: 0 20px 20px; /* Re-adding padding here since we removed margin from video */
}

.mediatheque-section__live-video {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    margin: 0;
    border-radius: 12px;
}

.mediatheque-section__live-video img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mediatheque-section__live-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mediatheque-section__live-video-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.mediatheque-section__live-video-play i {
    color: #ED2024;
    font-size: 28px;
    margin-left: 5px;
}

.mediatheque-section__live-info {
    padding: 0; /* Removed padding for flex alignment */
    background: transparent; /* Transparent background */
}

.mediatheque-section__live-title {
    font-family: 'Lato', 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin: 0;
    line-height: 1.4;
}

/* Video Carousel Section */
.mediatheque-section__carousel-area {
    background: transparent;
    padding: 20px 0 80px;
}

.mediatheque-section__carousel-wrapper {
    margin-top: 0;
    position: relative;
}

.mediatheque-section__carousel-track-container {
    overflow: hidden;
    margin: 0 -10px;
}

.mediatheque-section__carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease-in-out;
    padding: 10px;
}

.mediatheque-section__video-card {
    flex: 0 0 calc(33.333% - 14px);
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 5px solid #FFFFFF;
    display: flex;
    flex-direction: column;
}

.mediatheque-section__video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10;
    min-height: 80px;
    pointer-events: none;
}

.mediatheque-section__video-title {
    font-family: 'Lato', 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.mediatheque-section__video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.mediatheque-section__video-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    width: 100%;
}

.mediatheque-section__video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mediatheque-section__video-card:hover .mediatheque-section__video-thumbnail img {
    transform: scale(1.05);
}

.mediatheque-section__video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

.mediatheque-section__video-card:hover .mediatheque-section__video-play {
    transform: translate(-50%, -50%) scale(1.1);
}

.mediatheque-section__video-play i {
    color: #ED2024;
    font-size: 20px;
    margin-left: 3px;
}

/* Carousel Dots */
.mediatheque-section__carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.mediatheque-section__carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(14, 128, 64, 0.4); /* Green #0E8040 with opacity */
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.mediatheque-section__carousel-dot.active,
.mediatheque-section__carousel-dot:hover {
    background: #0E8040; /* Green #0E8040 */
    transform: scale(1.2);
}

/* View All Button */
.mediatheque-section__action-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.mediatheque-section__action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: #ED2024;
    color: #FFFFFF;
    border-radius: 30px;
    font-family: 'Lato', 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}

.mediatheque-section__action-btn:hover {
    background: #c91a1e;
    color: #FFFFFF;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 32, 36, 0.4);
}

.mediatheque-section__action-btn i {
    font-size: 14px;
}

/* Video Modal */
.mediatheque-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.mediatheque-modal.active {
    display: flex;
}

.mediatheque-modal__content {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
}

.mediatheque-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.mediatheque-modal__close:hover {
    transform: rotate(90deg);
    background: #ED2024;
    color: #FFFFFF;
}

.mediatheque-modal__iframe {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: none;
}

/* Responsive Design */
@media (max-width: 992px) {
    .mediatheque-section__live-area {
        padding: calc(var(--mediatheque-live-padding-bottom, 80px) * 0.75) 0 calc(var(--mediatheque-live-padding-bottom, 80px) * 0.75);
        margin-bottom: calc(var(--mediatheque-overlap, 40px) * -0.75);
    }

    .mediatheque-section__carousel-area {
        padding: 16px 0 60px;
    }

    .mediatheque-section__content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .mediatheque-section__title {
        font-size: 32px;
    }

    .mediatheque-section__video-card {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .mediatheque-section__live-area {
        padding: calc(var(--mediatheque-live-padding-bottom, 80px) * 0.5) 0 calc(var(--mediatheque-live-padding-bottom, 80px) * 0.625);
        margin-bottom: calc(var(--mediatheque-overlap, 40px) * -0.6);
    }

    .mediatheque-section__carousel-area {
        padding: 12px 0 50px;
    }

    .mediatheque-section__title {
        font-size: 28px;
    }

    .mediatheque-section__video-card {
        flex: 0 0 100%;
    }

    .mediatheque-section__carousel-track {
        flex-wrap: wrap;
    }

    .mediatheque-section__play-icon {
        width: 50px;
        height: 50px;
    }

    .mediatheque-section__play-icon i {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .mediatheque-section__title {
        font-size: 24px;
    }

    .mediatheque-section__description {
        font-size: 14px;
    }

    .mediatheque-section__live-video-play {
        width: 50px;
        height: 50px;
    }

    .mediatheque-section__live-video-play i {
        font-size: 20px;
    }

    .mediatheque-section__action-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}
