/* --- Styles de base --- */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    min-height: 100vh;
}

/* --- Menu Latéral --- */
nav {
    width: 250px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

nav h2 { 
    text-align: center;
    margin-top: 0;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 4px;
    transition: 0.3s;
    font-size: 18px
}

nav ul li a:hover { background: #5a7a95; }

nav .footer-message {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: #bdc3c7;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid #34495e;
    padding-top: 15px;
}

/* --- Contenu Principal --- */
main {
    margin-left: 250px;
    padding: 60px;
    width: calc(100% - 250px);
    box-sizing: border-box; 
}

/* Pour la page d'accueil avec image plein écran */
.home-main {
    padding: 0;
    margin-left: 250px;
    height: 100vh;
    overflow: hidden;
    width: calc(100% - 250px);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #2c3e50;
}

/* --- Galerie Photo --- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s;
}

.gallery-item img:hover { transform: scale(1.05); }

.gallery-item .image-title {
    text-align: center;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
}

/* --- Viewer (Modal) --- */
#viewer {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#viewer img { 
    max-width: 90%; 
    max-height: 70%; 
    border: 3px solid white;
    user-select: none;
}

#viewer .viewer-title {
    color: white;
    font-size: 18px;
    margin-top: 15px;
    text-align: center;
    max-width: 90%;
}

#viewer .close {
    position: absolute;
    top: 20px; 
    right: 30px;
    color: white; 
    font-size: 40px; 
    cursor: pointer;
    z-index: 1001;
}

#viewer .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.3s;
    user-select: none;
}

#viewer .nav-btn:hover {
    background: rgba(255,255,255,0.4);
}

#viewer .prev { left: 20px; }
#viewer .next { right: 20px; }

/* --- Sections de contenu --- */
.content-section {
    max-width: 1200px;
}

.content-section h1 {
    margin-top: 0;
    margin-bottom: 30px;
    color: #2c3e50;
}

.content-section p {
    line-height: 1.6;
    color: #555;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    body { flex-direction: column; }
    
    nav {
        width: 100%;
        height: auto;
        position: relative;
        padding: 10px;
    }
    
    main { 
        margin-left: 0; 
        padding: 20px; 
        width: 100%;
    }
    
    .home-main {
        margin-left: 0;
        width: 100%;
    }
    
    nav ul { 
        display: flex; 
        justify-content: space-around;
        flex-wrap: wrap;
    }
    
    nav ul li {
        flex: 1 1 auto;
        min-width: 100px;
    }
    
    #viewer .nav-btn {
        font-size: 20px;
        padding: 10px 15px;
    }
}
