/* ================================
   Mobile-Specific Styles
   ================================ */

@media (max-width: 768px) {

    .hover-label {
        display: none !important;
    }

    /* Desktop placed images - scale down on mobile */
    .placed-image {
        position: relative;
        transform: scale(1) !important;
        transform-origin: center;
        touch-action: manipulation;
    }

    .placed-image:active {
        transform: scale(1) !important;
        transition: transform 0.1s ease;
    }

    /* Mobile placed images */
    .mobile-placed-image {
        position: absolute;
        transform: none !important;
        transform-origin: center;
        cursor: pointer;
        touch-action: manipulation;
        pointer-events: auto;
        transition: transform 0.1s ease;
        object-fit: contain; /* Prevent image squeezing */
    }

    .mobile-placed-image:active {
        transform: scale(0.98) !important;
    }

    /* Mobile zoomed images */
    .mobile-zoomed-image {
        position: fixed !important;
        z-index: 9999 !important;
        pointer-events: none !important;
        touch-action: none !important;
    }

    /* Cursor image - smaller on mobile */
    .cursor-image {
        transform: scale(0.7) translate(-50%, -50%) !important;
    }

    /* Hide text overlay on zoomed images */
    .zoomed-image .mobile-text-overlay {
        display: none !important;
    }


    /* ================================
       Mobile Overlay Styles
       ================================ */

    /* Overlay container */
    .overlay {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: auto;
        height: auto;
        position: fixed;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 0;
    }

    /* Overlay title */
    .overlay h1 {
        position: relative;
        top: 4vh;
        transform: none;
        font-size: 4rem;
        margin: 0.5rem;
        padding: 0.5rem;
        text-align: center;
    }

    /* Overlay description */
    .overlay-description,
    .mobile-overlay-description {
        position: relative;
        transform: none;
        width: 80vw;
        margin: 0 auto 1rem auto;
        order: 2;
    }

    .overlay p {
        font-size: 0.75rem;
        padding: 0.5rem;
    }


    /* ================================
       Mobile Overlay States
       ================================ */

    /* Block background interactions when overlay is open */
    body.mobile-overlay-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    body.mobile-overlay-open > *:not(.overlay) {
        pointer-events: none;
        touch-action: none;
    }

    /* Disable mobile placed images when overlay is open */
    body.mobile-overlay-open .mobile-placed-image {
        pointer-events: none !important;
        touch-action: none !important;
        opacity: 0.5;
    }

    /* Visual feedback for snap-to-close */
    .overlay.mobile-scroll-close {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* ================================
       Mobile Overlay Animation Styles
       ================================ */

    .mobile-overlay-description {
        position: absolute;
        top: 75vh;
        left: 50%;
        transform: translateX(-50%);
        width: 90vw;
        text-align: center;
        transition: transform 0.1s ease;
    }

    .mobile-overlay-images {
        position: relative;
        top: 100vh;
        transform: translateX(-50%);
        width: 90vw;
        height:auto;
        transition: transform 0.1s ease;
        text-align: center;
        max-width: 90vw;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 20vh; /* Extra padding to prevent last image cutoff */
    }

}