/* ========================================
   WALLS 2, 3, 4 - CSS3D CONTENT
   Breakpoints: 900px (exhibited/contained), 600px (large/small contained)
   ======================================== */

/* ========================================
   PREVENT IMAGE DRAGGING
   ======================================== */

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wall2-shelf img,
.wall3-lectern img,
.wall-gallery img {
    pointer-events: none;
}

/* ========================================
   WALL 2 - BOOKSHELF WITH CONTACT PLACARD
   ======================================== */

.wall2-shelf {
    width: auto;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.shelf-content-wrapper {
    position: relative;
    transform: translateY(50%);
    pointer-events: none;
}

.shelf-image {
    display: block;
    width: auto;
    height: auto;
}

.shelf-image-desktop {
    display: block;
}

.shelf-image-mobile {
    display: none;
}

.shelf-label-wrapper {
    position: absolute;
    left: 50%;
    bottom: 55.75%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

/* ========================================
   WALL 3 - LECTERN BOOK
   ======================================== */

.wall3-lectern {
    width: auto;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.lectern-content-wrapper {
    position: relative;
    transform: translateY(50%);
    pointer-events: none;
}

.lectern-book-image {
    display: block;
    width: auto;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.lectern-book-image-desktop {
    display: block;
}

.lectern-book-image-tablet {
    display: none;
}

.lectern-label-wrapper {
    position: absolute;
    left: 50%;
    top: 24.25%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

/* ========================================
   WALL 4 - GALLERY FRAME
   ======================================== */

.wall-gallery {
    width: auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gallery-content-wrapper {
    position: relative;
    pointer-events: none;
}

.gallery-frame {
    display: block;
    width: auto;
    height: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.gallery-label-wrapper {
    position: absolute;
    left: 50%;
    top: 100%;
    margin-top: 30px;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

/* ========================================
   SHARED LABEL STYLES
   ======================================== */

.label-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    height: 95%;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 0 10px 5px rgba(255, 255, 255, 0.5),
        0 0 20px 10px rgba(255, 255, 255, 0.3),
        0 0 30px 15px rgba(255, 255, 255, 0.1);
    z-index: -1;
    pointer-events: none;
    animation: labelPulse 5s ease-in-out infinite;
}

@keyframes labelPulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.0);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.02);
    }
}

.shelf-label-bg,
.lectern-label-bg,
.gallery-label-bg {
    display: block;
    width: auto;
    height: auto;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.shelf-placard-overlay,
.lectern-overlay,
.gallery-label-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 2;
    width: 100%;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

.shelf-placard-text,
.lectern-text,
.gallery-label-text {
    font-family: 'Jost', sans-serif;
    font-size: var(--design-museum-label);
    font-weight: 500;
    color: #000000;
    letter-spacing: 0;
    margin: 0 0 15px 0;
    line-height: 1;
}

.gallery-label-text {
    margin: 0 0 5px 0;
}

.gallery-label-meta {
    font-family: 'Jost', sans-serif;
    font-size: var(--design-body-font);
    font-weight: 400;
    color: #000000;
    margin: 0 0 10px 0;
    opacity: 0.7;
}

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

.dismiss-btn {
    display: inline-block;
    margin: 0 auto;
    background: rgba(159, 170, 160, 1);
    border: 2px solid rgba(110, 120, 112, 1);
    color: #1a1510;
    padding: 8px 30px;
    border-radius: 2px;
    font-size: var(--design-button-font);
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-decoration: none;
    pointer-events: auto;
}

.dismiss-btn:hover {
    background: rgba(140, 150, 142, 1); 
    border-color: rgba(90, 100, 92, 1);
}

/* ========================================
   CONTAINED LARGE: 600px - 899px
   Tablets, large phones, Z Fold unfolded
   ======================================== */

@media (max-width: 899px) and (min-width: 600px) {
    /* Hide label glow on mobile */
    .label-glow {
        display: none;
    }
    
    /* Image swap - tablet lectern */
    .lectern-book-image-desktop {
        display: none;
    }
    
    .lectern-book-image-tablet {
        display: block;
    }
    
    /* Image sizing - moderate */
    .shelf-image {
        width: 800px;
    }
    
    .lectern-book-image {
        width: 700px;
    }
    
    .gallery-frame {
        width: 750px;
    }
    
    /* Label overlays */
    .shelf-placard-overlay,
    .lectern-overlay,
    .gallery-label-overlay {
        min-width: 400px;
        white-space: nowrap;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    /* Text sizing */
    .shelf-placard-text,
    .lectern-text,
    .gallery-label-text {
        font-size: 34px;
    }
    
    .gallery-label-meta {
        font-size: 26px;
    }
    
    /* Label positioning */
    .shelf-label-wrapper {
        bottom: 58% !important;
    }
    
    .lectern-label-wrapper {
        top: 23% !important;
    }
    
    .gallery-label-wrapper {
        margin-top: 40px !important;
    }
    
    /* CSS3D buttons */
    .wall2-shelf .dismiss-btn,
    .wall3-lectern .dismiss-btn,
    .wall-gallery .dismiss-btn {
        font-size: 30px;
    }
    
    /* Scale label backgrounds */
    .shelf-label-bg,
    .lectern-label-bg,
    .gallery-label-bg {
        transform: scale(1.3);
    }
}

/* ========================================
   CONTAINED SMALL: < 600px
   Phones, Z Flip, Z Fold outer screen
   ======================================== */

@media (max-width: 599px) {
    /* Hide label glow on mobile */
    .label-glow {
        display: none;
    }
    
    /* Image swap - mobile bookcase */
    .shelf-image-desktop {
        display: none;
    }
    
    .shelf-image-mobile {
        display: block;
    }
    
    /* Image swap - tablet lectern */
    .lectern-book-image-desktop {
        display: none;
    }
    
    .lectern-book-image-tablet {
        display: block;
    }
    
    /* Image sizing */
    .shelf-image {
        width: 700px;
    }
    
    .lectern-book-image {
        width: 600px;
    }
    
    .gallery-frame {
        width: 650px;
    }
    
    /* Label overlays */
    .shelf-placard-overlay,
    .lectern-overlay,
    .gallery-label-overlay {
        min-width: 350px;
        white-space: nowrap;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    /* Text sizing */
    .shelf-placard-text,
    .lectern-text,
    .gallery-label-text {
        font-size: 38px;
    }
    
    .gallery-label-meta {
        font-size: 28px;
    }
    
    /* Label positioning */
    .shelf-label-wrapper {
        bottom: 61.25% !important;
    }
    
    .lectern-label-wrapper {
        top: 22% !important;
    }
    
    .gallery-label-wrapper {
        margin-top: 50px !important;
    }
    
    /* CSS3D buttons */
    .wall2-shelf .dismiss-btn,
    .wall3-lectern .dismiss-btn,
    .wall-gallery .dismiss-btn {
        font-size: 32px;
    }
    
    /* Scale label backgrounds */
    .shelf-label-bg,
    .lectern-label-bg,
    .gallery-label-bg {
        transform: scale(1.4);
    }
}

/* ========================================
   EXTRA SMALL: < 400px
   Very small phones
   ======================================== */

@media (max-width: 399px) {
    /* Image swap - back to desktop lectern on phones */
    .lectern-book-image-desktop {
        display: block;
    }
    
    .lectern-book-image-tablet {
        display: none;
    }
    
    /* Image sizing */
    .shelf-image {
        width: 650px;
    }
    
    .lectern-book-image {
        width: 580px;
    }
    
    .gallery-frame {
        width: 500px;
    }
    
    /* Text sizing */
    .shelf-placard-text,
    .lectern-text,
    .gallery-label-text {
        font-size: 32px;
    }
    
    .gallery-label-meta {
        font-size: 24px;
    }
    
    /* Label positioning */
    .shelf-label-wrapper {
        bottom: 61.25% !important;
    }
    
    .lectern-label-wrapper {
        top: 24.25% !important;
    }
    
    .gallery-label-wrapper {
        margin-top: 30px !important;
    }
    
    /* CSS3D buttons */
    .wall2-shelf .dismiss-btn,
    .wall3-lectern .dismiss-btn,
    .wall-gallery .dismiss-btn {
        font-size: 28px;
    }
    
    .shelf-label-bg,
    .lectern-label-bg,
    .gallery-label-bg {
        transform: scale(1.25);
    }
}

/* ========================================
   TALL/NARROW DEVICES (Z Flip folded, etc.)
   The CSS3D walls need smaller elements on narrow screens
   ======================================== */

@media (max-aspect-ratio: 55/100) {
    /* Smaller images for narrow viewports */
    .shelf-image {
        width: 550px;
    }
    
    .lectern-book-image {
        width: 500px;
    }
    
    .gallery-frame {
        width: 450px;
    }
    
    /* Compact text */
    .shelf-placard-text,
    .lectern-text,
    .gallery-label-text {
        font-size: 28px;
    }
    
    .gallery-label-meta {
        font-size: 20px;
    }
    
    /* CSS3D buttons - smaller */
    .wall2-shelf .dismiss-btn,
    .wall3-lectern .dismiss-btn,
    .wall-gallery .dismiss-btn {
        font-size: 24px;
        padding: 6px 20px;
    }
    
    .shelf-label-bg,
    .lectern-label-bg,
    .gallery-label-bg {
        transform: scale(1.1);
    }
}

/* Z Flip specific - very compact */
@media (max-width: 320px) and (max-aspect-ratio: 55/100) {
    .shelf-image {
        width: 480px;
    }
    
    .lectern-book-image {
        width: 440px;
    }
    
    .gallery-frame {
        width: 400px;
    }
    
    .shelf-placard-text,
    .lectern-text,
    .gallery-label-text {
        font-size: 24px;
    }
    
    .gallery-label-meta {
        font-size: 18px;
    }
    
    .wall2-shelf .dismiss-btn,
    .wall3-lectern .dismiss-btn,
    .wall-gallery .dismiss-btn {
        font-size: 20px;
        padding: 5px 16px;
    }
    
    .shelf-label-bg,
    .lectern-label-bg,
    .gallery-label-bg {
        transform: scale(1.0);
    }
}