/* Réinitialisation complète */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Style global du body - SOLUTION SIMPLIFIÉE */
body {
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: block; /* On retire le flexbox qui peut causer des problèmes */
    position: relative;
    padding-bottom: 60px; /* Réserve de l'espace pour le footer */
}

/* Styles du header */
header {
    background-color: #f4f4f4;
    color: black;
    padding: 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header {
    display: flex;
    align-items: center;
    padding: 10px;
}

.header img {
    width: 80px;
    height: auto;
    margin-right: 15px;
}

.header div {
    text-align: left;
}

.header h1 {
    font-size: 1.8em;
    margin: 0;
}

.header h2 {
    font-size: 1em;
    margin: 0;
    color: black;
}

/* Styles de la barre de navigation */
.navbar {
    background-color: #333;
    padding: 10px 0;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    flex-wrap: wrap;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px;
    display: inline-block;
}

.navbar a:hover {
    text-decoration: underline;
    background-color: #005bb5;
}

.navbar-right {
    margin-left: auto;
}

/* Style pour le contenu principal - SIMPLIFIÉ */
.main-content {
    padding: 20px;
    min-height: calc(100vh - 200px); /* Garantit une hauteur minimale */
    overflow: visible;
}

/* Style pour les listes */
ul {
    padding-left: 20px;
    margin: 0;
    list-style-position: inside;
}

li {
    margin-bottom: 5px;
}

/* Style pour le footer - SOLUTION DÉFINITIVE */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px;
    width: 100%;
    position: fixed; /* On revient à fixed mais avec une meilleure gestion */
    bottom: 0;
    left: 0;
    z-index: 100;
}

.footer a {
    color: #fff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Basic CSS Grid Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ========================================= */
/* MEDIA QUERIES MOBILE - VERSION CORRIGÉE */
/* ========================================= */

/* Tablettes */
@media screen and (max-width: 1024px) {
    .header h1 {
        font-size: 1.6em;
    }
    
    .header h2 {
        font-size: 0.9em;
    }
    
    .navbar {
        justify-content: space-around;
    }
    
    .navbar a {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .main-content {
        padding: 15px;
        min-height: calc(100vh - 180px);
    }
}

/* Téléphones */
@media screen and (max-width: 767px) {
    body {
        padding-bottom: 50px; /* Ajusté pour mobile */
    }
    
    .header {
        position: relative; /* Désactive sticky sur mobile */
    }
    
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 8px;
    }
    
    .header img {
        width: 60px;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .header h1 {
        font-size: 1.4em;
    }
    
    .header h2 {
        font-size: 0.8em;
    }
    
    .navbar {
        flex-direction: column;
        align-items: center;
        padding: 5px 0;
    }
    
    .navbar a {
        width: 100%;
        text-align: center;
        padding: 10px;
        border-bottom: 1px solid #555;
    }
    
    .navbar-right {
        margin-left: 0;
        width: 100%;
    }
    
    .main-content {
        padding: 15px;
        min-height: calc(100vh - 150px);
        padding-bottom: 60px; /* Espace pour le footer */
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .footer {
        padding: 15px;
        position: fixed; /* Reste fixed sur mobile */
    }
}

/* Petits téléphones */
@media screen and (max-width: 480px) {
    body {
        padding-bottom: 45px;
    }
    
    .header h1 {
        font-size: 1.2em;
    }
    
    .header h2 {
        font-size: 0.7em;
    }
    
    .header img {
        width: 50px;
    }
    
    .navbar a {
        padding: 8px;
        font-size: 0.8em;
    }
    
    .main-content {
        padding: 10px;
        min-height: calc(100vh - 140px);
        padding-bottom: 50px;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .footer {
        padding: 12px;
    }
}