/* ============================================
   ESTILOS GLOBAIS E VARIÁVEIS
   ============================================ */

   :root {
    --primary-color: #2d5016;
    --secondary-color: #4a7c2c;
    --accent-color: #e8a537;
    --text-dark: #1a1a1a;
    --text-light: #ffffff;
    --background-light: #f5f5f5;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

/* Foco visível para navegação por teclado */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Skip to main content link (acessibilidade) */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* Reduzir movimento para usuários com preferência */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto; /* Desativa o scroll suave do CSS */
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   CABEÇALHO
   ============================================ */

.header {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.header-image {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.7), rgba(74, 124, 44, 0.7));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-light);
}

.header-overlay h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* ============================================
   NAVEGAÇÃO
   ============================================ */

   .navbar {
    background-color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 1rem 2rem;
    display: block;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background-color: var(--secondary-color);
    color: var(--accent-color);
}

.nav-link:active {
    background-color: var(--accent-color);
    color: var(--text-dark);
}

/* * *** MUDANÇA DE ACESSIBILIDADE AQUI ***
 * Estilo para o link ativo (Scrollspy) agora usa 'aria-current'
 * Isso garante que o estilo visual esteja sincronizado com a semântica.
 */
.nav-link[aria-current="page"] {
    background-color: var(--secondary-color);
    color: var(--accent-color);
    font-weight: 700;
    /* Adiciona uma borda sutil para reforço visual */
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: calc(1rem - 3px); /* Compensa a borda */
}

/* ============================================
   CONTEÚDO PRINCIPAL
   ============================================ */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   SEÇÕES
   ============================================ */

section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

section:last-child {
    border-bottom: none;
}

/* Esta classe .section-title agora é usada no HTML */
.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* ============================================
   SEÇÃO DE INTRODUÇÃO
   ============================================ */

.intro-section {
    background-color: #ffffff;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.05rem;
}

.intro-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* ============================================
   SEÇÃO DE ESPÉCIES
   ============================================ */

.species-section {
    background-color: #ffffff;
}

.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* ============================================
   CARDS DE ESPÉCIES
   ============================================ */

.species-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.species-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: var(--background-light);
}

.animal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.species-card:hover .animal-image {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Esta classe .card-title agora é usada no HTML */
.card-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Esta classe .scientific-name agora é usada no HTML */
.scientific-name {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Esta classe .card-description agora é usada no HTML */
.card-description {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Esta classe .conservation-status agora é usada no HTML */
.conservation-status {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Estas classes de status agora são usadas no HTML */
.status-safe {
    background-color: #d4edda;
    color: #155724;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.status-vulnerable {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.status-endangered {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.learn-more-btn {
    background-color: var(--secondary-color);
    color: var(--text-light);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    align-self: flex-start;
}

.learn-more-btn:hover {
    background-color: var(--primary-color);
    transform: translateX(2px);
}

.learn-more-btn:active {
    background-color: var(--accent-color);
    color: var(--text-dark);
}

.hidden-details {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--background-light);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    display: none;
}

.hidden-details.show {
    display: block;
}

/* ============================================
   SEÇÃO DE PRESERVAÇÃO
   ============================================ */

.preservation-section {
    background-color: #f9f9f9;
}

/* Esta classe .preservation-content agora é usada no HTML */
.preservation-content {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.05rem;
}

.preservation-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.preservation-tips {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.preservation-tips h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.preservation-tips ul {
    list-style-position: inside;
    line-height: 2;
}

.preservation-tips li {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.preservation-tips li:before {
    content: "🌿 ";
    margin-right: 0.5rem;
}



/* ============================================
   RODAPÉ
   ============================================ */

.footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

/* Esta classe .footer-content agora é usada no HTML */
.footer-content p {
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    .header-overlay h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .species-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card-image {
        height: 200px;
    }

    .intro-content,
    .preservation-content {
        font-size: 1rem;
    }

    .preservation-tips {
        padding: 1.5rem;
    }

    /* .contact-form não existe no HTML, mas vou manter caso adicione */
    .contact-form {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-overlay h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .nav-list {
        flex-direction: column;
    }

    .nav-link {
        padding: 0.75rem;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .card-title {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 0 15px;
    }

    section {
        padding: 2rem 0;
    }
}

/* ============================================
   IMPRESSÃO
   ============================================ */

@media print {
    .navbar,
    .footer,
    .learn-more-btn,
    .skip-to-main {
        display: none;
    }

    body {
        background-color: white;
        color: #000;
    }

    .species-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .header-image {
        height: 300px;
    }
}