/* --- Videos Section --- */
.videos-section {
    padding: 4rem 0; /* Changed padding to 0 horizontally to allow carousel to take full width */
    position: relative;
    overflow: hidden;
    color: var(--color-base-deep);
}

.videos-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-accent-surreal), var(--color-bg-light));
    z-index: -2;
}

.videos-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle at center, rgba(255, 226, 105, 0.1), transparent 70%);
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.section-subheading {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    text-align: center;
    margin-top: -2rem;
    margin-bottom: 3rem;
    color: var(--color-base-deep);
    opacity: 0.8;
}

.video-carousel-container {
    position: relative;
    max-width: 1200px; /* Constrain container width for desktop */
    margin: 0 auto; /* Center the container */
    overflow: hidden;
    padding: 0; /* Removed fixed padding to allow track to handle it */
}

.video-carousel-track {
    --carousel-gap: 1rem; /* Define a CSS variable for consistent gap */
    display: flex;
    flex-wrap: nowrap; /* Keep items in a single row */
    overflow-x: auto; /* Enable horizontal scrolling */
    scroll-snap-type: x mandatory; /* Snap to elements */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    gap: var(--carousel-gap); /* Spacing between items */
    max-width: 100%; /* Ensure track fits its container */
    padding: 0 1rem 1rem 1rem; /* Padding for the track, including bottom for scrollbar */
    margin: 0 auto; /* Center the track content if it doesn't fill max-width */
    transition: none; /* Remove JS-driven transform transition, let scroll-snap handle it */
    will-change: auto; /* Revert will-change as transform is no longer animated here */

    /* Hide scrollbar visually but keep functionality */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.video-carousel-track::-webkit-scrollbar {
    display: none;
}

.video-card {
    flex: 0 0 auto; /* Prevent shrinking, maintain natural width */
    scroll-snap-align: start; /* Snap to the start of each item */
    margin: 0 auto; /* Helps center a single item in its view if smaller than 100% */
    background-color: var(--color-bg-light);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    cursor: url('/white_glove_cursor.png'), auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    opacity: 0;
    transform: translateY(50px);
    will-change: transform, opacity;
}

.video-card.slide-in {
    opacity: 1;
    transform: translateY(0);
}

.video-card:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2), 0 0 20px var(--color-accent-danger);
}

.video-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-highlight-fun);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    text-align: center;
}

/* Carousel Navigation Arrows */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-accent-danger);
    color: var(--color-bg-light);
    border: none;
    border-radius: 50px;
    padding: 0.8rem 1.2rem;
    font-size: 1.5rem;
    cursor: url('/white_glove_cursor.png'), auto;
    z-index: 10;
    transition: transform 0.2s ease-out, background-color 0.2s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    -webkit-tap-highlight-color: transparent;
}

.carousel-nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
    background-color: var(--color-base-deep);
}

.carousel-nav-btn:focus-visible {
    outline: 3px dashed var(--color-accent-surreal);
    outline-offset: 4px;
}

.carousel-nav-btn.prev {
    left: 0;
    margin-left: -20px;
}

.carousel-nav-btn.next {
    right: 0;
    margin-right: -20px;
}

/* Carousel Pagination Dots */
.carousel-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination-dot {
    width: 12px;
    height: 12px;
    background-color: var(--color-base-deep);
    opacity: 0.4;
    border-radius: 50%;
    cursor: url('/white_glove_cursor.png'), auto;
    transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
}

.pagination-dot.active {
    opacity: 1;
    background-color: var(--color-accent-danger);
    transform: scale(1.2);
    border-color: var(--color-accent-danger);
}

.pagination-dot:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.pagination-dot:focus-visible {
    outline: 3px dashed var(--color-accent-surreal);
    outline-offset: 4px;
}

/* Video Modal - STYLES MOVED TO STYLE.CSS */
.video-modal {
    /* Kept for specificity if needed, but core styles are in style.css */
}

.modal-video-title {
    /* Kept for specificity if needed, but core styles are in style.css */
}

/* Reduced Motion for Videos Section */
@media (prefers-reduced-motion: reduce) {
    .video-card.slide-in {
        opacity: 1;
        transform: translateY(0);
        transition: none;
    }
}

/* Responsive adjustments for video carousel */
/* Mobile-specific: 1 video per slide */
@media (max-width: 768px) {
    .video-carousel-track .video-card {
        max-width: 90%; /* One card per slide, centered */
        width: 100%; /* Ensure it takes available width within max-width */
    }
    .video-carousel-container {
        padding: 0; /* Remove container padding for mobile, track handles it */
    }
}

/* Tablet/Desktop: Multi-card row */
@media (min-width: 769px) {
    .video-carousel-track .video-card {
        max-width: calc(33.333% - (2 * var(--carousel-gap) / 3)); /* 3 cards per row, accounting for gap */
        width: 100%;
        margin: 0; /* Remove auto margin for multi-card layout */
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .video-carousel-track .video-card {
        max-width: calc(50% - (1 * var(--carousel-gap) / 2)); /* 2 cards per row, accounting for gap */
    }
}