/* ============================================
   MÉMORIAL DAVOUT LECTEUR - STYLES
   ============================================ */

/* Masquer l'en-tête du thème ONA sur cette page - RENFORCÉ */
body.page-memorial-davout .site-header,
body.page-id-memorial-davout .site-header,
.page-memorial-davout .site-header,
.memorial-davout-page .site-header,
header.site-header {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

body.page-memorial-davout .site-content,
body.page-id-memorial-davout .site-content,
.page-memorial-davout .site-content,
.memorial-davout-page .site-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forcer sur toute la page memorial-davout */
body.page .site-header {
    display: none !important;
}

/* Container principal */
#memorial-davout-lecteur {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F5F5F5;
}

/* En-tête */
.memorial-header {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.memorial-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: bold;
    color: white;
}

.memorial-header p {
    margin: 0;
    font-size: 16px;
    color: #ECF0F1;
}

/* Messages de chargement et erreur */
.memorial-loading,
.memorial-error {
    background: white;
    padding: 40px;
    text-align: center;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.memorial-loading p {
    font-size: 18px;
    color: #7F8C8D;
}

.memorial-error p {
    font-size: 18px;
    color: #E74C3C;
}

/* Contenu principal */
.memorial-content {
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.memorial-main {
    display: flex;
    gap: 20px;
    padding: 20px;
    min-height: 600px;
}

/* Colonne gauche - Liste */
.memorial-left {
    flex: 1;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
}

.memorial-section-title {
    background: #F8F9FA;
    padding: 15px;
    font-weight: bold;
    font-size: 14px;
    color: #2C3E50;
    border-bottom: 2px solid #E0E0E0;
}

.memorial-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #E0E0E0;
    background: white;
}

.search-icon {
    font-size: 18px;
}

#memorial-search {
    flex: 1;
    padding: 10px;
    border: 1px solid #DDD;
    border-radius: 4px;
    font-size: 14px;
}

#memorial-search:focus {
    outline: none;
    border-color: #3498DB;
}

.memorial-liste {
    overflow-y: auto;
    max-height: 500px;
    padding: 10px;
}

.memorial-article-item {
    padding: 12px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
    font-size: 14px;
    color: #2C3E50;
}

.memorial-article-item:hover {
    background-color: #F8F9FA;
}

.memorial-article-item.selected {
    background-color: #3498DB;
    color: white;
}

/* Colonne droite - Fiche */
.memorial-right {
    flex: 1;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
}

.memorial-fiche {
    padding: 20px;
    overflow-y: auto;
    max-height: 550px;
}

.memorial-placeholder {
    text-align: center;
    color: #95A5A6;
    font-style: italic;
    padding: 40px 20px;
}

.memorial-fiche-row {
    display: flex;
    margin-bottom: 12px;
    gap: 10px;
}

.memorial-fiche-label {
    font-weight: bold;
    color: #7F8C8D;
    min-width: 180px;
    font-size: 14px;
}

.memorial-fiche-value {
    color: #2C3E50;
    flex: 1;
    font-size: 14px;
}

.memorial-fiche-value.bold {
    font-weight: bold;
}

.memorial-separator {
    height: 2px;
    background: #E0E0E0;
    margin: 20px 0;
}

.memorial-photos-title {
    font-weight: bold;
    font-size: 15px;
    color: #2C3E50;
    margin-bottom: 10px;
}

.memorial-photo-item {
    margin-bottom: 10px;
}

.memorial-photo-nom {
    color: #34495E;
    font-size: 14px;
    margin-bottom: 3px;
}

.memorial-photo-legende {
    color: #3498DB;
    font-style: italic;
    font-size: 13px;
    padding-left: 20px;
    margin-bottom: 8px;
}

.memorial-no-photos {
    color: #95A5A6;
    font-style: italic;
    font-size: 14px;
}

/* Footer - Boutons */
.memorial-footer {
    padding: 20px;
    background: #F8F9FA;
    border-top: 1px solid #E0E0E0;
    display: flex;
    gap: 10px;
}

.memorial-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.memorial-btn-primary {
    background: #3498DB;
    color: white;
}

.memorial-btn-primary:hover:not(:disabled) {
    background: #2980B9;
}

.memorial-btn-primary:disabled {
    background: #BDC3C7;
    cursor: not-allowed;
}

.memorial-btn-secondary {
    background: #95A5A6;
    color: white;
    margin-left: auto;
}

.memorial-btn-secondary:hover {
    background: #7F8C8D;
}

/* Responsive */
@media (max-width: 968px) {
    .memorial-main {
        flex-direction: column;
    }
    
    .memorial-left,
    .memorial-right {
        max-height: none;
    }
    
    .memorial-liste,
    .memorial-fiche {
        max-height: 400px;
    }
}

/* Scrollbar personnalisée */
.memorial-liste::-webkit-scrollbar,
.memorial-fiche::-webkit-scrollbar {
    width: 8px;
}

.memorial-liste::-webkit-scrollbar-track,
.memorial-fiche::-webkit-scrollbar-track {
    background: #F1F1F1;
}

.memorial-liste::-webkit-scrollbar-thumb,
.memorial-fiche::-webkit-scrollbar-thumb {
    background: #BDC3C7;
    border-radius: 4px;
}

.memorial-liste::-webkit-scrollbar-thumb:hover,
.memorial-fiche::-webkit-scrollbar-thumb:hover {
    background: #95A5A6;
}

/* ============================================
   LIGHTBOX POUR LES PHOTOS
   ============================================ */

#memorial-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10001;
}

/* Bouton fermer - ROND ROUGE en haut à droite */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #dc3545;
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    padding: 0;
    line-height: 1;
}

.lightbox-close:hover {
    background: #c82333;
    transform: scale(1.1);
}

.lightbox-image-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
}

#memorial-lightbox.zoomed .lightbox-image {
    cursor: grab;
}

#memorial-lightbox.dragging .lightbox-image {
    cursor: grabbing;
}

#memorial-lightbox.zoomed .lightbox-overlay {
    cursor: default;
}

/* Légende - COMPACT */
.lightbox-legende {
    margin-top: 10px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #3498DB;
    font-style: italic;
    font-size: 16px;
    border-radius: 8px;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Instructions - APRÈS la navigation - COMPACT */
.lightbox-instructions {
    margin-top: 5px;
    color: #ccc;
    font-size: 13px;
    text-align: center;
}

/* Barre de navigation sous la photo avec compteur et flèches - COMPACT */
.lightbox-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
}

/* Compteur au centre - COMPACT */
.lightbox-counter {
    color: #2C3E50;
    font-weight: bold;
    font-size: 14px;
    min-width: 50px;
    text-align: center;
}

/* Flèches de navigation - EN BAS avec le compteur - COMPACT */
.lightbox-prev,
.lightbox-next {
    /* Cercle noir visible */
    background: rgba(0,0,0,0.7);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    
    /* Centrer la flèche dans le cercle */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Reset les propriétés par défaut des boutons */
    padding: 0;
    margin: 0;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0,0,0,0.9);
    border-color: rgba(255,255,255,0.9);
    transform: scale(1.1);
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: scale(0.95);
}

/* Responsive lightbox */
@media (max-width: 968px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
    
    /* Barre de navigation encore plus compacte sur mobile */
    .lightbox-navigation {
        gap: 10px;
        padding: 4px 12px;
    }
    
    /* Flèches encore plus petites sur mobile */
    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .lightbox-counter {
        font-size: 13px;
        min-width: 45px;
    }
    
    .lightbox-instructions {
        font-size: 11px;
        padding: 0 10px;
        margin-top: 3px;
    }
    
    .lightbox-image {
        max-height: 60vh;
    }
    
    .lightbox-legende {
        font-size: 13px;
        padding: 6px 15px;
        margin-top: 8px;
    }
}

/* Hint tactile pour mobile */
.lightbox-touch-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.lightbox-touch-hint.show {
    opacity: 1;
}

/* Cacher le hint sur desktop */
@media (min-width: 769px) {
    .lightbox-touch-hint {
        display: none;
    }
}

/* Indicateur de niveau de zoom */
.lightbox-zoom-level {
    position: fixed;
    top: 20px;
    left: 20px;
    color: white;
    background: rgba(52, 152, 219, 0.9);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    z-index: 10002;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Bouton reset zoom */
.lightbox-zoom-reset {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(46, 204, 113, 0.9);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: none;
}

.lightbox-zoom-reset.visible {
    display: block;
}

.lightbox-zoom-reset:hover {
    background: rgba(39, 174, 96, 1);
    transform: translateX(-50%) scale(1.05);
}

/* Responsive zoom controls */
@media (max-width: 968px) {
    .lightbox-zoom-level {
        top: 10px;
        left: 10px;
        font-size: 14px;
        padding: 8px 15px;
    }
    
    .lightbox-zoom-reset {
        top: 60px;
        left: 50%;
        font-size: 12px;
        padding: 8px 15px;
    }
}
