/* --- Variables --- */
:root {
    --primary-green: #2c5f2d;
    --secondary-green: #97bc62;
    --accent-brown: #9F7D4F;
    --bg-light: #f4f7f6;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-light: #ffffff;
    --font-main: 'Roboto', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* --- Global --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.playfair-font { font-family: var(--font-serif); }
.hidden { display: none !important; }

/* --- Header --- */
header {
    background-color: var(--primary-green);
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-serif);
    display: flex;
    align-items: center;
    /* FIX: Increase letter spacing for the logo text to prevent visual overlap of 'oo' */
    letter-spacing: 0.05em;
}

.logo-img {
    height: 60px; /* Adjust based on your logo preference */
    width: auto;
    margin-right: 15px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--secondary-green);
    border-bottom: 2px solid var(--secondary-green);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    /* Updated with Great Grey Owl Image */
    background: url('https://www.allaboutbirds.org/guide/assets/og/75362591-1200px.jpg');
    background-size: cover;
    background-position: center 20%;
    color: white;
    text-align: center;
    padding: 100px 20px;
    margin-bottom: 40px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark overlay to make text readable */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Darker tint for better contrast */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(44, 95, 45, 0.8); /* Semi-transparent green box behind text */
    padding: 30px;
    border-radius: 10px;
}

.hero h1 { font-size: 3rem; margin-bottom: 20px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.mission-text { font-size: 1.2rem; margin-bottom: 30px; }
.cta-button {
    background-color: var(--secondary-green);
    color: var(--primary-green);
    padding: 12px 30px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    transition: background 0.3s;
    display: inline-block;
}
.cta-button:hover { background-color: var(--text-light); }

/* --- Content Sections --- */
.content-section {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 40px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.section-title {
    text-align: center;
    color: var(--primary-green);
    margin-bottom: 10px;
}
.section-subtitle { text-align: center; margin-bottom: 30px; color: #666; }

/* --- Trails Section --- */
.trails-section .section-title {
    margin-bottom: 12px;
}

.trails-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-intro {
    max-width: 720px;
    margin: 0 auto;
    color: #4f5b52;
    font-size: 1.05rem;
    line-height: 1.6;
}

.trails-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.1fr);
    gap: 28px;
    color: #203427;
    align-items: center;
    border: 1px solid #e2efe4;
    box-shadow: 0 20px 45px rgba(32, 52, 39, 0.12);
    position: relative;
    overflow: hidden;
}

.trails-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(151, 188, 98, 0.18), transparent 55%);
    pointer-events: none;
}

.trails-map {
    background: #f7faf8;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(47, 93, 51, 0.12);
    box-shadow: 0 10px 24px rgba(47, 93, 51, 0.12);
}

.trails-map iframe,
.trails-map img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.trails-map iframe {
    aspect-ratio: 16 / 10;
    height: 320px;
    border: 0;
}

.trails-map-label {
    display: inline-block;
    margin-top: 12px;
    font-weight: 700;
    color: #1e401f;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.trails-details {
    position: relative;
    z-index: 1;
}

.trails-details h2 {
    margin-bottom: 12px;
    font-size: 2rem;
}

.trails-details p {
    margin-bottom: 16px;
    color: #3a4a40;
}

.trails-details ul {
    list-style: none;
    padding: 0;
}

.trails-details li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    color: #2b3a31;
}

.trails-details li::before {
    content: "•";
    color: #78a968;
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 2px;
}

.trail-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    margin-right: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #eaf3ec;
    color: #1e401f;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #d2e3d5;
    box-shadow: 0 6px 14px rgba(24, 45, 30, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.trail-search:hover,
.trail-search:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(24, 45, 30, 0.18);
    background: #ffffff;
}

.trails-grid {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 26px;
}

.trail-mini-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e1eee2;
    box-shadow: 0 12px 30px rgba(47, 93, 51, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trail-mini-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(47, 93, 51, 0.18);
}

.trail-mini-card .trails-map {
    margin-bottom: 14px;
    padding: 12px;
}

.trail-mini-card .trails-map iframe {
    height: 190px;
}

.trail-mini-card h3 {
    margin-bottom: 10px;
    color: var(--primary-green);
}

.trail-mini-card p {
    margin-bottom: 12px;
    color: #4f5b52;
}

.trail-mini-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #2c3b31;
}

.trail-mini-card li {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.trail-mini-card li::before {
    content: "•";
    color: #5a8660;
    font-weight: 700;
}

.trail-mini-card .trail-search {
    background: var(--primary-green);
    color: #ffffff;
    margin-top: 14px;
    border-color: transparent;
}

@media (max-width: 900px) {
    .trails-card {
        grid-template-columns: 1fr;
    }
}

/* --- Slideshow --- */
.slideshow-container {
    position: relative;
    max-width: 800px;
    margin: auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.bird-slide {
    display: none; /* Hidden by default */
    text-align: center;
    position: relative;
}

/* Make images fill the slide nicely */
.bird-slide img {
    width: 100%;
    height: 400px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
}

.slide-content {
    background: var(--primary-green);
    color: white;
    padding: 20px;
    text-align: left;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 40%; /* Moved up slightly to be over image */
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    background-color: rgba(0,0,0,0.3);
    user-select: none;
    border-radius: 3px;
}
.next { right: 0; }
.prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); }

.dots-container { text-align: center; margin-top: 15px; }
.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 4px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}
.dot.active, .dot:hover { background-color: var(--primary-green); }

.catalogue-cta {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.btn-secondary {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-green);
    font-weight: bold;
    text-decoration: none;
    border: 2px solid var(--primary-green);
    padding: 8px 20px;
    border-radius: 20px;
    transition: 0.3s;
}
.btn-secondary:hover { background: var(--primary-green); color: white; }

/* --- Certificates Page --- */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}
.step-box {
    border: 1px solid #ddd;
    padding: 25px;
    border-radius: 8px;
    background: var(--bg-light);
}
.certificate-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.cert-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}
.cert-btn:hover { background: var(--secondary-green); color: var(--text-dark); }

.input-group { margin: 15px 0; display: flex; flex-direction: column; }
.input-group label { font-weight: bold; margin-bottom: 5px; }
.input-group input, .input-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}
.error-msg { color: red; font-weight: bold; margin: 10px 0; }

.canvas-container {
    text-align: center;
}

#certificate-canvas {
    max-width: 100%;
    height: auto;
    /* Removed simple border, the canvas draws it now */
    margin-top: 20px;
    display: block;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* Download Button Styles */
.download-container {
    text-align: center;
    margin-top: 20px;
}
.btn-download {
    background-color: #D4AF37; /* Gold */
    color: #333;
    padding: 15px 35px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: all 0.3s;
}
.btn-download:hover {
    background-color: #bfa141;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* --- About Page --- */
.about-grid {
    /* Adjusted for text-only layout */
    display: grid;
    grid-template-columns: 1fr; 
    gap: 40px;
    align-items: center;
}

.executive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.exec-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 5px solid var(--accent-brown);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.exec-card .role { font-size: 0.85rem; color: #666; font-weight: bold; text-transform: uppercase; margin-bottom: 5px; }
.exec-card .name { font-size: 1.15rem; color: var(--primary-green); font-weight: 700; }

/* --- Catalogue Page --- */
#catalogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    padding-top: 20px;
}

.bird-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    border-bottom: 4px solid var(--secondary-green);
    cursor: pointer;
}
.bird-card:hover { transform: translateY(-5px); }
.bird-card:focus-visible {
    outline: 3px solid var(--secondary-green);
    outline-offset: 4px;
}

.bird-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.bird-card-info { padding: 15px; }
.bird-card-title {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--primary-green);
    font-size: 1.2rem;
    margin-bottom: 5px;
}
.bird-card-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}
.bird-card-desc { font-size: 0.9rem; line-height: 1.4; }

.bird-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}
.bird-modal.is-open {
    display: block;
}
.bird-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 30, 19, 0.75);
}
.bird-modal__content {
    position: relative;
    margin: 5vh auto;
    max-width: 920px;
    width: min(90vw, 920px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}
.bird-modal__media {
    background: #eef1ea;
}
.bird-modal__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bird-modal__details {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bird-modal__title {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--primary-green);
    margin: 0;
}
.bird-modal__scientific {
    font-style: italic;
    color: #4a4a4a;
    margin: 0;
}
.bird-modal__meta {
    display: flex;
    gap: 12px;
    font-weight: 600;
    color: #1e401f;
    flex-wrap: wrap;
}
.bird-modal__fact {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}
.bird-modal__callout {
    border-top: 1px solid #e2e7df;
    padding-top: 12px;
}
.bird-modal__callout h3 {
    font-size: 1rem;
    color: #1e401f;
    margin: 0 0 6px;
}
.bird-modal__callout p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}
.bird-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(30, 64, 31, 0.9);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
}
.bird-modal__close:hover {
    background: rgba(30, 64, 31, 1);
}
.modal-open {
    overflow: hidden;
}

.search-bar {
    max-width: 600px;
    margin: 0 auto 30px;
    display: flex;
    gap: 10px;
}
.search-bar input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 25px;
    font-size: 1rem;
}

/* --- Footer --- */
footer {
    background-color: var(--primary-green);
    color: white;
    padding: 40px 5%;
    margin-top: auto; /* Sticky footer */
}
.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.footer-section h4 { color: var(--secondary-green); }
.contact-links { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.contact-links a { color: #ddd; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.contact-links a:hover { color: var(--secondary-green); }

/* --- Responsive --- */
@media (max-width: 768px) {
    header {
        padding: 0.75rem 6%;
        justify-content: center;
        text-align: center;
    }
    nav {
        width: 100%;
    }
    .nav-links {
        justify-content: center;
        gap: 12px;
    }
    .logo {
        justify-content: center;
        width: 100%;
    }
    .logo-img {
        height: 48px;
        margin-right: 10px;
    }
    .about-grid { grid-template-columns: 1fr; }
    .hero {
        padding: 80px 18px;
        min-height: 420px;
    }
    .hero h1 { font-size: 2.2rem; }
    .mission-text { font-size: 1rem; }
    .hero-content {
        padding: 22px;
    }
    .content-section {
        padding: 28px;
        margin-bottom: 30px;
    }
    .section-title { font-size: 1.8rem; }
    .section-subtitle { font-size: 0.95rem; }
    .trails-card {
        padding: 22px;
    }
    .trails-map iframe {
        height: 240px;
    }
    .trail-search {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }
    .slideshow-container {
        max-width: 100%;
    }
    .bird-slide img {
        height: 260px;
    }
    .prev, .next {
        top: 45%;
        padding: 12px;
        font-size: 20px;
    }
    .search-bar {
        flex-direction: column;
    }
    .footer-content { flex-direction: column; text-align: center; }
    .contact-links { align-items: center; }
    .bird-modal__content {
        grid-template-columns: 1fr;
        margin: 8vh auto;
    }
    .bird-modal__details {
        padding: 24px;
    }
}

@media (max-width: 600px) {
    header {
        padding: 0.75rem 4%;
    }
    .nav-links a {
        padding: 6px 8px;
        display: inline-flex;
        align-items: center;
    }
    .hero {
        padding: 70px 16px;
        min-height: 360px;
    }
    .hero h1 { font-size: 1.9rem; }
    .content-section {
        padding: 22px 18px;
        border-radius: 6px;
    }
    .section-title { font-size: 1.6rem; }
    .section-intro {
        font-size: 0.98rem;
    }
    .trails-card,
    .trail-mini-card {
        padding: 18px;
        border-radius: 14px;
    }
    .trails-map {
        padding: 12px;
    }
    .trails-map iframe {
        height: 210px;
    }
    .trails-details h2 {
        font-size: 1.6rem;
    }
    .trail-search {
        font-size: 0.95rem;
        padding: 10px 14px;
    }
    .bird-slide img {
        height: 220px;
    }
    .bird-modal__content {
        width: min(94vw, 560px);
    }
    .cert-btn {
        width: 100%;
    }
}
