/* ==============================
   Image Gallery Section
============================== */

* {
    box-sizing: border-box;
}

.image-gallery-section {
    padding: 100px 20px;
    background-color: #fff;
    font-family: Arial, Helvetica, sans-serif;
}

.gallery-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Gallery Heading */

.gallery-heading {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-label {
    display: inline-block;
    margin: 0 0 20px;
    padding: 7px 18px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.gallery-heading h2 {
    margin: 0;
    color: #171717;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.2;
}

.gallery-heading h2 span {
    color: #b99562;
}

/* Gallery Grid */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
}

.gallery-item {
    grid-column: span 3;
    min-width: 0;
    overflow: hidden;
    border-radius: 22px;
    background: #f3f3f3;
}

.gallery-item:nth-child(n + 5):nth-child(-n + 7) {
    grid-column: span 4;
}

.gallery-item:nth-child(n + 8) {
    grid-column: span 6;
}

.gallery-link {
    position: relative;
    display: block;
    height: 100%;
    overflow: hidden;
    color: #fff;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Hover Overlay */

.gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.gallery-overlay i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    font-size: 22px;
    color: #fff;
    transform: scale(0.7);
    transition: transform 0.35s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

/* Keyboard Accessibility */

.gallery-link:focus-visible {
    outline: 3px solid #b99562;
    outline-offset: 4px;
}

/* ==============================
   Lightbox
============================== */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    background: rgba(0, 0, 0, 0.94);
}

.gallery-lightbox.active {
    display: flex;
}

.gallery-lightbox img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
}

.gallery-lightbox button {
    position: absolute;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 38px;
    padding: 10px;
}

.lightbox-close {
    top: 15px;
    right: 25px;
}

.lightbox-prev {
    left: 15px;
}

.lightbox-next {
    right: 15px;
}

/* ==============================
   Responsive Layout
============================== */

@media (max-width: 991px) {
    .gallery-item,
    .gallery-item:nth-child(n + 5):nth-child(-n + 7) {
        grid-column: span 4;
    }

    .gallery-item:nth-child(n + 8) {
        grid-column: span 6;
    }

    .gallery-item img {
        height: 240px;
    }

    .image-gallery-section {
        padding: 75px 20px;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .gallery-item,
    .gallery-item:nth-child(n + 5):nth-child(-n + 7),
    .gallery-item:nth-child(n + 8) {
        grid-column: span 1;
    }

    .gallery-item img {
        height: 190px;
    }

    .gallery-heading {
        margin-bottom: 30px;
    }

    .image-gallery-section {
        padding: 55px 15px;
    }

    .gallery-lightbox {
        padding: 50px 35px;
    }

    .gallery-lightbox button {
        font-size: 28px;
    }

    .lightbox-prev {
        left: 0;
    }

    .lightbox-next {
        right: 0;
    }
}

@media (max-width: 380px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item img {
        height: 240px;
    }
}
