/* GL-set gallery shell: shared shader-gallery grid and empty-tile styles. */
:root {
    --gl-set-gallery-left: calc(var(--gallery-left) + var(--gallery-width) + var(--panel-spacing));
    --gl-set-gallery-right: calc(100% - var(--gl-set-gallery-left) - var(--gallery-width));
}

#glSetGallery {
    position: fixed;
    top: var(--gallery-top);
    bottom: var(--gallery-bottom);
    left: var(--gl-set-gallery-left);
    right: var(--gl-set-gallery-right);
    width: auto;
    height: auto;
    z-index: 2;
    padding: 32px 8px 8px;
    background-color: transparent;
    opacity: var(--gallery-opacity);
    display: flex;
    flex-direction: column;
    gap: var(--gallery-gap);
    border-radius: var(--gallery-radius);
    overflow: hidden;
    transition: background-color 500ms;
}

#glSetGallery.gallery-hidden {
    display: none;
}

#glSetGallery:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

#glSetGalleryLabel {
    position: absolute;
    top: var(--gallery-page-label-top);
    left: auto;
    right: 10px;
    text-align: right;
    display: var(--gallery-page-label-display);
    transform: var(--gallery-page-label-transform);
    color: var(--gallery-page-label-color);
    font-family: var(--gallery-page-label-font-family);
    font-size: var(--gallery-page-label-font-size);
    opacity: var(--gallery-page-label-opacity);
}

/* match shader-gallery page selector buttons. */
#glSetGalleryPrev,
#glSetGalleryNext {
    position: absolute;
    top: calc(50% + 12px);
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: auto;
    padding: 8px 12px;
    border: 0;
    border-radius: 5px;
    margin: 0;
    color: #fff;
    background-color: #000;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    opacity: 0.85;
}

#glSetGalleryPrev { left: 5%; }
#glSetGalleryNext { right: 5%; }

#glSetGalleryPrev:hover,
#glSetGalleryNext:hover {
    opacity: 1;
    background-color: #fff;
    color: #000;
}

/* copied previews, filename fallback and drop feedback. */
#glSetGallery .thumb img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    object-fit: cover;
}

#glSetGallery .thumb img[hidden],
#glSetGallery .gl-set-filename[hidden] {
    display: none;
}

#glSetGallery .gl-set-filename {
    display: block;
    padding: 8px;
    color: #fff;
    font-family: monospace;
    font-size: 11px;
    overflow-wrap: anywhere;
}

#glSetGallery .gl-set-drop-target,
#glSetGallery .gl-set-copying {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

#glSetGallery .gl-set-copy-error {
    outline: 2px solid #b44;
    outline-offset: -2px;
}

/* GL-set metadata follows the picture/video gallery text. */
#glSetGallery .thumb { position: relative; user-select: none; }
#glSetGallery .gl-set-input { display: none; }
#glSetGallery .gl-set-status {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    z-index: 1;
    color: #fff;
    font-family: var(--texture-label-font-family);
    font-size: var(--texture-details-font-size);
    text-align: right;
    pointer-events: none;
}
#glSetGallery .gl-set-status[hidden] { display: none; }
#glSetGallery .gl-set-status[data-compile-status="compiled"] { color: #00ff00; }
#glSetGallery .gl-set-status[data-compile-status="error"] { color: #ff0000; }
#glSetGallery .gl-set-filename {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 0;
    font-family: var(--texture-label-font-family);
    font-size: var(--texture-details-font-size);
    text-align: right;
}

body[data-display-profile="speculum"] #textureGallery .texture-tile img,
body[data-display-profile="speculum"] #videoGallery .texture-tile img,
body[data-display-profile="speculum"] #videoGallery .video-hover-preview,
body[data-display-profile="speculum"] #glSetGallery .thumb img { object-fit: contain; }
