/* Banner */
.gallery__heading-container {
    box-sizing: border-box;
    text-align: left;
    background-color: var(--navy-800);
    padding: clamp(1.25rem, 4vw, 2rem);
    margin-bottom: clamp(1.75rem, 5vw, 3rem);
}

.gallery__heading-container h2 {
    margin: 0;
    padding-bottom: 1rem;
    font-size: var(--fs-h2-banner);
    line-height: 1.2;
    font-weight: 700;
    color: #ffffff;
}

.gallery__description {
    margin: 0;
    max-width: 600px;
    font-size: 1rem;
    line-height: 1.6;
    color: #ffffff;
}

.gallery__back {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    opacity: 0.85;
}

.gallery__back:hover,
.gallery__back:focus-visible {
    opacity: 1;
    text-decoration: underline;
}


.gallery__section {
    padding: 0 var(--section-x) var(--section-y);
    background-color: var(--surface-alt);
}

.gallery__container {
    max-width: var(--container);
    margin-inline: auto;
}


.gallery__cards {
    --cols: 3;
    --gap-x: 1.125rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem var(--gap-x);
}

.gallery__card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 0 1 calc((100% - (var(--cols) - 1) * var(--gap-x)) / var(--cols));
    background-color: var(--surface);
    border-top: 5px solid var(--ink-line);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 4px 18px rgba(11, 31, 58, 0.06);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery__card:hover,
.gallery__card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(11, 31, 58, 0.08);
}

.gallery__card:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 3px;
}

.gallery__card-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background-color: var(--surface-alt);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery__card:hover .gallery__card-image,
.gallery__card:focus-visible .gallery__card-image {
    transform: scale(1.05);
}

.gallery__card-body {
    padding: 1.25rem 1.125rem 1.25rem;
}

.gallery__card-number {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--blue-600);
    font-size: 0.875rem;
    font-weight: 700;
}

.gallery__card h3 {
    margin: 0 0 0.375rem;
    font-size: 1.125rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--navy-900);
}

.gallery__card-count {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-body);
}

.gallery__card-link {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--blue-600);
}

.gallery__card-link::after {
    content: " \2192";
    display: inline-block;
    transition: transform 0.25s ease;
}

.gallery__card:hover .gallery__card-link::after,
.gallery__card:focus-visible .gallery__card-link::after {
    transform: translateX(4px);
}

.gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.125rem;
}

.gallery__item {
    margin: 0;
    overflow: hidden;
    background-color: var(--surface-alt);
    border-top: 5px solid var(--ink-line);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 4px 18px rgba(11, 31, 58, 0.06);
}

.gallery__image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.25s ease;
}

.gallery__image:hover {
    transform: scale(1.03);
}


.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(32, 36, 42, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox__image {
    max-width: 90%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
    animation: lightbox-zoom-in 0.25s ease;
}

@keyframes lightbox-zoom-in {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.lightbox__close {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    font-size: 2.5rem;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    z-index: 1001;
    transition: color 0.2s ease;
}

.lightbox__close:hover {
    color: #9bb6d6;
}

.lightbox__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(11, 31, 58, 0.65);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
}

.lightbox__prev {
    left: 1.5rem;
}

.lightbox__next {
    right: 1.5rem;
}

@media (hover: hover) {
    .lightbox__nav:hover {
        background-color: var(--blue-700);
        color: #ffffff;
        transform: translateY(-50%) scale(1.08);
    }
}

.lightbox__nav:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.lightbox__nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox__counter {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(11, 31, 58, 0.7);
    color: #ffffff;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 1002;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .gallery__cards {
        --cols: 2;
        --gap-x: 1rem;
        gap: 1.5rem var(--gap-x);
    }

    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .lightbox__nav {
        width: 40px;
        height: 40px;
    }

    .lightbox__prev {
        left: 0.75rem;
    }

    .lightbox__next {
        right: 0.75rem;
    }

    .lightbox__counter {
        bottom: 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .gallery__cards {
        --cols: 1;
        gap: 1.25rem;
    }

    .gallery__grid {
        grid-template-columns: 1fr;
    }

    .lightbox__close {
        top: 1rem;
        right: 1.2rem;
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery__card,
    .gallery__card-link::after,
    .gallery__image,
    .lightbox__image,
    .lightbox__nav {
        transition: none;
        animation: none;
    }

    .gallery__card:hover,
    .gallery__card:focus-visible,
    .gallery__image:hover {
        transform: none;
    }
}