/* Global Reset & Box Sizing */
:root {
    --color-bg: #FDFBF7;
    /* Warm off-white */
    --color-text-main: #2C3E2C;
    /* Deep green-black */
    --color-text-muted: #5F6E5F;
    /* Muted sage — darkened from #6B7A6B for WCAG AA (4.40:1 -> 5.23:1 on --color-bg) */
    --color-accent: #5A7A1E;
    /* Olive Drab / Nature Green — darkened from #6B8E23 for WCAG AA.
       4.80:1 as text on --color-bg, 4.96:1 behind white in .btn (was 3.68 / 3.81) */
    --color-accent-light: #E8F3E8;
    --color-earth: #A0522D;
    /* Sienna */

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;

    --spacing-container: 5%;
    --spacing-section: 6rem;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
    border-radius: 4px;
}

/* Utilities */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--spacing-container);
}

.text-center {
    text-align: center;
}

.text-justify {
    text-align: justify;
}

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

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--color-accent);
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: transform 0.2s, background-color 0.2s;
    cursor: pointer;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    background-color: #46601A;
}

.btn:active {
    transform: translateY(0);
    background-color: #3A5015;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    background-color: #9AA79A;
    color: #F4F4F4;
    cursor: not-allowed;
    transform: none;
}

/* Opaque, not transparent: this button sits low in the hero where the overlay
   thins to 65%, directly over the photograph. A transparent fill made the label
   effectively invisible until hover. */
.btn-outline {
    background: var(--color-bg, #FDFBF7);
    border: 2px solid var(--color-accent, #5A7A1E);
    color: var(--color-accent, #5A7A1E);
    margin-left: 1rem;
}

.btn-outline:hover {
    background: var(--color-accent, #5A7A1E);
    color: #fff;
}

.btn-outline:active {
    background: #3A5015;
    color: #fff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-accent, #5A7A1E);
    outline-offset: 3px;
}

.card-icon {
    color: var(--color-accent);
    margin-right: 10px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

button.gallery-item {
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    cursor: pointer;
    display: block;
}

/* Header */
header {
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    height: 60px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-main);
    opacity: 0.8;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--color-accent);
}

/* Hero Section */
.hero {
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    /* Bottom stop raised 0.4 -> 0.65: the CTAs sit at the foot of the hero, and
       at 0.4 the photograph showed through strongly enough to swallow them. */
    background: linear-gradient(rgba(253, 251, 247, 0.9), rgba(253, 251, 247, 0.65)), url('images/hero.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    margin-bottom: 1.5rem;
    color: var(--color-text-main);
}

.hero p {
    font-size: 1.35rem;
    color: var(--color-text-main);
    margin-bottom: 2.5rem;
    max-width: 600px;
    font-weight: 500;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    position: relative;
}

.about-text h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-accent);
    margin-top: 1rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--color-accent-light);
    border-radius: 8px;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-family: var(--font-heading);
    color: var(--color-accent);
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

/* Story Section */
.story-section {
    background-color: #fff;
}

.story-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.story-content h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 3rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.timeline-item {
    margin-bottom: 3rem;
    padding-left: 2rem;
    border-left: 2px solid var(--color-accent-light);
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-accent);
}

.year {
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    display: block;
}

/* Initiatives Grid */
.initiatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
    border-top: 4px solid var(--color-accent);
}

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

.card h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-bottom: 1rem;
}

.card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Footer */
footer {
    background-color: var(--color-text-main);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.footer-logo {
    height: 80px;
    width: auto;
    max-width: 300px;
    margin-bottom: 1rem;
    display: inline-block;
    object-fit: contain;
}

.footer-info {
    opacity: 0.7;
    margin-bottom: 2rem;
}

.social-links a {
    margin: 0 10px;
    font-size: 1.2rem;
}

/* Gallery Section */
.gallery-section {
    background-color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 44, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-icon {
    font-size: 2rem;
    color: #fff;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-icon {
    transform: translateY(0);
}

/* Gallery Loader */
.gallery-loader {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-accent-light);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade-in for gallery items */
.gallery-item {
    animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--color-accent);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    transition: color 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--color-accent);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
}

/* Lightbox Thumbnails */
.lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    max-width: 90%;
    overflow-x: auto;
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.thumbnail.active {
    opacity: 1;
    border: 2px solid var(--color-accent);
    transform: scale(1.1);
}


/* =====================================================
   Hamburger / Mobile Nav
   ===================================================== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    color: var(--color-text-main);
    font-size: 1.4rem;
    border-radius: 4px;
    transition: color 0.2s ease;
    z-index: 1100;
    position: relative;
}

.nav-toggle:hover {
    color: var(--color-accent);
}

/* Mobile nav drawer overlay */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.nav-overlay.open {
    display: block;
    opacity: 1;
}

/* Mobile drawer (slides down from header) */
.nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(253, 251, 247, 0.98);
    backdrop-filter: blur(6px);
    z-index: 1090;
    padding-top: 80px; /* clear header */
    padding-bottom: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.nav-drawer.open {
    display: block;
    transform: translateY(0);
}

.nav-drawer a {
    display: block;
    padding: 14px 5%;
    min-height: 44px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-main);
    border-bottom: 1px solid var(--color-accent-light);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-drawer a:hover {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
}

/* =====================================================
   Gallery Pagination
   ===================================================== */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 2.5rem 0 1rem;
    flex-wrap: wrap;
}

.pagination-controls button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border: 2px solid var(--color-accent-light);
    background: #fff;
    color: var(--color-text-main);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: var(--color-accent-light);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.pagination-controls button.active {
    background-color: #4a7c59;
    border-color: #4a7c59;
    color: #fff;
    box-shadow: 0 3px 8px rgba(74, 124, 89, 0.4);
}

.pagination-controls button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Prev / Next styled as outlined pills */
.pagination-controls button.pagination-prev,
.pagination-controls button.pagination-next {
    border-radius: 50px;
    padding: 0 18px;
    border-color: var(--color-accent);
    color: var(--color-accent);
    letter-spacing: 0.02em;
}

/* =====================================================
   Contact Form
   All colours resolve against this file's own :root block;
   literal fallbacks included because an undefined var() is
   dropped silently and would render the field unstyled.
   ===================================================== */
.contact-section {
    background: var(--color-accent-light, #E8F3E8);
}

.contact-intro {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    text-align: center;
    color: var(--color-text-muted, #5F6E5F);
    font-size: 1.05rem;
}

.contact-form {
    max-width: 620px;
    margin: 0 auto;
}

.form-row {
    margin-bottom: 1.5rem;
}

.form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text-main, #2C3E2C);
}

.form-row .required-mark {
    color: var(--color-earth, #A0522D);
    margin-left: 2px;
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-body, 'Lato', sans-serif);
    font-size: 1rem;
    color: var(--color-text-main, #2C3E2C);
    background: #fff;
    /* #748674, not a lighter sage: WCAG 1.4.11 wants 3:1 for a control
       boundary. 3.89:1 against the white field, 3.41:1 against the section. */
    border: 2px solid #748674;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.form-row textarea {
    min-height: 160px;
    resize: vertical;
}

.form-row input:hover,
.form-row textarea:hover {
    border-color: var(--color-text-muted, #5F6E5F);
}

.form-row input:focus,
.form-row textarea:focus {
    border-color: var(--color-accent, #5A7A1E);
    outline: none;
}

/* Error state is never colour-only — .field-error carries the text. */
.form-row input[aria-invalid="true"],
.form-row textarea[aria-invalid="true"] {
    border-color: #B3261E;
    background: #FDF6F5;
}

.field-error {
    display: none;
    margin-top: 0.4rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #8C1D18;
}

.field-error.is-visible {
    display: block;
}

/* Honeypot: off-screen rather than display:none, so bots that skip
   hidden fields still fill it. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.form-status {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    display: none;
}

.form-status.is-visible {
    display: block;
}

.form-status.is-success {
    background: #fff;
    color: #2E5E14;
    border-left: 4px solid var(--color-accent, #5A7A1E);
}

.form-status.is-error {
    background: #FDF6F5;
    color: #8C1D18;
    border-left: 4px solid #B3261E;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 6vw, 4rem);
    }

    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* stats grid: single row still works at 320px with tighter padding */
    .stat-item {
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Hide numbered page buttons; show Prev/Next only */
    .pagination-controls .page-num {
        display: none;
    }

    /* Smaller pagination buttons on very small screens */
    .pagination-controls button {
        min-width: 36px;
        min-height: 36px;
        font-size: 0.85rem;
        padding: 0 10px;
    }

    .container {
        padding: 0 4%;
    }

    /* Two hero CTAs side by side overflow a 320px viewport; stack them
       and drop the horizontal offset that assumed an inline row. */
    .hero .btn {
        display: block;
        width: 100%;
        text-align: center;
    }

    .btn-outline {
        margin-left: 0;
        margin-top: 1rem;
    }

    .form-actions .btn {
        width: 100%;
    }
}