/* --- Base & Général --- */
:root {
    --primary-color: #007bff; /* Bleu pour les liens et accents */
    --secondary-color: #6c757d; /* Gris pour les textes secondaires */
    --accent-color: #dc3545; /* Rouge/Orange pour les highlights (inspiré nicotom.com) */
    --bg-light: #f8f9fa; /* Fond très clair */
    --bg-white: #ffffff; /* Fond blanc pour les cartes */
    --text-dark: #343a40; /* Texte sombre */
    --border-color: #dee2e6; /* Couleur des bordures */
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Empêche l'espace sous les images */
}

/* --- Header --- */
header {
    background: var(--text-dark);
    color: var(--bg-white);
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 2.5em;
    letter-spacing: 1px;
}

header h1 a {
    color: var(--bg-white);
    text-decoration: none;
}

header p {
    margin: 5px 0 0;
    font-size: 1.1em;
    color: var(--secondary-color);
}

/* --- Navigation --- */
nav ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

nav ul li a {
    color: var(--bg-white);
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {background-color: #f1f1f1}

.dropdown:hover .dropdown-content {
    display: block;
}


/* --- Filter Form Container --- */
.filter-form-container {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.filter-form-container h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* --- Search Form (general styles, reused) --- */

/* --- Search Form --- */
.search-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.search-form select, .search-form input[type="number"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box; /* Inclut padding et border dans la largeur */
}

.search-form button {
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #0056b3;
}

/* --- Article List (index.php) --- */
.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.article-summary {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.article-summary:hover {
    transform: translateY(-5px);
}

.summary-image {
    width: 100%;
    height: 200px; /* Hauteur fixe pour les images de résumé */
    object-fit: cover; /* Recadre l'image pour remplir l'espace */
    border-radius: 4px;
    margin-bottom: 15px;
}

.summary-content h2 {
    margin-top: 0;
    font-size: 1.8em;
}

.summary-content h2 a {
    color: var(--text-dark);
    text-decoration: none;
}

.summary-content h2 a:hover {
    color: var(--primary-color);
}

.article-meta {
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.excerpt {
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    background: var(--primary-color);
    color: var(--bg-white);
    padding: 10px 20px;
    border-radius: 4px;
    align-self: flex-start; /* Aligne le bouton au début de la flexbox */
    margin-top: auto; /* Pousse le bouton vers le bas */
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background: #0056b3;
    text-decoration: none;
}

/* --- Article Complet (article.php) --- */
.article-full {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.article-full .article-header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.article-full .article-header h2 {
    margin-top: 0;
    font-size: 2.2em;
}

.article-full .article-content p {
    margin-bottom: 1em;
    text-align: justify;
}

.article-gallery {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.article-gallery h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.gallery-grid figure {
    margin: 0;
    text-align: center;
    background: var(--bg-light);
    padding: 10px;
    border-radius: 4px;
}

.gallery-grid img {
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.gallery-grid figcaption {
    font-size: 0.85em;
    color: var(--secondary-color);
    margin-top: 8px;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    font-size: 1.1em;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #0056b3;
    text-decoration: none;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-bottom: 15px;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Footer --- */
footer {
    background: var(--text-dark);
    color: var(--secondary-color);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9em;
    margin-top: 40px;
}

/* --- Media List (photos.php) --- */
.media-list h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .article-list {
        grid-template-columns: 1fr; /* Une seule colonne sur les petits écrans */
    }

    .article-full {
        padding: 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}