/* ========================================================== */
/*   STYLES MUTUALISÉS POUR LES PAGES DE GALERIE MODERNE      */
/*   (Mur, Tags, etc.)                                        */
/* ========================================================== */

html {
    scroll-behavior: smooth;
}
.voyage-gallery {
    max-width: 1280px;
    margin: 30px auto;
    padding: 0 15px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}
.gallery-header {
    padding: 5px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.filter-container {
    margin: 5px 0;
}
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    justify-content: center;
    padding: 5px 0;
}
.photo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.photo-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1;
}
.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.photo-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.photo-card:hover .photo-info {
    opacity: 1;
}
.photo-country, .photo-caption {
    margin: 0;
}
.photo-country { font-weight: 600; display: block; margin-bottom: 5px; }
.photo-caption { font-size: 0.9em; opacity: 0.9; }

.photo-link-overlay {
    position: absolute; top: 10px; right: 10px;
    display: flex; opacity: 0; transition: all 0.3s ease; z-index: 2;
}
.photo-card:hover .photo-link-overlay { opacity: 1; }
.photo-link-overlay a { color: white; text-decoration: none; font-size: 1.2em; padding: 5px; opacity: 0.8; transition: all 0.3s ease; }
.photo-link-overlay a:hover { opacity: 1; transform: scale(1.2); }
.photo-link-icon { background-color: rgba(0, 0, 0, 0.4); border-radius: 50%; }
.photo-link-icon::before { content: "\2192"; display: inline-block; font-size: 1.8em; text-shadow: 0 0 5px black; line-height: 1; }

.photo-card .star-overlay {
    position: absolute; top: 8px; left: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 3;
}
.photo-card:hover .star-overlay { opacity: 1; transform: scale(1); }
.photo-card .star-overlay img { width: 14px; height: 14px; filter: invert(100%) brightness(1.2); }

/* --- Styles pour le nuage de tags --- */
.nuage_tag {
    display: inline-block; text-decoration: none; border-radius: 12px; cursor: pointer;
    margin: 0; padding: 3px 10px; font-size: 0.75em; border: 1px solid #e8e8e8;
    background-color: transparent; color: #555; transition: all 0.2s ease-in-out;
    white-space: nowrap;
}
.nuage_tag:hover { background-color: #f5f5f5; border-color: #ccc; color:black}
.nuage_tag.active { background-color: #e74c3c; color: white; border-color: #e74c3c; font-weight: 600; }

/* --- Styles pour la barre de navigation sticky --- */
.pagination-container {
    display: flex; align-items: stretch; gap: 0; margin: 20px 0;
    position: -webkit-sticky; position: sticky; top: 0; z-index: 900;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
@media (min-width: 769px) { .pagination-container { top: 45px; } }

.slideshow-button-integrated {
    display: inline-flex; align-items: center; gap: 8px; padding: 0 20px;
    background: #0ba4bd; color: white; border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer; transition: background-color 0.2s ease;
    flex-shrink: 0; text-decoration: none; font-size: 0.9em;
}
.slideshow-button-integrated img { width: 20px; height: auto; filter: brightness(0) invert(1); }
.slideshow-button-integrated:hover { background-color: #0d93a8; }

.pagination-content-wrapper {
    display: flex; justify-content: space-between; align-items: center;
    flex-grow: 1; padding: 8px 15px; gap: 15px;
}
.pagination-center-block { display: flex; justify-content: center; align-items: center; gap: 20px; flex-grow: 1; }
.pagination-nav { display: flex; align-items: center; gap: 6px; }
.pagination-right-block { display: flex; align-items: center; gap: 10px; }

.nb_tag { font-size: 0.9em; color: #555; font-weight: 400; white-space: nowrap; }
.nb_tag_count { font-size: 1.1em; color: #e74c3c; font-weight: 600; }

.pagination-btn { display: inline-block; padding: 8px 14px; text-decoration: none; color: #555; background-color: #fff; border: 1px solid #ddd; border-radius: 6px; font-size: 0.9em; transition: all 0.2s ease; }
.pagination-btn:hover { background-color: #f5f5f5; border-color: #bbb; }
.pagination-btn.active { background-color: #e74c3c; color: white; border-color: #e74c3c; font-weight: bold; cursor: default; }
.pagination-ellipsis { padding: 8px 6px; color: #999; }

.pagination-top-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; text-decoration: none; color: #555; background-color: #f0f0f0; border: 1px solid #ddd; border-radius: 50%; font-size: 1.2em; font-weight: bold; transition: all 0.2s ease; }
.pagination-top-btn:hover { background-color: #e0e0e0; border-color: #bbb; transform: scale(1.05); }

.current-tag-display { font-size: 0.8em; color: #333; background-color: #f0f0f0; padding: 6px 12px; border-radius: 15px; border: 1px solid #ddd; white-space: nowrap; }
.current-tag-display strong { color: #e74c3c; }

/* --- Correction pour le défilement et la navigation de groupe --- */
.voyage-group-header {
    grid-column: 1 / -1;
    margin-top: 40px;
    margin-bottom: 10px;
    scroll-margin-top: 65px; 
    cursor: pointer;
}
@media (min-width: 769px) {
    .voyage-group-header {
        scroll-margin-top: 110px;
    }
}

/* --- Styles responsives --- */
@media (max-width: 768px) {
    .photo-wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
/* ========================================================== */
/*   STYLES SPÉCIFIQUES À LA PAGE "MUR D'IMAGES"              */
/* ========================================================== */

.info-alert {
    display: block;
    text-align: center;
    gap: 12px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #555; /* Couleur plus neutre que le rouge */
    font-weight: 500;
}

.slideshow-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #0ba4bd;
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9em;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.slideshow-button img {
    width: 20px;
    height: auto;
}
.slideshow-button:hover {
    transform: scale(1.05);
    background-color: #0d93a8;
}

.flat-btn {
    background-color: transparent;
    border: 1px solid #bbb;
    border-radius: 20px;
    color: #555;
    padding: 6px 15px;
    margin: 2px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}
.flat-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
    border-color: #999;
}
.flat-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

.refresh-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 25px;
    padding: 3px 20px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 5px;
}
.refresh-btn:hover {
    background-color: #e74c3c;
    color: white;
    transform: scale(1.05);
}
/* ========================================================== */
/*   AJOUT : Styles pour la pagination en bas de page (Tags)  */
/* ========================================================== */

.bottom-pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px; /* Espace après la grille d'images */
    margin-bottom: 20px;
}

.page-indicator-bottom {
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
    padding: 0 10px;
}

/* On s'assure que les boutons réutilisent bien le style existant */
.bottom-pagination-container .pagination-btn {
    padding: 8px 16px;
}
/* ========================================================== */
/*   STYLES SPÉCIFIQUES À LA NOUVELLE PAGE VIDÉOS             */
/* ========================================================== */

.video-list {
    display: flex;
    flex-direction: column;
    gap: 25px; /* Espace entre chaque vidéo */
    margin-bottom: 50px; /* Espace après chaque groupe de voyage */
}

.video-card {
    display: flex;
    gap: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.video-thumbnail-container {
    position: relative;
    flex-shrink: 0;
    width: 280px;
    background-color: #000;
    display: block;
}

.video-thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.video-thumbnail-container:hover img {
    opacity: 0.8;
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    pointer-events: none; /* L'icône ne doit pas intercepter le clic */
    opacity: 0.8;
    transition: all 0.3s ease;
}

.play-icon-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%; /* Léger décalage pour un centrage visuel parfait */
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid #e74c3c;
}

.video-thumbnail-container:hover .play-icon-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.video-details {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-details h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: var(--color-text);
}

.video-details p {
    margin: 0;
    font-size: 0.9em;
}

.video-details a {
    color: var(--color-link);
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: border-bottom-color 0.2s;
}

.video-details a:hover {
    border-bottom-color: var(--color-link);
}

/* --- Responsive pour les mobiles --- */
@media (max-width: 768px) {
    .video-card {
        flex-direction: column;
    }
    .video-thumbnail-container {
        width: 100%;
        padding-top: 56.25%; /* Ratio 16:9 pour la vidéo */
        height: 0;
    }
    .video-thumbnail-container img {
        position: absolute;
        top: 0;
        left: 0;
    }
    .video-details {
        padding: 12px 15px;
    }
    .video-details h3 {
        font-size: 1.3em;
    }
}
/* --- Correction pour le défilement et la navigation de groupe --- */
.voyage-group-header {
    grid-column: 1 / -1;
    margin-top: 40px;
    margin-bottom: 10px;
    /* CRUCIAL : Crée une marge invisible en haut pour le défilement */
    /* L'ancre s'arrêtera 65px AVANT le haut de l'élément */
    scroll-margin-top: 65px; 
    cursor: pointer;
}
/* On augmente la marge pour les écrans plus larges où le menu est plus grand */
@media (min-width: 769px) {
    .voyage-group-header {
        scroll-margin-top: 110px;
    }
}

/* ========================================================== */
/*   STYLES COMPLETS POUR LA PAGE VIDÉOS (V6 - Final)         */
/* ========================================================== */

/* --- 1. Conteneur Général --- */
.voyage-gallery {
    max-width: 1800px; /* Largeur maximale pour les grands écrans */
    margin: 0 auto;
    padding: 0 15px 30px 15px; /* Padding haut/bas/côtés */
}

/* --- 2. Filtres par Voyage (statiques) --- */
.video-filter-container {
    padding: 20px 10px 15px 10px;
}

.video-filter-controls {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    gap: 8px 12px;
}

.video-filter-btn {
    display: inline-block;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
    margin: 0;
    padding: 5px 15px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid #ddd;
    background-color: #f8f8f8;
    color: #444;
    transition: all 0.2s ease-in-out;
}

.video-filter-btn:hover {
    background-color: #e9e9e9;
    border-color: #ccc;
    transform: translateY(-1px);
}

.video-filter-btn.active {
    background-color: var(--color-accent, #e74c3c);
    color: white;
    border-color: var(--color-accent, #e74c3c);
    font-weight: 600;
}

/* --- 3. Barre de Titre et Pagination (Sticky) --- */
.sticky-title-bar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
/* Adapte la position si un menu principal est visible */
@media (min-width: 769px) { 
    .sticky-title-bar { 
        top: 45px; 
    } 
}

#sticky-voyage-title {
    margin: 0;
    font-size: 1.1em;
    font-family: var(--font-title);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.sticky-nav-tools {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

#sticky-pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#page-indicator {
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.pagination-btn {
    padding: 4px 12px;
    font-size: 0.8em;
    border-radius: 6px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: background-color 0.2s;
}
.pagination-btn:hover:not(:disabled) {
    background-color: #e0e0e0;
}
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scroll-to-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
}
.scroll-to-top-btn:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
    transform: scale(1.05);
}

/* --- 4. Grille et Cartes Vidéo --- */
.video-list-group {
    display: block;
}

.video-list {
    display: grid;
    /* Grille responsive : autant de colonnes que possible de 300px min */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.video-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.video-player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Ratio 16:9 */
    background-color: #000;
    cursor: pointer;
    overflow: hidden;
}

.video-player-container .video-thumbnail {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.video-player-container:hover .video-thumbnail {
    transform: scale(1.05);
}

.video-player-container iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 0;
}

.play-icon-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.8;
    transition: all 0.3s ease;
}
.play-icon-overlay::after {
    content: '';
    position: absolute;
    top: 50%; left: 54%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid #e74c3c;
}
.video-player-container.video-loaded .play-icon-overlay {
    display: none;
}

.video-details {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Permet à cette zone de remplir l'espace vertical restant */
}

.video-title-link {
    text-decoration: none;
    color: var(--color-text);
    margin-bottom: auto; /* Pousse le lien de page en bas de la carte */
}
.video-title-link h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    transition: color 0.2s ease;
}
.video-title-link:hover h3 {
    color: var(--color-accent, #e74c3c);
}

.video-page-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 10px;
    font-size: 0.8em;
    font-weight: 500;
    color: #555;
    background-color: #f0f0f0;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    align-self: flex-start;
}
.video-page-link:hover {
    background-color: #e0e0e0;
    color: #000;
}
.video-page-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 0.2s ease;
}
.video-page-link:hover svg {
    transform: translateX(3px);
}

/* --- 5. Points de rupture pour la grille sur grands écrans --- */
/* 2 colonnes par défaut sur la plupart des tablettes/petits PC */
@media (min-width: 768px) {
    .video-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* 3 colonnes sur les écrans larges */
@media (min-width: 1200px) {
    .video-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* 4 colonnes sur les très très grands écrans */
@media (min-width: 1600px) {
    .video-list {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (min-width: 769px) {
    .voyage-gallery {
        /* On ajoute un espace en haut du conteneur principal
           équivalent à la hauteur du menu (45px) + une marge de confort (20px). */
        margin-top: 65px;
    }
}
/* --- 6. Correctifs Responsives pour la Grille Vidéo --- */

/* Pour la plupart des appareils mobiles en mode portrait */
@media (max-width: 600px) {
    .video-list {
        /* On force la grille à n'avoir qu'une seule colonne.
           Chaque carte prendra toute la largeur disponible. */
        grid-template-columns: 1fr;
        
        /* On peut réduire légèrement l'espacement pour un look plus compact */
        gap: 20px;
    }

    /* Optionnel : Rendre le titre un peu plus grand sur mobile pour la lisibilité */
    .video-details h3 {
        font-size: 1.2em;
    }
}

/* On s'assure que la grille de base ne commence pas avec un minmax trop grand */
.video-list {
    display: grid;
    /* On réduit légèrement la taille minimale pour mieux s'adapter aux petites tablettes */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}
/* ========================================================== */
/*   STYLES COMPLETS POUR LA PAGE DE RECHERCHE (FINAL v3)     */
/* ========================================================== */

/* --- Formulaire de recherche principal --- */
.search-header { text-align: center; padding: 20px 10px 20px 10px; }
.search-form { display: flex; justify-content: center; gap: 10px; max-width: 600px; margin: 0 auto; }
.search-input { flex-grow: 1; text-align:center;padding: 12px 18px; font-size: 1em; border: 1px solid #ccc; border-radius: 25px; transition: all 0.2s ease; }
.search-input:focus { border-color: var(--color-link); box-shadow: 0 0 8px rgba(0, 86, 179, 0.2); outline: none; }
.search-submit-btn { padding: 0 25px; font-size: 1em; font-weight: bold; color: white; background-color: var(--color-accent, #e74c3c); border: none; border-radius: 25px; cursor: pointer; transition: background-color 0.2s; }
.search-submit-btn:hover { background-color: #c0392b; }

/* --- Barre Sticky --- */
@media (min-width: 769px) { .sticky-title-bar { top: 45px; } }
.sticky-form-content { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 8px 10px; }
.search-filter-controls { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
.search-filter-btn { padding: 6px 16px; font-size: 0.85em; border: 1px solid #ddd; background-color: #f8f8f8; border-radius: 20px; cursor: pointer; transition: all 0.2s ease; }
.search-filter-btn:hover:not(:disabled) { background-color: #e9e9e9; border-color: #ccc; }
.search-filter-btn.active { background-color: var(--color-link, #333); color: white; border-color: var(--color-text, #333); }
.search-filter-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.count-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; font-size: 0.8em; background-color: rgba(0,0,0,0.1); border-radius: 10px; }
.search-filter-btn.active .count-badge { background-color: rgba(255,255,255,0.2); }
.sticky-nav-tools { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.sticky-pagination-controls { display: flex; align-items: center; gap: 8px; }
.page-indicator { font-size: 0.9em; font-weight: 500; color: #555; white-space: nowrap; }

/* --- Indicateur de chargement et résultats --- */
.search-loader-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: #555; }
.loader-spinner { width: 40px; height: 40px; border: 4px solid rgba(0, 0, 0, 0.1); border-left-color: var(--color-link); border-radius: 50%; animation: lightbox-spin 0.8s linear infinite; margin-bottom: 15px; }
@keyframes lightbox-spin { to { transform: rotate(360deg); } }
.search-results-container { min-height: 300px; padding-top: 25px; }
.highlight { background-color: #fff3cd; color: #664d03; padding: 1px 3px; border-radius: 3px; }

/* --- Style pour les résultats "Pages" --- */
.search-results-pages { display: flex; flex-direction: column; gap: 15px; max-width: 900px; margin: 0 auto; }
.page-result-card { display: flex; gap: 15px; background-color: #fff; border: 1px solid #eee; border-radius: 8px; padding: 15px; text-decoration: none; color: inherit; transition: all 0.2s ease; }
.page-result-card:hover { border-color: #ccc; box-shadow: 0 4px 15px rgba(0,0,0,0.08); transform: translateY(-2px); }
.page-result-thumb { flex-shrink: 0; width: 120px; height: 80px; border-radius: 4px; overflow: hidden; }
.page-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.page-result-details h3 { margin: 0 0 8px 0; font-size: 1.2em; }
.page-result-details p { margin: 0; font-size: 0.9em; color: #555; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Animation pour chargement vidéo --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.video-player-container.video-loaded iframe { animation: fadeIn 0.4s ease-out; }

/* --- Style pour Lazy Loading Vidéo --- */
.video-thumbnail.lazyload { 
    background-color: #f0f0f0;
    /* Un GIF transparent de 1x1 pixel comme placeholder */
    content: url('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
}
.video-thumbnail { transition: opacity 0.5s ease-in-out; }
/* ================================================================== */
/*   AJOUT : Style pour le bouton "Ouvrir dans un nouvel onglet"    */
/* ================================================================== */

/* On rend la carte parente "relative" pour positionner le bouton à l'intérieur */
.page-result-card {
    position: relative;
}

.open-in-new-tab-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0; /* Caché par défaut */
    transform: scale(0.8);
    transition: all 0.2s ease-in-out;
}

/* Le bouton apparaît au survol de la carte */
.page-result-card:hover .open-in-new-tab-btn {
    opacity: 1;
    transform: scale(1);
}

.open-in-new-tab-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.open-in-new-tab-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}
/* ========================================================== */
/*   V3 : ADAPTATIONS RESPONSIVES CORRIGÉES POUR MOBILES      */
/* ========================================================== */

@media (max-width: 768px) {

    /* --- 1. Adaptation de la barre de navigation "Sticky" --- */
    .pagination-container,
    .sticky-title-bar {
        padding: 10px;
        height: auto;
    }

    .pagination-content-wrapper,
    .sticky-form-content {
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 12px;
    }

    .pagination-center-block {
        flex-basis: 100%;
        order: -1;
        justify-content: center;
    }
    
    .pagination-container .nb_tag {
        margin-right: auto;
    }
    .pagination-right-block {
        margin-left: auto;
    }

    /* --- 2. CORRECTION : Boutons Précédent/Suivant avec icônes SVG --- */
    
    .pagination-nav a.pagination-btn:first-child,
    .pagination-nav a.pagination-btn:last-child,
    .bottom-pagination-container a.pagination-btn:first-child,
    .bottom-pagination-container a.pagination-btn:last-child {
        font-size: 0; /* Cache le texte */
        padding: 0;
        width: 40px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .pagination-nav a.pagination-btn:first-child,
    .bottom-pagination-container a.pagination-btn:first-child {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23555'%3E%3Cpath d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 24px;
    }

    .pagination-nav a.pagination-btn:last-child,
    .bottom-pagination-container a.pagination-btn:last-child {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23555'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 24px;
    }

    /* --- 3. Adaptation des boutons de filtres --- */
    .button-group,
    .video-filter-controls {
        gap: 6px 8px;
    }

    .nuage_tag,
    .flat-btn,
    .video-filter-btn,
    .search-filter-btn {
        font-size: 0.8em;
        padding: 5px 12px;
    }

    /* --- 4. Adaptation de la grille --- */
    .photo-wall,
    .video-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    @media (min-width: 480px) and (max-width: 768px) {
        .photo-wall {
             grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        }
        .video-list {
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        }
    }
}