﻿body.gallery-modal-open {
    overflow: hidden;
}

.gallery-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gallery-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(39, 69, 44, 0.12);
    border-radius: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 40px rgba(31, 47, 33, 0.1);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(26, 47, 31, 0.14);
    border-color: rgba(213, 166, 62, 0.4);
}

.gallery-photo {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.gallery-card-badge {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(17, 31, 20, 0.7);
    color: #fff;
    font-family: "Manrope", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.gallery-modal.hidden {
    display: none;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: rgba(15, 23, 18, 0.88);
    backdrop-filter: blur(10px);
}

.gallery-modal-figure {
    margin: 0;
    width: min(100%, 1080px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.gallery-modal-image {
    display: block;
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.gallery-modal-meta {
    color: rgba(255, 255, 255, 0.82);
    font-family: "Manrope", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-modal-close,
.gallery-modal-nav {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.gallery-modal-close:hover,
.gallery-modal-nav:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.04);
}

.gallery-modal-close {
    top: 1.25rem;
    right: 1.25rem;
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
    line-height: 1;
}

.gallery-modal-nav {
    top: 50%;
    width: 3.25rem;
    height: 3.25rem;
    margin-top: -1.625rem;
    font-size: 1.6rem;
}

.gallery-modal-prev {
    left: 1.25rem;
}

.gallery-modal-next {
    right: 1.25rem;
}

@media (max-width: 768px) {
    .gallery-modal {
        padding: 4.5rem 1rem 1.5rem;
    }

    .gallery-modal-nav {
        top: auto;
        bottom: 1rem;
        margin-top: 0;
    }

    .gallery-modal-prev {
        left: calc(50% - 4rem);
    }

    .gallery-modal-next {
        right: calc(50% - 4rem);
    }
}
