/* ==========================================================================
   NILGIRI PIPIT EXPLORER — PAGE STYLES
   Scoped under .np-main with page-local custom properties.
   ========================================================================== */

:root {
    --np-green: #4ade80;
    --np-forest: #15803d;
    --np-moss: #65a30d;
    --np-brown: #92400e;
    --np-gold: #fbbf24;
    --np-bg: linear-gradient(135deg, #061a0a, #081f0d, #050f08);
    --np-bg-light: #0a2212;
    --np-card: rgba(14, 40, 22, 0.58);
    --np-border: rgba(74, 222, 128, 0.12);
    --np-text: #edf7ef;
    --np-sub: rgba(237, 247, 239, 0.7);
    --np-navbar-height: 70px;
}

.light-theme {
    --np-bg: linear-gradient(135deg, #f0fdf4, #f7fee7, #ecfdf5);
    --np-bg-light: #f7fee7;
    --np-card: rgba(255, 255, 255, 0.88);
    --np-border: rgba(20, 83, 45, 0.15);
    --np-text: #06210f;
    --np-sub: rgba(6, 33, 15, 0.7);
}

.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;
}

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

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

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

.light-theme .np-section-nav {
    background: rgba(240, 253, 244, 0.92);
}

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

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

.np-nav-link:hover {
    background: rgba(74, 222, 128, 0.12);
    color: #fff;
}

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

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

.np-hero-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(74, 222, 128, 0.18), transparent 55%),
        radial-gradient(circle at 75% 65%, rgba(101, 163, 13, 0.15), transparent 55%),
        linear-gradient(135deg, #04150a, #0a2a14, #04150a);
    z-index: 0;
}

.light-theme .np-hero-backdrop {
    background: radial-gradient(circle at 30% 30%, rgba(74, 222, 128, 0.25), transparent 55%), linear-gradient(135deg, #f0fdf4, #f7fee7, #f0fdf4);
}

.np-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
}

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

.hero-kicker {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid var(--np-green);
    border-radius: 999px;
    color: var(--np-green);
    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(--np-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--np-sub);
    line-height: 1.7;
    max-width: 700px;
    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(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 14px;
}

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

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

/* Sections */
.np-section {
    padding: 5rem 0;
    position: relative;
}

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

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

.section-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid var(--np-green);
    color: var(--np-green);
    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(--np-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;
}

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

.np-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(74, 222, 128, 0.2);
}

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

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

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

/* Taxonomy Table */
.taxonomy-box {
    max-width: 700px;
    margin: 0 auto 2rem;
    background: var(--np-card);
    border: 1px solid var(--np-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(--np-border);
    font-size: 0.95rem;
}

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

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

/* Map */
.map-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin-top: 2rem;
}

.map-wrapper {
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 16px;
    padding: 1rem;
    aspect-ratio: 3/2;
}

.map-svg {
    width: 100%;
    height: 100%;
}

.marker-dot {
    fill: var(--np-green);
    cursor: pointer;
    transition: r 0.2s ease;
}

.marker-dot:hover,
.map-marker:focus .marker-dot {
    r: 11;
    fill: var(--np-gold);
}

.marker-label {
    fill: var(--np-text);
    font-size: 10px;
    font-family: 'Outfit', sans-serif;
}

.map-info {
    padding: 2rem;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 16px;
    min-height: 200px;
}

.map-info h3 {
    font-family: 'Playfair Display', serif;
    color: var(--np-green);
    margin: 0 0 0.75rem;
}

.map-info p {
    color: var(--np-sub);
    line-height: 1.7;
}

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

.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(--np-gold);
}

.threat-severity.moderate {
    background: rgba(101, 163, 13, 0.2);
    color: #a3e635;
}

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

.status-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(180, 83, 9, 0.2);
    border: 1px solid var(--np-gold);
    color: var(--np-gold);
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

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

/* 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(--np-card);
    border: 1px solid var(--np-border);
    border-left: 3px solid var(--np-green);
    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(--np-forest), var(--np-green));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.fact-card p {
    color: var(--np-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(--np-card);
    border: 1px solid var(--np-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(74, 222, 128, 0.12), rgba(101, 163, 13, 0.08));
}

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

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

.gallery-item span {
    color: var(--np-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(--np-card);
    border: 1px solid var(--np-border);
    border-left: 3px solid var(--np-moss);
    border-radius: 12px;
}

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

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

/* Footer */
.np-main .footer {
    background: #04150a;
    border-top: 1px solid var(--np-border);
    padding: 3rem 0 1.5rem;
}

.light-theme .np-main .footer {
    background: #f0fdf4;
}

/* Reveal Animation */
.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) {
    .map-container {
        grid-template-columns: 1fr;
    }

    .np-section {
        padding: 3rem 0;
    }

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

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