/* ═══════════════════════════════════════════════════════════════
   PEAR FAIR — Main Stylesheet
   Color Palette:
     Primary Green  : #2e7d32
     Dark Green     : #1b5e20
     Light Green bg : #f1f8e9
     Pear Yellow    : #f9a825
     Light Yellow bg: #f9fbe7
     Dark text      : #1a1a1a
     Body text      : #444
     Border         : #e0e0e0
════════════════════════════════════════════════════════════════ */

/* ─── Theme variables (defaults — overridden by inline :root in header.php) */
:root {
    --color-primary:   #2e7d32;
    --color-accent:    #f9a825;
    --color-body-text: #444444;
    --color-heading:   #1a1a1a;
    --color-page-bg:   #ffffff;
    --color-alt-bg:    #f9fbe7;
    --color-link:      #2e7d32;
    --color-border:    #e0e0e0;
    --font-heading:    'Bree Serif', Georgia, serif;
    --font-body:       'Lato', Arial, sans-serif;
    --card-radius:     8px;
    --btn-radius:      6px;
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--color-body-text);
    background: var(--color-page-bg);
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    line-height: 1.25;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ─── Container ─────────────────────────────────────────────── */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Header ────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 3px solid #2e7d32;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.site-logo .logo-icon { font-size: 2rem; }
.site-logo .logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #2e7d32;
    letter-spacing: -.5px;
}

/* ─── Navigation ────────────────────────────────────────────── */
.nav-list {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
}

.nav-item { position: relative; }

.nav-link {
    display: block;
    padding: 8px 14px;
    color: #333;
    font-weight: 600;
    font-size: clamp(0.875rem, 1.5vw, 0.95rem);
    border-radius: 4px;
    transition: background .15s, color .15s;
    text-decoration: none;
    white-space: nowrap;
}
.nav-link:hover,
.nav-item.has-dropdown:hover .nav-link {
    background: #f1f8e9;
    color: #2e7d32;
    text-decoration: none;
}
/* Active / current page */
.nav-link--active,
.nav-link[aria-current="page"] {
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 700;
}
.nav-link--active:hover,
.nav-link[aria-current="page"]:hover {
    background: #c8e6c9;
    color: #1b5e20;
}

/* Dropdown */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 3px solid #2e7d32;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    min-width: 220px;
    list-style: none;
    z-index: 200;
}

.nav-item.has-dropdown:hover .dropdown { display: block; }

.dropdown li a {
    display: block;
    padding: 10px 18px;
    color: #333;
    font-size: .9rem;
    font-weight: 600;
    transition: background .1s;
    text-decoration: none;
}
.dropdown li a:hover { background: #f1f8e9; color: #2e7d32; }

/* Mobile toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: #333;
    border-radius: 2px;
    transition: .3s;
}

/* ─── Hero Block ────────────────────────────────────────────── */
.block-hero {
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: clamp(60px, 8vw, 100px) 20px;
    box-sizing: border-box;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
    margin-bottom: .5rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: rgba(255,255,255,.92);
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 13px 30px;
    border-radius: var(--btn-radius);
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: #f9a825;
    color: #1a1a1a;
    border-color: #f9a825;
}
.btn-primary:hover { background: #f57f17; border-color: #f57f17; color: #1a1a1a; text-decoration: none; }

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,.15); text-decoration: none; }

.btn-white {
    background: #fff;
    color: #2e7d32;
    border-color: #fff;
}
.btn-white:hover { background: #f1f8e9; text-decoration: none; }

.btn-outline-white {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,.7);
}
.btn-outline-white:hover { background: rgba(255,255,255,.1); text-decoration: none; }

.btn-green {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}
.btn-green:hover { background: #1b5e20; text-decoration: none; }

/* ─── Cards Block ───────────────────────────────────────────── */
.section-heading {
    text-align: center;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 2.5rem;
    color: #1b5e20;
}

.cards-grid {
    display: grid;
    gap: 28px;
}
.cards-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cards-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.cards-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 32px 24px;
    text-align: center;
    transition: box-shadow .2s, transform .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.card:hover { box-shadow: 0 8px 24px rgba(46,125,50,.15); transform: translateY(-3px); }

.card-icon { font-size: 2.8rem; margin-bottom: 14px; }
.card-img { width: 100%; height: 180px; object-fit: cover; border-radius: 6px; margin-bottom: 14px; }
.card-title { font-size: 1.15rem; margin-bottom: 8px; color: #1b5e20; }
.card-text { font-size: .92rem; color: #666; line-height: 1.6; }
.card-link { display: inline-block; margin-top: 14px; color: #2e7d32; font-weight: 700; font-size: .9rem; }

/* ─── CTA Block ─────────────────────────────────────────────── */
.block-cta .cta-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Text-Image Block ──────────────────────────────────────── */
.text-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.text-image-grid.reverse { direction: rtl; }
.text-image-grid.reverse > * { direction: ltr; }

/* ─── Gallery ───────────────────────────────────────────────── */
.gallery-grid { display: grid; gap: 12px; }
.gallery-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gallery-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.gallery-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; transition: transform .2s; }
.gallery-item img:hover { transform: scale(1.02); }

/* ─── Prose (rich text) ─────────────────────────────────────── */
.prose h1, .prose h2, .prose h3 { margin-bottom: .75rem; margin-top: 1.5rem; }
.prose h1:first-child, .prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: .4rem; }
.prose a { color: #2e7d32; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid #ddd; padding: 10px 14px; }
.prose th { background: #2e7d32; color: #fff; }
.prose details { border: 1px solid #e0e0e0; border-radius: 6px; padding: 16px; margin-bottom: 12px; }
.prose summary { font-weight: 700; cursor: pointer; }
.prose img { border-radius: 6px; }

/* ─── News Post Block ───────────────────────────────────────── */
.block-news-post + .block-news-post { padding-top: 0 !important; }

.news-post-date {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    color: #2e7d32;
    background: #f1f8e9;
    border: 1px solid #c8e6c9;
    border-radius: 20px;
    padding: 3px 14px;
    margin-bottom: 12px;
    letter-spacing: .02em;
}

.news-post-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #1b5e20;
    margin-bottom: 1.2rem;
    line-height: 1.25;
}

.news-post-featured-full {
    margin-bottom: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
}
.news-post-featured-full img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.news-post-float-left {
    float: left;
    width: 42%;
    margin: 4px 24px 16px 0;
    border-radius: 8px;
    object-fit: cover;
}
.news-post-float-right {
    float: right;
    width: 42%;
    margin: 4px 0 16px 24px;
    border-radius: 8px;
    object-fit: cover;
}

.news-post-body {
    line-height: 1.8;
}
.news-post-body::after {
    content: '';
    display: table;
    clear: both;
}

/* Inline images inside post content */
.news-post-body img {
    max-width: 100%;
    border-radius: 6px;
    height: auto;
}

.news-post-section-heading {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #1b5e20;
    text-align: center;
    margin-bottom: 2.5rem;
}
.news-post-article { margin-bottom: 1rem; }
.news-post-title a { color: #1b5e20; text-decoration: none; }
.news-post-title a:hover { text-decoration: underline; }
.news-post-excerpt { color: #555; font-size: .95rem; line-height: 1.6; margin: .5rem 0; }

.news-post-divider {
    height: 2px;
    background: linear-gradient(to right, #c8e6c9, transparent);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 1px;
}

@media (max-width: 600px) {
    .news-post-float-left,
    .news-post-float-right {
        float: none;
        width: 100%;
        margin: 0 0 16px 0;
    }
}

/* ─── Image placeholder ─────────────────────────────────────── */
.image-placeholder {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #999;
    font-size: .9rem;
}

/* ─── Container block ───────────────────────────────────────── */
.block-container { box-sizing: border-box; }
.container-inner { box-sizing: border-box; }
.container-horizontal { display: grid; align-items: start; }
.container-col { min-width: 0; box-sizing: border-box; }
@media (max-width: 700px) {
    .container-horizontal { grid-template-columns: 1fr !important; }
}

/* ─── Footer ────────────────────────────────────────────────── */
.site-footer {
    background: #1a3d1a;
    color: #ccc;
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 12px;
}
.footer-logo .logo-icon { font-size: 1.8rem; }

.site-footer p { font-size: .9rem; line-height: 1.7; color: #aaa; }

.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    color: #ccc;
    transition: background .2s, color .2s;
}
.footer-social a:hover { background: #f9a825; color: #1a1a1a; }

.footer-col h4 {
    font-family: 'Open Sans', sans-serif;
    font-size: .8rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #f9a825;
    margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #aaa; font-size: .9rem; transition: color .15s; }
.footer-col ul li a:hover { color: #fff; text-decoration: none; }

.contact-list li { font-size: .9rem; margin-bottom: 8px; }
.contact-list a { color: #aaa; }
.contact-list a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .82rem;
    color: #777;
}
.teal-credit { font-size: .75rem; color: #555; letter-spacing: .02em; }
.teal-credit a { color: #888; text-decoration: underline; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .text-image-grid { grid-template-columns: 1fr; gap: 30px; }
    .text-image-grid.reverse { direction: ltr; }

    /* Switch to hamburger menu — avoids cramped/unreadable nav between 769-900px */
    .nav-toggle { display: flex; }

    .site-nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 6px 20px rgba(0,0,0,.1);
        padding: 12px 0;
        z-index: 999;
    }
    .site-nav.open { display: block; }

    .nav-list { flex-direction: column; gap: 0; }
    /* Larger, easier-to-tap touch targets in the dropdown menu */
    .nav-link { padding: 13px 24px; border-radius: 0; font-size: 1rem; }
    .dropdown { display: none !important; position: static; border: none; box-shadow: none; }
    .nav-item.has-dropdown.open .dropdown { display: block !important; background: #f9fbe7; }
    .dropdown li a { padding: 11px 24px 11px 40px; font-size: .95rem; }

    .header-inner { position: relative; }
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1rem; }
    .cards-grid.cols-3,
    .cards-grid.cols-4 { grid-template-columns: 1fr; }
}
