.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.gallery-item {
    cursor: zoom-in;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
    opacity: 1;
}

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

.gallery-item:focus-visible {
    outline: 2px solid #ba0013;
    outline-offset: 4px;
}

.gallery-lightbox {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.gallery-lightbox::backdrop {
    background: rgb(5 9 15 / 88%);
}

.gallery-lightbox[open]::backdrop {
    animation: gallery-lightbox-backdrop-enter 180ms ease-out both;
}

.gallery-lightbox__shell {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: clamp(0.5rem, 2vw, 1.25rem);
    display: grid;
    place-items: center;
}

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    padding: 0;
    border: 0;
    background: transparent;
    appearance: none;
    cursor: zoom-out;
}

.gallery-lightbox__panel {
    position: relative;
    z-index: 1;
    width: min(1440px, calc(100vw - 1rem));
    height: min(94dvh, 960px);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: transparent;
    border: 0;
}

.gallery-lightbox__content {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
}

.gallery-lightbox[open] .gallery-lightbox__panel {
    animation: gallery-lightbox-enter 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gallery-lightbox__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem 0.9rem 1.25rem;
    background: rgb(5 9 15 / 82%);
    border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.gallery-lightbox__meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.gallery-lightbox__category {
    font-size: 0.74rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #ba0013;
}

.gallery-lightbox__position {
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 600;
    color: rgb(255 255 255 / 72%);
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
    position: relative;
    appearance: none;
    border: 0;
    padding: 0;
    display: grid;
    place-items: center;
    transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.gallery-lightbox__close {
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 0.875rem;
    background: rgb(255 255 255 / 10%);
    color: #ffffff;
    cursor: pointer;
    flex: 0 0 auto;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible {
    background: rgb(255 255 255 / 16%);
    color: #ffffff;
}

.gallery-lightbox__close::before,
.gallery-lightbox__nav::before {
    content: '';
    position: absolute;
    inset: -0.625rem;
}

.gallery-lightbox__close:active,
.gallery-lightbox__nav:active {
    transform: scale(0.96);
}

.gallery-lightbox__frame {
    position: relative;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    background: linear-gradient(180deg, #05090f 0%, #0b0f14 100%);
    grid-area: 1 / 1;
    z-index: 1;
}

.gallery-lightbox__backdrop-image {
    display: none;
}

.gallery-lightbox__figure {
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin: 0;
    display: grid;
    grid-column: 1;
    place-items: center;
    padding: clamp(0.75rem, 1.8vw, 1.5rem);
}

.gallery-lightbox__image {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center center;
    background: transparent;
}

.gallery-lightbox__title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gallery-lightbox__text {
    margin: 0;
    font-size: clamp(0.98rem, 1.25vw, 1.1rem);
    font-weight: 500;
    color: rgb(255 255 255 / 92%);
    line-height: 1.6;
}

.gallery-lightbox__aside {
    grid-area: 1 / 1;
    align-self: end;
    justify-self: start;
    position: relative;
    z-index: 2;
    min-width: 0;
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 0;
    overflow: auto;
    overscroll-behavior: contain;
    width: fit-content;
    max-width: min(34rem, calc(100% - 1.5rem));
    max-height: 32svh;
    margin: 0 0 1rem 1rem;
    padding: 1rem 1.1rem 1.15rem;
    background: rgb(5 9 15 / 82%);
    color: #ffffff;
}

.gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 0.875rem;
    color: #ffffff;
    background: rgb(5 9 15 / 72%);
    transform: translateY(-50%);
    cursor: pointer;
}

.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
    background: rgb(5 9 15 / 86%);
}

.gallery-lightbox__nav--prev {
    left: clamp(0.75rem, 1.5vw, 1rem);
}

.gallery-lightbox__nav--next {
    right: clamp(0.75rem, 1.5vw, 1rem);
}

.gallery-lightbox__nav:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.gallery-lightbox__nav .material-symbols-outlined {
    font-size: 1.25rem;
}

.mobile-menu-overlay {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.open {
    transform: translateX(0);
}

.menu-backdrop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.menu-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

@keyframes spin-slow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 12s linear infinite;
}

@keyframes gallery-lightbox-enter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

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

@keyframes gallery-lightbox-backdrop-enter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item img,
    .gallery-overlay,
    .gallery-lightbox__close,
    .gallery-lightbox__nav,
    .mobile-menu-overlay,
    .menu-backdrop {
        transition: none;
    }

    .gallery-lightbox[open]::backdrop,
    .gallery-lightbox[open] .gallery-lightbox__panel {
        animation: none;
    }
}

@media (max-width: 767px) {
    .gallery-lightbox__shell {
        padding: 0.5rem;
    }

    .gallery-lightbox__panel {
        width: min(100vw - 1rem, 100vw);
        height: calc(100dvh - 1rem);
        max-height: none;
    }

    .gallery-lightbox__toolbar {
        padding: 0.8rem 0.8rem 0.8rem 1rem;
    }
}

@media (min-width: 640px) and (max-width: 1024px) {
    .gallery-lightbox__aside {
        width: min(22rem, calc(100% - 1.5rem));
        min-width: 15rem;
        max-height: 28svh;
        margin: 0 0 0.9rem 0.9rem;
        padding: 0.9rem 1rem 1rem;
    }
}

@media (max-width: 639px) {
    .gallery-lightbox {
        width: 100vw;
        height: 100dvh;
    }

    .gallery-lightbox__frame {
        grid-template-columns: minmax(0, 1fr);
    }

    .gallery-lightbox__backdrop-image {
        display: block;
        position: absolute;
        inset: 0;
        background-color: #0b0f14;
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
        filter: blur(28px) brightness(0.42) saturate(0.9);
        transform: scale(1.12);
        opacity: 0.95;
        pointer-events: none;
    }

    .gallery-lightbox__shell {
        padding: 0;
    }

    .gallery-lightbox__panel {
        width: 100vw;
        height: 100dvh;
        max-height: none;
        border: 0;
        grid-template-rows: auto minmax(0, 1fr);
        background: #0b0f14;
    }

    .gallery-lightbox__content {
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
    }

    .gallery-lightbox__toolbar {
        padding: max(0.8rem, env(safe-area-inset-top)) 1rem 0.8rem;
        background: rgb(11 15 20 / 95%);
        border-bottom-color: rgb(255 255 255 / 10%);
    }

    .gallery-lightbox__position {
        color: rgb(255 255 255 / 72%);
    }

    .gallery-lightbox__close {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.875rem;
        background: rgb(255 255 255 / 12%);
        color: #ffffff;
    }

    .gallery-lightbox__nav {
        top: 50%;
        z-index: 3;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.875rem;
        background: rgb(5 9 15 / 72%);
    }

    .gallery-lightbox__nav--prev {
        left: 0.75rem;
    }

    .gallery-lightbox__nav--next {
        right: 0.75rem;
    }

    .gallery-lightbox__nav:hover,
    .gallery-lightbox__nav:focus-visible {
        background: rgb(5 9 15 / 86%);
    }

    .gallery-lightbox__image {
        height: 100%;
        max-height: none;
        position: relative;
        z-index: 1;
        object-fit: contain;
        object-position: center center;
        touch-action: pan-y;
    }

    .gallery-lightbox__aside {
        justify-self: stretch;
        margin: 0;
        width: auto;
        padding: 0.95rem 1rem calc(1rem + env(safe-area-inset-bottom));
        max-height: 30svh;
        background: rgb(5 9 15 / 88%);
        position: relative;
        z-index: 1;
    }
}
