/* Galerijos miniatiūros ir klaviatūra valdoma nuotraukų peržiūra. */
button.gallery-photo {
    display: block;
    width: 100%;
    height: 200px;
    margin: 0 0 25px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #eee;
    cursor: pointer;
}

button.gallery-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

button.gallery-photo:focus {
    outline: 3px solid #1a5f8a;
    outline-offset: 3px;
}

.gallery-window-accessible {
    position: fixed;
    z-index: 10000;
    inset: 0;
    overflow: auto;
    padding: 16px;
    background: rgba(0, 0, 0, .95);
    color: #fff;
    text-align: center;
}

.gallery-window-accessible .gallery-panel {
    max-width: 1400px;
    min-height: 100%;
    margin: auto;
}

.gallery-window-accessible .gallery-title {
    margin: 0 0 12px;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1.4;
}

.gallery-window-accessible .gallery-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.gallery-window-accessible .gallery-control {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 14px;
    border: 2px solid #fff;
    border-radius: 4px;
    background: #222;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.gallery-window-accessible .gallery-control:hover {
    background: #fff;
    color: #111;
}

.gallery-window-accessible .gallery-control:focus {
    outline: 3px solid #ffff00;
    outline-offset: 3px;
}

.gallery-window-accessible .gallery-control:disabled {
    opacity: .6;
    cursor: default;
}

.gallery-window-accessible .gallery-status,
.gallery-window-accessible .gallery-help {
    margin: 12px 0;
}

.gallery-window-accessible .gallery-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 220px);
    max-height: max(160px, calc(100dvh - 220px));
    margin: 16px auto;
    object-fit: contain;
}

.gallery-window-accessible [hidden] {
    display: none !important;
}

body.accessibility-contrast button.gallery-photo:focus {
    outline-color: #ffff00;
}

body.accessibility-contrast .gallery-window-accessible,
body.accessibility-contrast .gallery-window-accessible .gallery-control {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00;
}

@media (forced-colors: active) {
    button.gallery-photo:focus,
    .gallery-window-accessible .gallery-control:focus {
        outline-color: Highlight;
    }
    .gallery-window-accessible,
    .gallery-window-accessible .gallery-control {
        background: Canvas;
        color: CanvasText;
        border-color: ButtonText;
    }
}
