* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('../assets/cursor.png') 16 16, auto;
}

body {
    background: #EBEBE4;
    font-family: 'Intan', sans-serif;
    color: #7F4017;
    text-transform: lowercase;
    height: 100vh;
    overflow: hidden;
}

/* Allow overflow on mobile for specific pages that need scrolling */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        overflow-x: hidden;
    }
    
    body.allow-scroll {
        overflow-y: auto;
    }
}

html {
    overflow-x: hidden;
}

@media (max-width: 768px) {
    html {
        overflow: hidden;
    }
}

/* Custom Fonts */
@font-face {
    font-family: 'DesMontilles';
    src: url('../assets/fonts/DesMontilles-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Intan';
    src: url('../assets/fonts/intan.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}


.landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #E6F3FF;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing.scrolled {
    transform: translateY(-100vh);
    pointer-events: none;
}

/* Mobile: Simplify - landing will be removed from DOM via JavaScript */
@media (max-width: 768px) {
    /* Transition for landing removal */
    .landing.scrolled {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    /* Ensure landing doesn't block scroll on mobile - matches gallery page */
    .landing {
        position: fixed;
        z-index: 2000;
        height: 100vh;
    }
}

.landing-text {
    font-size: 8rem;
    font-weight: normal;
    color: #7F4017;
    letter-spacing: -2px;
    text-align: center;
    font-family: 'DesMontilles', serif;
}

.logo {
    max-width: 400px;
    max-height: 200px;
    width: auto;
    height: auto;
}

.postcard {
    max-width: 500px;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.scroll-hint {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #7F4017;
    font-family: 'Intan', sans-serif;
    font-size: 14px;
    opacity: 0.6;
    z-index: 2001;
    animation: bounce 2s infinite;
    transition: opacity 0.3s ease;
}

.scroll-hint.hidden {
    opacity: 0;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* Navigation Bar */
.nav-bar {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 5000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 1 !important;
    transition: all 0.3s ease;
}

.nav-logo-container {
    background: rgba(235, 235, 228, 0.6);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-title {
    max-width: 120px;
    max-height: 40px;
    width: auto;
    height: auto;
    opacity: 0.8;
}

.nav-links-container {
    background: rgba(235, 235, 228, 0.6);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-links {
    display: flex;
    gap: 15px;
    list-style: none;
}

.nav-links a {
    font-family: 'Intan', sans-serif;
    font-size: 18px;
    color: #7F4017;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 50px;
    background: transparent;
    border: 2px solid #7F4017;
    transition: all 0.3s ease;
    display: inline-block;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: #7F4017;
    color: #EBEBE4;
    transform: scaleX(1.1);
    transform-origin: center;
}

/* Hide mobile menu button on desktop */
.mobile-menu-btn {
    display: none;
}

.mobile-menu-lightbox {
    display: none;
}

/* Custom Cursor Styles */
a, button {
    cursor: url('../assets/cursor.png') 16 16, pointer;
}

input, textarea, select {
    cursor: url('../assets/cursor.png') 16 16, text;
}

/* Client Galleries Menu */
.galleries-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 100px 20px 100px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
    background: #7F4017;
    z-index: 500;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.galleries-menu.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Client Gallery Card */
.client-gallery-card {
    background: transparent;
    border-radius: 0px;
    overflow: visible;
    box-shadow: none;
    cursor: url('../assets/cursor.png') 16 16, pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.client-gallery-card:hover {
    transform: translateY(-5px);
}

.gallery-preview {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 400px;
}

.gallery-name {
    display: none;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: #7F4017;
    z-index: 1500;
}

/* Individual Gallery View */
.individual-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #EBEBE4;
    z-index: 3000;
    display: none;
    flex-direction: column;
}

.individual-gallery.active {
    display: flex;
}

/* View Full Gallery Button */
.view-full-gallery-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(235, 235, 228, 0.6);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: none;
    font-family: 'Intan', sans-serif;
    font-size: 16px;
    color: #7F4017;
    text-decoration: none;
    cursor: url('../assets/cursor.png') 16 16, pointer;
    transition: all 0.3s ease;
    z-index: 3500;
    display: none;
}

.view-full-gallery-btn:hover {
    background: #7F4017;
    color: #EBEBE4;
    transform: translateX(-50%) scale(1.05);
}

.view-full-gallery-btn.visible {
    display: block;
}

/* Individual Gallery Landing Page */
.individual-landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #E6F3FF;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.individual-landing.scrolled {
    transform: translateY(-100vh);
}

.individual-postcard {
    max-width: 500px;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 0px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.individual-scroll-hint {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #7F4017;
    font-family: 'Intan', sans-serif;
    font-size: 14px;
    opacity: 0.8;
    z-index: 2001;
    animation: bounce 2s infinite;
    transition: opacity 0.3s ease;
}

.individual-scroll-hint.hidden {
    opacity: 0;
}

/* Gallery wrapper for individual gallery (matches home page) */
.gallery-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 100;
}

@media (max-width: 768px) {
    .gallery-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        z-index: 100;
    }
}

@media (max-width: 768px) {
    /* Body scrolling is handled above in the main body rule */
    
    /* Hide individual landing hero completely when scrolled on mobile */
    .individual-landing.scrolled {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -1 !important;
        pointer-events: none !important;
        position: absolute !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        transform: none !important;
        top: -9999px !important;
        left: -9999px !important;
    }
    
    /* Home page landing is handled above with separate rule for better specificity */
    
    /* Prevent scroll bounce back on galleries menu */
    .galleries-menu.visible {
        overscroll-behavior-y: contain;
    }

    .gallery-wrapper {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        margin-top: 0;
        z-index: 100;
    }

    .gallery-container {
        position: absolute !important;
        top: 0;
        left: -5%;
        width: 110vw;
        height: 100vh;
        padding: 20px 15px;
    }
    
    /* Prevent scroll bounce back to hero */
    html {
        overscroll-behavior-y: contain;
    }
    
    /* Hide scroll hint when scrolled */
    .scroll-hint.hidden {
        display: none !important;
    }
}

.gallery-container {
    position: absolute;
    top: 0;
    left: -5%;
    width: 110vw;
    height: 100vh;
    display: flex;
    gap: 20px;
    padding: 20px 40px;
}

.gallery-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    will-change: transform;
}

.image-wrapper {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 0px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    cursor: url('../assets/cursor.png') 16 16, pointer;
}

.image-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 0px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.lightbox-nav {
    display: none;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 30px;
}

.lightbox-nav.next {
    right: 30px;
}

.lightbox-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    cursor: url('../assets/cursor.png') 16 16, pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #1a1a1a;
    transition: all 0.2s ease;
    z-index: 4500;
}

.lightbox-close:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    .galleries-menu {
        grid-template-columns: repeat(2, 1fr);
        padding: 90px 15px 100px;
    }
}

@media (max-width: 768px) {
    .landing-text {
        font-size: 4rem;
    }

    .postcard {
        max-width: 300px;
        max-height: 250px;
    }

    .individual-postcard {
        max-width: 300px;
        max-height: 250px;
    }

    .galleries-menu {
        grid-template-columns: 1fr;
        padding: 80px 15px 100px;
    }

    .gallery-preview {
        height: auto; /* Allow full height to prevent cropping */
        max-height: 300px; /* Reasonable max height for mobile */
    }

    .gallery-name {
        display: none;
    }

    .gallery-container {
        gap: 12px;
        padding: 12px 30px;
        left: -8%;
        width: 116vw;
        position: absolute !important;
    }
    
    .gallery-column {
        position: relative !important;
    }

    .gallery-column:nth-child(4),
    .gallery-column:nth-child(5) {
        display: none;
    }

    .image-wrapper {
        border-radius: 0px;
        gap: 12px;
    }

    .image-wrapper:hover {
        transform: none;
    }

    .lightbox-title {
        font-size: 24px;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }

    .lightbox-image {
        max-height: 60vh;
        border-radius: 0px;
    }

    .scroll-hint {
        font-size: 12px;
        bottom: 20px;
    }

    /* Mobile Navigation */
    .nav-bar {
        top: 15px;
        left: 15px;
        right: 15px;
        justify-content: space-between;
    }

    .nav-logo-container {
        padding: 12px 20px;
        cursor: url('../assets/cursor.png') 16 16, pointer;
        transition: transform 0.3s ease;
    }

    .nav-logo-container:hover {
        transform: scale(1.05);
    }

    .nav-title {
        max-width: 100px;
        max-height: 35px;
    }

    .nav-links-container {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
        background: rgba(235, 235, 228, 0.9);
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        cursor: url('../assets/cursor.png') 16 16, pointer;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        position: relative;
    }

    .mobile-menu-btn:hover {
        transform: scale(1.1);
        background: rgba(235, 235, 228, 1);
    }

    .mobile-menu-btn span {
        display: block;
        width: 20px;
        height: 2px;
        background: #7F4017;
        margin: 4px auto;
        transition: all 0.3s ease;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .mobile-menu-lightbox {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 10000;
        display: none;
        justify-content: center;
        align-items: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-lightbox.active {
        display: flex;
        opacity: 1;
    }

    .mobile-menu-content {
        background: rgba(235, 235, 228, 0.95);
        border-radius: 20px;
        padding: 40px 30px;
        text-align: center;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        transform: scale(0.8);
        transition: transform 0.3s ease;
        position: relative;
    }

    .mobile-menu-lightbox.active .mobile-menu-content {
        transform: scale(1);
    }

    .mobile-menu-links {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-menu-links li {
        margin: 20px 0;
    }

    .mobile-menu-links a {
        font-family: 'Intan', sans-serif;
        font-size: 24px;
        color: #7F4017;
        text-decoration: none;
        padding: 15px 30px;
        border-radius: 50px;
        display: block;
        transition: all 0.3s ease;
        border: 2px solid transparent;
    }

    .mobile-menu-links a:hover,
    .mobile-menu-links a.active {
        background: #7F4017;
        color: #EBEBE4;
        transform: scale(1.05);
    }

    .mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 30px;
        color: #7F4017;
        cursor: url('../assets/cursor.png') 16 16, pointer;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .mobile-menu-close:hover {
        background: rgba(127, 64, 23, 0.1);
        transform: scale(1.1);
    }
}

@media (max-width: 480px) {
    .landing-text {
        font-size: 3rem;
    }

    .postcard {
        max-width: 250px;
        max-height: 200px;
    }

    .individual-postcard {
        max-width: 250px;
        max-height: 200px;
    }

    .galleries-menu {
        padding: 70px 10px 10px;
    }

    .gallery-container {
        gap: 8px;
        padding: 8px 20px;
        left: -10%;
        width: 120vw;
    }

    .image-wrapper {
        border-radius: 0px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .image-wrapper:active {
        transform: scale(0.98);
    }
    
    .gallery-container {
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    
    .lightbox-nav {
        display: none;
    }
    
    .lightbox-close {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .scroll-hint {
        touch-action: manipulation;
    }
    
    .landing, .individual-landing {
        touch-action: pan-y;
    }
}

/* Hide mobile menu button when lightbox is active - universal selector */
.lightbox.active ~ .nav-bar .mobile-menu-btn,
body:has(.lightbox.active) .nav-bar .mobile-menu-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
