/* Gallery-specific styles */

.gallery-page {
    --gallery-bg-base: #000000;
    --gallery-bg-mid: #000000;
    --gallery-bg-end: #000000;
    --gallery-glow-a: rgba(255, 255, 255, 0.095);
    --gallery-glow-b: rgba(255, 255, 255, 0.06);
    --gallery-glow-c: rgba(255, 255, 255, 0.03);
    background: var(--gallery-bg-base);
    color: #f2f2f2;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
}

.gallery-page::before {
    content: '';
    position: fixed;
    inset: -24vmax;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(52vmax 40vmax at 12% 16%, var(--gallery-glow-a), transparent 68%),
        radial-gradient(60vmax 46vmax at 90% 82%, var(--gallery-glow-b), transparent 72%),
        radial-gradient(42vmax 34vmax at 50% 52%, var(--gallery-glow-c), transparent 74%),
        linear-gradient(132deg, var(--gallery-bg-base) 0%, var(--gallery-bg-mid) 52%, var(--gallery-bg-end) 100%);
    animation: gallery-aurora-drift 36s ease-in-out infinite alternate;
}

.gallery-page::after {
    content: '';
    position: fixed;
    inset: -15%;
    z-index: -1;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.025) 0 1px,
            rgba(0, 0, 0, 0) 1px 3px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.016) 0 1px,
            rgba(0, 0, 0, 0) 1px 4px
        );
    mix-blend-mode: soft-light;
    opacity: 0.34;
    animation: gallery-grain-shift 0.65s steps(2) infinite;
}

@keyframes gallery-aurora-drift {
    0% {
        transform: translate3d(-2.2%, -1.4%, 0) rotate(-1.2deg) scale(1.03);
    }
    50% {
        transform: translate3d(1.8%, 1.2%, 0) rotate(0.7deg) scale(1.05);
    }
    100% {
        transform: translate3d(-1.4%, 1.7%, 0) rotate(-0.5deg) scale(1.04);
    }
}

@keyframes gallery-grain-shift {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(1.5%, -1.8%, 0);
    }
}

.gallery-page .main-header,
.gallery-page .gallery-content,
.gallery-page .social-footer {
    position: relative;
    z-index: 1;
}

.gallery-page .brand-animation-box a {
    color: #f6f6f6;
}

.gallery-page .nav-links a,
.gallery-page .social-links a {
    color: #f6f6f6;
}

.gallery-page .nav-links a:hover,
.gallery-page .social-links a:hover {
    color: #d0d0d0;
}

.gallery-page .nav-links a.active,
.gallery-page .brand-animation-box a.active {
    color: #ffffff;
}

.gallery-page .social-links .dot {
    color: rgba(240, 240, 240, 0.48);
}

.gallery-secret-pizza-link {
    position: fixed;
    left: calc(env(safe-area-inset-left, 0px) + clamp(16px, 2vw, 30px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 2.2vw, 32px));
    z-index: 12;
    font-size: clamp(1.26rem, 2.3vw, 1.78rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    line-height: 1;
    text-decoration: none !important;
    color: #f4f4f4;
    opacity: 0.45;
    transform-origin: center;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.gallery-secret-pizza-link:hover,
.gallery-secret-pizza-link:focus-visible {
    opacity: 0.92;
    transform: translateY(-1px);
}

.gallery-content {
    --gallery-gap: clamp(12px, 1.4vw, 20px);
    --gallery-row-offset: clamp(18px, 2.2vw, 34px);
    --gallery-rows: 2;
    --gallery-row-height: clamp(150px, 24vh, 280px);
    --gallery-strip-height: calc(
        (var(--gallery-row-height) * var(--gallery-rows)) +
        (var(--gallery-gap) * (var(--gallery-rows) - 1))
    );
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    padding: clamp(0.9rem, 2.5vw, 2rem) 0 clamp(1.6rem, 3vw, 3rem);
}

.gallery-grid {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 0 clamp(8px, 1vw, 16px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.gallery-grid::-webkit-scrollbar {
    display: none;
}

.gallery-grid.dragging {
    cursor: grabbing;
}

.gallery-track {
    display: flex;
    gap: 0;
    width: max-content;
    min-height: var(--gallery-strip-height);
    align-items: flex-start;
}

.gallery-set {
    display: flex;
    gap: var(--gallery-gap);
    padding-right: var(--gallery-gap);
}

.gallery-set.gallery-set-rows {
    display: flex;
    flex-direction: column;
    gap: var(--gallery-gap);
    padding-right: var(--gallery-gap);
}

.gallery-column {
    display: flex;
    flex-direction: column;
    gap: var(--gallery-gap);
}

.gallery-row {
    display: flex;
    align-items: flex-start;
    gap: var(--gallery-row-gap, var(--gallery-gap));
    width: max-content;
}

.gallery-row-shift {
    transform: translateX(calc(var(--gallery-row-offset) * var(--row-shift-sign, 1)));
}

.gallery-item {
    display: block;
    margin: 0;
    line-height: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.gallery-item img {
    display: block;
    height: var(--gallery-row-height);
    width: auto;
    max-width: none;
    border: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.gallery-item img.progressive-image {
    transition: filter 0.34s ease, transform 0.34s ease, opacity 0.34s ease;
}

.gallery-item img.progressive-image.is-preview {
    filter: blur(11px);
    transform: scale(1.03);
    opacity: 0.88;
}

.gallery-empty {
    width: min(760px, 94vw);
    margin: 0 auto;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(245, 245, 245, 0.78);
    font-family: var(--primary-font);
    font-size: 1.05rem;
    line-height: 1.5;
}

@media (max-width: 940px) {
    .gallery-content {
        --gallery-row-height: clamp(128px, 22vh, 220px);
    }
}

@media (max-width: 620px) {
    .gallery-content {
        --gallery-rows: 2;
        --gallery-row-height: clamp(112px, 22vh, 180px);
        padding: 1rem 0 2.4rem;
    }
}
