/* PAGINA GALERIEI */

.gallery-page {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 145px 0 80px;
}

.gallery-hero {
    max-width: 780px;
    margin: 0 auto 65px;
    text-align: center;
}

.gallery-label {
    margin-bottom: 20px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

.gallery-hero h1 {
    margin: 0 0 22px;
    color: var(--white);
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.08;
    letter-spacing: -2px;
}

.gallery-hero h1 span {
    display: block;
    color: var(--gold);
}

.gallery-intro {
    max-width: 650px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}


/* TITLUL GALERIEI */

.gallery-heading {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 25px;
}

.gallery-heading h2 {
    margin: 0;
    color: var(--white);
    font-size: 30px;
}

.gallery-count {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}


/* GRID FOTO */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.gallery-item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--navy-2);
    cursor: pointer;
    text-align: left;
}

.gallery-item::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 55%,
        rgba(3, 9, 20, 0.28)
    );
    content: "";
    pointer-events: none;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.06);
}

.gallery-item:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}


/* BUTON ÎNAPOI */

.gallery-back {
    display: flex;
    justify-content: center;
    margin-top: 55px;
}

.gallery-back a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 23px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.gallery-back a span {
    color: var(--gold);
    font-size: 20px;
}

.gallery-back a:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    background: var(--navy-3);
}


/* VIZUALIZARE FOTO */

body.lightbox-open {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 65px 70px 45px;
    background: rgba(0, 0, 0, 0.94);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 125px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    user-select: none;
}

#lightboxCounter {
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    letter-spacing: 1px;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 58px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.lightbox-arrow:hover {
    border-color: var(--gold);
    background: rgba(244, 181, 47, 0.15);
}

.lightbox-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}


/* TABLETĂ */

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .gallery-page {
        padding-top: 125px;
    }

    .lightbox {
        gap: 12px;
        padding-right: 25px;
        padding-left: 25px;
    }

    .lightbox-arrow {
        width: 42px;
        height: 50px;
    }
}


/* TELEFON */

@media (max-width: 600px) {
    .gallery-page {
        width: calc(100% - 30px);
        padding-top: 115px;
        padding-bottom: 55px;
    }

    .gallery-hero {
        margin-bottom: 40px;
    }

    .gallery-hero h1 {
        letter-spacing: -1px;
    }

    .gallery-intro {
        font-size: 15px;
    }

    .gallery-heading {
        flex-wrap: wrap;
        gap: 7px;
    }

    .gallery-heading h2 {
        font-size: 25px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .gallery-item {
        aspect-ratio: 4 / 3;
    }

    .gallery-back {
        margin-top: 35px;
    }

    .lightbox {
        gap: 6px;
        padding: 65px 8px 30px;
    }

    .lightbox-content img {
        max-width: 100%;
        max-height: calc(100vh - 140px);
    }

    .lightbox-arrow {
        width: 34px;
        height: 45px;
        font-size: 18px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }

    #lightboxCounter {
        font-size: 12px;
    }
}