/**
 * Copyright (c) 2026 Kyle Blizzard. All Rights Reserved.
 * Coverflow gallery. Scoped to .gw-coverflow — does not restyle the glass rail.
 */

.gw-coverflow {
    --gw-cf-card-w: min(68vw, 980px);
    --gw-cf-card-h: min(72vh, 720px);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 1.25rem 0 1.5rem;
    color: var(--gw-text, #d4cfc4);
    background: transparent;
    overflow: hidden;
}

.gw-coverflow__head {
    text-align: center;
    padding: 0 1.25rem 0.35rem;
}

.gw-coverflow__eyebrow {
    margin: 0 0 0.2rem;
    font-family: var(--gw-font-body, 'Barlow', sans-serif);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gw-gold, #c9a84c);
}

.gw-coverflow__title {
    margin: 0;
    font-family: var(--gw-font-display, 'Big Shoulders Display', Impact, sans-serif);
    font-weight: 800;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gw-white, #f0ece2);
}

.gw-coverflow__stage {
    position: relative;
    height: min(78vh, 780px);
    overflow: hidden;
    min-height: 320px;
    outline: none;
    cursor: grab;
    touch-action: pan-y;
}

.gw-coverflow__stage:active {
    cursor: grabbing;
}

.gw-coverflow__stage:focus-visible {
    box-shadow: inset 0 0 0 1px var(--gw-blue-glass-border, rgba(47, 107, 255, 0.55));
}

.gw-coverflow__perspective {
    position: absolute;
    inset: 0 0 36px;
    perspective: 1400px;
    perspective-origin: 50% 42%;
}

.gw-coverflow__track {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    transform-style: preserve-3d;
}

.gw-coverflow__item {
    position: absolute;
    left: 50%;
    top: 52%;
    width: max-content;
    height: auto;
    max-width: min(78vw, 1200px);
    margin: 0;
    transform-style: preserve-3d;
    transition: transform 480ms cubic-bezier(0.22, 0.8, 0.28, 1), opacity 360ms ease;
    will-change: transform;
}

.gw-coverflow.is-dragging .gw-coverflow__item {
    transition: none;
}

.gw-coverflow__card {
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform-style: preserve-3d;
}

.gw-coverflow__img,
.gw-coverflow__video {
    width: auto;
    height: auto;
    max-width: min(74vw, 1100px);
    max-height: min(74vh, 760px);
    object-fit: contain;
    display: block;
    border-radius: 6px;
    background: #0a0a0c;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(184, 190, 198, 0.35);
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.gw-coverflow__item.is-center .gw-coverflow__img {
    box-shadow:
        0 0 0 1px rgba(244, 246, 248, 0.72),
        0 0 0 6px rgba(47, 107, 255, 0.16),
        0 28px 60px rgba(0, 0, 0, 0.72),
        0 0 40px rgba(47, 107, 255, 0.18);
}

.gw-coverflow__item.is-center .gw-coverflow__card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 42%;
    margin-top: 8px;
    border-radius: 6px;
    background-image: var(--gw-cf-reflect);
    background-size: cover;
    background-position: center top;
    transform: scaleY(-1);
    opacity: 0.38;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 78%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 78%);
}

.gw-coverflow__floor {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 18px;
    height: 46px;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(47, 107, 255, 0.18), transparent 70%);
    filter: blur(2px);
}

.gw-coverflow__bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    margin-top: 0.15rem;
}

.gw-coverflow__nav {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(184, 190, 198, 0.45);
    color: var(--gw-chrome-hi, #f4f6f8);
    background:
        linear-gradient(180deg, rgba(247, 248, 250, 0.16), rgba(58, 62, 68, 0.35));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 8px 18px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.gw-coverflow__nav:hover {
    border-color: rgba(47, 107, 255, 0.7);
    color: #fff;
}

.gw-coverflow__nav:focus-visible {
    outline: 2px solid var(--gw-blue, #2f6bff);
    outline-offset: 2px;
}

.gw-coverflow__nav[disabled] {
    opacity: 0.35;
    cursor: default;
}

.gw-coverflow__count {
    min-width: 5.5rem;
    margin: 0;
    text-align: center;
    font-family: var(--gw-font-body, 'Barlow', sans-serif);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gw-text-muted, #8a8578);
}

.gw-coverflow--empty {
    min-height: 52vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.25rem 4rem;
}

.gw-coverflow__empty {
    max-width: 28rem;
    margin: 0 auto;
    padding: 2.4rem 1.8rem 2.2rem;
    text-align: center;
    border-radius: 16px;
    background: rgba(14, 16, 22, 0.72);
    border: 1px solid rgba(174, 180, 188, 0.28);
    box-shadow:
        0 0 0 1px rgba(47, 107, 255, 0.12),
        0 24px 60px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.gw-coverflow__empty-copy {
    margin: 0.85rem 0 0;
    font-family: var(--gw-font-body, 'Barlow', sans-serif);
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--gw-text, #d4cfc4);
}

@media (max-width: 899px) {
    .gw-coverflow {
        --gw-cf-card-w: 68vw;
        --gw-cf-card-h: min(48vh, 420px);
        padding-bottom: calc(var(--gw-bottom-nav-height, 64px) + 1.2rem);
    }

    .gw-coverflow__stage {
        height: min(58vh, 520px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gw-coverflow__item {
        transition: none;
    }
}

/* Gallery page: escape the centered 70% shell so the full photo fits. */
@media (min-width: 1001px) {
    body:has(.gw-coverflow) .gw-shell {
        width: min(96vw, 1680px);
        max-width: 96vw;
        min-width: 0;
    }
}
