/* video-page.css */
/* Additional styles for the Video Gallery page */

/* ============================== */
/* 1) Video Gallery Grid Styles   */
/* ============================== */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.video-item {
    /* Remove aspect-ratio from the entire item */
    border: 0.125rem solid #ddd;
    border-radius: 0.625rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Wrapper for video with fixed aspect ratio and black background */
.video-wrapper {
    background-color: black; /* Black background for video area */
    aspect-ratio: 4 / 3;
    position: relative;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video description uses the page background and blue text */
.video-description {
    background-color: #ffffff;
    padding: 0.625rem;
    font-size: 1rem;
    color: #000000;
    text-align: center;
}

/* Hover and focus effects for video items */
.video-item:hover,
.video-item:focus {
    transform: scale(1.02);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.video-item:focus {
    outline: 0.25rem solid #007bff;
}

.gallery-heading h2 {
    text-align: center;
    margin: 1.25rem 0;
    font-size: 1.75rem;
    color: #333;
}

/* ============================== */
/* 2) Modal Popup Styles          */
/* ============================== */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 3.75rem;
    width: 100%;
    height: calc(100% - 3.75rem);
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 42.5rem;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    background-color: #000;
    border-radius: 0.625rem;
}

.modal-content video {
    width: 100%;
    height: auto;
    display: block;
}

/* Modal controls (close, previous, next) */
.close, .prev, .next {
    position: absolute;
    cursor: pointer;
    color: #fff;
    font-weight: bold;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close {
    top: 0.625rem;
    right: 1.25rem;
    font-size: 2rem;
}

.prev, .next {
    top: 50%;
    font-size: 1.5rem;
    padding: 1rem;
    user-select: none;
    margin-top: -1.25rem;
}

.prev {
    left: 0;
}

.next {
    right: 0;
}

.close:hover, .prev:hover, .next:hover {
    color: #ddd;
}

/* ============================== */
/* 3) Responsive Adjustments       */
/* ============================== */
@media (max-width: 1024px) {
    .video-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .video-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .video-gallery {
        grid-template-columns: 1fr;
    }
}
