/* ENCYCLOPEDIA.CSS - Encyclopedia page specific styles with mobile fixes */

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

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

/* Hero Section */
.hero {
    height: 58vh;
    min-height: 31.25rem;
    background: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.0)), url('../images/encyclopedia/hero.jpg') !important;
    background-size: cover !important;
    background-position: right 70% !important;
    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(-6.25rem);
    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;
}

/* Encyclopedia Section */
.encyclopedia-section {
    padding: 2rem 0 6.25rem 0;
    background: #fff;
}

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

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 0rem;
}

.section-header h2 {
    font-size: clamp(1.8rem, 3.6vw, 3.15rem);
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: #999;
    font-weight: 500;
    margin-top: -0.5rem;
}

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

.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 Images */
.species-image {
    width: 100%;
    max-width: 18.75rem;
    height: 12.5rem;
    margin: 0 auto 1.25rem;
    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 !important;
}

/* 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;
}

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

@media (max-width: 48rem) {
    .hero {
        height: 60vh;
        min-height: 25rem;
    }
    
    .hero-content {
        transform: translateY(-1.875rem);
    }
    
    .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;
    }
    
    .encyclopedia-section {
        padding: 3.75rem 0;
    }
    
    .section-header {
        margin-bottom: 3.125rem;
    }
}

@media (max-width: 30rem) {
    .hero-content {
        padding: 0 0.9375rem;
        transform: translateY(-1.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;
    }
}

@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;
    }
    
    .species-item h3 {
        font-size: 1.3rem;
    }
    
    .scientific-name {
        font-size: 1.1rem;
    }
}

@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;
    }
    
    .species-item h3 {
        font-size: 1.2rem;
    }
    
    .scientific-name {
        font-size: 1rem;
    }
}

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

/* Coming Soon Styles */
.species-item.coming-soon .scientific-name {
   color: #666 !important;
   font-style: italic;
}

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

.species-item.coming-soon:hover .species-image img {
    opacity: 1 !important; /* No hover effect for coming soon */
}

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


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

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

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