/* Google Fonts are loaded via <link> tags in includes/header.php (not @import here,
   to avoid a render-blocking serial request chain) */

/* ===== ACCESSIBILITY UTILITIES ===== */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    padding: 8px 16px;
    background: #2c2c2c;
    color: #ffffff;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
}
.skip-link:focus { left: 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Ensure [hidden] always wins over display rules in author styles */
[hidden] { display: none !important; }

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #2c2c2c;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(78, 110, 73, 0.2);
    color: #2c2c2c;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

section { padding: 80px 0; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-wrap: balance;
    text-rendering: optimizeLegibility;
}

h1 { font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; overflow-wrap: break-word; }
p:last-child { margin-bottom: 0; }

/* ===== NAV ===== */
#main-content { scroll-margin-top: 72px; }

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid #ebebeb;
    height: 72px;
    display: flex;
    align-items: center;
    transition: box-shadow 0.2s;
}

.site-nav.scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }

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

.nav-logo img {
    height: 44px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2c2c2c;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
    color: #4e6e49;
}

.nav-links a[aria-current="page"] {
    color: #4e6e49;
    border-bottom-color: #4e6e49;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-social a {
    color: #2c2c2c;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.nav-social a:hover { color: #4e6e49; }

.nav-social svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 5px;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #2c2c2c;
    transition: all 0.3s;
}

/* ===== HERO (HOME) ===== */
.hero {
    position: relative;
    min-height: 480px;
    background: url('/images/gallery/farm-1.jpg') center center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 0 80px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(30, 50, 30, 0.45);
}

.hero .container {
    position: relative;
    z-index: 1;
}


.hero h1 {
    font-size: 2.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: #ffffff;
}

.hero-tagline {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
}

/* ===== INTRO / ABOUT SECTION ===== */
.section-intro {
    background: #ffffff;
    text-align: center;
}

.section-intro h2 {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4e6e49;
    margin-bottom: 20px;
    font-weight: 400;
}

.section-intro p {
    max-width: 680px;
    margin: 0 auto 1rem;
    font-size: 1.05rem;
    color: #444444;
}

.section-intro p:first-of-type {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2c2c2c;
    font-weight: 600;
}

.section-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4e6e49;
    margin-bottom: 16px;
    font-weight: 400;
}

/* ===== MARKETS ===== */
.section-markets {
    background: #faf9f6;
}

.section-markets h2 {
    text-align: center;
    margin-bottom: 48px;
    font-size: 1.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.markets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.market-card {
    background: #ffffff;
    border: 1px solid #ebebeb;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.market-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    border-color: #d0d0d0;
    transform: translateY(-3px);
}

.market-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.market-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.market-card-body .btn {
    align-self: flex-start;
    margin-top: auto;
}

.market-card h3 {
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.market-card-time {
    font-size: 0.85rem;
    color: #767676;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 10px 24px;
    border: 1px solid #2c2c2c;
    color: #2c2c2c;
    transition: background 0.2s, color 0.2s;
}

.btn:hover {
    background: #2c2c2c;
    color: #ffffff;
}

/* ===== CAROUSEL ===== */
.section-gallery {
    padding: 0;
    background: #2c2c2c;
    position: relative;
    overflow: hidden;
}

.carousel {
    position: relative;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.carousel-track img {
    min-width: 100%;
    flex-shrink: 0;
    height: 520px;
    object-fit: cover;
    object-position: center;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.carousel-btn:hover { background: #ffffff; }
.carousel-btn-prev { left: 20px; }
.carousel-btn-next { right: 20px; }

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: background 0.2s;
}
.carousel-dot::after {
    content: '';
    position: absolute;
    inset: -10px; /* expands touch target to 28×28px (WCAG 2.5.8) */
}

.carousel-dot.active { background: #ffffff; }

/* ===== INSTAGRAM SECTION ===== */
.section-instagram {
    background: #ffffff;
    text-align: center;
}

.section-instagram h2 {
    font-size: 1.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.instagram-tile {
    aspect-ratio: 1;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    display: block;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
}

.instagram-tile:hover { opacity: 0.85; transform: scale(1.05); }

.instagram-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== HOME CTA ===== */
.section-cta {
    position: relative;
    background: #faf9f6 url('/images/gallery/farm-4.jpg') center / cover no-repeat;
    text-align: center;
}

.section-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(250, 249, 246, 0.92);
}

.section-cta .container {
    position: relative;
    z-index: 1;
}

.section-cta h2 {
    font-size: 1.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.section-cta p {
    font-size: 1rem;
    color: #666666;
    max-width: 600px;
    margin: 0 auto 32px;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #f5f4f0;
    padding: 60px 0 40px;
    text-align: center;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.footer-social a {
    color: #2c2c2c;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.footer-social a:hover { color: #4e6e49; }

.footer-social svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.footer-address {
    font-size: 0.9rem;
    color: #767676;
    margin-bottom: 24px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    list-style: none;
}

.footer-nav a {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666666;
    transition: color 0.2s;
}

.footer-nav a:hover { color: #4e6e49; }

.footer-copy {
    font-size: 0.75rem;
    color: #999999;
    margin-top: 28px;
    letter-spacing: 0.04em;
}

.footer-copy a {
    color: #999999;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-copy a:hover { color: #4e6e49; }

.footer-badge {
    margin: 0 0 20px;
}

.badge-aco {
    display: inline-block;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1;
    color: #4e6e49;
    border: 1px solid #4e6e49;
    padding: 8px 12px 4px;
    border-radius: 2px;
}

/* ===== PAGE HERO (ABOUT) ===== */
.page-hero {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center;
}

.page-header {
    padding: 60px 0 40px;
    text-align: center;
    background: #faf9f6;
}

.page-header-sub {
    color: #767676;
    margin-top: 12px;
}

.section-alt {
    background: #faf9f6;
}

.page-header h1 {
    font-size: 2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ===== ABOUT PAGE ===== */
.about-intro {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.about-intro h2 {
    font-size: 1.6rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text h2 {
    font-size: 1.3rem;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.about-image img {
    width: 100%;
    height: 380px;
    object-fit: cover;
}

.about-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 60px;
}

.about-photos img {
    width: 100%;
    height: 260px;
    object-fit: cover;
}

/* ===== CONTENT LINKS ===== */
/* a { color: inherit } is intentional for nav/footer; these are inline prose links */
.volunteer-content a,
.about-intro a,
.form-message a {
    color: #4e6e49;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.volunteer-content a:hover,
.about-intro a:hover,
.form-message a:hover {
    color: #3d5739;
}

.volunteer-hero .volunteer-content a {
    color: rgba(255, 255, 255, 0.9);
}
.volunteer-hero .volunteer-content a:hover {
    color: #ffffff;
}

/* ===== VOLUNTEER PAGE ===== */
.volunteer-hero {
    position: relative;
    min-height: 650px;
    display: flex;
    align-items: center;
    background: url('/images/gallery/farm-5.jpg') center 40% / cover no-repeat;
    padding: 100px 0;
}

.volunteer-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.volunteer-hero .container {
    position: relative;
    z-index: 1;
}

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

.volunteer-content h1 {
    font-size: 2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 24px;
    color: #ffffff;
}

.volunteer-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 12px;
}

.volunteer-content p + p { margin-bottom: 32px; }

.btn-light {
    border-color: #ffffff;
    color: #ffffff;
}
.btn-light:hover {
    background: #ffffff;
    color: #2d2d2d;
}

/* ===== CONTACT PAGE ===== */
.contact-map-section {
    width: 100%;
    padding: 0;
    line-height: 0;
}

.contact-map {
    width: 100%;
    overflow: hidden;
}

.contact-map iframe {
    display: block;
    width: 100%;
    height: 300px;
}

.contact-layout {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 60px;
    align-items: start;
}

.contact-info h2 {
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.contact-block {
    margin-bottom: 28px;
}

.contact-block-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #4e6e49;
    margin-bottom: 6px;
    display: block;
}

.contact-block p {
    font-size: 0.95rem;
    margin: 0;
}

.contact-form h2 {
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666666;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dddddd;
    background: #ffffff;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: #2c2c2c;
    transition: border-color 0.2s;
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaaaaa;
    font-style: italic;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #4e6e49;
    box-shadow: 0 0 0 3px rgba(78, 110, 73, 0.15);
}

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

.form-group.has-error input,
.form-group.has-error textarea {
    border-color: #c0392b;
}

.field-error {
    font-size: 0.8rem;
    color: #c0392b;
    margin-top: 4px;
    display: block;
}

.form-honeypot { display: none; }

.btn-submit {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 14px 40px;
    background: #2c2c2c;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover { background: #4e6e49; }

.btn:focus-visible,
.btn-submit:focus-visible,
.carousel-btn:focus-visible,
.nav-hamburger:focus-visible,
.nav-links a:focus-visible {
    outline: 2px solid #4e6e49;
    outline-offset: 2px;
}

.form-message {
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.form-message.success {
    background: #eaf4e8;
    border: 1px solid #4e6e49;
    color: #2d5a2d;
}

.form-message.error {
    background: #fdeaea;
    border: 1px solid #c0392b;
    color: #7b1010;
}

/* ===== PRIVACY PAGE ===== */
.privacy-content {
    max-width: 760px;
    margin: 0 auto;
}

.privacy-content h2 {
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 40px 0 12px;
}

.privacy-content h2:first-child { margin-top: 0; }

.privacy-content a {
    color: #4e6e49;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.privacy-content a:hover { color: #3d5739; }

/* ===== 404 PAGE ===== */
.page-404 {
    text-align: center;
    padding: 120px 0;
}

.page-404 h1 {
    font-size: 6rem;
    color: #ebebeb;
    margin-bottom: 16px;
}

.page-404 h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.page-404 p {
    color: #767676;
    margin-bottom: 32px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .markets-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-photos { grid-template-columns: 1fr; }
    .about-photos img { height: 220px; }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .instagram-grid { grid-template-columns: repeat(5, 1fr); }

    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid #ebebeb;
        border-bottom: 1px solid #ebebeb;
        padding: 8px 0;
    }

    .nav-links.open {
        display: flex;
        z-index: 200;
    }

    .nav-links li { border-bottom: 1px solid #f0f0f0; }

    .nav-links a {
        display: block;
        padding: 14px 24px;
        font-size: 0.85rem;
    }

    .nav-links li:last-child { border-bottom: none; }
    .nav-hamburger { display: flex; }
    .nav-social { display: none; }
}

/* tablet: 2-column grid for markets and about photos — must come after max-width:900px to win specificity */
@media (min-width: 580px) and (max-width: 900px) {
    .markets-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: none;
        margin: 0;
    }
    .about-photos {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    section { padding: 50px 0; }
    .volunteer-hero { min-height: 380px; padding: 60px 0; }
    .hero { padding: 70px 0 50px; min-height: 320px; }
    .hero h1 { font-size: 1.8rem; }

    .carousel-track img { height: 280px; }

    .market-card img { height: 160px; }

    .instagram-grid { grid-template-columns: repeat(5, 1fr); }

    .about-image img { height: 260px; }

    .page-hero { height: 240px; }
    .page-header { padding: 40px 0 30px; }
}

@media (max-width: 400px) {
    .instagram-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .carousel-track { transition: none; }
}

/* ===== FADE-IN SCROLL ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transition: opacity 0.9s ease;
}
.fade-in.visible {
    opacity: 1;
}
.market-card.fade-in:nth-child(2) { transition-delay: 0.15s; }
.market-card.fade-in:nth-child(3) { transition-delay: 0.30s; }
