/* ============================================
   Plant Species Page - Modern Responsive Styles
   Helenium autumnale (Sneezeweed)
   ============================================ */

:root {
    --primary-color: #1b5e20;
    --secondary-color: #2e7d32;
    --accent-color: #ff6f00;
    --text-color: #2c3e50;
    --light-bg: #f1f8f4;
    --border-color: #b3e5b3;
    --image-border: #4caf50;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --line-height: 1.6;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: #FFC680;
    background-image: url('../images/backgrn1.gif');
    background-attachment: fixed;
    background-size: cover;
    background-repeat: repeat;
    background-position: center;
    min-height: 100vh;
    letter-spacing: 0.3px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(241, 248, 244, 0.9) 0%, rgba(200, 235, 200, 0.82) 100%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../images/backgrn1.gif');
    background-attachment: fixed;
    background-size: cover;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.6;
    pointer-events: none;
    z-index: -2;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 3px solid var(--primary-color);
}

.common-name {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
}

.scientific-name {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--accent-color);
    font-style: italic;
    font-weight: 600;
    margin: var(--spacing-sm) 0;
}

.family {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
}

.nav-link:hover {
    color: var(--accent-color);
    background-color: rgba(46, 125, 50, 0.08);
    transform: translateY(-2px);
}

.nav-separator {
    color: var(--border-color);
    margin: 0 var(--spacing-xs);
}

.footer-nav {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--light-bg);
}

.divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: var(--spacing-lg) 0;
}

.main-content {
    line-height: 1.8;
}

.gallery-section {
    margin-bottom: var(--spacing-lg);
}

.gallery-heading {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.image-item {
    margin: 0;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.04) 0%, rgba(76, 175, 80, 0.04) 100%);
    border: 2px solid var(--image-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.image-item:hover {
    box-shadow: 0 8px 24px rgba(27, 94, 32, 0.15);
    transform: translateY(-4px);
}

.image-link {
    display: block;
    margin-bottom: var(--spacing-md);
    text-decoration: none;
    overflow: hidden;
    border-radius: 4px;
}

.plant-image {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
    cursor: pointer;
}

.image-link:hover .plant-image {
    transform: scale(1.05);
}

figcaption {
    color: var(--text-color);
    font-size: 0.92rem;
    text-align: center;
    font-weight: 500;
    line-height: 1.5;
}

.description-section {
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(100, 200, 100, 0.05) 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    color: var(--primary-color);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--secondary-color);
    border-radius: 50%;
}

.description-section p {
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
    line-height: 1.8;
}

.footer {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    border-top: 2px solid var(--light-bg);
    color: var(--text-color);
    font-size: 0.85rem;
}

.footer-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.skip-to-main {
    position: absolute;
    left: 0;
    top: -40px;
    background: var(--primary-color);
    color: #fff;
    padding: 8px 12px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

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

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
        border-radius: 0;
        margin: 0;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .navigation {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .nav-link {
        padding: var(--spacing-xs) 4px;
    }

    .navigation {
        gap: 2px;
    }

    .description-section {
        padding: var(--spacing-sm);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #81c784;
        --secondary-color: #a5d6a7;
        --text-color: #e0e0e0;
        --light-bg: #2c3e50;
    }

    body {
        background-color: #1a1a1a;
    }

    body::before {
        background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(40, 80, 40, 0.9) 100%);
    }

    .container {
        background: #1e1e1e;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

    .image-item {
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
        border-color: rgba(165, 214, 167, 0.4);
    }

    figcaption,
    .description-section p {
        color: #e0e0e0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-item {
    animation: fadeIn 0.4s ease-in-out;
}

button:focus,
a:focus,
[tabindex]:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}
