/* Common background styles for all pages */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    background-color: #D0C3AF;
    min-height: 100vh;
}

/* Immersive mode hides all chrome and scrollbars */
.immersive-mode, .immersive-mode body {
    overflow: hidden !important;
}

.immersive-mode .main-header,
.immersive-mode .info-button,
.immersive-mode .treasure-chamber-button,
.immersive-mode .back-to-top,
.immersive-mode .button-separator,
.immersive-mode .custom-cursor {
    display: none !important;
}

.immersive-mode #ribbonPaths {
    pointer-events: none !important;
}

/* Gallery overlay (shown in immersive mode) */
#gallery-overlay {
    position: fixed;
    inset: 0;
    background: #D0C3AF;
    z-index: 10000;
}

#gallery-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/grain-texture.png');
    opacity: 0.9;
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 0;
}

.overlap-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
}

.image-group {
    position: relative;
    width: 60%;
    height: 80vh;
}

.image-group img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.text-group {
    position: relative;
    width: 35%;
    height: 80vh;
}

.text-group img {
    position: absolute;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.text-group img:first-child {
    top: 20%;
}

.text-group img:last-child {
    top: 50%;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
    .overlap-container {
        flex-direction: column;
        padding: 0 3%;
        min-height: auto;
        gap: 2rem;
    }
    
    .image-group {
        width: 100%;
        height: 50vh;
        order: 1;
    }
    
    .text-group {
        width: 100%;
        height: auto;
        order: 2;
        min-height: 30vh;
    }
    
    .text-group img:first-child {
        top: 0%;
        position: relative;
        margin-bottom: 1rem;
    }
    
    .text-group img:last-child {
        top: auto;
        position: relative;
    }
}

@media (max-width: 480px) {
    .overlap-container {
        padding: 0 2%;
        gap: 1.5rem;
    }
    
    .image-group {
        height: 40vh;
    }
    
    .text-group {
        min-height: 25vh;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .overlap-container {
        flex-direction: row;
        padding: 0 2%;
        gap: 1rem;
    }
    
    .image-group {
        width: 60%;
        height: 80vh;
        order: 1;
    }
    
    .text-group {
        width: 40%;
        height: 80vh;
        order: 2;
        min-height: auto;
    }
    
    .text-group img:first-child {
        top: 10%;
        position: absolute;
        margin-bottom: 0;
    }
    
    .text-group img:last-child {
        top: 60%;
        position: absolute;
    }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .overlap-container {
        padding: 0 1%;
        gap: 1rem;
    }
    
    .image-group {
        height: 35vh;
    }
    
    .text-group {
        min-height: 20vh;
    }
}

/* Gallery container adjustments */
.gallery-container {
    padding-top: 10rem !important;
    margin-top: 0 !important;
}

.gallery-header {
    padding-top: 0 !important;
    margin-top: 10rem !important;
}

/* Global cursor style */
html {
    cursor: none;
}

/* Custom cursor */
.custom-cursor {
    width: 16px;
    height: 16px;
    background-color: rgb(30, 170, 255);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease;
    transform: translate(-50%, -50%);
}

.custom-cursor.hover {
    transform: translate(-50%, -50%) scale(1.5);
}

/* Reset cursor for specific elements that need default cursor */
input, 
textarea, 
button, 
a, 
[role="button"] {
    cursor: default;
}

/* Mobile cursor adjustments */
@media (max-width: 768px) {
    /* Hide custom cursor on mobile devices */
    html {
        cursor: auto;
    }
    
    .custom-cursor {
        display: none;
    }
    
    /* Ensure proper cursor for interactive elements on mobile */
    input, 
    textarea, 
    button, 
    a, 
    [role="button"] {
        cursor: pointer;
    }
    
    /* Improve touch targets for mobile */
    button, a, [role="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
    }
}

/* Global text selection styling */
::selection {
    background: #63480d;
    color: rgb(30,170,255);
}

/* For better cross-browser support */
::-moz-selection {
    background: rgb(30,170,255);
    color: #63480d;
} 
