/* ========================================
   LE MAS LILI - Responsive Stylesheet
   Mobile-first approach
   ======================================== */

/* === Tablet Landscape (max-width: 1200px) === */
@media (max-width: 1200px) {
    :root {
        --nav-width: 250px;
        --font-size-3xl: 40px;
        --font-size-2xl: 28px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--spacing-sm);
    }

    .about-grid {
        gap: var(--spacing-md);
    }
}

/* === Tablet Portrait (max-width: 992px) === */
@media (max-width: 992px) {
    :root {
        --spacing-xl: 3rem;
        --spacing-lg: 2rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav.active {
        transform: translateX(0);
    }

    .nav-content {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-md);
        padding: var(--spacing-lg);
    }

    .nav-link {
        font-size: var(--font-size-lg);
        text-align: center;
        width: 100%;
        max-width: 300px;
    }

    .main-content {
        margin-left: 0;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .about-image {
        max-width: 500px;
        margin: 0 auto;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .page-title {
        font-size: var(--font-size-2xl);
    }

    .hero-title {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    .hero-description p {
        font-size: var(--font-size-base);
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}

/* === Mobile Landscape (max-width: 768px) === */
@media (max-width: 768px) {
    :root {
        --font-size-3xl: 32px;
        --font-size-2xl: 24px;
        --font-size-xl: 20px;
        --font-size-lg: 16px;
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
        --spacing-md: 1rem;
    }

    /* Mobile background image */
    body {
        background-image: url('../images/background.jpg');
    }

    .container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .nav-menu {
        padding: 0 var(--spacing-sm);
    }

    .nav-link {
        font-size: var(--font-size-base);
        padding: var(--spacing-sm);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: var(--spacing-sm);
    }

    .gallery-item img {
        height: 250px;
    }

    .content-box {
        padding: var(--spacing-md);
    }

    .bio-text p {
        text-align: left;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }

    .lightbox-close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
    }

    .lightbox-prev {
        left: var(--spacing-sm);
    }

    .lightbox-next {
        right: var(--spacing-sm);
    }

    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
    }

    .contact-section {
        padding: var(--spacing-md);
    }

    .contact-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* === Mobile Portrait (max-width: 576px) === */
@media (max-width: 576px) {
    :root {
        --nav-width: 100%;
        --font-size-3xl: 28px;
        --font-size-2xl: 22px;
        --font-size-xl: 18px;
        --spacing-xl: 1.5rem;
    }

    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
    }

    .main-nav {
        width: 100%;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-subtitle {
        font-size: var(--font-size-xl);
    }

    .hero-description p {
        font-size: var(--font-size-sm);
        line-height: 1.6;
    }

    .page-title {
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-md);
    }

    .page-title::after {
        width: 60px;
        height: 2px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .gallery-item img {
        height: auto;
        min-height: 200px;
    }

    .artist-name {
        font-size: var(--font-size-xl);
    }

    .contact-title {
        font-size: var(--font-size-xl);
    }

    .contact-intro {
        font-size: var(--font-size-base);
    }

    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-content img {
        max-height: 70vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 35px;
        height: 35px;
        font-size: var(--font-size-base);
    }

    .flower {
        width: 80px;
        height: 80px;
    }

    .flower__center {
        width: 20px;
        height: 20px;
    }

    .flower__petal {
        width: 30px;
        height: 30px;
    }
}

/* === Extra Small Devices (max-width: 380px) === */
@media (max-width: 380px) {
    :root {
        --font-size-base: 14px;
        --spacing-md: 0.75rem;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }

    .mobile-menu-toggle span {
        width: 20px;
    }

    .container {
        padding: var(--spacing-md) var(--spacing-xs);
    }

    .content-box {
        padding: var(--spacing-sm);
    }

    .contact-section {
        padding: var(--spacing-sm);
    }

    .gallery-item img {
        min-height: 180px;
    }
}

/* === Print Styles === */
@media print {
    .page-loader,
    .mobile-menu-toggle,
    .main-nav,
    .scroll-top,
    .lightbox,
    .gallery-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .page {
        display: block !important;
        opacity: 1 !important;
        page-break-after: always;
    }

    body {
        background: white;
        color: black;
    }

    .page-title,
    .artist-name,
    .contact-title,
    .hero-subtitle {
        color: black;
    }

    .hero-video-container {
        display: none;
    }
}

/* === Landscape Orientation === */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-video-container {
        height: 100vh;
    }

    .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
        margin-bottom: var(--spacing-sm);
    }

    .hero-description p {
        font-size: var(--font-size-sm);
        margin-bottom: 0.25rem;
    }

    .page-title {
        margin-bottom: var(--spacing-sm);
    }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .flower {
        animation: none;
    }

    .hero-title {
        animation: none;
        opacity: 1;
    }

    .hero-description {
        animation: none;
        opacity: 1;
    }
}

/* === High Resolution Displays === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gallery-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* === Touch Device Optimizations === */
@media (hover: none) and (pointer: coarse) {
    .nav-link:hover::before {
        width: 0;
    }

    .nav-link.active::before {
        width: 10px;
    }

    .gallery-item:hover {
        transform: none;
    }

    .gallery-overlay {
        opacity: 0;
        pointer-events: none;
    }

    .contact-link:hover {
        transform: none;
    }

    .scroll-top:hover {
        transform: none;
    }
}
