* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Fondo por defecto (home, páginas generales) */
    color: #e5e7eb;
}

body.theme-default {
    background: radial-gradient(circle at top left, #064e3b, #020617);
}

/* Bosque templado: verde profundo */
body.theme-bosque {
    background: radial-gradient(circle at top left, #065f46, #020617);
}

/* Selva tropical: verde más intenso y cálido */
body.theme-selva {
    background: radial-gradient(circle at top left, #15803d, #052e16);
}

/* Desierto: tonos arena / naranja */
body.theme-desierto {
    background: radial-gradient(circle at top left, #854d0e, #1f2937);
}

/* Ríos y humedales: azules turquesa */
body.theme-rio {
    background: radial-gradient(circle at top left, #0ea5e9, #020617);
}

/* Medio marino: azul profundo */
body.theme-mar {
    background: radial-gradient(circle at top left, #1d4ed8, #020617);
}

/* Montaña: azul frío + oscuro */
body.theme-montana {
    background: radial-gradient(circle at top left, #414c69, #020617);
}


/* Contenedor general */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Enlaces generales */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* CABECERA */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.98), rgba(21, 128, 61, 0.95));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(15, 118, 110, 0.6);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1rem;
}

.logo {
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* NAV */

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.main-nav a {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(15, 118, 110, 0.15);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.main-nav a:hover {
    background: rgba(15, 118, 110, 0.35);
    border-color: rgba(19, 78, 74, 0.9);
    transform: translateY(-1px);
}

.main-nav a.active {
    background: #22c55e;
    color: #022c22;
    border-color: #bbf7d0;
}

/* ------- NUEVO: login / logout con el MISMO estilo ------- */

/* Empujar nombre+botones hacia la derecha */
.nav-user-name {
    margin-left: auto;          /* este hace que a partir del nombre se vaya todo a la derecha */
    padding: 0.4rem 0.6rem;
    opacity: 0.9;
    white-space: nowrap;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.05);
}

/* Para que el <button> y el <a> de login se vean como los demás chips */
.nav-auth-form {
    margin: 0;
}

.nav-auth-button {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(15, 118, 110, 0.15);
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.nav-auth-button:hover {
    background: rgba(15, 118, 110, 0.35);
    border-color: rgba(19, 78, 74, 0.9);
    transform: translateY(-1px);
}

.nav-auth-logout {
    background: rgba(127, 29, 29, 0.18);
    border-color: rgba(248, 113, 113, 0.6);
}

/* MAIN */

.site-main {
    padding: 2rem 0 3rem;
}

/* Tarjeta genérica para contenido (puedes usarla en tus vistas) */

.content-card {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 1.1rem;
    border: 1px solid rgba(30, 64, 175, 0.4);
    padding: 1.5rem 1.7rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.content-card h1 {
    margin-top: 0;
}

.content-card h2 {
    margin-top: 1.4rem;
    font-size: 1.1rem;
}

.content-card p {
    line-height: 1.6;
    font-size: 0.98rem;
}

/* Listas dentro de la tarjeta */

.content-card ul {
    margin: 0.4rem 0 0.6rem;
    padding-left: 1.2rem;
}

.content-card li {
    margin-bottom: 0.2rem;
}

/* Breadcrumb (ruta tipo Inicio / Guía / Animal) */

.breadcrumb {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.3rem;
}

.breadcrumb a {
    text-decoration: underline;
    text-decoration-style: dotted;
}

/* Meta de la ficha del animal (tipo, dificultad, etc.) */

.animal-meta {
    font-size: 0.88rem;
    opacity: 0.85;
}

/* Botón/enlace para volver atrás */

.back-link {
    margin-top: 1.4rem;
    font-size: 0.9rem;
}

.back-link a {
    color: #a7f3d0;
}

/* FOOTER */

.site-footer {
    background: #020617;
    border-top: 1px solid rgba(15, 23, 42, 1);
    padding: 1.4rem 0 2.2rem;
}

.footer-inner {
    font-size: 0.8rem;
    opacity: 0.75;
}

.footer-note {
    margin-top: 0.3rem;
    max-width: 32rem;
}

/* TIPOGRAFÍA GLOBAL */

h1, h2, h3 {
    color: #f9fafb;
}

p {
    margin-top: 0.4rem;
}

/* Responsive */

@media (max-width: 700px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        justify-content: flex-start;
    }
}

/* ---------- NAV ITEM + MEGA MENÚ ---------- */

.nav-item {
    position: relative;
}

.nav-link {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    background: rgba(15, 118, 110, 0.15);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.nav-link:hover {
    background: rgba(15, 118, 110, 0.35);
    border-color: rgba(19, 78, 74, 0.9);
    transform: translateY(-1px);
}

/* Panel del mega menù */
.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 110%;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 40;
}

/* Mostrar al pasar el ratón o enfocar con teclado */
.has-mega:hover .mega-menu,
.has-mega:focus-within .mega-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mega-inner {
    margin-top: 0.4rem;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 0.9rem;
    border: 1px solid rgba(22, 101, 52, 0.8);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
    padding: 1rem 1.2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    min-width: 540px;
}

.mega-column h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a7f3d0;
}

.mega-grid {
    display: grid;
    gap: 0.4rem;
}

.mega-animal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(15, 23, 42, 1);
    text-decoration: none;
    font-size: 0.9rem;
}

.mega-animal:hover {
    border-color: #22c55e;
    background: rgba(22, 163, 74, 0.2);
}

.mega-animal-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #bbf7d0, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #022c22;
}

.mega-animal-name {
    white-space: nowrap;
}

/* Responsive: el panel se hace columna en móviles */
@media (max-width: 768px) {
    .mega-inner {
        grid-template-columns: 1fr;
        min-width: 0;
    }
}

/* ---------- HOME: HERO ---------- */

.home-page {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.hero-landing {
    position: relative;
    margin-top: 1.5rem;
    border-radius: 1.5rem;
    overflow: hidden;
    min-height: min(520px, 80vh);
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.9), rgba(22, 101, 52, 0.95)),
        /*url('/img/forest-animals.jpg') center / cover no-repeat; /* Puedes cambiar esta imagen */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(74, 222, 128, 0.3), transparent 55%),
        radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.25), transparent 60%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 2rem;
    padding: 2.5rem 2.5rem 2.7rem;
}

.hero-left h1 {
    font-size: clamp(2.1rem, 4vw, 2.7rem);
    line-height: 1.1;
    margin: 0.6rem 0 0.7rem;
}

.hero-subtitle {
    max-width: 32rem;
    font-size: 0.98rem;
    opacity: 0.9;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(134, 239, 172, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-actions {
    margin-top: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.btn-hero-main,
.btn-hero-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
}

.btn-hero-main {
    background: #22c55e;
    color: #022c22;
    border-color: #bbf7d0;
}

.btn-hero-main:hover {
    filter: brightness(1.05);
}

.btn-hero-ghost {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(15, 23, 42, 0.9);
}

.btn-hero-ghost:hover {
    background: rgba(15, 23, 42, 0.7);
}

/* Buscador */

.hero-search {
    margin-top: 1.4rem;
}

.hero-search-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.hero-search-group {
    display: flex;
    align-items: stretch;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.95);
    overflow: hidden;
}

.hero-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.7rem;
    font-size: 0.95rem;
    opacity: 0.8;
}

.hero-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: #e5e7eb;
    padding: 0.45rem 0.3rem;
    font-size: 0.9rem;
}

.hero-search input:focus {
    outline: none;
}

.hero-search button {
    border: none;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: #22c55e;
    color: #022c22;
}

/* Hero derecha */

.hero-right {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.hero-card {
    border-radius: 1rem;
    padding: 1.1rem 1.2rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(15, 23, 42, 1);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.5);
}

.hero-card-main {
    border-radius: 1.1rem;
    padding: 0.95rem 1.1rem;
    border: 1px solid #15803d;
    background: radial-gradient(circle at top left, #16a34a, #022c22);
    box-shadow: 0 18px 40px rgba(22, 163, 74, 0.55);
}

.hero-main-default {
    background: radial-gradient(circle at top left, #16a34a, #022c22);
    border-color: #16a34a;
}

.hero-main-bosque {
    background: radial-gradient(circle at top left, #166534, #022c22);
    border-color: #22c55e;
}

.hero-main-selva {
    background: radial-gradient(circle at top left, #22c55e, #065f46);
    border-color: #22c55e;
}

.hero-main-desierto {
    background: radial-gradient(circle at top left, #facc15, #713f12);
    border-color: #facc15;
    box-shadow: 0 18px 40px rgba(250, 204, 21, 0.45);
}

.hero-main-rio {
    background: radial-gradient(circle at top left, #0ea5e9, #022c3a);
    border-color: #0ea5e9;
    box-shadow: 0 18px 40px rgba(56, 189, 248, 0.45);
}

.hero-main-mar {
    background: radial-gradient(circle at top left, #3b82f6, #1d4ed8);
    border-color: #3b82f6;
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.45);
}

.hero-main-montana {
    background: radial-gradient(circle at top left, #60a5fa, #1e3a8a);
    border-color: #60a5fa;
    box-shadow: 0 18px 40px rgba(96, 165, 250, 0.45);
}

.hero-card-main h2 {
    margin: 0 0 0.2rem;
    font-size: 1.2rem;
}

.hero-card-tag {
    font-size: 0.78rem;
    opacity: 0.8;
    margin-bottom: 0.6rem;
}

.hero-card-text {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.6rem;
}

.hero-card-link {
    font-size: 0.9rem;
    color: #bbf7d0;
}

.hero-card-mini {
    font-size: 0.9rem;
}

.hero-mini-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.2rem;
}

.hero-mini-text {
    font-size: 0.9rem;
}

/* ---------- SECCIONES GENERALES ---------- */

.section-block {
    margin-top: 1rem;
}

.section-header {
    text-align: left;
    margin-bottom: 1.4rem;
}

.section-header h2 {
    margin: 0 0 0.4rem;
    font-size: 1.3rem;
}

.section-header p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.85;
}

/* ---------- CATEGORÍAS ---------- */

.category-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.category-card {
    padding: 1rem 1rem 1.1rem;
    border-radius: 1rem;
    background: #020617;
    border: 1px solid #111827;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    border-color: rgba(34, 197, 94, 0.7);
}

.category-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}

.category-card h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
}

.category-card p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ---------- SABÍAS QUE ---------- */

.section-highlight {
    background: radial-gradient(circle at top left, #064e3b, #020617);
    border-radius: 1.4rem;
    padding: 1.4rem 1.6rem;
    border: 1px solid rgba(22, 163, 74, 0.6);
}

.facts-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    align-items: center;
    justify-content: space-between;
}

.facts-card {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    max-width: 420px;
    border: 1px solid #111827;
}

#fact-text {
    margin: 0 0 0.7rem;
    font-size: 0.95rem;
}

#fact-next {
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: #22c55e;
    color: #022c22;
    cursor: pointer;
}

/* ---------- ANIMALES DESTACADOS ---------- */

.featured-grid {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.featured-card {
    border-radius: 1.2rem;
    overflow: hidden;
    background: #020617;
    border: 1px solid #111827;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.featured-img {
    height: 150px;
    background-size: cover;
    background-position: center;
}

/* Puedes cambiar estas imágenes por reales en /public/img/... */
.featured-img-axolote {
    background-image: linear-gradient(135deg, #22c55e, #0f766e);
}
.featured-img-gecko {
    background-image: linear-gradient(135deg, #4ade80, #22c55e);
}
.featured-img-guacamayo {
    background-image: linear-gradient(135deg, #22c55e, #16a34a);
}

.featured-body {
    padding: 0.9rem 1rem 1.1rem;
}

.featured-tag {
    font-size: 0.8rem;
    opacity: 0.8;
}

.featured-card h3 {
    margin: 0.2rem 0;
    font-size: 1.05rem;
}

.featured-text {
    margin: 0.3rem 0 0.4rem;
    font-size: 0.92rem;
    opacity: 0.9;
}

.featured-meta {
    font-size: 0.8rem;
    opacity: 0.75;
}

.featured-link {
    font-size: 0.9rem;
    color: #bbf7d0;
}

/* ---------- COMPARADOR ---------- */

.section-compare {
    margin-top: 0.5rem;
}

.compare-wrapper {
    display: grid;
    gap: 1rem;
}

.compare-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.compare-select {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.compare-select select {
    background: #020617;
    border-radius: 0.6rem;
    border: 1px solid #111827;
    padding: 0.35rem 0.6rem;
    color: #e5e7eb;
}

.compare-table {
    border-radius: 1rem;
    overflow: hidden;
    background: #020617;
    border: 1px solid #111827;
}

.compare-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    font-size: 0.9rem;
}

.compare-row:nth-child(odd) {
    background: #020617;
}

.compare-row:nth-child(even) {
    background: #030712;
}

.compare-row > div {
    padding: 0.45rem 0.8rem;
}

.compare-label {
    opacity: 0.85;
}

.compare-header-row {
    background: #064e3b;
    font-weight: 600;
}

/* ---------- INFO / CTA FINAL ---------- */

.info-layout {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.92rem;
}

.info-list li + li {
    margin-top: 0.4rem;
}

.section-final-cta {
    margin-bottom: 1.5rem;
}

.final-cta-card {
    border-radius: 1.3rem;
    padding: 1.5rem 1.6rem;
    background: radial-gradient(circle at top left, #22c55e, #065f46);
    color: #022c22;
    text-align: left;
}

.final-cta-card h2 {
    margin-top: 0;
    margin-bottom: 0.4rem;
}

.final-cta-card p {
    margin-top: 0;
    margin-bottom: 0.9rem;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        padding: 2rem 1.6rem 2.2rem;
    }

    .hero-right {
        max-width: 360px;
        margin: 0 auto;
    }

    .info-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hero-landing {
        border-radius: 1rem;
    }

    .facts-layout {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Lista de animales en la guía */

.animal-list-grid {
    list-style: none;
    padding: 0;
    margin: 1.4rem 0 0;
    display: grid;
    gap: 0.9rem;
}

.animal-list-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    background: #020617;
    border-radius: 1rem;
    border: 1px solid #111827;
    padding: 0.8rem 0.95rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.animal-list-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #bbf7d0, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.animal-list-content h2 {
    margin: 0;
    font-size: 1.05rem;
}

.animal-list-content h2 a {
    text-decoration: none;
}

.animal-list-meta {
    margin: 0.1rem 0 0.3rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.animal-list-text {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.animal-list-link {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #a7f3d0;
}

.search-summary {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.search-empty {
    margin-top: 1rem;
    font-size: 0.95rem;
}


/* Animaciones de aparición al hacer scroll */

/* .reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
} */

/* Sin animación*/
.reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
}



/* ---------- PÁGINAS DE BIOMA / HÁBITAT ---------- */

.habitat-hero {
    position: relative;
}

.habitat-hero-top {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
}

.habitat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(22, 163, 74, 0.18);
    border: 1px solid rgba(22, 163, 74, 0.7);
}

.habitat-emoji {
    font-size: 1.1rem;
}

.habitat-hero h1 {
    margin-top: 0.5rem;
    margin-bottom: 0.3rem;
}

.habitat-tagline {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.habitat-meta-block {
    text-align: right;
}

.habitat-meta-label {
    font-size: 0.8rem;
    opacity: 0.75;
    margin: 0;
}

.habitat-meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.2rem 0 0;
}

/* Secciones del bioma */

.habitat-sections {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.habitat-section-card {
    background: #020617;
    border-radius: 1rem;
    border: 1px solid #111827;
    padding: 1rem 1.1rem;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
}

.habitat-section-card h2 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

.habitat-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.3rem;
    align-items: flex-start;
}

.habitat-facts-list {
    flex: 1;
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.95rem;
}

.habitat-facts-list li + li {
    margin-top: 0.4rem;
}

/* Animales del hábitat */

.habitat-animals-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.habitat-animal-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    background: #020617;
    border-radius: 1rem;
    border: 1px solid #111827;
    padding: 0.9rem 1rem;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
}

.habitat-animals-header {
    margin-bottom: 0.6rem;
}

.habitat-animals-footer {
    margin-top: 0.7rem;
}


.habitat-animal-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #bbf7d0, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.habitat-animal-body h3 {
    margin: 0;
    font-size: 1.05rem;
}

.habitat-animal-meta {
    margin: 0.1rem 0 0.3rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.habitat-animal-text {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.habitat-animal-link {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #a7f3d0;
}

@media (max-width: 700px) {
    .habitat-hero-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .habitat-meta-block {
        text-align: left;
    }
}

.breadcrumb {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.breadcrumb a {
    text-decoration: underline;
    text-decoration-style: dotted;
}

.breadcrumb-separator {
    opacity: 0.6;
}

.breadcrumb-current {
    font-weight: 500;
}


/* Perfil climático del bioma */

.habitat-climate {
    background: radial-gradient(circle at top left, #064e3b, #020617);
    border-radius: 1.2rem;
    padding: 1.3rem 1.4rem;
    border: 1px solid rgba(22, 163, 74, 0.7);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.habitat-climate-header h2 {
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.habitat-climate-header p {
    margin: 0 0 0.9rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.habitat-climate-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.climate-card {
    background: rgba(15, 23, 42, 0.96);
    border-radius: 0.9rem;
    border: 1px solid #111827;
    padding: 0.8rem 0.9rem;
}

.climate-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    opacity: 0.75;
    margin: 0 0 0.2rem;
}

.climate-value {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.climate-note {
    margin: 0;
    font-size: 0.82rem;
    opacity: 0.8;
}

.climate-text {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}



/* ---------- BADGE DE DIFICULTAD ---------- */

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.difficulty-easy {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.7);
    color: #bbf7d0;
}

.difficulty-medium {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.8);
    color: #facc15;
}

.difficulty-hard {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.85);
    color: #fecaca;
}



/* ---------- TIMELINE DÍA / NOCHE ---------- */

.habitat-timeline {
    background: #020617;
    border-radius: 1.2rem;
    border: 1px solid #111827;
    padding: 1.2rem 1.3rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.timeline-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
    margin-top: 0.6rem;
}

.timeline-segment {
    position: relative;
    border-radius: 0.9rem;
    padding: 0.8rem 0.9rem;
    overflow: hidden;
}

.timeline-day {
    background: linear-gradient(
        135deg,
        rgba(250, 204, 21, 0.35),   /* amarillo sol */
        rgba(249, 115, 22, 0.25)    /* naranja atardecer */
    );
    border: 1px solid rgba(250, 204, 21, 0.9);
}


.timeline-night {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.3), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.9);
}

.timeline-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    opacity: 0.85;
    margin-bottom: 0.2rem;
}

.timeline-temp {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.timeline-note {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.88;
}



/* ---------- BARRA DE TEMPERATURA MIN / MAX ---------- */

.temp-bar {
    margin-bottom: 0.9rem;
}

.temp-bar-scale {
    position: relative;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
}

.temp-bar-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        #38bdf8 0%,
        #22c55e 40%,
        #facc15 70%,
        #f97316 85%,
        #ef4444 100%
    );
    opacity: 0.35;
}

.temp-bar-range {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.9);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
}

.temp-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    opacity: 0.85;
}



/* ---------- MATRIZ / MAPA DE ANIMALES ---------- */

.matrix-wrapper {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid #111827;
    background: #020617;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.animals-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.animals-matrix thead {
    background: #020617;
}

.animals-matrix th,
.animals-matrix td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #0f172a;
}

.animals-matrix th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

.animals-matrix tbody tr:nth-child(even) {
    background: #020617;
}

.animals-matrix tbody tr:nth-child(odd) {
    background: #030712;
}

.matrix-animal-emoji {
    margin-right: 0.3rem;
}

.matrix-link {
    font-size: 0.85rem;
    color: #a7f3d0;
}



/* ---------- FILTROS DEL MAPA / MATRIZ ---------- */

.matrix-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.9rem;
}

.matrix-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.matrix-filter-group label {
    opacity: 0.8;
}

.matrix-filter-group select {
    background: #020617;
    border-radius: 0.6rem;
    border: 1px solid #111827;
    padding: 0.35rem 0.6rem;
    color: #e5e7eb;
    font-size: 0.85rem;
}

.matrix-filter-button {
    border-radius: 999px;
    border: none;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: #22c55e;
    color: #022c22;
    cursor: pointer;
}

.matrix-filter-button:hover {
    filter: brightness(1.05);
}

@media (max-width: 640px) {
    .matrix-filters {
        align-items: stretch;
    }

    .matrix-filter-button {
        width: 100%;
        text-align: center;
    }
}



/* ---------- HÁBITAT SIMULADO (TERRARIOS / ACUARIOS) ---------- */

.habitat-captive {
    background: #020617;
    border-radius: 1.2rem;
    border: 1px solid #111827;
    padding: 1.3rem 1.4rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.habitat-captive-header h2 {
    margin-top: 0;
    margin-bottom: 0.4rem;
}

.habitat-captive-header p {
    margin: 0 0 0.9rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.habitat-captive-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 0.9rem;
}

.captive-card {
    background: #030712;
    border-radius: 0.9rem;
    border: 1px solid #111827;
    padding: 0.85rem 0.95rem;
}

.captive-card h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.captive-card p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.captive-tips h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 0.98rem;
}

.captive-tips ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

.captive-tips li + li {
    margin-top: 0.3rem;
}



/* Tarjeta para curiosidades ecológicas */

.habitat-facts-card {
    background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.18), #020617);
    border-radius: 1.2rem;
    border: 1px solid #111827;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.habitat-facts-card h2 {
    margin-top: 0;
}

.fact-icon {
    flex-shrink: 0;
    font-size: 1.05rem;
    margin-top: 0.05rem;
}

/* Un pelín más de separación vertical entre secciones de la página de hábitat */

.section-block + .section-block {
    margin-top: 1.4rem;
}



/* Acentos por tema: bordes y brillos en bloques clave de los biomas */

.theme-bosque .habitat-hero,
.theme-bosque .habitat-climate,
.theme-bosque .habitat-captive {
    border-color: rgba(34, 197, 94, 0.8);
}

.theme-selva .habitat-hero,
.theme-selva .habitat-climate,
.theme-selva .habitat-captive {
    border-color: rgba(16, 185, 129, 0.9);
}

.theme-desierto .habitat-hero,
.theme-desierto .habitat-climate,
.theme-desierto .habitat-captive {
    border-color: rgba(234, 179, 8, 0.85);
}

.theme-rio .habitat-hero,
.theme-rio .habitat-climate,
.theme-rio .habitat-captive {
    border-color: rgba(56, 189, 248, 0.9);
}

.theme-mar .habitat-hero,
.theme-mar .habitat-climate,
.theme-mar .habitat-captive {
    border-color: rgba(59, 130, 246, 0.9);
}

.theme-montana .habitat-hero,
.theme-montana .habitat-climate,
.theme-montana .habitat-captive {
    border-color: rgba(96, 165, 250, 0.85);
}



/* Subrayado/acentos en títulos según bioma */

/* BOSQUE */
.theme-bosque .habitat-hero h1,
.theme-bosque .habitat-captive-header h2,
.theme-bosque .animal-hero-card h1,
.theme-bosque .animal-facts-card h2,
.theme-bosque .animal-welfare-card h2,
.theme-bosque .animal-captive-card h2 {
    color: #bbf7d0;
}

/* SELVA */
.theme-selva .habitat-hero h1,
.theme-selva .habitat-captive-header h2,
.theme-selva .animal-hero-card h1,
.theme-selva .animal-facts-card h2,
.theme-selva .animal-welfare-card h2,
.theme-selva .animal-captive-card h2 {
    color: #a7f3d0;
}

/* DESIERTO */
.theme-desierto .habitat-hero h1,
.theme-desierto .habitat-captive-header h2,
.theme-desierto .animal-hero-card h1,
.theme-desierto .animal-facts-card h2,
.theme-desierto .animal-welfare-card h2,
.theme-desierto .animal-captive-card h2 {
    color: #fed7aa;
}

/* RÍO / HUMEDALES */
.theme-rio .habitat-hero h1,
.theme-rio .habitat-captive-header h2,
.theme-rio .animal-hero-card h1,
.theme-rio .animal-facts-card h2,
.theme-rio .animal-welfare-card h2,
.theme-rio .animal-captive-card h2 {
    color: #bae6fd;
}

/* MARINO */
.theme-mar .habitat-hero h1,
.theme-mar .habitat-captive-header h2,
.theme-mar .animal-hero-card h1,
.theme-mar .animal-facts-card h2,
.theme-mar .animal-welfare-card h2,
.theme-mar .animal-captive-card h2 {
    color: #bfdbfe;
}

/* MONTAÑA */
.theme-montana .habitat-hero h1,
.theme-montana .habitat-captive-header h2,
.theme-montana .animal-hero-card h1,
.theme-montana .animal-facts-card h2,
.theme-montana .animal-welfare-card h2,
.theme-montana .animal-captive-card h2 {
    color: #e0f2fe;
}


/* La pill que muestra el emoji + nombre del bioma */

.theme-bosque .habitat-pill { border-color: #22c55e; background: rgba(34,197,94,0.18); }
.theme-selva  .habitat-pill { border-color: #16a34a; background: rgba(22,163,74,0.2); }
.theme-desierto .habitat-pill { border-color: #facc15; background: rgba(250,204,21,0.2); }
.theme-rio .habitat-pill { border-color: #0ea5e9; background: rgba(14,165,233,0.22); }
.theme-mar .habitat-pill { border-color: #3b82f6; background: rgba(59,130,246,0.22); }
.theme-montana .habitat-pill { border-color: #60a5fa; background: rgba(96,165,250,0.22); }


.theme-bosque .content-card { border-color: rgba(34, 197, 94, 0.7); }
.theme-selva  .content-card { border-color: rgba(16, 185, 129, 0.7); }
.theme-desierto .content-card { border-color: rgba(234, 179, 8, 0.7); }
.theme-rio .content-card { border-color: rgba(56, 189, 248, 0.7); }
.theme-mar .content-card { border-color: rgba(59, 130, 246, 0.7); }
.theme-montana .content-card { border-color: rgba(96, 165, 250, 0.7); }



/* ---------- FICHAS DE ANIMALES ---------- */

.animal-page {
    padding: 1.3rem 1.4rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid #111827;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    background: rgba(15, 23, 42, 0.96);
}

.animal-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.animal-icon-wrap {
    flex-shrink: 0;
}

.animal-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: radial-gradient(circle at 30% 20%, #bbf7d0, #16a34a);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5);
}

.animal-header-main h1 {
    margin: 0 0 0.2rem;
}

.animal-scientific {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.animal-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.82rem;
}

.animal-meta-pill {
    border-radius: 999px;
    border: 1px solid #111827;
    padding: 0.18rem 0.55rem;
    background: rgba(15, 23, 42, 0.9);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Contenido principal en tarjetas */

.animal-section-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 0.4rem;
}

.animal-section-card {
    background: #020617;
    border-radius: 0.9rem;
    border: 1px solid #111827;
    padding: 0.85rem 0.95rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.animal-section-card h2 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

.animal-section-card p,
.animal-section-card ul {
    margin: 0;
    font-size: 0.9rem;
}

.animal-section-card ul {
    padding-left: 1.1rem;
}

.animal-section-card li + li {
    margin-top: 0.25rem;
}

@media (max-width: 700px) {
    .animal-header {
        flex-direction: column;
        align-items: flex-start;
    }
}



/* ---------- PÁGINAS DE ANIMALES AL ESTILO BIOMA ---------- */

.animal-hero-card {
    padding: 1.2rem 1.3rem 1.0rem;
    border-radius: 1.2rem;
    border: 1px solid #111827;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    background: #020617;
}

.animal-hero-top {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
}

.animal-hero-left {
    margin-top: 1.5rem;
    margin-left: 2rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.animal-emoji-badge {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: radial-gradient(circle at 30% 20%, #bbf7d0, #16a34a);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.7);
}

.animal-hero-top h1 {
    margin: 0 0 0.2rem;
}

.animal-scientific {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.animal-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.82rem;
}

.animal-meta-pill {
    border-radius: 999px;
    border: 1px solid #111827;
    padding: 0.16rem 0.55rem;
    background: rgba(15, 23, 42, 0.95);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.animal-hero-right {
    max-width: 320px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.animal-tagline {
    margin: 0;
}

/* Bloques principales */

.animal-section-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-top: 0.4rem;
}

.animal-section-card {
    background: #020617;
    border-radius: 0.9rem;
    border: 1px solid #111827;
    padding: 0.85rem 0.95rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.animal-section-card h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.animal-section-card p,
.animal-section-card ul {
    margin: 0;
    font-size: 0.9rem;
}

.animal-section-card ul {
    padding-left: 1.1rem;
}

.animal-section-card li + li {
    margin-top: 0.25rem;
}

/* Curiosidades del animal */

.animal-facts {
    margin-top: 0.9rem;
    border-top: 1px solid #111827;
    padding-top: 0.6rem;
}

.animal-facts h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 0.98rem;
}

.animal-facts ul {
    margin: 0;
    padding-left: 1.1rem;
    list-style: none;
}

.animal-facts li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.animal-facts li + li {
    margin-top: 0.25rem;
}

/* Avisos y cautividad */

.animal-captive-card {
    padding: 1.2rem 1.3rem 1rem;
    border-radius: 1.2rem;
    border: 1px solid #111827;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    background: #020617;
}

.animal-warning {
    margin-bottom: 0.8rem;
    font-size: 0.86rem;
    background: rgba(248, 113, 113, 0.16);
    border: 1px solid rgba(248, 113, 113, 0.7);
    border-radius: 0.7rem;
    padding: 0.55rem 0.7rem;
}

.animal-legal-note {
    margin-top: 0.7rem;
    font-size: 0.83rem;
    opacity: 0.85;
}

@media (max-width: 800px) {
    .animal-hero-top {
        flex-direction: column;
    }

    .animal-hero-right {
        max-width: 100%;
    }
}



/* Ficha rápida en la cabecera del animal */

.animal-hero-right {
    max-width: 320px;
    font-size: 0.9rem;
    opacity: 0.95;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.animal-tagline {
    margin: 0;
}

.animal-stats-card {
    background: #020617;
    border-radius: 0.9rem;
    border: 1px solid #111827;
    padding: 0.55rem 0.7rem;
    font-size: 0.84rem;
}

.animal-stats-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
}

.animal-stats-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.animal-stats-card li + li {
    margin-top: 0.2rem;
}

.stat-label {
    opacity: 0.8;
}

.stat-value {
    float: right;
    font-weight: 500;
}

/* Curiosidades como bloque separado */

.animal-facts-card {
    border-radius: 1.2rem;
    border: 1px solid #111827;
    padding: 1.1rem 1.2rem 0.9rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    background: #020617;
}

.animal-facts {
    margin-top: 0.4rem;
}

.animal-facts ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}


/* ---------- PERFIL DE BIENESTAR DEL ANIMAL ---------- */

.animal-welfare-card {
    border-radius: 1.2rem;
    border: 1px solid #111827;
    padding: 1.1rem 1.2rem 1rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    background: #020617;
}

.welfare-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-top: 0.4rem;
}

.welfare-item {
    background: #030712;
    border-radius: 0.9rem;
    border: 1px solid #111827;
    padding: 0.75rem 0.85rem;
}

.welfare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.welfare-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.welfare-level-pill {
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

/* Barra base */

.welfare-bar {
    position: relative;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        rgba(34, 197, 94, 0.25),
        rgba(250, 204, 21, 0.3),
        rgba(248, 113, 113, 0.3)
    );
    margin-bottom: 0.35rem;
}

.welfare-fill {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
}

/* Niveles (ancho y color) */

.welfare-fill.level-low {
    width: 35%;
    background: rgba(34, 197, 94, 0.9);
}

.welfare-fill.level-medium {
    width: 65%;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.9), rgba(250, 204, 21, 0.9));
}

.welfare-fill.level-high {
    width: 95%;
    background: linear-gradient(90deg, rgba(250, 204, 21, 0.95), rgba(248, 113, 113, 0.95));
}

/* Píldoras de texto a juego */

.welfare-level-pill.level-low {
    border-color: rgba(34, 197, 94, 0.85);
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.welfare-level-pill.level-medium {
    border-color: rgba(250, 204, 21, 0.9);
    background: rgba(250, 204, 21, 0.18);
    color: #facc15;
}

.welfare-level-pill.level-high {
    border-color: rgba(248, 113, 113, 0.9);
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
}

.welfare-note {
    margin: 0;
    font-size: 0.86rem;
    opacity: 0.9;
}



/* Fila de imágenes bajo el hero */

.animal-hero-media-row {
    margin-top: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Cada imagen dentro del hero */

.animal-hero-photo {
    position: relative;
    border-radius: 0.9rem;
    overflow: hidden;
    border: 1px solid #111827;
    width: 230px;              /* ancho fijo */
    aspect-ratio: 1 / 1;       /* 👈 “cubo” (cuadrado) */
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6);
    background: #020617;
}

.animal-hero-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;         /* recorta las muy altas o muy anchas */
    transition: transform 0.25s ease-out;
    cursor: zoom-in;           /* icono de lupa */
}

.animal-hero-photo:hover img {
    transform: scale(1.06);    /* zoom suave al pasar el ratón */
}

@media (max-width: 800px) {
    .animal-hero-media-row {
        justify-content: center;
    }

    .animal-hero-photo {
        width: 100%;
        max-width: 340px;
    }
}


#image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    z-index: 80;
}

#image-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

#image-lightbox img {
    max-width: 75vw;
    max-height: 75vh;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}



/* ---------- FORO (ESTÁTICO POR AHORA) ---------- */

.forum-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 0.6rem;
}

.forum-card {
    background: #020617;
    border-radius: 0.9rem;
    border: 1px solid #111827;
    padding: 0.85rem 0.95rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.forum-card h2 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
}

.forum-card p {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
}

.forum-card ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.86rem;
}

.forum-card li + li {
    margin-top: 0.25rem;
}

.forum-info {
    margin-top: 0.8rem;
    font-size: 0.9rem;
}

.forum-note {
    margin-top: 0.3rem;
    font-size: 0.83rem;
    opacity: 0.9;
}



/* Bloque de imagen en la lista de animales */

.animal-list-media {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 0.8rem;   /* cuadrado con esquinas redondeadas */
    overflow: hidden;
    margin-right: 1rem;
    background: #020617;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imagen cuadrada */

.animal-list-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback si no hay imagen: emoji centrado */

.animal-list-fallback span {
    font-size: 2rem;
}



.thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.7rem;
}

.thread-card {
    background: #020617;
    border-radius: 0.9rem;
    border: 1px solid #111827;
    padding: 0.7rem 0.9rem;
}

.thread-card h2 {
    margin: 0 0 0.1rem;
    font-size: 1rem;
}

.thread-meta {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

.thread-preview {
    margin: 0;
    font-size: 0.88rem;
    opacity: 0.9;
}

.thread-header h1 {
    margin-top: 0;
    margin-bottom: 0.1rem;
}

.thread-body,
.post-body {
    margin-top: 0.4rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.thread-body img,
.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.75rem auto;
    border-radius: 0.5rem;
}


.thread-body p,
.post-body p {
    margin-bottom: 0.35rem;
}

.thread-body ul,
.post-body ul {
    padding-left: 1.1rem;
    margin-bottom: 0.35rem;
}

.thread-divider {
    margin: 1rem 0;
    border-color: #111827;
}

.post-card {
    background: #020617;
    border-radius: 0.7rem;
    border: 1px solid #111827;
    padding: 0.6rem 0.75rem;
    margin-top: 0.5rem;
}

.post-meta {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    opacity: 0.85;
}

.post-body {
    font-size: 0.9rem;
}

.thread-reply {
    margin-top: 1rem;
}

.forum-form .form-group {
    margin-bottom: 0.6rem;
}

.forum-form input[type="text"],
.forum-form textarea {
    width: 100%;
    border-radius: 0.6rem;
    border: 1px solid #111827;
    background: #020617;
    color: #e5e7eb;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
}

.form-error {
    color: #f97316;
    font-size: 0.8rem;
}

.btn-primary {
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    background: #22c55e;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #022c22;
}


.thread-admin-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.thread-admin-actions form {
    display: inline-block;
}

.btn-danger,
.btn-warning,
.btn-green {
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-danger {
    background: #ef4444;
    color: #fee2e2;
}

.btn-warning {
    background: #f97316;
    color: #fffbeb;
}

.btn-green {
    background: #16f921;
    color: #fffbeb;
}


/* ====== PÁGINAS DE LOGIN / REGISTRO ====== */

.auth-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.auth-card {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.auth-form {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-field label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"] {
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 0.55rem 0.75rem;
    background: #020617;
    color: #e5e7eb;
    font: inherit;
}

.form-field input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.form-inline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.checkbox-label input {
    width: 1rem;
    height: 1rem;
}

/* Botón principal (puedes usar el mismo estilo que otros botones verdes) */
.btn-primary {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    border: none;
    background: #22c55e;
    color: #022c22;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.25);
}

.w-full {
    width: 100%;
}

/* Mensajes de error */
.auth-errors {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.6);
    font-size: 0.85rem;
}

.auth-errors ul {
    margin: 0.25rem 0 0;
    padding-left: 1rem;
}

/* Texto de cambio de pantalla */
.auth-switch {
    margin-top: 1.2rem;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.9;
}

.auth-switch a {
    color: #22c55e;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}



/* ====== PÁGINAS DE PERFIL ====== */

.profile-form .form-grid {
    display: grid;
    gap: 1rem;
}

.form-field label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.form-field input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
}

.form-field small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}

.form-error {
    color: #fecaca;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.form-actions {
    margin-top: 1rem;
}

.btn-primary {
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    border: none;
    cursor: pointer;
    background: #22c55e;
    color: #022c22;
    font-weight: 600;
}

.btn-danger {
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    border: 1px solid rgba(248, 113, 113, 0.7);
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
    cursor: pointer;
}

.btn-green {
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    border: 1px solid rgba(113, 248, 120, 0.7);
    background: rgba(29, 127, 34, 0.2);
    color: #d6feca;
    cursor: pointer;
}

.btn-warning {
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    border: 1px solid rgba(248, 190, 113, 0.7);
    background: rgba(127, 85, 29, 0.2);
    color: #fee6ca;
    cursor: pointer;
}

.thread-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.thread-list-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.8);
}

.thread-meta-small {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
}

.danger-zone {
    margin-top: 2rem;
    border-top: 1px solid rgba(127, 29, 29, 0.5);
    padding-top: 1rem;
}


/* Fila con emoji + nombre */
.profile-form .profile-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

/* Campos del formulario en general */
.form-field label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.form-field small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}

/* Campo de nombre: ocupa toda la altura disponible */
.name-field input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

/* Campo de emoji: columna estrecha */
.avatar-field {
    width: 90px; /* puedes subir a 100 si lo quieres más ancho */
}

/* Selector grande con el emoji centrado */
.avatar-select {
    width: 64px;
    height: 64px;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    font-size: 2rem;
    text-align: center;
    padding: 0;          /* sin padding para que el emoji quede centrado */
}

/* Separación del botón respecto al input de nombre */
.form-actions {
    margin-top: 0.5rem;
}


/* --------- Recordarme login ------------ */

.form-remember {
    margin-top: 0.6rem;
    font-size: 0.85rem;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    /* si tu navegador soporta accent-color, quedará del mismo verde */
    accent-color: #22c55e;
}



/* ------- Mapa de animales ------- */



.matrix-map-card {
    background: #020617;
    border-radius: 1rem;
    border: 1px solid #111827;
    padding: 0.8rem 1rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.matrix-map-card h2 {
    margin-top: 0;
    margin-bottom: 0.15rem;
}

.matrix-subtext {
    font-size: 0.88rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

#animals-map {
    width: 100%;
    min-height: 360px;
    max-height: 480px;
    border-radius: 0.8rem;
    overflow: hidden;
}



/* Responsive: en móvil, mapa encima y filtros debajo */
@media (max-width: 900px) {
    .matrix-top-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Proyectos */

.projects-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
}

.projects-filter-label {
    opacity: 0.8;
    margin-right: 0.35rem;
}

.chip {
    position: relative;
    border: none;
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background: radial-gradient(circle at 0 0, rgba(190, 242, 100, 0.18), transparent),
                radial-gradient(circle at 100% 100%, rgba(52, 211, 153, 0.2), transparent),
                rgba(15, 23, 42, 0.95);
    color: #e5f4ff;
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.2);
    transition:
        background 0.18s ease-out,
        transform 0.12s ease-out,
        box-shadow 0.18s ease-out,
        border-color 0.18s ease-out,
        color 0.18s ease-out;
}

.chip:hover {
    transform: translateY(-1px);
    border-color: rgba(74, 222, 128, 0.9);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.7);
    background: radial-gradient(circle at 0 0, rgba(190, 242, 100, 0.3), transparent),
                radial-gradient(circle at 100% 100%, rgba(52, 211, 153, 0.3), transparent),
                rgba(15, 23, 42, 1);
}

.chip:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.7);
}

.chip-active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4), rgba(45, 212, 191, 0.35));
    border-color: rgba(74, 222, 128, 1);
    color: #ecfdf5;
    box-shadow: 0 0 0 1px rgba(21, 128, 61, 0.7), 0 8px 18px rgba(15, 23, 42, 0.85);
}


.projects-feed {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

/* Tira horizontal tipo "news" */
.project-strip {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0.8rem;
    border-radius: 0.9rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.project-strip-thumb img {
    width: 100%;
    height: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 0.7rem;
}

.project-strip-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-strip-title {
    font-size: 1rem;
    margin: 0;
}

.project-strip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.78rem;
    opacity: 0.9;
}

.tag-pill {
    border-radius: 999px;
    padding: 0.05rem 0.55rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.tag-cleanup {
    border-color: rgba(59, 130, 246, 0.9);
}

.tag-fauna {
    border-color: rgba(245, 158, 11, 0.9);
}

.tag-flora {
    border-color: rgba(34, 197, 94, 0.9);
}

.tag-education {
    border-color: rgba(244, 114, 182, 0.9);
}

.project-location {
    opacity: 0.8;
}

.project-strip-excerpt {
    font-size: 0.9rem;
    opacity: 0.95;
}

.project-strip-note {
    font-size: 0.8rem;
    opacity: 0.85;
}

.projects-footer-note {
    margin-top: 1.4rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

@media (max-width: 640px) {
    .project-strip {
        grid-template-columns: 1fr;
    }

    .project-strip-thumb img {
        max-height: 160px;
    }
}


/* ====== FICHAS DE PROYECTOS (DETALLE) ====== */

.project-article {
    padding: 1.3rem 1.4rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid #111827;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    background: rgba(15, 23, 42, 0.96);
}

/* Cabecera tipo ficha de animal pero para proyectos */

.project-article-header {
    display: flex;
    gap: 1.2rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-article-title-block {
    flex: 1.6;
}

.project-article-title-block h1 {
    margin: 0 0 0.3rem;
}

.project-article-title-block p {
    margin: 0;
    font-size: 0.97rem;
    opacity: 0.9;
}

/* Meta a la derecha: país, tipo, tema */

.project-article-meta {
    flex: 1;
    max-width: 260px;
    text-align: right;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.project-meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.95);
    white-space: nowrap;
}

/* Colores según tipo de proyecto */

.project-meta-type {
    border-color: rgba(34, 197, 94, 0.9);
    background: rgba(22, 163, 74, 0.16);
    color: #bbf7d0;
}

.project-meta-theme {
    border-color: rgba(56, 189, 248, 0.9);
    background: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
}

/* Cuerpo: tarjetas tipo animal-section-card pero para secciones del artículo */

.project-section-card {
    background: #020617;
    border-radius: 0.95rem;
    border: 1px solid #111827;
    padding: 0.95rem 1.05rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    margin-top: 0.8rem;
}

.project-section-card h2 {
    margin-top: 0;
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
}

.project-section-card p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-section-card ul {
    margin: 0.3rem 0 0.4rem;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

.project-section-card li + li {
    margin-top: 0.25rem;
}

/* Reutilizamos cards de ayuda dentro de proyectos con un look coherente */

.project-section-card .cards-grid {
    margin-top: 0.4rem;
}

.project-section-card .help-card {
    background: #030712;
    border-radius: 0.85rem;
    border: 1px solid #111827;
    padding: 0.8rem 0.9rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

/* Nota legal / avisos al final del artículo */

.project-legal-note,
.project-strip-note {
    font-size: 0.83rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Enlace "Leer más" o similares dentro de proyectos */

.project-strip-link {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #bbf7d0;
    text-decoration: none;
}

.project-strip-link:hover {
    text-decoration: underline;
}

/* Responsive: cabecera apilada en móvil */

@media (max-width: 800px) {
    .project-article-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-article-meta {
        max-width: 100%;
        text-align: left;
        align-items: flex-start;
    }
}


.project-proposal-form {
    margin-top: 1.2rem;
}

.project-form {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.project-form .form-row {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.project-form .form-field label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.2rem;
    display: block;
}

.project-form input,
.project-form select,
.project-form textarea {
    width: 100%;
    border-radius: 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #020617;
    color: #e5e7eb;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
    font-family: inherit;
}

.project-form input:focus,
.project-form select:focus,
.project-form textarea:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.form-success {
    margin-bottom: 0.7rem;
    padding: 0.5rem 0.7rem;
    border-radius: 0.7rem;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.85);
    font-size: 0.85rem;
}

/* Toggle arriba del listado */

.project-proposal-toggle {
    margin-bottom: 0.5rem;
}

.project-proposal-toggle-btn {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: #bbf7d0;
    cursor: pointer;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    text-align: left;
}

.project-proposal-toggle-btn:hover .project-proposal-toggle-text {
    text-decoration: underline;
    color: #f7e7bb;
}

/* Formulario colapsable */

.project-proposal-form {
    margin-bottom: 0.8rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    transition:
        max-height 0.35s ease,
        opacity 0.25s ease,
        padding 0.25s ease,
        margin 0.25s ease;
}

.project-proposal-form.is-open {
    max-height: 900px; /* suficiente para que quepa todo */
    opacity: 1;
    padding-top: 0.95rem;
    padding-bottom: 1.05rem;
    margin-bottom: 1rem;
}





/* ====== PÁGINA ADMIN: PROPUESTAS DE PROYECTOS ====== */

.admin-proposals-page .admin-proposals-card {
    border-radius: 1.2rem;
    border: 1px solid rgba(248, 250, 252, 0.12);
    background: radial-gradient(circle at top left, #111827, #020617);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
}

.admin-proposals-page .admin-proposals-header h1 {
    margin-bottom: 0.25rem;
}

.admin-proposals-page .admin-proposals-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.admin-proposals-empty {
    margin-top: 0.7rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Tabla */

.admin-proposals-table-wrapper {
    margin-top: 0.9rem;
    border-radius: 1rem;
    border: 1px solid #111827;
    background: #020617;
    overflow: hidden;
    /*box-shadow: 0 18px 40px rgba(230, 118, 118, 0.65);*/
}

.admin-proposals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-proposals-table thead {
    background: linear-gradient(135deg, #022c22, #064e3b);
}

.admin-proposals-table th,
.admin-proposals-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #0f172a;
}

.admin-proposals-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    opacity: 0.9;
}

.admin-proposals-table tbody tr:nth-child(odd) {
    background: #020617;
}

.admin-proposals-table tbody tr:nth-child(even) {
    background: #030712;
}

.admin-proposals-muted {
    opacity: 0.6;
}

/* Tags de categoría */

.admin-proposals-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.9);
}

/* Colores por tipo (coinciden con fauna / flora / limpieza / educación) */
.admin-proposals-tag-fauna {
    border-color: rgba(245, 158, 11, 0.9);
    background: rgba(120, 53, 15, 0.35);
    color: #fed7aa;
}

.admin-proposals-tag-flora {
    border-color: rgba(34, 197, 94, 0.9);
    background: rgba(22, 163, 74, 0.3);
    color: #bbf7d0;
}

.admin-proposals-tag-limpieza {
    border-color: rgba(59, 130, 246, 0.9);
    background: rgba(30, 64, 175, 0.35);
    color: #bfdbfe;
}

.admin-proposals-tag-educacion {
    border-color: rgba(244, 114, 182, 0.9);
    background: rgba(190, 24, 93, 0.35);
    color: #fbcfe8;
}

/* Contacto */

.admin-proposals-contact {
    font-size: 0.82rem;
}

.admin-proposals-contact-name {
    font-weight: 500;
    margin-bottom: 0.1rem;
}

.admin-proposals-contact-email,
.admin-proposals-contact-link {
    color: #a7f3d0;
    text-decoration: none;
}

.admin-proposals-contact-email:hover,
.admin-proposals-contact-link:hover {
    text-decoration: underline;
}

/* Detalles (mensaje) */

.admin-proposals-details {
    font-size: 0.83rem;
}

.admin-proposals-details summary {
    cursor: pointer;
    color: #a7f3d0;
    list-style: none;
}

.admin-proposals-details summary::marker,
.admin-proposals-details summary::-webkit-details-marker {
    display: none;
}

.admin-proposals-details summary::before {
    content: '▼ ';
    font-size: 0.7rem;
    opacity: 0.8;
}

.admin-proposals-details[open] summary::before {
    content: '▲ ';
}

.admin-proposals-details p {
    margin-top: 0.4rem;
    margin-bottom: 0;
    white-space: pre-line;
}

/* Paginación debajo */

.admin-proposals-pagination {
    margin-top: 0.8rem;
    font-size: 0.85rem;
}

/* Responsive */

@media (max-width: 800px) {
    .admin-proposals-table-wrapper {
        overflow-x: auto;
    }

    .admin-proposals-table {
        min-width: 720px; /* para que no se rompa la tabla */
    }
}


.project-article-header {
    margin-top: 2.5rem;
    margin-bottom: 3.5rem;
}
.project-article .project-section-card {
    margin-top: 0.9rem;
    margin-bottom: 1rem;
}
.project-article .project-section-card:first-of-type {
    margin-top: 1.6rem;
    margin-bottom: 1.6rem;
}



/* ---------- MENÚ RESPONSIVE ---------- */

/* Botón hamburguesa: oculto en escritorio */
.nav-toggle {
    display: none;
    border: none;
    background: transparent;
    padding: 0.25rem;
    margin-left: auto;
    cursor: pointer;
}

/* Líneas de la hamburguesa */
.nav-toggle-line {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: #e5e7eb;
    transition:
        transform 0.2s ease-out,
        opacity 0.2s ease-out,
        background 0.2s ease-out;
}


.nav-toggle-line + .nav-toggle-line {
    margin-top: 4px;
}

/* Estado "X" cuando el menú está abierto */
.nav-toggle.is-open .nav-toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open .nav-toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}
@media (max-width: 700px) {
    .site-header .container {
        padding-inline: 1.1rem;
    }

    .header-inner {
        display: flex;               /* aseguramos flex */
        flex-direction: row;         /* en fila, no columna */
        align-items: center;
        justify-content: space-between; /* nombre izq, hamburguesa dcha */
        flex-wrap: wrap;             /* para que el nav pueda bajar */
    }

    /* Mostrar el botón hamburguesa en móvil */
    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        margin-left: 0;              /* por si tiene margin-left:auto en desktop */
    }

    /* El nav ocupa la fila siguiente */
    .main-nav {
        width: 100%;
        flex-basis: 100%;            /* fuerza a ir a la siguiente línea */
        order: 2;                    /* se coloca después del logo+hamburguesa */

        margin-top: 0.5rem;
        flex-direction: column;
        gap: 0.35rem;
        background: rgba(15, 23, 42, 0.98);
        border-radius: 0.9rem;
        padding: 0 0.75rem;
        border: 1px solid rgba(15, 23, 42, 1);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);

        max-height: 0;
        opacity: 0;
        transform: translateY(-6px);
        overflow: hidden;
        pointer-events: none;
        transition:
            max-height 0.22s ease-out,
            opacity 0.22s ease-out,
            transform 0.22s ease-out,
            padding-top 0.22s ease-out,
            padding-bottom 0.22s ease-out;
    }

    .main-nav.nav-open {
        max-height: 500px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .main-nav a,
    .nav-auth-button,
    .nav-user-name {
        width: 100%;
        justify-content: flex-start;
    }

    .main-nav a {
        text-align: left;
    }

    .nav-user-name {
        margin-left: 0;
    }
}




/* ====== PÁGINA 404 PERSONALIZADA ====== */

.error-page {
    padding: 1.6rem 1.8rem 1.4rem;
}

.error-header {
    text-align: left;
    margin-bottom: 1.2rem;
}

.error-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(34, 197, 94, 0.7);
    color: #bbf7d0;
    margin-bottom: 0.45rem;
}

.error-layout {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: flex-start;
}

.error-main p {
    font-size: 0.95rem;
    opacity: 0.9;
}

.error-list {
    margin: 0.5rem 0 0.9rem;
    padding-left: 1.15rem;
    font-size: 0.9rem;
}

.error-list li + li {
    margin-top: 0.25rem;
}

.error-list a {
    color: #a7f3d0;
    text-decoration: underline;
    text-decoration-style: dotted;
}

/* Lado derecho con ilustración */
.error-aside {
    display: flex;
    justify-content: flex-end;
}

.error-illustration {
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.3), #020617);
    border-radius: 1.1rem;
    border: 1px solid rgba(16, 185, 129, 0.7);
    padding: 0.9rem 1rem;
    max-width: 260px;
    text-align: center;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.error-emoji {
    font-size: 2.1rem;
    margin-bottom: 0.4rem;
}

.error-note {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Botones en la 404, reutilizando estilos de hero */
.error-actions {
    margin-top: 0.7rem;
}

/* Responsive: en móvil que se ponga todo en columna */
@media (max-width: 800px) {
    .error-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .error-aside {
        justify-content: flex-start;
    }

    .error-illustration {
        max-width: 100%;
    }
}


/* ==== PÁGINAS DE ERROR (404, 500, etc.) ==== */

.error-page {
    max-width: 800px;
    margin: 2rem auto 0;
}

.error-card {
    text-align: left;
}

.error-header {
    margin-bottom: 1rem;
}

.error-code {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(248, 113, 113, 0.16);
    border: 1px solid rgba(248, 113, 113, 0.8);
    color: #fecaca;
    margin-bottom: 0.4rem;
}

.error-list {
    margin: 0.6rem 0 1.1rem;
    padding-left: 1.2rem;
    font-size: 0.9rem;
}

.error-actions {
    margin-top: 0.4rem;
}

.error-debug-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.8;
}


/* ---------- BANNER DE COOKIES ---------- */

.cookie-banner {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 70;
    pointer-events: none; /* hasta que se muestre */
    transform: translateY(100%);
    opacity: 0;
    transition:
        transform 0.28s ease-out,
        opacity 0.28s ease-out;
}

.cookie-banner-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-inner {
    margin-bottom: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(6, 95, 70, 0.96));
    border: 1px solid rgba(34, 197, 94, 0.7);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.cookie-text {
    max-width: 640px;
}

.cookie-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.cookie-links {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    opacity: 0.9;
}

.cookie-links a {
    color: #bbf7d0;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.cookie-btn {
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition:
        background 0.15s ease-out,
        transform 0.1s ease-out,
        box-shadow 0.15s ease-out,
        border-color 0.15s ease-out;
}

.cookie-btn-primary {
    background: #22c55e;
    color: #022c22;
    border-color: #bbf7d0;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.35);
}

.cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.45);
}

.cookie-btn-secondary {
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.7);
}

.cookie-btn-secondary:hover {
    background: rgba(15, 23, 42, 1);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.8);
}

@media (max-width: 640px) {
    .cookie-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-actions {
        width: 100%;
        justify-content: flex-start;
    }
}


/* ----  Boton mas guia animales ---- */

/* Lista de la guía de animales */
.animal-list-item {
    list-style: none;
}

/* Ocultar los elementos extra hasta que se pulse "Ver más" */
.animal-hidden {
    display: none !important;
}

.load-more-wrapper {
    margin-top: 1.5rem;
    text-align: center;
}

#btn-load-more.btn-disabled {
    opacity: 0.5;
    cursor: default;
}




/* --- Mejora hero de portada en móvil --- */
@media (max-width: 640px) {

    /* Bloque principal del hero (la “tarjeta” verde grande) */
    .home-hero,
    .hero-card,
    .hero-section-main {
        padding: 1.75rem 1.25rem;
        border-radius: 1.5rem;
    }

    /* Etiqueta "NUEVO · GUÍA..." y texto pequeño */
    .home-hero .hero-eyebrow,
    .home-hero small {
        font-size: 0.8rem;
    }

    /* Título principal */
    .home-hero h1 {
        font-size: 1.9rem;
        line-height: 1.2;
        margin-bottom: 0.9rem;
    }

    /* Párrafo descriptivo */
    .home-hero p {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    /* CTA principal ("Explorar especies") */
    .home-hero .hero-cta {
        width: 100%;
        justify-content: center;
        text-align: center;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    /* Margen inferior para que no quede pegado al siguiente bloque */
    .home-hero + .hero-search {
        margin-top: 1.25rem;
    }
}


/* Buscador responsive */
@media (max-width: 640px) {
    .hero-search {
        margin-top: 1.25rem;
    }

    .hero-search-group {
        display: flex;
        /*flex-direction: column;
        align-items: stretch;*/
        gap: 0.5rem;
    }

    .hero-search-group input {
        width: 100%;
        box-sizing: border-box;
    }

    .hero-search-group button {
        width: 30%;
        box-sizing: border-box;
    }

    .hero-search-label {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
}


/* ----- Noticias -----*/


.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-card {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}

.news-card-media img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.75rem;
}

.news-card-body h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.news-card-meta {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 0.35rem;
}

.news-card-excerpt {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.news-card-link {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Detalle */
.news-detail-figure img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 1.1rem;
    margin-bottom: 1.25rem;
}

.news-detail-body p + p {
    margin-top: 0.75rem;
}

.news-detail-source {
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

.news-list-item {
    /* ya tienen .news-card, pero por si acaso */
}

.news-hidden {
    display: none !important;
}

.load-more-wrapper {
    margin-top: 1.5rem;
    text-align: center;
}

#btn-load-more-news.btn-disabled {
    opacity: 0.5;
    cursor: default;
}


.recommended-news-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.news-card.news-card-small {
    flex: 1 1 260px;
}

.news-card.news-card-small .news-card-media img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 0.9rem;
}

.news-card.news-card-small h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}


.recommended-news-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.news-card.news-card-small {
    flex: 1 1 260px;
}

/* ----- Noticias home ----- */

/* Tarjeta de noticia en la home */
.news-home-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* CONTENEDOR de la imagen: altura fija + recorte */
.news-home-thumb {
    width: 100%;
    height: 170px;          /* 👉 prueba 150–190 según lo que te guste */
    border-radius: 0.9rem;
    overflow: hidden;
    margin-bottom: 0.35rem;
    background: #020617;    /* por si tarda en cargar */
}

/* IMAGEN dentro del contenedor:
   rellena el hueco y se recorta si sobra */
.news-home-thumb img {
    width: 100%;
    height: 100% !important;   /* fuerza altura */
    object-fit: cover;         /* recorte bonito */
    display: block;
}

/* Cuando no hay imagen, mostramos un bloque oscuro con icono */
.news-home-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #020617;
    font-size: 1.8rem;
}

/* Textos */
.news-home-meta {
    font-size: 0.8rem;
    opacity: 0.8;
}

.news-home-excerpt {
    font-size: 0.9rem;
}

.news-home-link {
    margin-top: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
}
