/* Gallery Section Styles */
#gallery-section {
    padding: 60px 0;
    background-color: #fcfcfc;
}

#gallery-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    /* Ensure all rows (explicit and implicit) are 200px */
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Mosaic Layout Logic */
/* Item 1: Large square (2x2) */
.gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

/* Make images fill their containers */
.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;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(181, 63, 40, 0.2);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* The "+Number" Overlay */
.more-overlay {
    position: absolute;
    inset: 0;
    background: #ff66008e;
    /* Brand color with opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    opacity: 1;
    transition: background 0.3s;
}

.more-overlay:hover {
    background: #ff660033;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }

    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        /* Let items flow purely vertically or simpler grid */
    }

    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 1;
        /* Reset to normal on small screens if desired, or keep big */
        height: 250px;
    }

    .gallery-item {
        height: 180px;
    }
}


/* LIGHTBOX STYLES */
.lightbox {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    color: #ddd;
    text-align: center;
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Controls */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding-left: 18px;
    margin-top: -22px;
    height: 50px;
    width: 50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: #ff6600;
}

/* Thumbnails Strip */
.lightbox-thumbnails {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    overflow-x: scroll;
    /* Force scrollbar to be visible */
    padding: 10px;
    max-width: 90%;
    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #ff6600 #333;
}

/* WebKit Scrollbar Styling (Chrome, Edge, Safari) */
.lightbox-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background-color: #ff6600;
    border-radius: 4px;
    border: 2px solid #333;
    /* Padding effect */
}

.lightbox-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    border-radius: 4px;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.lightbox-thumb:hover,
.lightbox-thumb.active {
    opacity: 1;
    transform: scale(1.1);
    border: 2px solid #ff6600;
}