/* Fichier : /presse/assets/css/style.css */

/* --- Style général --- */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
}

/* --- En-tête --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header .logo img {
    height: 40px;
}

header h1 {
    font-size: 1.5em;
    font-weight: 300;
    margin: 0;
}

/* --- Conteneur principal --- */
main {
    padding: 30px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Section de type "carte" --- */
.section-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 30px; 
}

/* --- Filtres --- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
}

.filter-group-left {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filters input[type="text"],
.filters select,
.filters input[type="date"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    background-color: #f9f9f9;
}

.filters input[type="text"] {
    flex-grow: 1;
    min-width: 200px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-apply, .btn-secondary, .btn-pdf {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.btn-apply, .btn-pdf {
    background-color: #FF3000;
    color: white;
}

.btn-apply:hover, .btn-pdf:hover {
    background-color: #D62800;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.quick-filters-container {
    border-top: 1px solid #eee;
    margin-top: 25px;
    padding-top: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.quick-filters-label {
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-filter-btn {
    background-color: #eee;
    color: #555;
    border: none;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.quick-filter-btn:hover {
    background-color: #ddd;
}

/* --- Compteur de résultats --- */
.results-count {
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
}

/* --- Grille des articles (2 colonnes) --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #777;
}

/* --- Style d'un article (Vignette à gauche) --- */
.article-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: row; /* Disposition horizontale */
    align-items: flex-start;
}

.article-item .image-container {
    flex: 0 0 250px;
    aspect-ratio: 3 / 4; /* Conteneur plus haut */
    overflow: hidden;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Affiche l'image en entier sans la rogner */
    transition: filter 0.3s ease;
}

.article-item .image-container:hover img {
    filter: brightness(85%);
}

.article-item .article-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.article-item h3 {
    margin: 5px 0 10px 0;
    font-size: 1.1em;
    color: #000;
    line-height: 1.4;
}

.article-item .media-type {
    display: inline-block;
    background-color: #FF3000;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 12px;
    align-self: flex-start;
}

.article-item .publication {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 15px;
}

.article-item .tags {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-filter-btn {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    background-color: #eee;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    color: #555;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tag-filter-btn:hover {
    background-color: #ddd;
}

/* --- MODALE (CORRIGÉE) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden; /* La modale elle-même ne défile pas */
}

.modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    box-sizing: border-box;
}

#modal-media-content {
    flex-grow: 1; 
    width: 100%;
    /* * MODIFICATION CLÉ :
     * 'display: block' au lieu de 'flex'.
     * 'overflow: auto' affichera les ascenseurs si l'enfant (l'image) est plus grand.
    */
    display: block; 
    overflow: auto; 
    position: relative;
    padding: 10px; 
    box-sizing: border-box;
    text-align: center; /* Centre l'image horizontalement si elle est plus petite que le conteneur */
}

#modal-media-content img {
    border-radius: 5px;
    width: auto;
    height: auto;
    max-width: 95%; /* S'adapte à la fenêtre par défaut */
    max-height: 95%; /* S'adapte à la fenêtre par défaut */
    /* MODIFIÉ : requis pour que margin:auto fonctionne */
    display: inline-block;
    margin: auto; 
}

#modal-media-content video,
#modal-media-content audio {
    max-width: 80%;
    max-height: 80%;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #8E8989;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1002; /* Doit être au-dessus de tout */
}

.modal-actions {
    flex-shrink: 0; /* Empêche cette zone de rétrécir */
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 1001; /* S'assure que les boutons sont au-dessus du contenu */
}

.modal-download-actions {
    display: flex;
    gap: 10px; /* Espace entre les deux boutons */
    align-items: center;
}

.zoom-controls {
    display: none; /* Géré par JS */
    gap: 10px;
}

.zoom-controls button {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.zoom-controls button:hover {
    transform: scale(1.1);
}

#zoom-reset {
    font-size: 0.9em;
}

.download-btn {
    display: inline-block; /* S'assure qu'il est visible */
    padding: 10px 20px;
    background-color: #FF3000;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}
.download-btn:hover {
    background-color: #D62800;
}


/* --- Responsive --- */
@media (max-width: 992px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .article-item {
        flex-direction: column;
    }
    .article-item .image-container {
        width: 100%;
        flex-basis: auto;
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 600px) {
    header, main {
        padding: 15px;
    }
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group-left {
        flex-direction: column;
        align-items: stretch;
    }
}	