/* ENCYCLOPEDIA-MENU.CSS - Specific styles for encyclopedia category pages */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Helvetica Neue", Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

/* Page Title Styles - Match encyclopedia section-header h2 */
.page-title {
    font-size: clamp(1.8rem, 3.6vw, 3.15rem);
    font-weight: 700;
    color: #333;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
    text-align: left;
}

@media (max-width: 768px) {
    .page-title {
        margin-bottom: 0.25rem;
    }
}

/* Hero Section */
.hero {
    height: 58vh;
    min-height: 30rem;
    background-size: cover;
    background-position: center 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    color: white;
    max-width: 50rem;
    padding: 0 1.25rem;
    transform: translateY(0rem);
    width: 100%;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    font-weight: 500;
    margin-bottom: 1.5625rem;
    text-shadow: 0.125rem 0.125rem 0.5rem rgba(0, 0, 0, 0.9);
    line-height: 1.2;
    color: white;
    max-width: 50rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-content p {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    margin-bottom: 0;
    opacity: 0.95;
    line-height: 1.5;
    text-shadow: 0.0625rem 0.125rem 0.375rem rgba(0, 0, 0, 0.9);
    max-width: 43.75rem;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

/* Species Section */
.species-section {
    padding: 2rem 0 4rem 0;
    background: #fff;
}

/* Family Section with Introduction - Simplified approach */
.species-section.family-page {
    padding: 6rem 0 4rem 0;
    background: #fff;
}

.species-section.family-page .container {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Mobile and tablet adjustments for family pages */
@media (max-width: 1024px) {
    .species-section.family-page {
        padding: 4rem 0 2rem 0;
    }
    
    .species-section.family-page .container {
        min-height: auto;
        display: block;
    }
}

/* Desktop only - restore centering */
@media (min-width: 1025px) {
    .species-section.family-page .container {
        min-height: 60vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Body layout for sticky footer */
body {
    font-family: "Helvetica Neue", Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

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

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #666;
    padding-left: 0;
}

.breadcrumb a {
    color: #7f9b4d;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

@media (max-width: 21.875rem) {
    .breadcrumb {
        padding: 0;
        font-size: 0.9rem;
    }
}

/* Family Introduction */
.family-introduction {
    text-align: center;
    margin: 3rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.family-introduction h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.family-introduction p {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Species Grid */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
    justify-content: center;
    gap: 2.5rem 3.75rem;
    max-width: 75rem;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    width: 100%;
}

/* Single species grid (for family pages with one species) */
.species-grid.single-species {
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
    grid-template-columns: 1fr;
    min-width: 300px;
}

.species-item {
    text-align: center;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    pointer-events: auto;
}

.species-item:hover {
    text-decoration: none;
    color: inherit;
}

.species-item:hover .species-image img {
    opacity: 0.8 !important;
}

/* Override for coming soon items */
.species-item.coming-soon:hover .species-image img {
    opacity: 1 !important; /* Pas d'effet hover pour coming soon */
}

.species-item-wrapper {
    position: relative;
    text-align: center;
}

/* Species Images */
.species-image {
    width: 100%;
    max-width: 18.75rem;
    height: 12.5rem;
    margin: 0 auto 0.5rem;
    overflow: hidden;
    border-radius: 0.625rem;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.species-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.species-item:hover .species-image img {
    opacity: 0.8;
}

/* Species Info Container (for name + conservation status) */
.species-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.1rem;
}

/* Species Text */
.species-item h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.scientific-name {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #7f9b4d;
    font-style: italic;
    font-weight: 500;
    margin-bottom: 0rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.scientific-name:hover {
    text-decoration: underline;
    color: #6a8240;
}

.species-count {
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Conservation Status Badges */
.conservation-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* IUCN Status Colors */
.status-lc { /* Least Concern */
    background: #374e52;
    color: #f7f7f7;
}

.status-nt { /* Near Threatened */
    background: #374e52;
    color: #f7f7f7;
}

.status-vu { /* Vulnerable */
    background: #e0b336;
    color: #f7fdcb;
}

.status-en { /* Endangered */
    background: #c77324;
    color: #ddc691;
}

.status-cr { /* Critically Endangered */
    background: #8b432c;
    color: #e5ccc7;
}

.status-ew { /* Extinct in the Wild */
    background: #654321;
}

.status-ex { /* Extinct */
    background: #000000;
}

.status-dd { /* Data Deficient */
    background: #888888;
}

/* Footer */
.footer {
    background: #000;
    color: #999;
    padding: 15px 0;
    text-align: center;
    border-top: 1px solid #1a1a1a;
}

.footer p {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.footer a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #7f9b4d;
}

/* Mobile Responsiveness */
@media (max-width: 75rem) {
    .species-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3.75rem 2.5rem;
    }
    
    .species-grid.single-species {
        grid-template-columns: 1fr;
        max-width: 350px;
    }
}

/* Fix pour tablettes 769px-1200px */
@media (min-width: 769px) and (max-width: 1200px) {
    .species-grid.single-species {
        grid-template-columns: 1fr;
        max-width: 400px;
        min-width: 350px;
    }
    
    .species-grid.single-species .species-image {
        max-width: 18.75rem;
        width: 100%;
    }
}

@media (max-width: 48rem) {
    .hero {
        height: 60vh;
        min-height: 25rem;
    }
    
    .hero-content {
        transform: translateY(-0.5rem);
    }
    
    .species-section {
        padding: 1.5rem 0 2.5rem 0;
    }
    
    .species-section.family-page {
        min-height: calc(100vh - 160px);
        padding: 2rem 0;
    }
    
    .species-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 1.25rem 0.625rem;
        width: 100%;
    }
    
    .species-image {
        max-width: 22rem;
        height: 14rem;
    }
    
    .species-item h3 {
        font-size: 1.7rem;
    }
    
    .scientific-name {
        font-size: 1.4rem;
    }
    
    .species-count {
        font-size: 1.1rem;
    }
    
    .family-introduction h2 {
        font-size: 2rem;
    }
    
    .family-introduction p {
        font-size: 1.1rem;
    }
}

@media (max-width: 30rem) {
    .hero-content {
        padding: 0 0.9375rem;
        transform: translateY(-0.5rem);
    }
    
    .species-section {
        padding: 1rem 0 2rem 0;
    }
    
    .species-grid {
        padding: 0.5rem;
        width: 100%;
        margin: 0;
    }
    
    .species-image {
        max-width: 100%;
        width: 100%;
        height: 12.5rem;
    }
    
    .species-item h3 {
        font-size: 1.5rem;
    }
    
    .scientific-name {
        font-size: 1.3rem;
    }
    
    .species-count {
        font-size: 1rem;
    }
    
    .breadcrumb {
        margin-bottom: 1rem;
    }
    
    .family-introduction {
        margin: 2rem 0;
    }
    
    .family-introduction h2 {
        font-size: 1.8rem;
    }
    
    .family-introduction p {
        font-size: 1rem;
    }
}

@media (max-width: 21.875rem) {
    .container {
        padding: 0 1rem;
    }
    
    .species-grid {
        padding: 0.25rem;
        width: 100%;
        margin: 0;
    }
    
    .species-image {
        max-width: 100%;
        width: 100%;
        height: auto;
        aspect-ratio: 3/2;
    }
    
    .breadcrumb {
        padding: 0;
        font-size: 0.9rem;
        margin-left: 0;
    }
    
    .species-item h3 {
        font-size: 1.3rem;
    }
    
    .scientific-name {
        font-size: 1.1rem;
    }
    
    .species-count {
        font-size: 0.95rem;
    }
    
    .family-introduction h2 {
        font-size: 1.5rem;
    }
    
    .family-introduction p {
        font-size: 0.95rem;
    }
}

@media (max-width: 19.5rem) {
    .container {
        padding: 0 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .species-grid {
        padding: 0.25rem;
        margin: 0;
        width: 100%;
    }
    
    .hero-content {
        padding: 0 0.75rem;
    }
    
    .breadcrumb {
        padding: 0;
        margin-left: 0;
    }
    
    .species-item h3 {
        font-size: 1.2rem;
    }
    
    .scientific-name {
        font-size: 1rem;
    }
    
    .species-count {
        font-size: 0.9rem;
    }
}

@media (max-width: 18.625rem) {
    .container {
        padding: 0 0.25rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .species-grid {
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .hero-content {
        padding: 0 0.25rem;
    }
    
    .breadcrumb {
        padding: 0;
        margin-left: 0;
    }
    
    .species-item h3 {
        font-size: 1rem;
    }
    
    .scientific-name {
        font-size: 0.9rem;
    }
    
    .species-count {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .hero {
        background-position: 30% 70%; /* Un peu vers la gauche */
    }
}

@media (max-width: 480px) {
    .hero {
        background-position: 32% 70%; /* Plus vers la gauche */
    }
}

@media (max-width: 320px) {
    .hero {
        background-position: 36% 70%; /* Très à gauche */
    }
}

/* Coming Soon Styles */
.species-item-wrapper.coming-soon .species-item {
    pointer-events: none;
    cursor: default;
}

.species-item.coming-soon .scientific-name {
    color: #999 !important; /* Gris plus clair que #666 */
    font-style: italic;
    cursor: default;
}

.species-item.coming-soon .scientific-name:hover {
    text-decoration: none !important;
    color: #999 !important;
    cursor: default;
}

/* Désactiver aussi le hover sur l'image pour les coming soon */
.species-item.coming-soon:hover .species-image img {
    opacity: 1 !important; /* Pas d'effet hover */
}

/* Optionnel : rendre tout le bloc un peu plus terne */
.species-item.coming-soon {
    opacity: 0.7;
}

.coming-soon-badge {
    display: inline-block !important;
    background: #ccc !important;
    color: white !important;
    padding: 6px 16px !important;
    border-radius: 15px !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-top: 0px !important;
}

@media (min-width: 48.1rem) {
    .species-grid {
        justify-items: center;
    }
}