/* ENGINE 3A — Species Page CSS */

/* =========================================================
   ENGINE 3A — DESIGN SYSTEM FINAL
   Premium species page system for millions of species
   ========================================================= */

:root {
    --ng-page-bg: #f4f8f5;
    --ng-card-bg: rgba(255,255,255,0.96);
    --ng-soft-bg: #f8fbf8;
    --ng-border: rgba(18,53,31,0.09);
    --ng-text: #102f1e;
    --ng-muted: #65786c;
    --ng-green: #12622e;
    --ng-green-dark: #12351f;

    --ng-container: 1500px;
    --ng-page-pad: 96px;

    --ng-radius-lg: 24px;
    --ng-radius-md: 20px;
    --ng-radius-sm: 14px;

    --ng-shadow-card: 0 12px 34px rgba(13,48,28,0.08);
    --ng-shadow-soft: 0 8px 22px rgba(13,48,28,0.06);

    --ng-gap-lg: 28px;
    --ng-gap-md: 18px;
    --ng-gap-sm: 12px;
}

/* Page */
body {
    background: var(--ng-page-bg) !important;
    color: var(--ng-text) !important;
}

/* Global species containers */
.species-hero-pro,
.ng-species-overview-row,
.ng-species-profile-widget,
.ng-gallery-widget,
.ng-media-row,
.ng-tabs-widget,
.ng-encyclopedia-card,
.ng-related-sources-row,
.ng-related-sources-row + .card {
    max-width: var(--ng-container) !important;
    width: calc(100% - var(--ng-page-pad)) !important;
    box-sizing: border-box !important;
}

/* Hero */
.species-hero-pro {
    margin: 42px auto 0 auto !important;
    border-radius: var(--ng-radius-lg) !important;
    overflow: hidden !important;
}

.species-hero-pro-image {
    height: 430px !important;
    border-radius: var(--ng-radius-lg) var(--ng-radius-lg) 0 0 !important;
}

.species-hero-pro-image img {
    border-radius: var(--ng-radius-lg) var(--ng-radius-lg) 0 0 !important;
}

.species-hero-pro-text {
    left: 54px !important;
    bottom: 56px !important;
    max-width: 720px !important;
}

.species-hero-pro-text h1 {
    font-size: 56px !important;
    line-height: 1 !important;
    letter-spacing: -0.045em !important;
}

.species-hero-pro-text h2 {
    font-size: 28px !important;
}

.species-hero-fact-strip-pro {
    border-radius: 0 0 var(--ng-radius-lg) var(--ng-radius-lg) !important;
    padding: 18px 26px !important;
    gap: 14px !important;
}

.hero-strip-card-pro {
    border-radius: 18px !important;
    min-height: 64px !important;
    box-shadow: none !important;
}

/* Main widgets */
.ng-widget-card,
.ng-species-profile-widget,
.ng-gallery-widget,
.ng-media-row,
.ng-tabs-widget,
.ng-encyclopedia-card,
.ng-related-widget,
.ng-sources-widget,
.ng-related-sources-row + .card {
    background: var(--ng-card-bg) !important;
    border: 1px solid var(--ng-border) !important;
    box-shadow: var(--ng-shadow-card) !important;
}

.ng-species-overview-row {
    margin: 28px auto 28px auto !important;
    padding: 0 !important;
    gap: var(--ng-gap-lg) !important;
    grid-template-columns: minmax(0, 1.75fr) minmax(380px, 0.9fr) !important;
}

.ng-widget-card {
    border-radius: var(--ng-radius-lg) !important;
    padding: 24px !important;
}

.ng-widget-header h2,
.ng-gallery-header h2,
.ng-species-profile-widget h2,
.ng-media-widget h2,
.ng-encyclopedia-card > h2,
.ng-widget-mini-header h2 {
    color: var(--ng-green-dark) !important;
    letter-spacing: -0.025em !important;
}

.ng-widget-header p,
.ng-gallery-header p,
.ng-media-widget p,
.ng-profile-item span,
.ng-map-footer,
.ng-summary-text,
.ng-related-widget p,
.ng-sources-widget li {
    color: var(--ng-muted) !important;
}

/* Species profile */
.ng-species-profile-widget,
.ng-gallery-widget {
    margin: 0 auto !important;
    padding: 32px 36px !important;
    border-radius: var(--ng-radius-lg) !important;
}

.ng-species-profile-grid {
    gap: 14px !important;
}

.ng-profile-item {
    border-radius: 18px !important;
    background: var(--ng-soft-bg) !important;
    border: 1px solid var(--ng-border) !important;
}

/* Gallery */
.ng-gallery-feature {
    border-radius: var(--ng-radius-lg) !important;
    height: 420px !important;
}

.ng-gallery-thumb,
.ng-gallery-more {
    border-radius: 18px !important;
}

.ng-gallery-feature-label {
    border-radius: 16px !important;
}

/* Compact media */
.ng-media-row {
    margin: 0 auto !important;
    padding: 0 36px 32px 36px !important;
    border-radius: var(--ng-radius-lg) !important;
}

.ng-media-widget {
    border-radius: var(--ng-radius-md) !important;
    box-shadow: none !important;
}

/* Tabs */
.ng-tabs-widget {
    margin: 34px auto 0 auto !important;
    padding: 14px 18px 16px 18px !important;
    border-radius: var(--ng-radius-lg) var(--ng-radius-lg) 0 0 !important;
    border-bottom: 0 !important;
    box-shadow: var(--ng-shadow-card) !important;
}

.ng-tabs-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 0 !important;
}

.ng-tabs-nav a {
    background: #f5faf6 !important;
    border: 1px solid var(--ng-border) !important;
    border-radius: 999px !important;
    color: #244634 !important;
    padding: 10px 13px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    line-height: 1 !important;
}

.ng-tabs-nav a.active {
    background: var(--ng-green) !important;
    border-color: var(--ng-green) !important;
    color: white !important;
}

/* Encyclopedia */
.ng-encyclopedia-card {
    margin: 0 auto 0 auto !important;
    padding: 36px !important;
    border-radius: 0 0 var(--ng-radius-lg) var(--ng-radius-lg) !important;
}

.ng-encyclopedia-card .section-nav {
    display: none !important;
}

.ng-encyclopedia-card .species-content-section {
    border-radius: var(--ng-radius-md) !important;
    padding: 28px 32px !important;
    background: linear-gradient(180deg, #fbfdfb 0%, #f7faf7 100%) !important;
    border: 1px solid var(--ng-border) !important;
}

.ng-encyclopedia-card .species-content-section p {
    font-size: 17px !important;
    line-height: 1.78 !important;
    color: #20382a !important;
}

/* Related / sources */
.ng-related-sources-row {
    margin: 28px auto 28px auto !important;
    gap: var(--ng-gap-md) !important;
}

.ng-related-widget,
.ng-sources-widget {
    border-radius: var(--ng-radius-lg) !important;
}

/* Mobile */
@media (max-width: 980px) {
    :root {
        --ng-page-pad: 28px;
    }

    .species-hero-pro {
        margin-top: 24px !important;
    }

    .species-hero-pro-image {
        height: 360px !important;
    }

    .species-hero-pro-text {
        left: 28px !important;
        bottom: 36px !important;
    }

    .species-hero-pro-text h1 {
        font-size: 42px !important;
    }

    .ng-species-overview-row,
    .ng-related-sources-row,
    .ng-media-row {
        grid-template-columns: 1fr !important;
    }

    .ng-species-profile-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .ng-gallery-premium {
        grid-template-columns: 1fr !important;
    }

    .ng-gallery-feature {
        height: 320px !important;
    }
}

@media (max-width: 620px) {
    .ng-species-profile-grid,
    .ng-gallery-thumbs {
        grid-template-columns: 1fr !important;
    }

    .species-hero-fact-strip-pro {
        grid-template-columns: 1fr 1fr !important;
    }

    .ng-widget-card,
    .ng-species-profile-widget,
    .ng-gallery-widget,
    .ng-media-row,
    .ng-encyclopedia-card {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
}


/* ENGINE 2B — Species Browser V2 */

.ng-browser-page {
    max-width: 1500px;
    width: calc(100% - 96px);
    margin: 42px auto 60px auto;
}

.ng-browser-hero {
    background:
        linear-gradient(135deg, rgba(18,98,46,0.94), rgba(18,53,31,0.96)),
        radial-gradient(circle at 85% 20%, rgba(255,255,255,0.16), transparent 30%);
    color: white;
    border-radius: 28px;
    padding: 48px;
    box-shadow: 0 18px 42px rgba(13,48,28,0.16);
}

.ng-browser-hero > span {
    display: inline-block;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    padding: 8px 13px;
    font-weight: 900;
    margin-bottom: 18px;
}

.ng-browser-hero h1 {
    margin: 0;
    font-size: 56px;
    letter-spacing: -0.045em;
    color: white;
}

.ng-browser-hero p {
    max-width: 720px;
    font-size: 18px;
    line-height: 1.55;
    color: rgba(255,255,255,0.82);
}

.ng-browser-search {
    display: flex;
    gap: 12px;
    margin-top: 26px;
    max-width: 850px;
}

.ng-browser-search input {
    flex: 1;
    border: 0;
    border-radius: 16px;
    padding: 17px 18px;
    font-size: 16px;
}

.ng-browser-search button,
.ng-browser-search a {
    border: 0;
    border-radius: 16px;
    padding: 16px 20px;
    background: white;
    color: #12351f;
    font-weight: 900;
    text-decoration: none;
}

.ng-browser-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 26px 0 18px 0;
    color: #12351f;
}

.ng-browser-toolbar strong {
    font-size: 24px;
}

.ng-browser-toolbar span {
    margin-left: 8px;
    color: #65786c;
}

.ng-browser-sort {
    display: flex;
    gap: 8px;
}

.ng-browser-sort a {
    background: white;
    border: 1px solid rgba(18,53,31,0.09);
    border-radius: 999px;
    padding: 10px 14px;
    color: #244634;
    text-decoration: none;
    font-weight: 900;
}

.ng-browser-sort a.active {
    background: #12622e;
    color: white;
}

.ng-species-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.ng-species-card {
    display: block;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(18,53,31,0.09);
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 12px 34px rgba(13,48,28,0.08);
    color: #102f1e;
    transition: transform .18s ease, box-shadow .18s ease;
}

.ng-species-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(13,48,28,0.13);
}

.ng-species-card-media {
    height: 180px;
    background: #f0f6f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ng-species-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ng-species-card-media span {
    font-size: 54px;
}

.ng-species-card-body {
    padding: 20px;
}

.ng-species-card-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ng-species-card-badges span {
    background: #f5faf6;
    border: 1px solid rgba(18,53,31,0.09);
    color: #244634;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 900;
}

.ng-species-card h2 {
    margin: 0 0 7px 0;
    font-size: 22px;
    color: #12351f;
    letter-spacing: -0.02em;
}

.ng-species-card p {
    margin: 0 0 7px 0;
    color: #65786c;
    font-weight: 700;
}

.ng-species-card em {
    color: #12622e;
}

.ng-browser-pagination {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.ng-browser-pagination a {
    background: white;
    border: 1px solid rgba(18,53,31,0.09);
    border-radius: 14px;
    padding: 13px 16px;
    color: #12351f;
    text-decoration: none;
    font-weight: 900;
}

@media (max-width: 1200px) {
    .ng-species-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 850px) {
    .ng-browser-page {
        width: calc(100% - 28px);
    }

    .ng-browser-hero {
        padding: 32px;
    }

    .ng-browser-hero h1 {
        font-size: 42px;
    }

    .ng-browser-search,
    .ng-browser-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ng-species-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .ng-species-card-grid {
        grid-template-columns: 1fr;
    }
}

/* ENGINE 2B — Browser card metadata */

.ng-species-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.ng-species-card-meta span {
    background: #f5faf6;
    border: 1px solid rgba(18,53,31,0.08);
    color: #4d6657;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
}



/* ENGINE 2B — Browser filter pills */

.ng-browser-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 8px 0;
}

.ng-browser-filters a {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(18,53,31,0.09);
    border-radius: 999px;
    padding: 11px 15px;
    color: #244634;
    text-decoration: none;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(13,48,28,0.05);
}

.ng-browser-filters a.active {
    background: #12622e;
    color: white;
    border-color: #12622e;
}


/* ENGINE 2B — Browser filter pills */

.ng-browser-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 8px 0;
}

.ng-browser-filters a {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(18,53,31,0.09);
    border-radius: 999px;
    padding: 11px 15px;
    color: #244634;
    text-decoration: none;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(13,48,28,0.05);
}

.ng-browser-filters a.active {
    background: #12622e;
    color: white;
    border-color: #12622e;
}


/* ENGINE 2B — Load More */

.ng-load-more-btn {
    border: 0;
    border-radius: 16px;
    padding: 15px 22px;
    background: #12622e;
    color: white;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(13,48,28,0.14);
}

.ng-load-more-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* =========================================================
   ENGINE 3B - Premium Species Profile
   ========================================================= */

.ng-species-profile-widget {
    margin-top: 22px;
}

.ng-profile-section {
    margin-bottom: 18px;
}

.ng-profile-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(18,53,31,.08);
    font-size: 1.15rem;
    font-weight: 800;
    color: #163b26;
}

.ng-profile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 16px;
}

.ng-profile-card {
    background: #fbfdfb;
    border: 1px solid rgba(18,53,31,.08);
    border-radius: 18px;
    padding: 18px;
    min-height: 102px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: .18s;
}

.ng-profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,.05);
}

.ng-profile-card span {
    font-size: .82rem;
    color: #70867a;
    margin-bottom: 8px;
}

.ng-profile-card strong {
    font-size: 1.05rem;
    color: #143724;
    line-height: 1.35;
}

@media (max-width: 1400px) {
    .ng-profile-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .ng-profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .ng-profile-grid {
        grid-template-columns: 1fr;
    }
}



/* =========================================================
   NatureGuard Species Top V2
   ========================================================= */

.ng-species-top-v2 {
    margin: 0 0 28px;
}

.ng-top-hero {
    position: relative;
    min-height: 540px;
    overflow: hidden;
    border-radius: 22px;
    background: #18231c;
}

.ng-top-hero-image,
.ng-top-hero-placeholder {
    display: block;
    width: 100%;
    height: 540px;
    object-fit: cover;
}

.ng-top-hero-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.ng-top-hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(0,0,0,0.05) 25%,
            rgba(0,0,0,0.76) 100%
        );
    pointer-events: none;
}

.ng-top-title {
    position: absolute;
    left: 34px;
    right: 34px;
    bottom: 54px;
    z-index: 2;
    color: white;
}

.ng-top-title h1 {
    margin: 6px 0;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1;
}

.ng-top-category {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(0,0,0,0.48);
    font-size: 13px;
    font-weight: 700;
}

.ng-top-secondary {
    margin-top: 8px;
    font-size: 19px;
    opacity: 0.95;
}

.ng-top-latin {
    margin-top: 5px;
    font-size: 16px;
    opacity: 0.82;
}

.ng-top-credit {
    position: absolute;
    left: 18px;
    bottom: 14px;
    z-index: 3;
    max-width: calc(100% - 36px);
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(0,0,0,0.58);
    color: rgba(255,255,255,0.92);
    font-size: 11px;
}

.ng-top-license {
    opacity: 0.76;
}


.ng-top-facts {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ng-top-fact {
    min-height: 78px;
    padding: 13px 15px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    background: white;
    box-shadow: 0 3px 14px rgba(0,0,0,0.05);
}

.ng-top-fact-label {
    display: block;
    margin-bottom: 7px;
    color: #65736a;
    font-size: 12px;
    font-weight: 700;
}

.ng-top-fact strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
}


.ng-top-knowledge {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.ng-top-knowledge-card {
    padding: 16px 18px;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 16px;
    background: white;
    box-shadow: 0 3px 14px rgba(0,0,0,0.04);
}

.ng-top-knowledge-card > span {
    display: block;
    margin-bottom: 7px;
    color: #4c6354;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.ng-top-knowledge-card p {
    margin: 0;
    line-height: 1.55;
}

.ng-top-summary {
    grid-column: 1 / -1;
}


@media (max-width: 760px) {

    .ng-top-hero,
    .ng-top-hero-image,
    .ng-top-hero-placeholder {
        height: 420px;
        min-height: 420px;
    }

    .ng-top-title {
        left: 20px;
        right: 20px;
        bottom: 58px;
    }

    .ng-top-title h1 {
        font-size: 38px;
    }

    .ng-top-knowledge {
        grid-template-columns: 1fr;
    }

    .ng-top-summary {
        grid-column: auto;
    }

    .ng-top-facts {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 430px) {

    .ng-top-hero,
    .ng-top-hero-image,
    .ng-top-hero-placeholder {
        height: 360px;
        min-height: 360px;
    }

    .ng-top-title h1 {
        font-size: 32px;
    }

    .ng-top-secondary {
        font-size: 16px;
    }

}

