/* Fichier : /style.css (remplacez les anciens styles de la lightbox par ceux-ci) */

/* ========================================================== */
/*   STYLES LIGHTBOX v2.2 (CORRECTIF FINAL POUR LE ZOOM)      */
/* ========================================================== */

/* --- 1. L'Overlay principal --- */
#lightbox-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(30, 30, 30, 0.9); 
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 3000; 
    display: flex; align-items: center; justify-content: center; 
    opacity: 0; visibility: hidden; 
    transition: opacity 0.3s ease, visibility 0s 0.3s; 
    touch-action: none; 
    padding: 2.5vh 2.5vw; 
    box-sizing: border-box; 
}
#lightbox-overlay.is-visible { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }

/* --- 2. Le Viewport et le Cadre de l'image --- */
#lightbox-viewport { 
    position: relative; width: 100%; height: 100%; 
    display: flex; align-items: center; justify-content: center; 
}

#lightbox-frame { 
    position: relative; 
    overflow: hidden; 
    border: 10px solid white; 
    border-radius: 8px; 
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35); 
    cursor: grab; 
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1), border 0.3s ease, border-radius 0.3s ease;
    box-sizing: border-box; 
    background-color: #fff;
}
#lightbox-frame:active { cursor: grabbing; }

/* --- 3. L'Image --- */
#lightbox-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; transform-origin: 0 0;
    will-change: transform, opacity; user-select: none; 
    /* L'image elle-même n'intercepte aucun clic, c'est le cadre qui gère tout */
    pointer-events: none; 
    transition: opacity 0.3s ease-in-out;
}

/* --- 4. Zones de Clic Tactiles --- */
.lightbox-click-zone {
    position: absolute; top: 0; bottom: 0;
    width: 20%; z-index: 5; 
}
/* On ne laisse le curseur "pointer" que si la zone est active pour le zoom */
#lightbox-frame:not(.is-zoomed) .lightbox-click-zone {
    cursor: pointer;
}
/* CORRECTIF ZOOM : Quand le cadre est zoomé, les zones de clic doivent laisser passer les événements de déplacement */
#lightbox-frame.is-zoomed .lightbox-click-zone {
    pointer-events: none;
}
#lightbox-prev-zone { left: 0; }
#lightbox-next-zone { right: 0; }

/* --- 5. Nouveaux Boutons d'Action (sur l'image) --- */
.lightbox-action-btn {
    position: absolute;
    z-index: 20;
    background-color: rgba(30, 30, 30, 0.6);
    border: none;
    cursor: default; 
    
    /* MODIFICATION : Padding augmenté pour une zone de clic plus grande */
    padding: 12px;
    
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.lightbox-action-btn svg {
    /* MODIFICATION : Taille de l'icône augmentée pour une meilleure visibilité */
    width: 28px;
    height: 28px;
    
    fill: #fff;
    display: block;
    pointer-events: auto;
    cursor: pointer;
}
#lightbox-frame:hover .lightbox-action-btn {
    opacity: 0.3;
    transform: scale(1);
}
#lightbox-frame:hover .lightbox-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 1; 
}
#lightbox-close-btn { top: 15px; left: 15px; }
#lightbox-fullscreen-btn { top: 15px; right: 15px; }
/* --- 5.b Styles additionnels pour le bouton avec texte (CORRIGÉ) --- */
/* Règle corrigée pour rendre tout le bouton cliquable et l'adapter au texte */
.lightbox-action-btn {
    position: absolute;
    z-index: 20;
    background-color: rgba(30, 30, 30, 0.6);
    border: none;
    
    /* MODIFICATIONS CLÉS */
    display: flex;              /* Pour aligner icône et texte */
    align-items: center;        /* Centrage vertical */
    gap: 10px;                  /* Espace entre icône et texte */
    padding: 8px 16px 8px 12px; /* Padding adapté */
    border-radius: 25px;        /* Bordure moins arrondie */
    cursor: pointer;            /* Le curseur s'applique à tout le bouton */
    pointer-events: auto;       /* REND LE BOUTON CLIQUABLE */
    
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
/* On supprime le curseur 'pointer' de l'icône seule, car il est maintenant sur le bouton parent */
/* L'icône n'a plus besoin d'être interactive, le bouton parent s'en charge */
.lightbox-action-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    display: block;
}

/* Style du texte à l'intérieur du bouton */
.lightbox-btn-text {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    user-select: none; /* Empêche la sélection du texte au clic */
}
/* Ajustement spécifique pour le bouton de fermeture qui n'a pas de texte */
#lightbox-close-btn {
    padding: 12px;
}
/* --- 6. Boutons de Navigation Latéraux (flèches) --- */
.lightbox-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: none; width: 40px; height: 70px; 
    cursor: pointer; transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    opacity: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 10;
}
#lightbox-frame:hover .lightbox-nav-btn { opacity: 1; }
.lightbox-nav-btn:hover { background-color: #fff; transform: translateY(-50%) scale(1.05); }
#lightbox-prev-btn { 
    left: -10px; border-radius: 0 10px 10px 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%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: 18px 18px;
}
#lightbox-next-btn { 
    right: -10px; border-radius: 10px 0 0 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%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: 18px 18px;
}

/* --- 7. Bandeau d'Informations en bas --- */
/* DANS lightbox.css */

/* ========================================================== */
/*   7. BANDEAU D'INFOS - NOUVELLE VERSION (DEUX COLONNES)    */
/* ========================================================== */

#lightbox-info-capsule {
    position: absolute; 
    bottom: 0; 
    left: 0; 
    right: 0;
    /* On retire le fond en dégradé pour un look plus net */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 15px 20px; /* Padding légèrement augmenté */
    display: flex; /* <-- MODE FLEXBOX */
    justify-content: space-between; /* Aligne les deux colonnes sur les bords */
    align-items: center; /* Centre verticalement les colonnes */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
}
#lightbox-frame:hover #lightbox-info-capsule { 
    transform: translateY(0); 
}

/* Colonne de gauche pour les 4 contrôles */
.lightbox-left-controls {
    display: flex;
    flex-direction: column; /* Les groupes de boutons seront l'un sur l'autre */
    gap: 12px; /* Espace vertical entre les groupes */
    border: 2px solid white;
    border-radius: 8px;
    padding: 5px 5px;
    background-color: #fdfdfd;
}

/* Un groupe de boutons (ex: Diapo + Onglet) */
.control-group {
    display: flex;
    align-items: center;
    gap: 20px; /* Espace horizontal entre les boutons d'un même groupe */
}

/* Style commun pour les boutons/liens de la colonne de gauche */
.control-group a, .control-group button {
    color: #333; 
    text-decoration: none;
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px; /* Espace entre l'icône et le texte (pour l'altitude) */
    transition: color 0.2s, transform 0.2s;
}
.control-group a:hover, .control-group button:hover { 
    color: #007bff; 
    transform: scale(1.1); 
}
.control-group svg { 
    width: 24px; 
    height: 24px; 
    fill: currentColor; 
}
.altitude-info { 
    font-size: 14px; 
}
.slideshow-icon { 
    width: 28px; 
    height: 28px; 
}

/* Colonne de droite pour le texte central */
.lightbox-central-col { 
    text-align: center; 
}
.lightbox-text-content { 
    line-height: 1.4; 
}
.lightbox-title { 
    font-weight: 700; 
    font-size: 15px; 
    color: #333; 
}
.lightbox-comment-text { 
    font-style: italic; 
    font-size: 14px; 
    color: #555; 
    margin-top: 2px; 
}
.lightbox-location-link { 
    font-size: 12px; 
    color: #0056b3; 
    text-decoration: underline; 
    cursor: pointer; 
    margin-top: 8px; 
    transition: color 0.2s; 
}
.lightbox-location-link:hover { 
    color: #007bff; 
}

/* Colonne de droite pour le nouveau bouton commentaire */
.lightbox-right-controls {
    /* Ce conteneur sert juste à positionner le bouton */
}

/* Style du nouveau bouton commentaire, inspiré du FAB */
#lightbox-comment-fab {
    position: relative; /* Position relative au flux normal */
    width: 56px;
    height: 56px;
    background-color: var(--color-accent, #e74c3c);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-out, background-color 0.2s;
}
#lightbox-comment-fab:hover {
    background-color: #c0392b;
    transform: scale(1.05);
}
#lightbox-comment-fab svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* On réutilise le style de la pastille de compteur */
#lightbox-comment-fab .comment-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: bold;
    display: none; /* Caché par défaut */
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}
#lightbox-comment-fab .comment-count-badge.is-visible {
    display: flex;
}
.lightbox-central-col { text-align: center; }
.lightbox-text-content { line-height: 1.4; }
.lightbox-title { font-weight: 700; font-size: 15px; color: #333; }
.lightbox-comment-text { font-style: italic; font-size: 14px; color: #555; margin-top: 2px; }
.lightbox-location-link { font-size: 12px; color: #0056b3; text-decoration: underline; cursor: pointer; margin-top: 8px; transition: color 0.2s; }
.lightbox-location-link:hover { color: #007bff; }
.altitude-info svg { vertical-align: middle; margin-right: 4px; }
.slideshow-icon { width: 24px; height: 24px; }

/* --- 8. Styles pour le Mode Plein Écran --- */
#lightbox-overlay.fullscreen-mode { padding: 0; }
#lightbox-overlay.fullscreen-mode #lightbox-frame {
    width: 100% !important; height: 100% !important;
    border: none; border-radius: 0;
    background-color: transparent; box-shadow: none;
}
#lightbox-overlay.fullscreen-mode .lightbox-nav-btn { display: none; }
#lightbox-overlay.fullscreen-mode #lightbox-frame:hover .lightbox-action-btn { opacity: 1; }
#lightbox-overlay.fullscreen-mode #lightbox-info-capsule {
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0s 0.2s;
}

/* --- 9. Indicateur de Chargement --- */
#lightbox-loader {
    position: absolute; top: 50%; left: 50%;
    width: 40px; height: 40px; margin: -20px 0 0 -20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #333;
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}
@keyframes lightbox-spin { to { transform: rotate(360deg); } }

/* ========================================================== */
/*   STYLES LIGHTBOX DE CONTENU POLYVALENTE (v3 - Améliorée)  */
/* ========================================================== */

#content-lightbox-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 4000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    /* Transition plus douce pour le fond */
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.4s;
    padding: 2.5vh 2.5vw;
    box-sizing: border-box;
}

#content-lightbox-overlay.is-visible {
    opacity: 1; visibility: visible;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- AMÉLIORATION : Animation d'ouverture plus sophistiquée --- */
#content-lightbox-container {
    position: relative;
    opacity: 0;
    transform: scale(0.9) translateY(10px); /* Départ légèrement plus bas et plus petit */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    border-radius: 10px; /* Bords légèrement plus arrondis */
}

#content-lightbox-overlay.is-visible #content-lightbox-container {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* --- AMÉLIORATION : Mode Texte plus raffiné --- */
#content-lightbox-container.is-text-mode {
    background-color: #fdfdfd; /* Un blanc moins dur */
    color: #333;
    padding: 35px 40px;
    width: 90%;
    max-width: 580px;
    height: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- AMÉLIORATION : Mode Iframe plus sobre --- */
#content-lightbox-container.is-iframe-mode {
    background-color: #111;
    /* Bordure plus subtile */
    border: 1px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
    max-width: 1600px;
    max-height: 1200px;
}

/* --- AMÉLIORATION : Typographie pour le contenu texte --- */
#lightbox-text-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #222;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
#lightbox-text-content p {
    font-size: 16px;
    line-height: 1.7;
    margin: 0 0 15px 0;
}
#lightbox-text-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 10px;
}
#lightbox-text-content li {
    padding: 8px 0 8px 25px;
    position: relative;
}
/* Ajout d'une puce personnalisée pour la liste */
#lightbox-text-content li::before {
    content: '›';
    position: absolute;
    left: 5px;
    top: 6px;
    font-size: 20px;
    color: #007bff;
    font-weight: bold;
}
#lightbox-text-content a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, border-bottom-color 0.2s;
    border-bottom: 1px dotted rgba(0, 123, 255, 0.4);
}
#lightbox-text-content a:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
}


/* --- Visibilité des contenus --- */
#lightbox-text-content, #lightbox-iframe-content { display: none; }

/* --- AMÉLIORATION : Bouton Fermer plus interactif --- */
#content-lightbox-close-btn {
    position: absolute;
    z-index: 10;
    border: none;
    cursor: pointer;
    background-color: transparent;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    padding: 6px;
}
/* Rotation au survol pour un effet plus ludique */
#content-lightbox-close-btn:hover {
    transform: scale(1.1) rotate(90deg);
}
#content-lightbox-close-btn svg { display: block; transition: fill 0.2s ease; }

/* Bouton Fermer : version MODE TEXTE (discret) */
.is-text-mode #content-lightbox-close-btn { top: 10px; right: 10px; }
.is-text-mode #content-lightbox-close-btn svg { width: 26px; height: 26px; fill: #aaa; }
.is-text-mode #content-lightbox-close-btn:hover svg { fill: #333; }

/* Bouton Fermer : version MODE IFRAME (plus visible) */
.is-iframe-mode #content-lightbox-close-btn {
    top: -20px; right: -20px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.is-iframe-mode #content-lightbox-close-btn:hover {
    background-color: #f0f0f0;
}
.is-iframe-mode #content-lightbox-close-btn svg { width: 28px; height: 28px; fill: #333; }


/* --- Iframe & Loader (inchangés) --- */
#lightbox-iframe-content { width: 100%; height: 100%; border: none; }
#content-lightbox-loader {
    position: absolute; top: 50%; left: 50%;
    width: 40px; height: 40px; margin: -20px 0 0 -20px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
    z-index: 5;
    display: none;
}
/* DANS lightbox.css, trouvez cette règle et REMPLACEZ-LA */

.info-col { 
    display: flex;
    flex-direction: column;  /* <<< LA MODIFICATION CLÉ : passe en mode colonne */
    align-items: center;     /* Centre les éléments horizontalement dans la colonne */
    justify-content: center; /* Centre le bloc d'icônes verticalement dans son espace */
    gap: 12px;               /* Espace vertical entre les icônes */
    min-width: 80px;         /* Donne une largeur minimale pour un meilleur rendu */
}
/* AJOUTER À LA FIN de style.css */

/* ========================================================== */
/*   STYLE POUR LA VIGNETTE DANS LA LIGHTBOX COMMENTAIRES     */
/* ========================================================== */

.lightbox-comment-context {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #e9ecef;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 25px; /* Espace avant la liste des commentaires */
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid #dee2e6;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.lightbox-comment-context:hover {
    background-color: #e2e6ea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.lightbox-context-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0; /* Empêche l'image de se rétrécir */
}

.lightbox-context-text {
    text-align: left;
    line-height: 1.4;
}

.lightbox-context-text span {
    display: block;
    font-size: 0.8em;
    color: #6c757d;
}

.lightbox-context-text strong {
    font-size: 0.95em;
    font-weight: 600;
}
