/* ==========================================================================
   Castro Valley Marketplace — shared design system (v2)
   Load on every page BEFORE page-specific styles.
   Tokens first; change a color/radius here and the whole site follows.
   ========================================================================== */

:root {
    --green: #4C7737;
    --green-dark: #3d5f2c;
    --gold: #FFC52F;
    --gold-dark: #e5b229;
    --ink: #333;
    --muted: #666;
    --faint: #999;
    --cream: #faf8f4;
    --line: #e5e5e5;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lift: 0 10px 30px rgba(0,0,0,0.14);
    --font-display: 'thirsty-rough-two', 'Barlow', Arial, sans-serif;
    --font-body: 'Barlow', Arial, sans-serif;
}

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

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--ink);
    background: #fff;
}

img { max-width: 100%; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Header / nav ---- */
.site-header {
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.header-inner {
    max-width: 1350px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo img {
    width: 110px;
    height: auto;
    display: block;
}

.desktop-nav {
    display: flex;
    gap: 2px;
    align-items: center;
}

.desktop-nav a {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    background: var(--cream);
    color: var(--green);
}

.nav-dropdown { position: relative; }

.nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-dropdown > a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    opacity: 0.6;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 180px;
    box-shadow: var(--shadow-lift);
    border-radius: var(--radius-sm);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 6px;
}

.menu-toggle {
    display: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
    color: var(--green);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.menu-toggle .icon-close { display: none; }
.menu-toggle.active .icon-open { display: none; }
.menu-toggle.active .icon-close { display: block; }

.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-nav.active { display: flex; }

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.mobile-nav-close {
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-menu li { border-bottom: 1px solid var(--line); }

.mobile-nav-menu a {
    display: block;
    padding: 16px 25px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.mobile-nav-menu a.sub {
    padding-left: 45px;
    font-size: 15px;
    font-weight: 400;
    color: var(--muted);
}

@media (max-width: 900px) {
    .desktop-nav { display: none; }
    .menu-toggle { display: flex; }
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s;
}

.btn-primary {
    background: var(--gold);
    color: var(--green);
}

.btn-primary:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.btn-outline:hover {
    background: #fff;
    color: var(--green);
}

.btn-green {
    background: var(--green);
    color: #fff;
}

.btn-green:hover { background: var(--green-dark); }

/* ---- Shared section helpers ---- */
.section-header { text-align: center; margin-bottom: 50px; }

.section-header h2,
.section-title {
    font-family: var(--font-display);
    font-size: 42px;
    color: var(--green);
    margin-bottom: 15px;
    line-height: 1.15;
}

.section-header p {
    font-size: 18px;
    color: var(--muted);
}

/* ---- FAQ (details/summary accordions) ---- */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-list details {
    background: #fff;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.faq-list summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
    content: '\2b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--green);
    flex-shrink: 0;
}

.faq-list details[open] summary::after { content: '\f068'; }

.faq-list details p {
    padding: 0 22px 18px;
    color: var(--muted);
    line-height: 1.7;
}

.faq-list details a { color: var(--green); font-weight: 600; }

/* ---- Newsletter form ---- */
.newsletter-form {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    min-width: 0;
    padding: 15px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font-body);
}

.newsletter-form button {
    padding: 15px 28px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.3s;
}

.newsletter-form button:hover { background: var(--green-dark); }

.newsletter-note {
    display: none;
    margin-top: 15px;
    font-weight: 600;
    color: var(--green);
}

.newsletter-note.error { color: #a33; }

@media (max-width: 600px) {
    .newsletter-form { flex-direction: column; }
}

/* ---- Footer ---- */
.site-footer {
    background: #2c2c2c;
    color: #fff;
    padding: 56px 20px 0;
}

.footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand .footer-tagline {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--gold);
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 14px;
    color: #c9c9c9;
    line-height: 1.7;
}

.footer-brand a { color: #c9c9c9; text-decoration: none; }
.footer-brand a:hover { color: #fff; }

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }

.footer-col a {
    color: #c9c9c9;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-col a:hover { color: var(--gold); }

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.3s;
}

.footer-social a:hover {
    background: var(--gold);
    color: var(--green);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 18px 20px;
    text-align: center;
    font-size: 13px;
    color: #a5a5a5;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    .footer-social { justify-content: center; }
}
