/* --- Layout & General Page Styling --- */
.fr-page {
    padding: 24px 0 60px;
}

.fr-container {
    max-width: 1300px;
}

.fr-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    align-items: start;
}

.fr-content {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 24px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 24px rgba(15, 23, 42, 0.06);
}

.fr-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    margin-bottom: 24px;
}

.fr-page-title {
    margin: 0;
    font-weight: 700;
    font-size: 24px;
    color: #0f172a;
}

.fr-page-subtitle {
    margin: 6px 0 0;
    color: rgba(15, 23, 42, 0.70);
}

/* Sidebar Responsive Logic */
@media (max-width: 991.98px) {
    .fr-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fr-content {
        padding: 16px;
    }
}

@media (max-width: 575.98px) {
    .fr-page-title {
        font-size: 20px;
    }
}


/* --- Specific Video Gallery Styles --- */

/* Video Grid Layout */
.gallery-container {
    display: grid;
    /* Force 3 columns on desktop */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 10px 0;
}

/* Responsive adjustments for the gallery grid */
@media (max-width: 1200px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .gallery-container {
        grid-template-columns: 1fr;
    }
}

/* Video Item Card */
.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #000;
    /* Dark background for video placeholders */
    aspect-ratio: 16/9;
    /* Standard video aspect ratio */
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0.9;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
    opacity: 0.6;
}

/* Overlay Effect */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 1;
    /* Always visible for video to show title/play btn */
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center play button */
    align-items: center;
    padding: 20px;
}

.gallery-overlay-icon {
    color: #fff;
    font-size: 48px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    margin-bottom: auto;
    /* Push to center vertically with margin hacks or flex adjustments */
    margin-top: auto;
}

.gallery-item:hover .gallery-overlay-icon {
    transform: scale(1.1);
    background: #e11d48;
    /* Youtube Red-ish or Brand Color */
}

.gallery-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    transform: translateY(0);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}


/* Lightbox / Video Modal Styling */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    background: #000;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
}

.lightbox-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    color: #fff;
    text-align: center;
    font-size: 1.2rem;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #dc3545;
}

@media (max-width: 768px) {
    .lightbox-content {
        width: 100%;
    }
}