/*   Image overlay. Only links explicitly marked data-photo-viewer opt in.   */
a[data-photo-viewer] {
    cursor: zoom-in;
}

a[data-photo-viewer]:focus-visible {
    outline: 3px solid #7d5329;
    outline-offset: 5px;
}

html.st-photo-viewer-open {
    overflow: hidden;
}

.st-photo-viewer {
    --st-photo-clearance: 176px;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    box-sizing: border-box;
    margin: 0;
    padding: 64px 48px 40px;
    border: 0;
    background: transparent;
    color: #fff;
    font: 14px/1.45 Arial, Helvetica, sans-serif;
    text-align: center;
    overflow: auto;
    overscroll-behavior: contain;
}

.st-photo-viewer:not([open]) {
    display: none;
}

.st-photo-viewer[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-photo-viewer::backdrop {
    background: radial-gradient(ellipse at center, rgba(35, 42, 51, .50) 0%, rgba(12, 16, 23, .65) 68%, rgba(3, 5, 9, .76) 100%);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: st-photo-fade-in 180ms ease-out;
}

.st-photo-viewer__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    margin: 0;
    animation: st-photo-arrive 180ms ease-out;
}

.st-photo-viewer__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - var(--st-photo-clearance));
    max-height: calc(100dvh - var(--st-photo-clearance));
    object-fit: contain;
    background: #fff;
    border: 0;
    border-radius: 5px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .14);
}

.st-photo-viewer__image[hidden] {
    display: none;
}

.st-photo-viewer[aria-busy="true"] .st-photo-viewer__image {
    visibility: hidden;
}

.st-photo-viewer__caption {
    max-width: 660px;
    color: #f2f3f5;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: .02em;
}

.st-photo-viewer__controls {
    position: absolute;
    top: 20px;
    right: 24px;
    margin: 0;
    padding: 0;
}

.st-photo-viewer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    color: #fff;
    font: inherit;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

.st-photo-viewer__close:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .6);
}

.st-photo-viewer__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.st-photo-viewer__close-icon {
    font-size: 25px;
    font-weight: normal;
    line-height: 1;
}

.st-photo-viewer__hint {
    position: absolute;
    right: 20px;
    bottom: 20px;
    left: 20px;
    margin: 0;
    color: #b9bfc9;
    font-size: 12px;
    text-indent: 0;
    pointer-events: none;
}

.st-photo-viewer__hint kbd {
    margin: 0 3px;
    padding: 2px 5px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 4px;
    font: inherit;
}

.st-photo-viewer__status {
    margin: 0;
    color: #e2e5e9;
    text-indent: 0;
}

.st-photo-viewer__status[hidden] {
    display: none;
}

@keyframes st-photo-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes st-photo-arrive {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
    .st-photo-viewer { --st-photo-clearance: 204px; padding: 68px 12px 48px; }
    .st-photo-viewer__controls { top: 12px; right: 12px; }
    .st-photo-viewer__caption { font-size: 13px; }
    .st-photo-viewer__hint { right: 12px; bottom: 16px; left: 12px; }
}

@media (max-height: 480px) {
    .st-photo-viewer { --st-photo-clearance: 128px; padding-top: 56px; padding-bottom: 24px; }
    .st-photo-viewer__controls { top: 8px; right: 12px; }
    .st-photo-viewer__figure { gap: 8px; }
    .st-photo-viewer__hint { display: none; }
}

@media (pointer: coarse) {
    /* Keep controls legible even on legacy pages without a mobile viewport tag. */
    .st-photo-viewer__close { min-height: clamp(44px, 12vw, 120px); font-size: clamp(14px, 3.5vw, 36px); }
    .st-photo-viewer__caption { font-size: clamp(14px, 3.5vw, 36px); }
    .st-photo-viewer__hint { font-size: clamp(12px, 3vw, 30px); }
    .st-photo-viewer__keyboard-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .st-photo-viewer::backdrop, .st-photo-viewer__figure { animation: none; }
    .st-photo-viewer__close { transition: none; }
}
