/* Homepage widgets row */
.homepage-widgets-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    justify-items: center;
    margin-top: 36px;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .homepage-widgets-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Responsible Aviculture Widget */
.responsible-widget {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.10);
    max-width: 520px;
    min-width: 320px;
    min-height: 240px;
    height: auto;
    padding: 32px 36px 24px 36px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
    z-index: 1;
    width: 100%;
}
.responsible-title {
    font-family: 'Bree Serif', serif;
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 8px;
    text-align: left;
    flex-shrink: 0;
}
.responsible-content {
    font-size: 0.9rem;
    color: #3a3a3a;
    line-height: 1.7;
    flex-grow: 1;
    display: flex;
    align-items: center;
}
.responsible-content .inline-nav-link {
    color: #474747;
    text-decoration: none;
    transition: color 0.3s ease;
}
.responsible-content .inline-nav-link:hover {
    color: #474747;
    text-decoration: underline;
}
@media (max-width: 600px) {
    .responsible-widget {
        padding: 18px 14px 16px 14px;
        min-height: 190px;
        height: auto;
    }
    .responsible-title {
        font-size: 1.08rem;
    }
    .responsible-content {
        font-size: 0.82rem;
    }
}
/* Findings Widget Styles */
.findings-widget {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.10);
    max-width: 520px;
    margin: 0;
    padding: 32px 28px 24px 28px;
    text-align: left;
    position: relative;
    z-index: 1;
    min-height: 240px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
}
.findings-title {
    font-family: 'Bree Serif', serif;
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 18px;
    flex-shrink: 0;
    text-align: left;
    letter-spacing: 0.01em;
}
.findings-carousel {
    min-height: 70px;
    margin-bottom: 18px;
    position: relative;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
}
.finding {
    display: none;
    font-size: 0.9rem;
    color: #3a3a3a;
    line-height: 1.7;
    transition: opacity 0.4s;
    padding: 0 8px;
    text-align: center;
}
.finding.active {
    display: block;
    animation: fadeInFinding 0.5s;
}
@keyframes fadeInFinding {
    from { opacity: 0; }
    to { opacity: 1; }
}
.findings-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
    flex-shrink: 0;
}
.findings-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c7e6c7;
    border: none;
    outline: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.findings-dots .dot.active {
    background: #4caf50;
    transform: scale(1.18);
}
.findings-dots .dot:focus {
    outline: 2px solid #4caf50;
}
@media (max-width: 600px) {
    .findings-widget {
        padding: 18px 8px 16px 8px;
        min-height: 190px;
        height: auto;
    }
    .findings-title {
        font-size: 1.08rem;
        width: 100%;
    }
    .findings-carousel {
        min-height: 40px;
    }
    .finding {
        font-size: 0.82rem;
    }
}
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #e6f7e6;
}

/* Header */
/* Header */
header {
    background-color: #ffffff;
    padding: 12px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
}

header h1 {
    text-align: left;
    font-size: 1.6rem;
    color: #474747;
    margin: 0;
}

nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

nav a {
    color: #474747;
    text-decoration: none;
    font-size: 1.1em;
    padding: 8px 15px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #474747;
    text-decoration: underline;
}

/* ZooMS link style */
.zooms-link {
    display: inline-block;
    padding: 0;
    line-height: 0;
    text-decoration: none;
}

.zooms-link img {
    height: 30px;
    width: auto;
    display: block;
    margin-top: 7px;
}

.zooms-link:hover img {
    opacity: 0.9;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* Intro Section */
.intro {
    background-color: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Statement card (homepage) */
.statement-hero {
    position: relative;
    /* height is driven by the image placed inside */
    display: block;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
}

.statement-hero .statement-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: scaleX(-1);
    transform-origin: center;
    z-index: 0;
    pointer-events: none;
}

/* Caption on hero image (bottom-right) */
.hero-caption {
    position: absolute;
    right: clamp(12px, 4vw, 40px);
    bottom: 18px;
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.8rem;
    z-index: 3;
    pointer-events: none;
}

@media (max-width: 480px) {
    .hero-caption {
        font-size: 0.75rem;
        right: 12px;
        bottom: 16px;
    }
}

.statement-card {
    background-color: #fff;
    --statement-card-scale: 1;
    padding: 18px 40px 18px;
    margin: 0;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    width: 560px;
    text-align: left;
    position: absolute;
    left: clamp(24px, 6vw, 120px);
    top: 50%;
    transform: translateY(-50%) scale(var(--statement-card-scale));
    transform-origin: left center;
    z-index: 2;
}

.statement-card p {
    margin-bottom: 1.3rem;
    color: #2c3e50;
    line-height: 1.8;
    font-size: 1rem;
}

.statement-card p.signature {
    margin-top: 1rem;
    font-weight: 700;
    font-family: 'Handlee', cursive;
    text-align: left;
    font-size: 0.98rem;
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .statement-card {
        --statement-card-scale: 0.9;
    }
}

@media (max-width: 1024px) {
    .statement-card {
        --statement-card-scale: 0.8;
    }
}

/* Responsible Aviculture Banner */
.responsible-aviculture-banner {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background-color: #e3f3fc;
    padding: 50px 20px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 40px;
    align-items: start;
}

.banner-left {
    text-align: left;
}

.banner-left h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.1;
    font-family: 'Bree Serif', serif;
}

.vietnam-pheasant-image {
    max-width: 150px;
    height: auto;
    display: block;
    border-radius: 8px;
}

.banner-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-center p {
    color: #2c3e50;
    line-height: 1.8;
    font-size: 1rem;
    text-align: justify;
    margin: 0;
}

.banner-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.involvement-link {
    display: inline-block;
    background-color: #2c3e50;
    color: #ffffff;
    padding: 15px 25px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
}

.involvement-link:hover {
    background-color: #34495e;
    transform: translateY(-2px);
}

/* Responsive adjustments for the banner */
@media (max-width: 992px) {
    .banner-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .banner-left {
        text-align: center;
    }
    
    .vietnam-pheasant-image {
        margin: 0 auto;
    }
    
    .banner-center p {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .responsible-aviculture-banner {
        padding: 30px 15px;
    }
    
    .banner-left h2 {
        font-size: 1.5rem;
    }
    
    .involvement-link {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

.intro h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 5px;
}

.intro h3 {
    color: #7f8c8d;
    font-size: 1.3em;
    margin-bottom: 20px;
    font-weight: normal;
}

.intro p {
    margin-bottom: 15px;
    text-align: justify;
}

/* Species Spotlight */
.species-spotlight {
    background-color: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.species-spotlight h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.species-card img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 5px;
    margin-bottom: 15px;
    display: block;
}

.species-card h4 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 5px;
}

.scientific-name {
    font-style: italic;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.status {
    display: inline-block;
    padding: 5px 15px;
    background-color: #e74c3c;
    color: #fff;
    border-radius: 3px;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.species-card p {
    margin-bottom: 15px;
    text-align: justify;
}

/* Handbook */
.handbook {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.handbook h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 25px;
}

.species-search {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.species-search h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filters input[type="checkbox"] {
    cursor: pointer;
}

/* Species List */
.species-list {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.species-item {
    padding: 20px;
    border: 1px solid #ecf0f1;
    border-radius: 5px;
    transition: box-shadow 0.3s ease;
}

.species-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.species-item h4 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 5px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.85em;
    margin-right: 8px;
    margin-top: 8px;
}

.badge.challenging {
    background-color: #e74c3c;
    color: #fff;
}

.badge.straightforward {
    background-color: #27ae60;
    color: #fff;
}

.badge.cold-sensitive {
    background-color: #3498db;
    color: #fff;
}

.resources {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* ensure flex children align left */
    text-align: left; /* enforce left-aligned text inside cards */
    gap: 8px;
}

.resources a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.resources a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Articles Section */
.articles {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.articles h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.article-card {
    margin-bottom: 25px;
}

.article-card img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Handbook / Articles grid on handbook index */
.article-grid {
    display: grid;
    /* keep reasonable card widths and center the grid when few items exist */
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    gap: 20px;
    align-items: start;
    justify-content: center;
    /* don't allow the grid to stretch excessively on wide viewports */
    max-width: 1100px;
    margin: 10px auto 40px;
}

.article-grid .species-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 340px; /* ensures a single card doesn't become too wide */
    margin: 0 auto;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.article-grid .species-item::before {
    width: 100%;
    /* image block controlled by --card-img; fallback placeholder */
    content: "";
    display: block;
    width: 100%;
    height: 160px;
    background-image: var(--card-img, url('../files/placeholder-image-1.jpg'));
    background-size: cover;
    background-position: center;
}

.article-grid .species-item .scientific-name {
    margin: 2px 0 0 0;
    color: #7f8c8d;
    font-style: italic;
}

.article-grid .species-item h4 {
    margin: 12px 0 0 0;
    font-size: 1.05rem;
    color: #2c3e50;
}

.article-grid .species-item .badge {
    margin: 10px 0 0 0;
}

.article-grid .species-item .resources {
    margin: 12px 0 16px 0;
    margin-top: auto;
}

.article-grid .species-item .resources a {
    display: inline-block;
    margin-right: 10px;
    color: #3498db;
}

.article-grid .species-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

@media (max-width: 480px) {
    .article-grid .species-item::before {
        height: 120px;
    }
    .article-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        max-width: 100%;
        padding: 0 12px;
    }
}

/* Venn diagram container tweaks: reduce vertical whitespace and tighten caption */
.venn-diagram {
    margin: 6px 0; /* less gap above/below the diagram */
}
.venn-diagram svg {
    display: block;
    margin: 0 auto;
}
.venn-diagram figcaption {
    margin-top: 4px;
    color: #555;
    font-size: 0.95rem;
}

.article-card a {
    color: #3498db;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.article-card a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Contact/FAQ */
.contact-faq {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.contact-faq h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 25px;
}

.contact-faq > p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.contact-email {
    text-align: center;
    margin: 30px 0;
}

.contact-email a {
    display: inline-block;
    padding: 12px 30px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.contact-email a:hover {
    background-color: #2980b9;
}

.faq-list {
    margin-top: 30px;
}

.faq-item {
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.faq-item h3 {
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

/* Footer */
footer {
    background-color: #ffffff;
    color: #2c3e50;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

footer p {
    margin: 0;
}

/* Ensure footer links inherit the new footer colour and remain visible */
footer a {
    color: inherit;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Article Layout Styles */
.article-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 900px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.article-title {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 12px;
    line-height: 1.25;
}

.article-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #7f8c8d;
    font-size: 0.95em;
}

.article-meta span {
    display: inline-block;
}

.article-hero-image {
    /* extend the hero to the card outer width (compensate for article padding)
       and allow the image to be 900px to match the card max-width */
    margin: -40px -40px 24px -40px;
    width: calc(100% + 80px);
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.article-hero-image img {
    /* prefer a 900px-wide image so it fills the card; allow it to scale down
       on small viewports with max-width:100% */
    width: 900px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px 8px 0 0;
}

/* Overlay header that sits on top of hero within the article card */
.article-header-overlay {
    position: absolute;
    /* kept for backward compatibility but we no longer put the title in it */
}

/* Title placed directly inside the hero: hover over image at left */
    /* Container for hero text (title + subheading) placed over the image */
    .article-hero-image .hero-text {
        position: absolute;
        left: 40px;
        top: 24px;
        z-index: 4;
        color: #ffffff;
        text-align: left;
    }

    .article-hero-image .hero-title {
        margin: 0;
        padding: 0;
        font-weight: 700;
        font-size: 2.5rem;
        line-height: 1.15;
        text-shadow: 0 1px 2px rgba(0,0,0,0.45);
        color: #ffffff;
    }

/* Ensure the second word sits on its own line and tidy spacing */
.article-hero-image .hero-title .hero-sub {
    display: inline;
    margin-top: 0;
    font-weight: 700;
}

/* Subheading under the hero title */
.article-hero-image .hero-subheading {
    display: block;
    margin: 6px 0 0 0;
    color: #ffffff;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.1;
}

/* Prevent overflow on small screens: make hero and image fit naturally */
@media (max-width: 940px) {
    .article-hero-image {
        margin: 0 0 24px 0;
        width: 100%;
        border-radius: 8px 8px 0 0;
    }

    .article-hero-image img {
        width: 100%;
        max-width: 100%;
    }

    .article-header-overlay {
        left: 40px;
        transform: none;
        text-align: left;
    }

    .article-hero-image .hero-text {
        left: 24px;
        top: 18px;
    }

    .article-hero-image .hero-title {
        font-size: 1.8rem;
    }

    .article-hero-image .hero-title .hero-sub {
        font-size: 1.6rem;
    }

    .article-hero-image .hero-subheading {
        margin-top: 4px;
        font-size: 0.95rem;
    }
}

.article-hero-image figcaption {
    margin-top: 10px;
    font-style: italic;
    color: #7f8c8d;
    font-size: 0.9em;
    text-align: center;
}

.article-section {
    margin-bottom: 40px;
}

.article-section h2 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 18px;
    margin-top: 28px;
}

.article-section h3 {
    color: #2c3e50;
    font-size: 1.1em;
    margin-bottom: 14px;
    margin-top: 22px;
}

.article-section p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
}

.article-section ul {
    margin-bottom: 20px;
    padding-left: 30px;
}

.article-section li {
    margin-bottom: 10px;
    line-height: 1.7;
    color: #333;
}

.article-image {
    margin: 30px 0;
    width: 100%;
}

.article-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    display: block;
}

.article-image figcaption {
    margin-top: 8px;
    font-style: italic;
    color: #7f8c8d;
    font-size: 0.9em;
    text-align: center;
}

.article-image-pair .image-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.article-image-pair .image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.article-image-pair .image-wrapper figcaption {
    margin-top: 8px;
    font-style: italic;
    color: #7f8c8d;
    font-size: 0.85em;
    text-align: center;
}

.article-quote {
    margin: 30px 0;
    padding: 20px 30px;
    background-color: #f9f9f9;
    border-left: 4px solid #3498db;
    font-style: italic;
    color: #555;
    font-size: 1.1em;
    line-height: 1.8;
}

.article-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.article-tags {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.article-tags .tag {
    display: inline-block;
    padding: 6px 14px;
    background-color: #ecf0f1;
    color: #2c3e50;
    border-radius: 3px;
    font-size: 0.9em;
}

.article-nav {
    margin-top: 20px;
}

.back-to-articles {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    font-size: 1.05em;
    transition: color 0.3s ease;
}

.back-to-articles:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
    }

    header h1 {
        font-size: 2em;
        text-align: center;
    }
    
    nav {
        gap: 15px;
        justify-content: center;
        margin-top: 10px;
        position: static;
        transform: none;
        left: auto;
    }
    
    nav a {
        font-size: 1em;
    }

    .zooms-link img {
        margin-top: 4px;
    }
    
    main {
        padding: 0 15px 30px;
    }
    
    .intro, .species-spotlight, .handbook, .contact-faq {
        padding: 20px;
    }
    .statement-hero {
        padding: 0;
    }
    .statement-card {
        --statement-card-scale: 0.68;
        left: 12px;
        top: 50%;
        transform: translateY(-50%) scale(var(--statement-card-scale));
        margin: 0;
    }

    .article-content {
        padding: 25px 20px;
    }

    .article-title {
        font-size: 1.2em;
    }

    .article-section h2 {
        font-size: 1.2em;
    }

    .article-section h3 {
        font-size: 1.0em;
    }

    .article-image-pair .image-pair {
        grid-template-columns: 1fr;
    }

    .article-quote {
        padding: 15px 20px;
        font-size: 1em;
    }
}

@media (max-width: 600px) {
    .statement-hero {
        display: block;
    }

    .statement-card {
        position: static;
        width: 100%;
        max-width: 100%;
        left: auto;
        top: auto;
        transform: none;
        margin-top: 14px;
        padding: 18px 16px;
    }
}
