/**
 * Image Fade Player Stylesheet
 *
 * Provides full-screen overlay styling to smoothly fade the viewport to a pristine white
 * (or configured background colour) whilst placing images precisely in the middle centre.
 *
 * Crafted with care; as calm and dignified as a Pembroke Welsh Corgi taking an afternoon nap.
 */

/* Google Font: Playfair Display */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

/* The full-screen stage where our magical fade occurs */
.image-fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading, 10000);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 1000ms ease-in-out, background-color 500ms ease-in-out;
}

/* Active state when the fade sequence is underway */
.image-fade-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* Wrapper to hold and centre our stage elements in the middle centre of the screen */
.image-fade-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    box-sizing: border-box;
    gap: 1.5rem;
    max-width: 100%;
    max-height: 100%;
}

/* Static logo box positioned above the animation frames, about 1.5x the image dimensions */
.image-fade-logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(85vw, 360px);
    max-height: 160px;
    box-sizing: border-box;
}

.image-fade-logo {
    max-width: 100%;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Frame container holding the cycling animation images in a shared grid stack */
.image-fade-frame-container {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    /* Borders placed on frame container so borders remain crisp and never blink */
    border: 1px solid #000000;
    outline: 1px solid #000000;
    outline-offset: 1px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    line-height: 0;
    background: transparent;
}

/* Layered image elements sharing the same grid area for silky crossfading */
.image-fade-display {
    grid-area: 1 / 1;
    max-width: min(75vw, 300px);
    max-height: min(75vh, 240px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-sizing: border-box;
    display: block;
    opacity: 0;
    transition: opacity 200ms ease-in-out;
}

/* Active visible state for the image layer */
.image-fade-display.is-visible {
    opacity: 1;
}

/* Incremental typewriter loading text container, anchored so letters type out to the right */
.image-fade-loading-text {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.08em;
    color: #1e293b;
    min-height: 1.75em;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    white-space: pre;
}

/* Visible portion of the typed message */
.image-fade-text-visible {
    display: inline;
}

/* Invisible ghost characters reserving the total width so the word never shifts */
.image-fade-text-ghost {
    display: inline;
    visibility: hidden;
    user-select: none;
    pointer-events: none;
}


/* Whimsical fallback status text */
.image-fade-status {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #4a5568;
    font-size: 0.95rem;
    margin-top: 0.75rem;
}

