/* ==========================================================================
   ELVIRA RAT EXPLORER — PAGE STYLES
   Earthy brown-rock palette matching the species' habitat
   ========================================================================== */

:root {
    --er-brown: #b45309;
    --er-stone: #78716c;
    --er-rock: #a16207;
    --er-gold: #fbbf24;
    --er-green: #16a34a;
    --er-bg: linear-gradient(135deg, #1c0f06, #1a0e08, #1c0f06);
    --er-bg-light: #2a160b;
    --er-card: rgba(45, 25, 10, 0.6);
    --er-border: rgba(180, 83, 9, 0.2);
    --er-text: #fef3c7;
    --er-sub: rgba(254, 243, 199, 0.72);
    --er-navbar-height: 70px;
}

.light-theme {
    --er-bg: linear-gradient(135deg, #fffbeb, #fef3c7, #fef9c3);
    --er-bg-light: #fef3c7;
    --er-card: rgba(255, 255, 255, 0.88);
    --er-border: rgba(180, 83, 9, 0.18);
    --er-text: #1c0f06;
    --er-sub: rgba(28, 15, 6, 0.72);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.er-main {
    background: var(--er-bg);
    color: var(--er-text);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    padding-top: var(--er-navbar-height);
}

.er-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Section Nav */
.er-section-nav {
    position: sticky;
    top: var(--er-navbar-height);
    z-index: 40;
    background: rgba(28, 15, 6, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--er-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.light-theme .er-section-nav {
    background: rgba(255, 251, 235, 0.92);
}

.er-section-nav-inner {
    display: flex;
    gap: 0.25rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.er-nav-link {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--er-gold);
    text-decoration: none;
    transition: all 0.25s ease;
}

.er-nav-link:hover {
    background: rgba(251, 191, 36, 0.12);
    color: #fff;
}

.er-nav-link.active {
    background: var(--er-brown);
    color: #fff;
}

/* Hero */
.er-hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 1.5rem;
}

.er-hero-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(180, 83, 9, 0.25), transparent 55%),
        radial-gradient(circle at 75% 65%, rgba(161, 98, 7, 0.2), transparent 55%),
        linear-gradient(135deg, #1c0f06 0%, #3a1e0a 50%, #1c0f06 100%);
    z-index: 0;
}

.light-theme .er-hero-backdrop {
    background: radial-gradient(circle at 30% 40%, rgba(180, 83, 9, 0.2), transparent 55%), linear-gradient(135deg, #fffbeb, #fef3c7, #fef9c3);
}

.er-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.hero-kicker {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(180, 83, 9, 0.15);
    border: 1px solid var(--er-brown);
    border-radius: 999px;
    color: var(--er-gold);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 700;
    line-height: 1.05;
    color: #fff;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, var(--er-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--er-sub);
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto 2rem;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 1.5rem;
    background: var(--er-card);
    border: 1px solid var(--er-border);
    border-radius: 14px;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--er-gold);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--er-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections */
.er-section {
    padding: 5rem 0;
}

.er-section-alt {
    background: var(--er-bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(180, 83, 9, 0.12);
    border: 1px solid var(--er-brown);
    color: var(--er-gold);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.75rem);
    color: var(--er-text);
    margin: 0;
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.er-card {
    padding: 1.75rem;
    background: var(--er-card);
    border: 1px solid var(--er-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid var(--er-brown);
}

.er-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(180, 83, 9, 0.25);
}

.er-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--er-gold);
    margin: 0 0 0.75rem;
}

.er-card p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--er-sub);
    margin: 0 0 0.75rem;
}

.er-card p:last-child {
    margin-bottom: 0;
}

/* Taxonomy */
.taxonomy-box {
    max-width: 700px;
    margin: 0 auto 2rem;
    background: var(--er-card);
    border: 1px solid var(--er-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.taxonomy-table {
    width: 100%;
    border-collapse: collapse;
}

.taxonomy-table th,
.taxonomy-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--er-border);
    font-size: 0.95rem;
}

.taxonomy-table th {
    color: var(--er-gold);
    font-weight: 600;
    width: 35%;
}

.taxonomy-table td {
    color: var(--er-text);
}

/* Conservation */
.conservation-status-box {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 2rem;
    background: var(--er-card);
    border: 1px solid var(--er-border);
    border-radius: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.status-badge.endangered {
    background: rgba(185, 28, 28, 0.2);
    border: 1px solid #f87171;
    color: #f87171;
}

.conservation-status-box p {
    color: var(--er-sub);
    line-height: 1.7;
    font-size: 1rem;
}

/* Threats */
.threat-card {
    border-left: 4px solid var(--er-rock);
}

.threat-severity {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.threat-severity.critical {
    background: rgba(185, 28, 28, 0.2);
    color: #f87171;
}

.threat-severity.high {
    background: rgba(180, 83, 9, 0.2);
    color: var(--er-gold);
}

.threat-severity.moderate {
    background: rgba(22, 163, 74, 0.2);
    color: #86efac;
}

/* Facts */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.fact-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: var(--er-card);
    border: 1px solid var(--er-border);
    border-left: 3px solid var(--er-brown);
    border-radius: 14px;
}

.fact-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--er-rock), var(--er-brown));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.fact-card p {
    color: var(--er-sub);
    line-height: 1.6;
    font-size: 0.92rem;
    margin: 0;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.gallery-item {
    background: var(--er-card);
    border: 1px solid var(--er-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-visual {
    height: 130px;
    display: grid;
    place-items: center;
    font-size: 3rem;
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.15), rgba(161, 98, 7, 0.1));
}

.gallery-item figcaption {
    padding: 1rem;
}

.gallery-item strong {
    display: block;
    color: var(--er-gold);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.gallery-item span {
    color: var(--er-sub);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* References */
.references-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reference-item {
    padding: 1.5rem;
    background: var(--er-card);
    border: 1px solid var(--er-border);
    border-left: 3px solid var(--er-rock);
    border-radius: 12px;
}

.reference-item h3 {
    font-size: 1rem;
    color: var(--er-gold);
    margin: 0 0 0.5rem;
}

.reference-item p {
    color: var(--er-sub);
    line-height: 1.65;
    font-size: 0.9rem;
    margin: 0;
}

/* Reveal */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .er-section {
        padding: 3rem 0;
    }

    .er-hero {
        min-height: 80vh;
        padding: 3rem 1rem;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
    }
}
