:root
{
    --w: 90vw;
    --h: 95vh;
    --r: 12px;
}


.screenshot-button:hover img
{
    transform: scale(1.05); 
}

.screenshot-button:focus-visible
{
    outline: 3px solid var(--color-viewer-focus); 
    outline-offset:4px; 
}

.modal
{
    position:fixed;
    inset:0;
    display:none;
    place-items:center;
    padding:24px;
    background: var(--color-viewer-overlay);
    backdrop-filter: blur(6px);
    z-index:10000;
}

.modal.is-open
{
    display:grid;
}

.viewer
{
    width: var(--w);
    max-height: var(--h);
    background: var(--color-viewer-surface);
    border: 1px solid var(--color-viewer-border);
    border-radius: var(--r);
    overflow:hidden;
    box-shadow: var(--shadow-viewer);
    position:relative;
}

.track
{
    display:flex;
    height: min(var(--h), 90vh);
    transition: transform .5s ease;
    will-change: transform;
}

.slide
{
    flex: 0 0 100%;
    position:relative;
    display:grid;
    place-items:center;
    background: var(--color-viewer-slide);
}

.slide img
{
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    display: block;
}

/* Controls */
.btn
{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:44px;
    height:44px;
    border-radius:999px;
    border: 1px solid var(--color-viewer-control-border);
    background: var(--color-viewer-control);
    color: var(--color-text-inverse);
    display:grid;
    place-items:center;
    cursor:pointer;
    user-select:none;
    font-size:26px;
    line-height:1;
    backdrop-filter: blur(8px);
}
.btn:hover{ background: var(--color-viewer-control-hover); }
.btn:focus-visible{ outline: 3px solid var(--color-viewer-focus); outline-offset:3px; }
.prev{ left:12px; }
.next{ right:12px; }

.close
{
    top:14px;
    right:14px;
    transform:none;
    font-size:22px;
}

.dots
{
    position:absolute;
    left:0; right:0;
    bottom:12px;
    display:flex;
    justify-content:center;
    gap:10px;
    pointer-events:auto;
}

.dot
{
    width:10px;
    height:10px;
    border-radius:999px;
    background: var(--color-viewer-dot);
    border:0;
    cursor:pointer;
}

.dot[aria-current="true"]
{
    background: var(--color-text-inverse);
    transform: scale(1.2);
}

@media (prefers-reduced-motion: reduce)
{
    .track{ transition:none; }
    .screenshot-button img{ transition:none; }
}
