/* -----------------------------------
   FUENTES Y BASE
----------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500&display=swap');

:root {
    --azul-oscuro: #0f1e3a;
    --gris-texto: #333;
    --blanco: #ffffff;
    --max-width: 1200px;
}

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

body {
    font-family: "Inter", sans-serif;
    background: #f7f9fc;
    color: var(--gris-texto);
    line-height: 1.6;
}

/* -----------------------------------
   HEADER + NAV – FIX FINAL
----------------------------------- */

.site-header {
    width: 100%;
    position: absolute; /* FIX: ya no empuja el contenido */
    top: 0;
    left: 0;
    z-index: 9999;
}

.top-bar {
    width: 100%;
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.55),
        rgba(0,0,0,0.25),
        rgba(0,0,0,0)
    );

    position: relative;
    z-index: 99999;
}

.top-logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.top-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.top-actions {
    min-width: 90px;
    text-align: right;
}

.nav-link {
    font-family: "Playfair Display", serif;
    font-size: 1.3rem;
    text-decoration: none;
    color: #ffffff;
    letter-spacing: 1px;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    opacity: 0.75;
}

/* LOGO – GIRA SOLO AL PRESIONAR */
.logo-animated {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: block;
    transition: transform 0.2s ease-out;
}

.logo-animated:active {
    animation: spin-fast 0.5s linear 1;
}

@keyframes spin-fast {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* -----------------------------------
   HERO
----------------------------------- */

.home-hero {
    width: 100%;
    height: 240px;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.55),
        rgba(0,0,0,0.35),
        rgba(255,255,255,0)
    );
}

.main-title {
    position: absolute;
    bottom: 25px;
    width: 100%;
    text-align: center;
    font-size: 3.2rem;
    font-family: "Playfair Display", serif;
    color: #ffffff;
    text-shadow: 0 4px 12px rgba(0,0,0,0.6);
    z-index: 5;
}

/******************************************************
  GRID DE ESPECIES
******************************************************/
.species-grid {
    width: 92%;
    max-width: 1200px;
    margin: 80px auto 100px auto;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
}

.species-card {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 22px rgba(0,0,0,0.12);
    cursor: pointer;
    transition: transform 0.25s ease;
    text-align: center;
    padding-bottom: 18px;
}

.species-card:hover {
    transform: translateY(-4px);
}

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

.species-card .name {
    margin-top: 15px;
    font-size: 22px;
    font-weight: 600;
    color: #1b2540;
}

.species-card .latin {
    margin-top: 6px;
    font-size: 17px;
    font-style: italic;
    color: #3b4760;
}

/******************************************************
  RESPONSIVE
******************************************************/
@media (max-width: 900px) {
    .species-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-title {
        font-size: 2.6rem;
        letter-spacing: 9px;
    }
}

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

    .species-card img {
        height: 230px;
    }

    .main-title {
        font-size: 2.2rem;
        letter-spacing: 7px;
    }
}

/******************************************************
  FOOTER
******************************************************/
.footer-copy {
    width: 100%;
    padding: 30px 0;
    text-align: center;
    background: #ffffff;
    border-top: 2px solid #000;
    font-size: 18px;
    letter-spacing: 1px;
    color: #1a1a1a;
    margin-top: 80px;
}