

:root {
    --ga-gap: 10px;
    --ga-radius: 12px;
    --ga-lift: 0 18px 40px -20px rgba(16, 24, 40, .6);
    --ga-surface: var(--surface, #fff);
    --ga-border: var(--border, #e2e6ec);
}


html.ga-locked,
body.ga-locked {
    overflow: hidden;
}




.ga-card,
.pg-cell {
    position: relative;
    margin: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--ga-radius);
    background: #eef2f7;
}

.ga-open,
.gallery-image-button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: #eef2f7;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: zoom-in;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.ga-open img,
.gallery-image-button img {
    display: block;
    width: 100%;
    height: 100%;
    
    object-fit: cover;
    background: #eef2f7;
    transition: transform .45s cubic-bezier(.2, .75, .3, 1), filter .3s ease;
}

.ga-card:hover .ga-open img,
.ga-card:focus-within .ga-open img,
.pg-cell:hover .gallery-image-button img,
.pg-cell:focus-within .gallery-image-button img {
    transform: scale(1.06);
}



.ga-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--ga-gap);
    
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
}

.ga-card {
    background: var(--ga-surface);
    border: 1px solid var(--ga-border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
    transition: transform .25s cubic-bezier(.2, .75, .3, 1), box-shadow .25s ease;
}

.ga-card:hover,
.ga-card:focus-within {
    transform: translateY(-3px);
    box-shadow: var(--ga-lift);
    border-color: #ccd4e0;
}


.ga-open {
    padding: 0 !important;
    border: 0 !important;
}


.ga-bar {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 6px 5px;
    background: linear-gradient(to top, rgba(8, 11, 16, .9), rgba(8, 11, 16, 0));
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease;
}

.ga-card:hover .ga-bar,
.ga-card:focus-within .ga-bar {
    opacity: 1;
    transform: none;
}


@media (hover: none) {
    .ga-bar {
        opacity: 1;
        transform: none;
    }
}

.ga-bar form {
    display: inline;
}



.ga-bar .ga-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0 !important;
    gap: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0;              
    line-height: 0;
    white-space: nowrap;
    text-decoration: none;
    background: rgba(16, 20, 27, .8);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}


.ga-btn svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.ga-btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.ga-bar .ga-btn:hover,
.ga-bar .ga-btn:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #10141b;
}

.ga-btn-danger {
    margin-left: 0;
}


.ga-badge {
    position: absolute;
    z-index: 2;
    left: 6px;
    top: 6px;
    padding: .2rem .45rem;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(12, 15, 20, .68);
    backdrop-filter: blur(6px);
}

.ga-badge[data-published="true"] {
    background: #146c43;
}

.ga-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}


.gallery-edit-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.gallery-edit-preview img {
    display: block;
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: var(--ga-radius);
    border: 1px solid var(--ga-border);
    background: #eef2f7;
}

.gallery-edit-preview-empty {
    display: grid;
    place-items: center;
    width: 220px;
    height: 220px;
    border-radius: var(--ga-radius);
    border: 1px dashed var(--ga-border);
    color: #5b6472;
    font-size: .85rem;
}

.gallery-edit-meta {
    color: #5b6472;
    font-size: .78rem;
}

.field-hint {
    display: block;
    margin-top: 4px;
    color: #5b6472;
    font-size: .78rem;
}



.public-gallery {
    overflow-x: clip;
}

.public-gallery-grid {
    
    columns: 200px;
    column-gap: var(--ga-gap);
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.pg-cell {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin: 0 0 var(--ga-gap);
    border: 0;
    box-shadow: 0 2px 10px -4px rgba(16, 24, 40, .3);
    transition: transform .25s cubic-bezier(.2, .75, .3, 1), box-shadow .25s ease;
}

.pg-cell:hover,
.pg-cell:focus-within {
    transform: translateY(-3px);
    box-shadow: var(--ga-lift);
}


.pg-description {
    display: none;
}



.gallery-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
    color: #fff;
}


.gallery-lightbox:not([open]) {
    display: none;
}

.gallery-lightbox[open] {
    display: flex;
    flex-direction: column;
    animation: ga-fade .22s ease;
}

.gallery-lightbox::backdrop {
    background: rgba(8, 7, 6, .93);
    backdrop-filter: blur(10px) saturate(120%);
}

@keyframes ga-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-lightbox__stage {
    flex: 1 1 auto;
    
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(58px, 8vh, 96px) clamp(60px, 7vw, 120px) clamp(10px, 2vh, 18px);
}

.gallery-lightbox img {
    display: block;
    
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    background: #0b0d12;
    box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .95);
}

.gallery-lightbox img[hidden] {
    display: none;
}


.gl-close,
.gl-nav {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: #fff;
    background: rgba(18, 20, 26, .72);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.gl-close {
    top: 14px;
    right: 14px;
    font-size: 1.7rem;
}

.gl-prev {
    left: clamp(8px, 1.6vw, 20px);
    top: 50%;
    transform: translateY(-50%);
}

.gl-next {
    right: clamp(8px, 1.6vw, 20px);
    top: 50%;
    transform: translateY(-50%);
}

.gl-close:hover,
.gl-close:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #10141b;
    transform: scale(1.06);
}

.gl-prev:hover,
.gl-prev:focus-visible,
.gl-next:hover,
.gl-next:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #10141b;
    transform: translateY(-50%) scale(1.06);
}

.gl-close[hidden],
.gl-nav[hidden] {
    display: none;
}


.ga-caption {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 8px clamp(14px, 4vw, 32px) clamp(14px, 3vh, 26px);
    text-align: center;
    font-size: .95rem;
    line-height: 1.35;
}

.ga-caption-text:empty {
    display: none;
}

.ga-caption-alt {
    max-width: 62ch;
    color: #b9b3aa;
    font-size: .82rem;
    line-height: 1.4;
}

.ga-caption-alt[hidden] {
    display: none;
}

.ga-caption small {
    margin-top: 4px;
    color: #8d877f;
    font-variant-numeric: tabular-nums;
}


.gallery-loading {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: .6em 1.1em;
    border-radius: 999px;
    font-size: .9rem;
    color: #e9e5df;
    background: rgba(255, 255, 255, .08);
}

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

.gallery-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    animation: ga-spin .7s linear infinite;
}

@keyframes ga-spin {
    to { transform: rotate(360deg); }
}

.gallery-lightbox :focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}



@media (max-width: 820px) {
    .gallery-lightbox__stage {
        padding: 62px 12px 6px;
    }

    .gl-close,
    .gl-nav {
        width: 42px;
        height: 42px;
    }

    .gl-close {
        top: 10px;
        right: 10px;
    }

    .gl-prev { left: 6px; }
    .gl-next { right: 6px; }

    .ga-caption {
        padding-bottom: 20px;
        font-size: .88rem;
    }
}

@media (max-width: 640px) {
    
    .ga-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .ga-btn {
        padding: .28rem .4rem;
        font-size: .68rem;
    }

    .ga-badge {
        font-size: .56rem;
        padding: .16rem .34rem;
    }

    
    .public-gallery-grid {
        columns: 130px;
        column-gap: 8px;
    }

    .pg-cell {
        margin-bottom: 8px;
        border-radius: 10px;
    }

    .ga-caption {
        padding-bottom: 18px;
        font-size: .84rem;
    }

    .ga-caption-alt {
        font-size: .76rem;
    }
}


@media (prefers-reduced-motion: reduce) {
    .ga-card,
    .ga-open img,
    .ga-bar,
    .pg-cell,
    .gallery-image-button img,
    .gl-close,
    .gl-nav,
    .gallery-lightbox[open],
    .gallery-loading::before {
        animation: none;
        transition: none;
    }
}
