/* Styles généraux */
.container {
    max-width: 1400px;
    margin: 2em auto;
    padding: 0 1em;
}

body {
    /* On s'assure que le body prend au moins toute la hauteur de l'écran */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.content-wrapper {
    flex-grow: 1;
    /* Permet au contenu principal de "pousser" le footer en bas */
}

.site-footer {
    padding: 2em;
    text-align: center;
    background-color: #f8f9fa;
    /* Une couleur de fond discrète */
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    /* Couleur de texte sobre */
    font-size: 0.9em;
}

.site-footer a {
    color: #555;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.search-section {
    margin-bottom: 2em;
    display: flex;
    justify-content: center;
}

/* Layout principal en 2 colonnes */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.main-content {}

.sidebar {}

/* Grille de vignettes */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.thumbnail {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.thumbnail a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.thumbnail:hover {
    transform: translateY(-5px);
    transition: transform 0.2s ease-in-out;
}

.thumbnail img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.thumbnail-info {
    padding: 10px;
    font-size: 0.9em;
}

.thumbnail-info .species {
    font-weight: bold;
    color: #333;
}

.thumbnail-info .scientific-name {
    font-style: italic;
    font-size: 0.9em;
    color: #666;
}

.pagination-nav {
    margin-top: 2.5em;
    width: 100%;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-link,
.pagination-active,
.pagination-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.pagination-link {
    color: #495057;
    cursor: pointer;
}

.pagination-link:hover {
    background-color: #f1f3f5;
    color: #212529;
}

.pagination-active {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pagination-disabled {
    color: #adb5bd;
    cursor: not-allowed;
}

/* Arbre de classification dans la sidebar */
.sidebar h3 {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5em;
}

.sidebar ul {
    list-style: none;
    padding-left: 15px;
}

.sidebar li a {
    text-decoration: none;
    color: #333;
    display: inline-block;
    padding: 1px 0;
    line-height: 1.1;
}

.sidebar li a:hover {
    color: #007bff;
}

.sidebar .active>a {
    font-weight: bold;
    color: #007bff;
}

.sidebar .rank-phylum {
    font-size: 1em;
    font-weight: 500;
    color: #212529;
}

.sidebar .rank-class {
    font-size: 0.8em;
}

.sidebar .rank-order {
    font-size: 0.7em;
    color: #495057;
}

.sidebar .rank-li-order,
.sidebar .rank-li-class,
.sidebar .rank-li-phylum {
    padding: 0;
    margin-top: -2px;
    margin-bottom: -5px;
}

/* Style pour le bandeau d'information du filtre */
.filter-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    text-align: center;
    margin-bottom: 1em;
    background: #e9ecef;
    padding: 10px 20px;
    border-radius: 8px;
}

.filter-info button {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.filter-info button:hover {
    background: #dc3545;
}

.filter-info button svg {
    width: 12px;
    height: 12px;
}

/* Styles pour la Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.lightbox-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-card img {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    object-fit: contain;
}

.lightbox-info {
    padding-left: 20px;
    color: #333;
}

.lightbox-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5em;
}

.lightbox-info .scientific-name {
    font-style: italic;
    color: #555;
    display: block;
}

.lightbox-info p {
    
    color: #444;
}

.info-line {
    display: flex;
    justify-content: space-between;
    padding-right: 10px;
}

.lightbox-info-right {
    text-align: right;
    margin-top: -25px;
    padding-right: 10px;
}

.lightbox-info strong {
    color: #111;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2.5em;
    cursor: pointer;
    line-height: 1;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    z-index: 2010;
    background: none;
    border: none;
    padding: 0;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2em;
    cursor: pointer;
    z-index: 2020;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

.lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

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

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}