/* --- Layout & General Page Styling --- */
.fr-page {
    padding: 24px 0 60px;
}

.fr-container {
    max-width: 1300px;
    /* Increased from 1200px to give more room */
}

.fr-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    /* Reduced sidebar from 320px to 260px */
    gap: 30px;
    /* Included slightly more gap */
    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 Gallery Styles --- */

/* Gallery Grid Layout */
.gallery-container {
    display: grid;
    /* Force 3 columns on desktop as requested */
    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;
    }
}

/* Gallery 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: #fff;
    aspect-ratio: 4/3;
    /* Consistent 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;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

/* Overlay Effect */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-icon {
    color: #fff;
    font-size: 24px;
    margin-bottom: 10px;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
}

.gallery-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.2s;
}

.gallery-item:hover .gallery-overlay-icon,
.gallery-item:hover .gallery-title {
    transform: translateY(0);
}

/* Lightbox / 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;
    /* Hidden by default */
    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;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    color: #fff;
    margin-top: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #dc3545;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    pointer-events: none;
    /* Allow clicks to pass through spacer */
}

.lightbox-prev,
.lightbox-next {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    /* Re-enable clicks on buttons */
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        gap: 16px;
    }

    .lightbox-nav {
        padding: 0 10px;
    }
}