body {
    background: #f5f5f5;
}

/* ========================================
   SECTION
======================================== */

.gallery-section {
    background: white;
    border-radius: 30px;
    padding: 120px 20px;
    max-width: 1400px;
    margin: 80px auto;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.08);
}

/* ========================================
   HEADER
======================================== */

.gallery-header {
    margin-bottom: 80px;
}

.gallery-header h2 {
    font-family: "Playfair Display", serif;
    font-size: 2.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 20px;
    position: relative;
}

.gallery-header p {
    font-size: 1.15rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #999;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

.gallery-header p::before,
.gallery-header p::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 60px;
    height: 1px;
    background: #ddd;
}

.gallery-header p::before {
    right: 100%;
}

.gallery-header p::after {
    left: 100%;
}

/* ========================================
   GRID
======================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

/* ========================================
   ITEM
======================================== */

.gallery-item {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;

    opacity: 1;
    transform: none;

    transition:
        transform 0.4s ease,
        filter 0.4s ease;

    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 240px;

    object-fit: cover;
    object-position: center;

    display: block;
    border-radius: 18px;

    transition:
        transform 0.5s ease,
        filter 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

/* ========================================
   OVERLAY
======================================== */

.gallery-item span {
    position: absolute;
    inset: 0;

    background: linear-gradient(
        to top,
        rgba(0,0,0,0.65),
        transparent
    );

    opacity: 0;
    transition: 0.3s;
}

.gallery-item::before {
    content: attr(data-title);

    position: absolute;
    left: 20px;
    bottom: 42px;

    color: white;
    font-size: 1.1rem;
    font-weight: 500;

    opacity: 0;
    transform: translateY(10px);

    transition: 0.3s;
    z-index: 2;
}

.gallery-item::after {
    content: attr(data-description);

    position: absolute;
    left: 20px;
    bottom: 20px;

    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;

    opacity: 0;
    transform: translateY(10px);

    transition: 0.3s;
    z-index: 2;
}

.gallery-item:hover::before,
.gallery-item:hover::after,
.gallery-item:hover span {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   LIGHTBOX
======================================== */

.gallery-lightbox {
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.95);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.3s ease;

    z-index: 9999;

    overflow: hidden;
    padding: 20px;
}

.gallery-lightbox.show {
    opacity: 1;
    pointer-events: all;
}

.lightbox-image {
    max-width: calc(100vw - 120px);
    max-height: 88vh;

    border-radius: 16px;

    box-shadow: 0 20px 60px rgba(0,0,0,0.6);

    animation: zoomIn 0.35s ease;
}

@keyframes zoomIn {

    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   CLOSE BUTTON
======================================== */

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;

    font-size: 42px;
    color: #fff;

    cursor: pointer;

    opacity: 0.7;
    transition: 0.3s;

    z-index: 10001;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ========================================
   NAVIGATION
======================================== */

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);

    color: #fff;
    font-size: 42px;
    line-height: 1;

    cursor: pointer;

    z-index: 10000;

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        opacity 0.25s ease;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0,0,0,0.75);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: translateY(-50%) scale(0.96);
}

/* ========================================
   TABLET
======================================== */

@media (max-width: 1100px) {

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .gallery-section {
        padding: 90px 16px;
        border-radius: 22px;
    }

    .gallery-header {
        margin-bottom: 50px;
    }

    .gallery-header h2 {
        font-size: 2.1rem;
    }

    .gallery-header p {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .gallery-item {
        border-radius: 12px;
    }

    .gallery-item img {
        height: 180px;
        border-radius: 12px;
    }

    .lightbox-prev,
    .lightbox-next {

        width: 50px;
        height: 50px;

        font-size: 34px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-image {
        max-width: calc(100vw - 90px);
    }
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 480px) {

    .gallery-section {
        padding: 60px 12px;
        border-radius: 18px;
    }

    .gallery-header {
        margin-bottom: 35px;
    }

    .gallery-header h2 {
        font-size: 1.8rem;
    }

    .gallery-header p {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }

    .gallery-header p::before,
    .gallery-header p::after {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item {
        border-radius: 10px;
    }

    .gallery-item img {
        height: 150px;
        border-radius: 10px;
    }

    .lightbox-prev,
    .lightbox-next {

        width: 46px;
        height: 46px;

        font-size: 30px;

        background: rgba(0,0,0,0.55);
    }

    .lightbox-prev {
        left: 6px;
    }

    .lightbox-next {
        right: 6px;
    }

    .lightbox-close {
        top: 15px;
        right: 18px;
        font-size: 34px;
    }

    .lightbox-image {
        max-width: calc(100vw - 70px);
        max-height: 82vh;
        border-radius: 12px;
    }
}
