/* ============================= */
/* SPECIES ACCOUNT - HEADER TEMPLATE */
/* Compatible avec encyclopedia-menu.css et general.css */
/* ============================= */

/* Variables de base */
:root {
    --primary-green: #7f9b4d;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-light: #e9ecef;
    --white: #ffffff;
}

/* Container */
.container {
    max-width: 60rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    width: 100%;
}

/* ============================= */
/* SPECIES TITLE HEADER */
/* ============================= */

.species-title-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-top: 2rem;
}

.species-names h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
}

.scientific-name {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: var(--text-dark);
    font-style: italic;
    font-weight: 500;
    margin: 0;
}

/* ============================= */
/* CONSERVATION STATUS BAND - VERSION PLUS FINE */
/* ============================= */

.conservation-status-band {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.65rem 1.2rem; /* ENCORE PLUS FIN */
    margin: -1rem 0 1rem 0; /* ENCORE MOINS d'espace avec breadcrumb, ENCORE PLUS après */
    font-size: 0.95rem; /* RÉDUIT : était 1rem */
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 2.5rem; /* RÉDUIT : était 3rem */
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* RÉDUIT : était 0.5rem */
    white-space: nowrap;
}

.status-label {
    font-weight: 500;
    color: var(--text-dark);
}

.status-value {
    font-weight: 400;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.4rem; /* RÉDUIT : était 0.5rem */
}

/* ============================= */
/* AUTO IUCN STATUS INDICATORS */
/* ============================= */

.status-indicator {
    width: 10px; /* RÉDUIT : était 12px */
    height: 10px; /* RÉDUIT : était 12px */
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* IUCN Status Colors - Couleurs officielles */
.status-lc { background-color: #51bc1d; } /* Least Concern */
.status-nt { background-color: #97c115; } /* Near Threatened */
.status-vu { background-color: #ffc90e; } /* Vulnerable */
.status-en { background-color: #f28533; } /* Endangered */
.status-cr { background-color: #c52412; } /* Critically Endangered */
.status-ew { background-color: #542344; } /* Extinct in Wild */
.status-ex { background-color: #000000; } /* Extinct */
.status-dd { background-color: #BEBEBE; } /* Data Deficient */
.status-ne { background-color: #D3D3D3; } /* Not Evaluated */

/* ============================= */
/* AUTO POPULATION TREND INDICATORS */
/* ============================= */

.trend-indicator {
    font-size: 0.8rem; /* RÉDUIT : était 0.9rem */
    transition: all 0.2s ease;
}

/* Couleurs des flèches selon la tendance */
.trend-increasing { color: #51bc1d; } /* Vert pour croissance */
.trend-stable { color: #3498DB; }     /* Bleu pour stable */
.trend-decreasing { color: #c52412; } /* Rouge pour déclin */
.trend-unknown { color: #95A5A6; }    /* Gris pour inconnu */

/* ============================= */
/* RESPONSIVE CONSERVATION BAND */
/* ============================= */

@media (max-width: 768px) {
    .conservation-status-band {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem; /* RÉDUIT : était 0.75rem */
        padding: 0.65rem; /* ENCORE PLUS FIN sur mobile */
        margin: -0.25rem 0 1rem 0; /* UN PEU PLUS d'espace avec breadcrumb sur mobile */
    }
    
    .status-item {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 400px) {
    .conservation-status-band {
        font-size: 0.8rem;
    }
    
    .status-label {
        font-size: 0.75rem;
    }
    
    .status-value {
        font-size: 0.7rem;
    }
}

/* ============================= */
/* SPECIES SECTION */
/* ============================= */

.species-section {
    padding: 0 0 4rem 0;
    background: #fff;
    margin-top: 70px;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-light);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.breadcrumb a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #6a8240;
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #999;
}

/* ============================= */
/* INTRO SPLIT SECTION - MODIFIÉE AVEC IMAGE TOGGLE */
/* ============================= */

.intro-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    align-items: start;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    font-weight: 400;
    text-align: justify;
}

/* ============================= */
/* NOUVEAU SYSTÈME IMAGE TOGGLE */
/* ============================= */

/* Conteneur principal de l'image d'introduction */
.intro-image-container {
    width: 100%;
    max-width: 250px;
    justify-self: start;
    position: relative;
}

/* Wrapper pour l'image avec aspect ratio et bordures */
.intro-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    overflow: hidden;
    background: var(--bg-light);
}

/* Images (species et map) */
.intro-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.intro-image.hidden {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
}

/* ============================= */
/* BOUTON TOGGLE - PROPORTIONNEL À L'IMAGE */
/* ============================= */

.image-toggle-btn {
    position: absolute;
    bottom: 3%; /* Proportionnel à la hauteur de l'image */
    right: 3%; /* Proportionnel à la largeur de l'image */
    width: 11%; /* Proportionnel à la largeur de l'image */
    height: 8.8%; /* Proportionnel à la hauteur de l'image (pour garder un carré sur ratio 4:5) */
    min-width: 20px; /* Taille minimum pour rester cliquable */
    min-height: 20px;
    max-width: 35px; /* Taille maximum pour ne pas être trop gros */
    max-height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-toggle-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.image-toggle-btn:active {
    transform: translateY(0px);
}

/* Icône Font Awesome proportionnelle */
.image-toggle-btn i {
    font-size: 85%; /* Taille plus grosse pour desktop */
    color: var(--text-dark);
    line-height: 1;
}

/* ============================= */
/* RESPONSIVE POUR IMAGE TOGGLE */
/* ============================= */

@media (max-width: 768px) {
    .intro-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .intro-image-container {
        max-width: 100%;
        width: 100%;
        justify-self: center;
        order: -1;
    }

    /* Le bouton s'adapte automatiquement grâce aux pourcentages */
    .image-toggle-btn {
        min-width: 24px; /* Un peu plus grand sur mobile pour être plus facile à cliquer */
        min-height: 24px;
        max-width: 40px;
        max-height: 40px;
    }

    /* Icône plus grosse sur mobile */
    .image-toggle-btn i {
        font-size: 95%; /* Beaucoup plus visible sur mobile */
    }
}

@media (max-width: 480px) {
    .intro-image-container {
        max-width: 100%;
        width: 100%;
    }

    .image-toggle-btn {
        min-width: 26px; /* Encore plus grand sur très petit écran */
        min-height: 26px;
        max-width: 42px;
        max-height: 42px;
    }

    /* Icône encore plus grosse sur très petit écran */
    .image-toggle-btn i {
        font-size: 100%; /* Maximum de visibilité */
    }
}

/* ============================= */
/* ACCORDION SECTIONS - CLEAN STYLE */
/* ============================= */

/* Main Accordion Container */
.accordion-container {
    margin-top: 3rem;
}

/* Individual Accordion Item */
.accordion-item {
    margin-bottom: 2rem;
}

/* Accordion Header */
.accordion-header {
    width: 100%;
    padding: 1rem 0;
    background: none;
    border: none;
    border-bottom: 2px solid var(--border-light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: border-color 0.3s ease;
}

.accordion-header:hover {
    border-bottom-color: var(--primary-green);
}

.accordion-header.active {
    /* No special styling when active */
}

/* Header Content */
.accordion-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

/* Images Badge */
.images-badge {
    background: var(--primary-green);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    margin-right: 1rem;
}

.images-badge i {
    font-size: 0.8rem;
}

.accordion-arrow {
    font-size: 1rem;
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.accordion-header.active .accordion-arrow {
    transform: rotate(180deg);
}

/* Accordion Content */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.15s ease-out;
}

.accordion-content.active {
    max-height: none;
    transition: max-height 0.3s ease-in;
}

.accordion-body {
    padding: 2rem 0;
}

.accordion-body p {
    margin-bottom: 1rem;
    text-align: justify;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
}

/* Sub-sections within accordion - ACCORDIONIZED */
/* CORRECTION: Supprimer le margin-left du conteneur */
.sub-section {
    margin-top: 2.5rem;
    /* SUPPRIMÉ: margin-left: 1.5rem; */
}

/* CORRECTION: Ajouter margin-left uniquement au header */
.sub-section-header {
    width: 100%;
    padding: 0.75rem 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: border-color 0.3s ease;
    text-align: left;
    margin-left: 1.5rem; /* AJOUTÉ: Décalage uniquement du titre */
    gap: 0.75rem;
}

.sub-section-header:hover {
    border-bottom-color: var(--primary-green);
}

.sub-section-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.sub-section-arrow {
    font-size: 0.8rem;
    transition: transform 0.15s ease-out;
    color: var(--text-light);
    flex-shrink: 0;
}

.sub-section-header.active .sub-section-arrow {
    transform: rotate(180deg);
}

.sub-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.15s ease-out;
}

.sub-section-content.active {
    max-height: none;
    transition: max-height 0.3s ease-in;
}

.sub-section-body {
    padding: 1.5rem 0;
}

.sub-section:first-child {
    margin-top: 0;
}

.sub-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    margin-left: 1.5rem;
}

.sub-section h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

/* ============================= */
/* SPECIAL SUBSPECIES SYSTEM */
/* ============================= */

/* Individual Subspecies Accordion */
/* CORRECTION: Supprimer le margin-left du conteneur */
.subspecies-accordion {
    margin-bottom: 1.5rem;
    /* SUPPRIMÉ: margin-left: 1.5rem; */
}

/* CORRECTION: Ajouter margin-left uniquement au header avec double décalage */
.subspecies-header {
    width: 100%;
    padding: 0.5rem 0;
    background: none;
    border: none;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: border-color 0.3s ease;
    text-align: left;
    margin-left: 3rem; /* AJOUTÉ: Double décalage car niveau plus profond */
    gap: 0.75rem;
}

.subspecies-header:hover {
    border-bottom-color: var(--primary-green);
}

.subspecies-header em {
    font-style: italic;
}

.subspecies-arrow {
    font-size: 0.7rem;
    transition: transform 0.15s ease-out;
    color: var(--text-light);
    flex-shrink: 0;
}

.subspecies-header.active .subspecies-arrow {
    transform: rotate(180deg);
}

.subspecies-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.15s ease-out;
}

.subspecies-content.active {
    max-height: none;
    overflow: visible;
    transition: max-height 0.3s ease-in;
}

.subspecies-body {
    padding: 1rem 0;
}

/* ============================= */
/* 5:4 SLIDESHOW GALLERY SYSTEM */
/* ============================= */

.gallery-5-4-slideshow {
    margin: 1.5rem 0;
    position: relative;
    width: 100%;
}

.gallery-5-4-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    width: 100%;
}

.gallery-5-4-slides {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

.gallery-5-4-slide {
    min-width: 100%;
    flex-shrink: 0;
    width: 100%;
}

.gallery-5-4-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    box-sizing: border-box;
}

.gallery-5-4-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.gallery-5-4-image {
    width: 100%;
    aspect-ratio: 5/4;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    display: block;
}

.gallery-5-4-caption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    text-align: left;
    font-style: italic;
    width: 100%;
    box-sizing: border-box;
}

/* NOUVEAU: Global Caption System */
.gallery-5-4-global-caption {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    text-align: left;
    font-style: italic;
    width: 100%;
}

/* NOUVEAU: Individual Caption System - identique au global caption */
.gallery-5-4-individual-caption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    text-align: left;
    font-style: italic;
    width: 100%;
}

/* NOUVEAU: Variant sans bordures */
.gallery-5-4-slideshow.no-borders .gallery-5-4-image {
    border: none;
    border-radius: 4px;
}

/* NOUVEAU: Variant avec légende globale uniquement */
.gallery-5-4-slideshow.global-caption .gallery-5-4-caption {
    display: none;
}

/* Navigation Arrows - NOUVEAU: Flèches noires simples */
.gallery-5-4-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: black;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-5-4-nav:hover {
    opacity: 0.7;
}

.gallery-5-4-prev {
    left: -5px;
}

.gallery-5-4-next {
    right: -5px;
}

/* Dots Indicators - NOUVEAU: Points noirs plus hauts */
.gallery-5-4-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.gallery-5-4-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-5-4-dot.active {
    background: black;
    transform: scale(1.2);
}

.gallery-5-4-dot:hover {
    background: #666;
}

/* Hide navigation if only one slide */
.gallery-5-4-slideshow[data-slides="1"] .gallery-5-4-nav,
.gallery-5-4-slideshow[data-slides="1"] .gallery-5-4-dots {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .gallery-5-4-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-5-4-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .gallery-5-4-prev {
        left: 5px;
    }
    
    .gallery-5-4-next {
        right: 5px;
    }
    
    .gallery-5-4-caption,
    .gallery-5-4-global-caption,
    .gallery-5-4-individual-caption {
    font-size: 0.8rem;
    }
    
    /* NOUVEAU: Plus d'espace pour les dots et légende sur mobile */
    .gallery-5-4-dots {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .gallery-5-4-global-caption {
        margin-top: 1rem;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
    
    .gallery-5-4-container {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-5-4-slideshow {
        margin: 1rem 0 2rem 0;
    }
    
    .gallery-5-4-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .gallery-5-4-grid {
        gap: 1rem;
    }
    
    /* NOUVEAU: Encore plus d'espace sur très petits écrans */
    .gallery-5-4-dots {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .gallery-5-4-global-caption {
        margin-top: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

/* ============================= */
/* REFERENCES SYSTEM STYLING */
/* ============================= */

/* Reference Links in Text - Blue Link Style */
.ref-link {
    display: inline;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: normal;
    vertical-align: super;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ref-link:hover {
    color: #004499;
    text-decoration: underline;
    cursor: pointer;
}

.ref-link:visited {
    color: #551a8b;
}

.ref-link:active {
    color: #ff0000;
}

/* References List */
.references-list {
    list-style: decimal;
    padding-left: 2rem;
    margin-top: 1rem;
}

.references-list li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.references-list li:target,
.ref-highlighted {
    background: #fff3cd;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

/* ============================= */
/* RESPONSIVE DESIGN */
/* ============================= */

@media (max-width: 768px) {
    .species-title-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .species-names h1 {
        font-size: 1.8rem;
    }
    
    .scientific-name {
        font-size: 1.2rem;
    }
    
    .breadcrumb {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .intro-split {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 3rem;
    }
    
    .intro-image {
        max-width: 100%;
        width: 100%;
        justify-self: center;
        order: -1;
    }
    
    .intro-text {
        font-size: 1.1rem;
    }
    
    /* AJOUTÉ: Harmoniser les tailles de texte */
    .accordion-body p {
        font-size: 1.1rem;
    }
    
    .subspecies-body p {
        font-size: 1.1rem;
    }
    
    .sub-section-body p {
        font-size: 1.1rem;
    }
    
    /* Responsive: Réduire les décalages sur mobile */
    .sub-section-header {
        margin-left: 1rem;
        gap: 0.5rem;
    }
    
    .subspecies-header {
        margin-left: 2rem;
        gap: 0.5rem;
    }
    
    .sub-section h4 {
        margin-left: 1rem;
    }
}

@media (max-width: 480px) {
    .species-section {
        padding: 0 0 2rem 0;
    }
    
    .species-title-header {
        padding-top: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .species-names h1 {
        font-size: 1.5rem;
    }
    
    .scientific-name {
        font-size: 1rem;
    }
    
    .breadcrumb {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .intro-image {
        max-width: 100%;
        width: 100%;
    }
    
    .intro-text {
        font-size: 1rem;
    }
    
    /* AJOUTÉ: Harmoniser les tailles de texte */
    .accordion-body p {
        font-size: 1rem;
    }
    
    .subspecies-body p {
        font-size: 1rem;
    }
    
    .sub-section-body p {
        font-size: 1rem;
    }
    
    /* Responsive: Décalages encore plus réduits sur très petits écrans */
    .sub-section-header {
        margin-left: 0.75rem;
        gap: 0.4rem;
    }
    
    .subspecies-header {
        margin-left: 1.5rem;
        gap: 0.4rem;
    }
    
    .sub-section h4 {
        margin-left: 0.75rem;
    }
}

/* ============================= */
/* 2:3 HABITAT GALLERY SYSTEM */
/* ============================= */

.gallery-2-3 {
    margin: 1.5rem 0;
    width: 100%;
}

.gallery-2-3-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
}

.gallery-2-3-item {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.gallery-2-3-image {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    border-radius: 1%;
    display: block;
}

.gallery-2-3-caption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    text-align: left;
    font-style: italic;
}

/* Responsive pour 2:3 Gallery */
@media (max-width: 768px) {
    .gallery-2-3-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .gallery-2-3-caption {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-2-3-grid {
        gap: 1rem;
    }
    
    .gallery-2-3-caption {
        font-size: 0.75rem;
    }
}

/* ============================= */
/* LIGHTBOX SYSTEM - CLEAN DESIGN */
/* ============================= */

/* Images cliquables pour lightbox */
[data-lightbox] {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

[data-lightbox]:hover {
    opacity: 0.9;
}

/* Lightbox overlay - fond noir personnalisé */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0c0c0c; /* Noir moins agressif */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Lightbox content container */
.lightbox-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Main lightbox image */
.lightbox-image {
    max-width: 90vw;
    max-height: calc(100vh - 80px);
    object-fit: contain;
    flex-shrink: 0;
}

/* Close button - simple, sans cercle */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #e0e0e0; /* Gris clair, moins éblouissant */
    font-size: 2rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* Barre du bas - même couleur que le fond */
.lightbox-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: #0c0c0c;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-sizing: border-box;
}

/* Légende */
.lightbox-caption {
    color: #e0e0e0; /* Gris clair */
    font-size: 1.1rem;
    line-height: 1.4;
    flex: 1;
    margin-right: 20px;
}

/* Conteneur droite (compteur + flèches) */
.lightbox-right-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Compteur desktop */
.lightbox-counter-desktop {
    color: #e0e0e0; /* Gris clair */
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Conteneur des flèches côte à côte desktop */
.lightbox-nav-container-desktop {
    display: flex;
    gap: 15px;
}

/* Navigation arrows - simples, sans cercle */
.lightbox-nav {
    background: none;
    border: none;
    color: #e0e0e0; /* Gris clair */
    font-size: 1.5rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.lightbox-nav:hover {
    opacity: 0.7;
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Contrôles mobiles en haut - cachés par défaut */
.lightbox-mobile-top-controls {
    display: none;
}

/* Hide navigation when only one image */
.lightbox-single .lightbox-nav-container,
.lightbox-single .lightbox-nav-container-desktop,
.lightbox-single .lightbox-counter,
.lightbox-single .lightbox-counter-desktop {
    display: none;
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .lightbox-image {
        max-width: 95vw;
        max-height: calc(100vh - 140px); /* Espace pour contrôles haut et bas */
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 1.8rem;
    }
    
    /* Afficher les contrôles mobiles */
    .lightbox-mobile-top-controls {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 10002;
    }
    
    /* Flèches en haut à gauche */
    .lightbox-mobile-top-controls .lightbox-nav-container {
        position: absolute;
        top: 20px;
        left: 20px;
        display: flex;
        gap: 15px;
    }
    
    /* Compteur en haut au centre */
    .lightbox-mobile-top-controls .lightbox-counter {
        position: absolute;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        color: #e0e0e0;
        font-size: 1rem;
        font-weight: 500;
        white-space: nowrap;
    }
    
    /* Cacher les contrôles desktop sur mobile */
    .lightbox-right-controls {
        display: none;
    }
    
    /* Barre du bas uniquement pour la légende */
    .lightbox-bottom-bar {
        height: 80px;
        padding: 15px 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .lightbox-caption {
        font-size: 1rem;
        text-align: center;
        margin: 0;
        flex: none;
    }
    
    .lightbox-nav {
        font-size: 1.4rem;
        padding: 8px;
        /* SUPPRIMÉ: background, border-radius, width, height, display, align-items, justify-content */
    }
}

@media (max-width: 480px) {
    .lightbox-image {
        max-height: calc(100vh - 120px);
    }
    
    .lightbox-close {
        top: 12px;
        right: 12px;
        font-size: 1.6rem;
    }
    
    .lightbox-mobile-top-controls .lightbox-nav-container {
        top: 15px;
        left: 15px;
        gap: 12px;
    }
    
    .lightbox-mobile-top-controls .lightbox-counter {
        top: 15px;
        font-size: 0.9rem;
    }
    
    .lightbox-bottom-bar {
        height: 70px;
        padding: 10px 15px;
    }
    
    .lightbox-caption {
        font-size: 0.9rem;
    }
    
    .lightbox-nav {
        font-size: 1.2rem;
        padding: 6px;
        /* SUPPRIMÉ: width, height */
    }
}

/* ============================= */
/* DISTRIBUTION MAP GALLERY SYSTEM */
/* Galerie spécialisée pour cartes de distribution */
/* ============================= */

.gallery-distribution-map {
    margin: 1.5rem 0;
    width: 100%;
}

/* Conteneur de la carte */
.distribution-map-container {
    width: 100%;
    position: relative;
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* Image de la carte - pleine largeur */
.distribution-map-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Preserve aspect ratio */
    background: white;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.distribution-map-image:hover {
    opacity: 0.95;
}

/* Légende de la carte */
.distribution-map-caption {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.5;
    text-align: left;
    background: white;
    border-top: 1px solid var(--border-light);
}

/* Style pour les éléments italiques (noms scientifiques) */
.distribution-map-caption em {
    font-style: italic;
    color: var(--text-dark);
}

/* ============================= */
/* RESPONSIVE DESIGN */
/* ============================= */

@media (max-width: 768px) {
    .gallery-distribution-map {
        margin: 1.25rem 0;
    }
    
    .distribution-map-caption {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .gallery-distribution-map {
        margin: 1rem 0;
    }
    
    .distribution-map-caption {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}

/* ============================= */
/* LISTES DANS LES ACCORDÉONS - À AJOUTER À species-account.css */
/* ============================= */

/* Listes normales dans les accordéons */
.accordion-body ul {
    list-style-type: disc;
    padding-left: 2rem;
    margin: 1rem 0;
}

.accordion-body ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    font-size: 1.1rem;
    color: var(--text-dark);
    text-align: justify;
}

/* Responsive - même logique que le texte normal */
@media (max-width: 768px) {
    .accordion-body ul li {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .accordion-body ul li {
        font-size: 1rem;
    }
}

/* ============================= */
/* FIX FINAL POUR LES CAPTIONS MOBILE */
/* ============================= */

@media (max-width: 768px) {
    .lightbox-bottom-bar {
        height: auto !important;
        min-height: 80px !important;
    }
    
    .lightbox-caption {
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
        line-height: 1.3 !important;
    }
}

@media (max-width: 480px) {
    .lightbox-bottom-bar {
        height: auto !important;
        min-height: 70px !important;
    }
    
    .lightbox-caption {
        padding: 0 5px !important;
        line-height: 1.2 !important;
    }
}