/* Mobile First Responsive Design */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 767px) {
    /* Navigation */
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid #e5e7eb;
        text-align: center;
    }
    
    .nav-menu .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-external {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        padding-top: 20px;
        margin-top: 20px;
        justify-content: center;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero Section */
    .hero-content {
        flex-direction: column; /* Empiler texte et image */
        gap: 20px;
        padding: 0 15px;
    }
    .hero-image {
        max-width: 300px; /* Réduire la taille de l'image */
        margin-top: 20px; /* Décaler l'image vers le bas */
    }
    
    .hero-text {
        max-width: 100%;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-text p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    /* Page Hero */
    .page-hero {
        height: 300px;
    }
    
    .page-hero-content {
        justify-content: center;
        text-align: center;
    }
    
    .page-hero-text {
        max-width: 100%;
    }
    
    .page-hero-text h1 {
        font-size: 2.2rem;
    }
    
    /* Sections */
    .section {
        padding: 60px 0;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Projects Grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-card {
        max-width: 100%;
    }
    
    /* Recent Projects */
    .recent-projects {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-card-horizontal {
        flex-direction: column;
    }
    
    .project-image-horizontal {
        width: 100%;
        height: 200px;
    }
    
    /* Photos Gallery */
    .photos-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    /* Contact */
    .contact-container {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .contact-profile {
        padding: 40px 20px;
    }
    
    .contact-info {
        padding: 40px 20px;
    }
    
    .contact-cta {
        padding: 40px 20px;
        margin: 40px 15px 0;
    }
    
    /* Filters */
    .filters {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 6px 16px;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0;
    }
    
    .footer-credits {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-text h1 {
        font-size: 3rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .contact-profile {
        padding: 50px 30px;
    }
    
    .contact-info {
        padding: 50px 30px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 1200px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero-text h1 {
        font-size: 4rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    .photos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-caption {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Animation classes */
.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Print styles */
@media print {
    .navbar,
    .hero-buttons,
    .section-cta,
    .filters,
    .footer {
        display: none;
    }
    
    .hero {
        height: auto;
        padding: 2cm 0;
    }
    
    .section {
        padding: 1cm 0;
    }
    
    .project-card,
    .photo-card {
        break-inside: avoid;
        margin-bottom: 1cm;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 767px) {
    .hero-content {
        flex-direction: column; /* Empiler texte et image */
        gap: 20px;
        padding: 0 15px;
    }
    
    .hero-image {
        max-width: 300px; /* Déjà présent */
    }
    
    .hero-image img {
        max-width: 300px; /* Rétrécir l'image à 200px (ajustez selon vos besoins) */
        width: 100%; /* Garantit que l'image reste responsive */
        height: auto; /* Préserve les proportions */
    }


    .error-visual {
        margin-left: 0; /* Supprime le margin-left négatif */
        align-items: center; /* Centre les éléments */
        justify-content: center; /* Centre horizontalement */
        padding: 0 15px; /* Ajoute un padding pour éviter que le contenu touche les bords */
    }

    .error-number {
        font-size: clamp(4rem, 15vw, 6rem); /* Réduit la taille du texte pour mobile */
        margin-bottom: 1rem; /* Réduit l'espace en dessous */
    }

    .error-film-strip {
        scale: 0.7; /* Réduit légèrement la taille du film strip */
        padding: 0.5rem; /* Ajuste le padding */
    }

    .film-frame {
        width: 30px; /* Réduit la taille des frames */
        height: 22px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-content {
        gap: 50px; /* Réduire l'écart */
        justify-content: space-around;
    }
    .hero-image img {
        max-width: 400px; /* Ajuster la taille de l'image */
    }

    .error-visual {
        margin-left: 0; /* Supprime le margin-left négatif */
        align-items: center; /* Centre les éléments */
        justify-content: center; /* Centre horizontalement */
        padding: 0 20px; /* Padding adapté pour tablettes */
    }

    .error-number {
        font-size: clamp(5rem, 12vw, 8rem); /* Taille intermédiaire pour tablettes */
        margin-bottom: 1.5rem;
    }

    .error-film-strip {
        scale: 0.9; /* Légère réduction pour tablettes */
    }
}