/* ============================================
   CARBONE XIV - RESPONSIVE STYLES
   Mobile-First Optimisations
   ============================================ */

/* Tablets et petits écrans */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .section-padding {
        padding: var(--spacing-lg) 0;
    }

    .histoire-grid {
        grid-template-columns: 1fr;
    }

    .histoire-image img {
        height: 400px;
    }

    /* FIX: Support tactile pour iPad - toujours afficher le bouton portfolio */
    .artiste-btn {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .artiste-info {
        background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    }

    .lightbox-content {
        grid-template-columns: 1fr;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Navigation mobile */
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: var(--spacing-md);
        transition: left var(--transition-normal);
        align-items: flex-start;
    }

    .nav-menu a {
        font-size: 1rem;
        white-space: nowrap;
        width: 100%;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translateY(8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-8px);
    }

    /* Hero mobile */
    .hero {
        background-attachment: scroll;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* Sections */
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Artistes grid */
    .artistes-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-sm);
    }

    /* FIX: Bouton "Voir Portfolio" toujours visible sur mobile/tablette */
    .artiste-btn {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .artiste-info {
        background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    }

    /* Portfolio */
    .portfolio-filters {
        gap: var(--spacing-xs);
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--spacing-xs);
    }

    /* Formulaire */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .appointment-form {
        padding: var(--spacing-md);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* Lightbox mobile */
    .lightbox {
        padding: var(--spacing-xs);
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-info,
    .lightbox-comments {
        padding: var(--spacing-sm);
    }

    /* Messenger button */
    .messenger-button {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .messenger-button svg {
        width: 20px;
        height: 20px;
    }

    /* Merch grid */
    .merch-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--spacing-md);
    }

    /* Instagram grid */
    .instagram-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-xs);
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero-title {
        font-size: 2rem;
        letter-spacing: 0.1em;
    }

    .section-padding {
        padding: var(--spacing-md) 0;
    }

    .artistes-grid {
        grid-template-columns: 1fr;
    }

    /* FIX: Bouton portfolio toujours visible sur petits écrans */
    .artiste-btn {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .instagram-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
    }

    .btn-large {
        padding: 1rem 2rem;
    }
}

/* Paysage mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: var(--spacing-xl) 0;
    }

    .scroll-indicator {
        display: none;
    }
}

/* Optimisations performance */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but can adjust if needed */
}

/* Impression */
@media print {
    .navbar,
    .messenger-button,
    .scroll-indicator,
    .btn,
    .footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .section-padding {
        padding: 1rem 0;
    }
}
