/* ==================================================
   SLIDESHOW
   ================================================== */

html,
body {

    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;
}


body {

    font-family:
        Tahoma,
        Verdana,
        Arial,
        sans-serif;

    color: #000000;

    /*
     * Transparent so the background of index.html
     * remains visible behind the iframe.
     */

    background: transparent;
}


/* ==================================================
   MAIN CONTAINER
   ================================================== */

.slideshow {

    box-sizing: border-box;

    width: 100%;
    height: 100%;

    display: flex;

    flex-direction: column;

    padding: 14px;

    overflow: hidden;

    background: transparent;
}


/* ==================================================
   MEDIA
   ================================================== */

.media-area {

    /*
     * Use all available space above the controls.
     */

    flex: 1 1 auto;

    min-width: 0;

    /*
     * Reserve at least 500px for the image area
     * on the normal index page.
     */

    min-height: 500px;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    /*
     * Transparent.
     */

    background: transparent;
}


/*
 * Preserve the original aspect ratio.
 */

.media-area img,
.media-area video {

    display: block;

    max-width: 100%;
    max-height: 100%;

    width: auto;
    height: auto;

    object-fit: contain;
}


/* ==================================================
   EMPTY MESSAGE
   ================================================== */

.empty-message {

    color: #000000;

    font-size: 18px;

    text-align: center;
}


/* ==================================================
   CONTROLS ROW
   ================================================== */

.controls-row {

    /*
     * Fixed-height control area.
     */

    flex: 0 0 36px;

    min-height: 36px;

    display: flex;

    align-items: center;

    gap: 18px;

    padding-top: 12px;
}


/* ==================================================
   BUTTON GROUP
   ================================================== */

.controls {

    display: flex;

    align-items: center;

    gap: 6px;

    flex: 0 0 auto;
}


/* ==================================================
   BUTTONS
   ================================================== */

.control-button {

    box-sizing: border-box;

    width: 29px;
    height: 36px;

    min-width: 29px;
    min-height: 36px;

    padding: 0;

    border:
        1px solid
        #999999;

    border-radius: 4px;

    background:
        rgba(255, 255, 255, 0.92);

    color: #000000;

    font-family:
        Arial,
        sans-serif;

    line-height: 1;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
}


.control-button[hidden] {

    display: none !important;

}


.control-button:hover:not(:disabled) {

    background:
        rgba(255, 255, 255, 1);

}


.control-button:disabled {

    opacity: 0.28;

    cursor: default;

}


/* ==================================================
   SINGLE-STEP ARROWS
   ================================================== */

#youngerButton,
#olderButton {

    font-size: 28px;

    font-weight: normal;

    padding-bottom: 3px;

}


/* ==================================================
   PLAY BUTTONS
   ================================================== */

#playYoungerButton,
#playOlderButton {

    font-size: 18px;

}


/* ==================================================
   PAUSE
   ================================================== */

#pauseButton {

    font-size: 17px;

}


/* ==================================================
   FULLSCREEN
   ================================================== */

.fullscreen-button {

    margin-left: 10px;

}


.fullscreen-button svg {

    display: block;

    width: 20px;
    height: 20px;

    fill: none;

    stroke: #000000;

    stroke-width: 2.2;

    stroke-linecap: round;

    stroke-linejoin: round;

}


/* ==================================================
   ZOOM / FULL-SIZE BUTTON
   ================================================== */

.zoom-button svg {

    display: block;

    width: 20px;
    height: 20px;

    fill: none;

    stroke: #000000;

    stroke-width: 2.1;

    stroke-linecap: round;

    stroke-linejoin: round;

}


/* ==================================================
   FULL-SIZE IMPRESSION OVERLAY
   ================================================== */

body.overlay-open {

    overflow: hidden;

}


.impression-overlay {
    position: fixed;

    inset: 0;

    z-index: 2147483646;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    box-sizing: border-box;

    background: rgba(0,0,0,0.94);

    overflow: hidden;
}


.impression-overlay.is-open {

    display: flex;

}


/* ==================================================
   OVERLAY MEDIA CONTAINER
   ================================================== */

.overlay-media {

    width: 100%;
    height: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    /*
     * Absolutely essential for reliable
     * two-finger pinch zoom.
     *
     * The browser must NOT interpret the
     * gesture as page scrolling/zooming.
     */

    touch-action: none;

    -webkit-user-select: none;
    user-select: none;

    -webkit-touch-callout: none;

}


/* ==================================================
   OVERLAY IMAGE / VIDEO
   ================================================== */

.overlay-media-content {

    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;

    transform-origin: center center;

    position: relative;
    z-index: 1;

    transition: transform 0.03s linear;

    user-select: none;
    -webkit-user-select: none;

    /*
     * NO SHADOW.
     */

    box-shadow:
        none !important;

    filter:
        none !important;

    /*
     * Prevent native image dragging.
     */

    -webkit-user-drag: none;

    user-drag: none;

    cursor: grab;

    will-change: transform;

}


/*
 * When the browser is displaying a video
 * in the full-size overlay, keep the video
 * visually clean as well.
 */

.overlay-media-content video {

    box-shadow:
        none !important;

    filter:
        none !important;

}


/* ==================================================
   CLOSE BUTTON
   ================================================== */

.overlay-close {

    position: absolute;

    top: 14px;
    right: 18px;

    z-index: 2147483647 !important;

    width: 42px;
    height: 42px;

    padding: 0;

    border: 1px solid rgba(255,255,255,0.75);
    border-radius: 50%;

    background: rgba(255,255,255,0.88);

    color: #000000;

    font-family: Arial, sans-serif;
    font-size: 32px;
    line-height: 36px;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
}

.overlay-close:hover {

    background:
        rgba(255, 255, 255, 1);

}


/* ==================================================
   DROPDOWN
   ================================================== */

#fileSelect {

    box-sizing: border-box;

    flex: 1 1 auto;

    min-width: 0;

    height: 36px;

    padding:
        4px
        10px;

    border:
        1px solid
        #999999;

    border-radius: 4px;

    background:
        rgba(255, 255, 255, 0.92);

    color: #000000;

    font-family:
        Tahoma,
        Verdana,
        Arial,
        sans-serif;

    font-size: 14px;

}


/* ==================================================
   FULLSCREEN
   ================================================== */

.slideshow:fullscreen {

    width: 100vw;
    height: 100vh;

    box-sizing: border-box;

    padding: 20px;

    background-image:
        var(--site-background-image);

    background-color:
        rgba(255, 255, 255, 0.05);

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    box-shadow:
        inset 0 0 0 1000px
        rgba(255, 255, 255, 0.12);

    backdrop-filter:
        blur(2px);

    -webkit-backdrop-filter:
        blur(2px);

}


.slideshow:-webkit-full-screen {

    width: 100vw;
    height: 100vh;

    box-sizing: border-box;

    padding: 20px;

    background-image:
        var(--site-background-image);

    background-color:
        rgba(255, 255, 255, 0.05);

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    box-shadow:
        inset 0 0 0 1000px
        rgba(255, 255, 255, 0.12);

    backdrop-filter:
        blur(2px);

    -webkit-backdrop-filter:
        blur(2px);

}


/* ==================================================
   FULLSCREEN MEDIA SIZING
   ================================================== */

.slideshow:fullscreen .media-area,
.slideshow:-webkit-full-screen .media-area {

    min-height: 0;

    height: auto;

}


.slideshow:fullscreen .controls-row,
.slideshow:-webkit-full-screen .controls-row {

    flex: 0 0 36px;

    min-height: 36px;

}


.slideshow:fullscreen .media-area img,
.slideshow:fullscreen .media-area video,
.slideshow:-webkit-full-screen .media-area img,
.slideshow:-webkit-full-screen .media-area video {

    max-width: 100%;
    max-height: 100%;

}


/* ==================================================
   FULLSCREEN OVERLAY
   ================================================== */

/*
 * Because the overlay is now INSIDE .slideshow,
 * it automatically belongs to the fullscreen
 * element and is therefore visible in fullscreen.
 */

.slideshow:fullscreen .impression-overlay,
.slideshow:-webkit-full-screen .impression-overlay {

    z-index: 9999;

}


/* ==================================================
   SMALL SCREENS
   ================================================== */

@media (max-width: 600px) {

    .slideshow {

        padding: 8px;

    }


    .media-area {

        min-height: 500px;

    }


    .controls-row {

        gap: 8px;

    }


    .controls {

        gap: 4px;

    }


    .control-button {

        width: 26px;
        height: 34px;

        min-width: 26px;
        min-height: 34px;

    }


    .fullscreen-button {

        margin-left: 5px;

    }


    .zoom-button {

        margin-left: 0;

    }


    .zoom-button svg,
    .fullscreen-button svg {

        width: 18px;
        height: 18px;

    }


    #fileSelect {

        font-size: 12px;

    }


    /*
     * Make the close button slightly smaller
     * on narrow screens.
     */

    .overlay-close {

        top: 8px;
        right: 10px;

        width: 38px;
        height: 38px;

        font-size: 29px;

        line-height: 32px;

    }

}


/* ==================================================
   VERY LOW LANDSCAPE SCREENS
   ================================================== */

@media (max-height: 600px) {

    .slideshow:fullscreen,
    .slideshow:-webkit-full-screen {

        padding: 8px;

    }


    .slideshow:fullscreen .media-area,
    .slideshow:-webkit-full-screen .media-area {

        min-height: 0;

    }


    .slideshow:fullscreen .controls-row,
    .slideshow:-webkit-full-screen .controls-row {

        padding-top: 6px;

        flex: 0 0 34px;

        min-height: 34px;

    }

}


@media (max-width: 600px) and (max-height: 600px) {

    .slideshow:fullscreen .controls-row,
    .slideshow:-webkit-full-screen .controls-row {

        gap: 5px;

    }

}