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

.gallery-section {
    position: relative;
    padding: 110px 0;
    overflow: hidden;
    background:var(--s1)
}

.gallery-section::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    right: -250px;
    top: -180px;
    border-radius: 50%;
    background: radial-gradient(
            circle,
            rgba(244, 166, 42, 0.08) 0%,
            rgba(244, 166, 42, 0) 70%
    );
    pointer-events: none;
}


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

.gallery-head {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.6fr);
    gap: 60px;
    align-items: end;
    margin-bottom: 42px;
}

.gallery-head .s-title {
    margin-bottom: 0;
}

.gallery-description {
    margin: 0 0 7px;
    max-width: 480px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 16px;
    line-height: 1.7;
}


/* ===========================
   GALLERY GRID
   1 BIG + 12 SMALL
   SMALL = 3 ROWS × 4 COLS
=========================== */

.gallery-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.7fr)
        repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}


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

.gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 14px;
    background: var(--s2, #0F282B);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateZ(0);
    isolation: isolate;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition:
            transform 0.65s cubic-bezier(0.2, 0.75, 0.25, 1),
            filter 0.4s ease;
}


/* ===========================
   BIG PHOTO
=========================== */

.gallery-item--big {
    grid-row: span 3;
    min-height: 100%;
}


/* ===========================
   SMALL PHOTOS = SQUARE
=========================== */

.gallery-item:not(.gallery-item--big) {
    aspect-ratio: 1 / 1;
}


/* ===========================
   OVERLAYS
=========================== */

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0) 50%,
            rgba(0, 0, 0, 0.24) 100%
    );
    opacity: 0.55;
    transition: opacity 0.35s ease;
}

.gallery-item::before {
    content: "+";
    position: absolute;
    z-index: 2;
    right: 14px;
    top: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    background: rgba(5, 20, 21, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: scale(0.82);
    transition:
            opacity 0.3s ease,
            transform 0.3s ease,
            background 0.3s ease,
            border-color 0.3s ease;
}


/* ===========================
   HOVER
=========================== */

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

.gallery-item:hover::after {
    opacity: 0.85;
}

.gallery-item:hover::before {
    opacity: 1;
    transform: scale(1);
    background: rgba(244, 166, 42, 0.16);
    border-color: rgba(244, 166, 42, 0.45);
}


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

.gallery-lightbox {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 80px;
    background: rgba(3, 10, 11, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
            opacity 0.3s ease,
            visibility 0.3s ease;
}

.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gallery-lightbox__stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 100px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
}


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

.gallery-lightbox__close {
    position: absolute;
    z-index: 20;
    right: 24px;
    top: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
            background 0.25s ease,
            border-color 0.25s ease,
            transform 0.25s ease;
}

.gallery-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
    transform: rotate(4deg);
}


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

.gallery-lightbox__nav {
    position: absolute;
    z-index: 20;
    top: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 38px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
            background 0.25s ease,
            border-color 0.25s ease,
            transform 0.25s ease;
}

.gallery-lightbox__nav:hover {
    background: rgba(244, 166, 42, 0.15);
    border-color: rgba(244, 166, 42, 0.45);
}

.gallery-lightbox__prev {
    left: 24px;
}

.gallery-lightbox__next {
    right: 24px;
}


/* ===========================
   COUNTER
=========================== */

.gallery-lightbox__counter {
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    padding: 7px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.08em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}


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

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns:
            minmax(0, 1.45fr)
            repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

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


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

@media (max-width: 900px) {
    .gallery-section {
        padding: 80px 0;
    }

    .gallery-head {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 30px;
    }

    .gallery-description {
        max-width: 620px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .gallery-item--big {
        grid-column: span 4;
        grid-row: auto;
        aspect-ratio: 16 / 8;
    }

    .gallery-item:not(.gallery-item--big) {
        aspect-ratio: 1 / 1;
    }

    .gallery-lightbox {
        padding: 50px 65px;
    }
}


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

@media (max-width: 600px) {
    .gallery-section {
        padding: 65px 20px;
    }

    .gallery-head {
        margin-bottom: 24px;
    }

    .gallery-description {
        font-size: 14px;
        line-height: 1.6;
    }

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

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

    .gallery-item--big {
        grid-column: span 2;
        grid-row: auto;
        aspect-ratio: 16 / 10;
    }

    .gallery-item:not(.gallery-item--big) {
        aspect-ratio: 1 / 1;
    }

    .gallery-item::before {
        display: none;
    }

    .gallery-lightbox {
        padding: 50px 10px 72px;
    }

    .gallery-lightbox__image {
        max-height: calc(100vh - 125px);
        border-radius: 6px;
    }

    .gallery-lightbox__close {
        width: 42px;
        height: 42px;
        top: 10px;
        right: 10px;
        font-size: 28px;
    }

    .gallery-lightbox__nav {
        top: auto;
        bottom: 14px;
        width: 46px;
        height: 46px;
        transform: none;
        font-size: 30px;
    }

    .gallery-lightbox__prev {
        left: calc(50% - 60px);
    }

    .gallery-lightbox__next {
        right: calc(50% - 60px);
    }

    .gallery-lightbox__counter {
        bottom: 27px;
        font-size: 12px;
    }
}


/* ===========================
   VERY SMALL MOBILE
=========================== */

@media (max-width: 380px) {
    .gallery-grid {
        gap: 5px;
    }

    .gallery-item {
        border-radius: 7px;
    }
}
.gallery-more {
    position: absolute;
    z-index: 5;
    inset: 0;

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

    background: rgba(4, 18, 19, 0.58);

    color: #fff;

    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;

    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    transition:
            background 0.3s ease,
            backdrop-filter 0.3s ease;
}

.gallery-item:hover .gallery-more {
    background: rgba(4, 18, 19, 0.4);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}

@media (max-width: 600px) {

    .gallery-more {
        font-size: 15px;
    }

}