/* ===== Video Gallery Specific Styles ===== */

/* Grid Layout matching the Photo Gallery */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

/* ===== Video Player Container inside Lightbox ===== */
.video-lightbox-content {
    position: relative;
    width: 90vw;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers the video perfectly */
    gap: 15px;
    margin-bottom: 70px; 
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    max-width: calc(75vh * (16 / 9)); /* Prevents it from getting too tall on desktops */
    aspect-ratio: 16 / 9; /* ALWAYS locks to strictly 16:9 like standard YouTube */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    margin: 0 auto;
}

/* Ensures the iframe completely fills the wrapper */
.iframe-wrapper iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* Dynamically applied when a vertical video/Short is played inside the 16:9 popup */
/* Zooms the video to stretch across the 16:9 width, hiding the black pillarboxes completely */
.iframe-wrapper.is-vertical iframe {
    transform: scale(3.17); /* Exact mathematical scale (16/9 divided by 9/16) */
    transform-origin: center center;
}

/* ===== Hover Play Icon Overlay ===== */
.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15); /* Visible by default with a subtle tint */
    transition: background 0.3s ease;
    z-index: 2;
}

/* Darken image slightly on hover to make play button pop */
.lead-card:hover .video-play-overlay {
    background: rgba(0,0,0,0.35);
}

.video-play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--violet, #6D28D9);
    font-size: 24px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    opacity: 1; /* PERMANENTLY VISIBLE */
    transform: scale(1);
    transition: transform 0.3s ease, opacity 0.3s ease, color 0.3s ease;
    padding-left: 5px; /* Optically centers the play triangle */
}

/* Scale up on card hover */
.lead-card:hover .video-play-icon {
    transform: scale(1.15);
    color: var(--pink, #EC4899);
}

/* Subtle image zoom on hover for standard lead cards */
.lead-card:hover .img-wrap img {
    transform: scale(1.05);
}

/* --- Dynamic Zoom Levels for Vertical Videos --- */

/* Level 1: Maximum Zoom (2.5x) - Hides almost all black bars */
.zoom-level-1 { transform: scale(2.4) !important; }
.lead-card:hover .img-wrap img.zoom-level-1 { transform: scale(2.5) !important; }

/* Level 2: Medium Zoom (2.0x) - Sweet spot compromise */
.zoom-level-2 { transform: scale(2.0) !important; }
.lead-card:hover .img-wrap img.zoom-level-2 { transform: scale(2.1) !important; }

/* Level 3: Light Zoom (1.5x) - Keeps more top/bottom of the picture */
.zoom-level-3 { transform: scale(1.5) !important; }
.lead-card:hover .img-wrap img.zoom-level-3 { transform: scale(1.6) !important; }

/* Mobile adjustments */
@media (max-width: 768px) {
    .video-lightbox-content { width: 95vw; }
    .iframe-wrapper { max-width: 100%; } /* Allow full width on mobile phones */
    .video-play-icon { width: 45px; height: 45px; font-size: 18px; padding-left: 4px; }
}