.ww-gallery-page {
    --ww-gallery-edge: clamp(1.25rem, 3vw, 2.75rem);
    min-height: calc(100vh - var(--ww-nav-height));
    background:
        radial-gradient(900px 520px at 15% 0%, rgba(20, 184, 166, .16), transparent 62%),
        radial-gradient(760px 500px at 90% 12%, rgba(244, 114, 182, .12), transparent 58%),
        #030609;
    color: #f8fafc;
}

.ww-gallery-hero {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    padding: 4rem 1rem 1.5rem;
    background: linear-gradient(180deg, rgba(2, 6, 12, .84), rgba(3, 6, 9, .28));
}

.ww-gallery-hero-directory {
    display: none;
}

.ww-gallery-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 6, 9, .82), rgba(3, 6, 9, .28), rgba(3, 6, 9, .82)),
        radial-gradient(circle at center, transparent 0 42%, rgba(255, 255, 255, .08) 42.2%, transparent 42.6%);
    pointer-events: none;
}

.ww-gallery-hero-bg {
    position: absolute;
    inset: 0;
    opacity: .32;
    background-size: cover;
    background-position: center;
    filter: saturate(.85) contrast(1.05);
}

.ww-gallery-hero-inner {
    position: relative;
    width: min(1180px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ww-gallery-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ww-gallery-avatar {
    width: 76px;
    height: 76px;
    border-radius: 2px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
}

.ww-gallery-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: .95;
    margin: 0;
    font-weight: 900;
    letter-spacing: 0;
}

.ww-gallery-sub {
    margin-top: .5rem;
    color: rgba(255, 255, 255, .72);
}

.ww-gallery-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.ww-gallery-shell-viewer {
    width: 100%;
    padding: 0 0 3rem;
}

.ww-gallery-index {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    align-items: start;
}

.ww-gallery-card {
    display: block;
    text-decoration: none;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(8, 12, 18, .76);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .30);
    align-self: start;
}

.ww-gallery-cover {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, rgba(20, 184, 166, .20), rgba(244, 114, 182, .12));
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .58);
    font-weight: 900;
}

.ww-gallery-cover img,
.ww-gallery-photo-img img,
.ww-gallery-accordion-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ww-gallery-card-copy {
    padding: .9rem;
    display: grid;
    gap: .35rem;
}

.ww-gallery-card-title {
    font-weight: 900;
    font-size: 1.05rem;
}

.ww-gallery-card-meta,
.ww-gallery-card-desc {
    color: rgba(255, 255, 255, .68);
    font-size: .9rem;
    line-height: 1.35;
}

.ww-gallery-stage {
    overflow: hidden;
}

.ww-gallery-viewer {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.ww-gallery-collection-feature {
    margin: 0 calc(50% - 50vw) 1rem;
    background: rgba(3, 6, 10, .92);
}

.ww-gallery-collection-feature .ww-gallery-accordion-head {
    padding-top: 2.4rem;
}

.ww-gallery-collection-tools {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.ww-gallery-empty {
    padding: 2rem;
    color: rgba(255, 255, 255, .70);
}

.ww-gallery-accordion-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.2rem var(--ww-gallery-edge) 1rem;
    background:
        radial-gradient(580px 220px at 22% 0%, rgba(45, 212, 191, .16), transparent 68%),
        rgba(3, 6, 10, .92);
}

.ww-gallery-kicker {
    color: rgba(255, 255, 255, .62);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.ww-gallery-accordion-head h2 {
    margin: .35rem 0 .4rem;
    font-size: clamp(1.4rem, 3vw, 2.6rem);
    line-height: 1;
    letter-spacing: 0;
}

.ww-gallery-slider-caption {
    color: rgba(255, 255, 255, .72);
    font-size: .94rem;
}

.ww-gallery-slider-count {
    display: flex;
    align-items: flex-end;
    gap: .45rem;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
}

.ww-gallery-slider-count strong {
    color: #fff;
    font-size: 1.6rem;
    line-height: .8;
}

.ww-gallery-slider-count span {
    color: rgba(255, 255, 255, .48);
    font-weight: 900;
}

.ww-gallery-modal-close,
.ww-gallery-modal-arrow {
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(2, 6, 12, .62);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.ww-gallery-modal-close:hover,
.ww-gallery-modal-arrow:hover {
    border-color: rgba(255, 255, 255, .62);
    background: rgba(255, 255, 255, .12);
}

.ww-gallery-accordion {
    display: flex;
    gap: .75rem;
    height: clamp(340px, 52vh, 560px);
    padding: 0 var(--ww-gallery-edge) 1.2rem;
    background: rgba(3, 6, 10, .92);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ww-gallery-accordion::-webkit-scrollbar {
    display: none;
}

.ww-gallery-accordion-panel {
    position: relative;
    flex: 0 0 clamp(76px, 8vw, 112px);
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 2px;
    overflow: hidden;
    background: #05070b;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    scroll-snap-align: center;
    transition: flex-basis .34s ease, border-color .24s ease, transform .24s ease, filter .24s ease;
}

.ww-gallery-accordion-panel:hover,
.ww-gallery-accordion-panel.is-active {
    border-color: rgba(94, 234, 212, .70);
}

.ww-gallery-accordion-panel:not(.is-active) {
    filter: saturate(.72) brightness(.72);
}

.ww-gallery-accordion-panel.is-active {
    flex-basis: min(68vw, 860px);
    filter: saturate(1) brightness(1);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.ww-gallery-panel-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 34%, rgba(0, 0, 0, .78));
    pointer-events: none;
}

.ww-gallery-panel-copy {
    position: absolute;
    left: .8rem;
    right: .8rem;
    bottom: .8rem;
    display: grid;
    gap: .35rem;
    text-align: left;
    pointer-events: none;
}

.ww-gallery-panel-index {
    color: rgba(255, 255, 255, .58);
    font-size: .78rem;
    font-weight: 900;
}

.ww-gallery-panel-title {
    color: #fff;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 3px 18px rgba(0, 0, 0, .78);
}

.ww-gallery-panel-meta {
    color: rgba(255, 255, 255, .72);
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.2;
}

.ww-gallery-accordion-panel:not(.is-active) .ww-gallery-panel-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 240px;
    font-size: .9rem;
}

.ww-gallery-accordion-panel:not(.is-active) .ww-gallery-panel-meta {
    display: none;
}

.ww-gallery-panel-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 1rem;
    color: rgba(255, 255, 255, .58);
    font-weight: 900;
    background: linear-gradient(135deg, rgba(20, 184, 166, .20), rgba(244, 114, 182, .12));
}

.ww-gallery-collection-grid {
    box-sizing: border-box;
    padding: 1rem var(--ww-gallery-edge) 0;
}

.ww-gallery-collection-grid .ww-gallery-card {
    height: auto;
}

.ww-gallery-collection-grid .ww-gallery-cover {
    aspect-ratio: 16 / 9;
    max-height: 220px;
    overflow: hidden;
}

.ww-gallery-collection-grid .ww-gallery-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.ww-gallery-collection-grid .ww-gallery-card-copy {
    min-height: 76px;
}

.ww-gallery-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem var(--ww-gallery-edge);
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(3, 6, 10, .88);
}

.ww-gallery-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .8rem;
    padding: 0 var(--ww-gallery-edge) clamp(1.2rem, 4vw, 3rem);
    background: rgba(3, 6, 10, .88);
}

.ww-gallery-grid-image {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    min-width: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 2px;
    overflow: hidden;
    background: #05070b;
    color: #fff;
    cursor: pointer;
}

.ww-gallery-grid-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .24s ease, filter .24s ease;
}

.ww-gallery-grid-image span {
    position: absolute;
    left: .6rem;
    right: .6rem;
    bottom: .55rem;
    color: #fff;
    font-size: .82rem;
    font-weight: 900;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .82);
}

.ww-gallery-grid-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .72));
    pointer-events: none;
}

.ww-gallery-grid-image:hover,
.ww-gallery-grid-image.is-active {
    border-color: rgba(94, 234, 212, .72);
}

.ww-gallery-grid-image:hover img {
    transform: scale(1.04);
    filter: saturate(1.08);
}

.ww-gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: .7rem;
    padding: 0 1.2rem 1.2rem;
    background: rgba(3, 6, 10, .88);
}

.ww-gallery-photo {
    display: block;
    padding: 0;
    text-align: left;
    color: #f8fafc;
    border-radius: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .08);
    cursor: pointer;
}

.ww-gallery-photo:hover,
.ww-gallery-photo.is-active {
    border-color: rgba(45, 212, 191, .72);
}

.ww-gallery-photo.is-active {
    box-shadow: 0 0 0 2px rgba(45, 212, 191, .18);
}

.ww-gallery-photo-img {
    aspect-ratio: 4 / 3;
    background: #020408;
}

.ww-gallery-photo-caption {
    padding: .55rem .6rem;
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ww-gallery-modal[hidden] {
    display: none;
}

.ww-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 6, 12, .90);
    backdrop-filter: blur(10px);
}

.ww-gallery-modal-inner {
    position: relative;
    width: min(1180px, 100%);
    height: min(86vh, 820px);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: .8rem;
}

.ww-gallery-modal-img-wrap {
    min-height: 0;
    display: grid;
    place-items: center;
    border-radius: 2px;
    background: rgba(0, 0, 0, .42);
    border: 1px solid rgba(255, 255, 255, .12);
    overflow: hidden;
}

.ww-gallery-modal-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ww-gallery-modal-caption {
    color: #f8fafc;
    font-weight: 900;
    text-align: center;
    min-height: 1.4rem;
}

.ww-gallery-modal-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 42px;
    height: 42px;
    border-radius: 2px;
    font-size: 1.7rem;
    line-height: 1;
}

.ww-gallery-modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 2px;
    font-size: 1.8rem;
    font-weight: 900;
}

.ww-gallery-modal-prev {
    left: .75rem;
}

.ww-gallery-modal-next {
    right: .75rem;
}

.ww-gallery-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: center;
}

.ww-gallery-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    padding: .65rem 1rem;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #f8fafc;
    text-decoration: none;
    font-weight: 800;
}

.ww-gallery-upload {
    background: #5eead4;
    color: #042f2e;
    border-color: rgba(94, 234, 212, .65);
}

@media (max-width: 760px) {
    .ww-gallery-page {
        --ww-gallery-edge: .9rem;
    }

    .ww-gallery-shell {
        width: 100%;
        padding-top: 0;
    }

    .ww-gallery-viewer {
        border-left: 0;
        border-right: 0;
    }

    .ww-gallery-title-row {
        align-items: flex-start;
    }

    .ww-gallery-avatar {
        width: 60px;
        height: 60px;
    }

    .ww-gallery-accordion-head {
        align-items: flex-start;
        padding: 1rem var(--ww-gallery-edge) .8rem;
    }

    .ww-gallery-collection-feature .ww-gallery-accordion-head {
        padding-top: 1.2rem;
        flex-direction: column;
    }

    .ww-gallery-collection-tools {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .ww-gallery-accordion {
        height: 390px;
        gap: .5rem;
        padding: 0 var(--ww-gallery-edge) .7rem;
    }

    .ww-gallery-accordion-panel {
        flex-basis: 64px;
    }

    .ww-gallery-accordion-panel.is-active {
        flex-basis: min(78vw, 360px);
    }

    .ww-gallery-panel-copy {
        left: .65rem;
        right: .65rem;
        bottom: .65rem;
    }

    .ww-gallery-image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
        padding: 0 var(--ww-gallery-edge) 1rem;
    }

    .ww-gallery-modal {
        padding: .5rem;
    }

    .ww-gallery-modal-arrow {
        width: 42px;
        height: 42px;
    }

    .ww-gallery-modal-prev {
        left: .35rem;
    }

    .ww-gallery-modal-next {
        right: .35rem;
    }
}
