/* ============================================================
   FarmTab — Global Typography & Design System
   Applies DM Serif Display + DM Sans sitewide for cohesive
   visual identity across all templates.

   Load order: enqueued AFTER style.css, BEFORE all other sheets.
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── Global CSS Variables ── */
:root {
  /* Typography */
  --ft-font-display:  'DM Serif Display', Georgia, serif;
  --ft-font-body:     'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Brand Colors */
  --ft-green-dark:    #1a3a22;
  --ft-green:         #2f6f3e;
  --ft-green-mid:     #3d8a50;
  --ft-green-light:   #e8f2ea;
  --ft-green-xlight:  #f2f7f3;
  --ft-sand:          #f0ede6;
  --ft-border:        #dde8df;
  --ft-text:          #1a2e1c;
  --ft-text-mid:      #3d5c42;
  --ft-text-light:    #6a8a6e;
  --ft-white:         #ffffff;

  /* Shadows */
  --ft-shadow:        0 2px 16px rgba(26,58,34,0.08);
  --ft-shadow-md:     0 4px 32px rgba(26,58,34,0.12);

  /* Radii */
  --ft-radius:        12px;
  --ft-radius-sm:     8px;
  --ft-radius-pill:   999px;
}

/* ============================================================
   GLOBAL FONT APPLICATION
   Override the system-ui fallback set in style.css
   ============================================================ */

body,
p, li, td, th, label, input, button, select, textarea,
.widget, .entry-content, .woocommerce, .woocommerce-page {
  font-family: var(--ft-font-body);
  color: #1a2e1c;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   HEADING SYSTEM
   h1–h6 get DM Serif Display across every template.
   Sizes scale down gracefully from h1 → h6.
   ============================================================ */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--ft-font-display);
  color: var(--ft-text);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 0;
}

h1, .h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

h2, .h2 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

h3, .h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  line-height: 1.2;
  margin-bottom: 0.65rem;
}

h4, .h4 {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

h5, .h5 {
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

h6, .h6 {
  font-size: 0.875rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ============================================================
   BODY TEXT CONSISTENCY
   ============================================================ */

p {
  font-family: var(--ft-font-body);
  line-height: 1.7;
  color: #3d5c42;
  margin-bottom: 1rem;
}

a {
  font-family: var(--ft-font-body);
  color: var(--ft-green);
}

strong, b {
  font-weight: 700;
  font-family: var(--ft-font-body);
}

small {
  font-size: 0.8rem;
  font-family: var(--ft-font-body);
}

/* ============================================================
   FRONT PAGE OVERRIDES
   front-page.css sets system-ui — override headings only
   ============================================================ */

.front-page h1,
.front-page h2,
.front-page h3,
.front-page h4,
.front-page h5,
.front-page h6 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

.front-page p,
.front-page li,
.front-page span,
.front-page a {
  font-family: var(--ft-font-body);
}

/* Hero overlay headings on front page */
.hero-overlay h1 {
  font-family: var(--ft-font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400; /* DM Serif Display is naturally bold at regular weight */
  letter-spacing: -0.025em;
  color: #fff;
}

.farm-search-hero-overlay h2 {
  font-family: var(--ft-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  color: #fff;
}

/* How It Works card headings */
.how-it-works-step-text h3 {
  font-family: var(--ft-font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

/* Farmer CTA card */
.farmer-cta-card h2 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

/* Featured farms headers */
.featured-farms-header h2,
.featured-farms-header h3,
.farm-results-section h3,
.available-products-section h3 {
  font-family: var(--ft-font-body);
  font-weight: 700;
  letter-spacing: 0;
}

/* Homepage farm card body */
.homepage-farm-card-body h3 {
  font-family: var(--ft-font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

/* FAQ section (front page) */
.faq-column summary {
  font-family: var(--ft-font-body);
  font-weight: 600;
}

/* ============================================================
   FEATURES PAGE OVERRIDES
   features-farmtab-styles.css uses system-ui implicitly
   ============================================================ */

.features-farmtab-page h1,
.features-farmtab-page h2,
.features-farmtab-page h3 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

.features-farmtab-page .hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

.features-farmtab-page .section-title {
  font-family: var(--ft-font-display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.features-farmtab-page .section-description {
  font-family: var(--ft-font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ft-text-mid);
}

.features-farmtab-page .feature h3 {
  font-family: var(--ft-font-display);
  font-size: 1.2rem;
}

.features-farmtab-page .feature p {
  font-family: var(--ft-font-body);
  font-size: 0.95rem;
  color: var(--ft-text-mid);
}

/* Navbar pills on features page */
.features-farmtab-page .navbar a,
.features-farmtab-page .nav-links a {
  font-family: var(--ft-font-body);
}

/* ============================================================
   CSA SCHEDULER PAGE OVERRIDES
   ============================================================ */

.csa-scheduler-page h1,
.csa-scheduler-page h2,
.csa-scheduler-page h3 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

.csa-scheduler-page .hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

.csa-scheduler-page .hero p,
.csa-scheduler-page .delivery-text p,
.csa-scheduler-page p {
  font-family: var(--ft-font-body);
}

/* ============================================================
   MAP & PRODUCTS PAGE OVERRIDES
   ============================================================ */

.fmp-page,
.fmp-page p,
.fmp-page span,
.fmp-page button,
.fmp-page input {
  font-family: var(--ft-font-body);
}

.fmp-results-header h2 {
  font-family: var(--ft-font-body);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.fmp-farm-card-header h3,
.fmp-product-body h3 {
  font-family: var(--ft-font-body);
  font-weight: 700;
  letter-spacing: 0;
}

.fmp-infowindow-body h3 {
  font-family: var(--ft-font-body);
  font-weight: 700;
  letter-spacing: 0;
}

/* ============================================================
   MAP PAGE OVERRIDES
   ============================================================ */

.farmtab-map-hero h1 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

.farmtab-farm-list-section h2 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

.farmtab-farm-card-body h3 {
  font-family: var(--ft-font-body);
  font-weight: 700;
  letter-spacing: 0;
}

/* ============================================================
   SUBSITE PROFILE HEADER OVERRIDES
   ============================================================ */

.farmtab-farm-name {
  font-family: var(--ft-font-display);
  letter-spacing: -0.01em;
}

.sidebar-store-name {
  font-family: var(--ft-font-body);
  font-weight: 800;
}

.sidebar-cart-header h3,
.mobile-cart-panel-header h3 {
  font-family: var(--ft-font-body);
  font-weight: 700;
}

/* ============================================================
   SHOP / WOOCOMMERCE OVERRIDES
   ============================================================ */

.woocommerce-loop-product__title,
.farmtab-product .woocommerce-loop-product__title {
  font-family: var(--ft-font-body);
  font-weight: 600;
  letter-spacing: 0;
}

.woocommerce div.product .product_title {
  font-family: var(--ft-font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.woocommerce div.product .price {
  font-family: var(--ft-font-body);
  font-weight: 700;
}

/* Related products headings */
.related.products h2,
.upsells.products h2 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

/* Cart & Checkout */
.farmtab-cart-container h2,
.farmtab-checkout-container h2,
.farmtab-checkout-container h3 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

.cart_totals h2 {
  font-family: var(--ft-font-body);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0;
}

/* Checkout accordion labels */
.co-step-label {
  font-family: var(--ft-font-body);
  font-weight: 700;
}

.co-summary-title {
  font-family: var(--ft-font-body);
  font-weight: 700;
}

/* Thank you page */
.co-thankyou-wrap h2,
.woocommerce-thankyou-order-received {
  font-family: var(--ft-font-body);
  font-weight: 700;
}

/* My Account */
.farmtab-myaccount-container h2,
.farmtab-myaccount-container h3,
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

/* Single Product quick-view */
.farmtab-qv-title {
  font-family: var(--ft-font-display);
  letter-spacing: -0.015em;
}

.sp-title {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

/* ============================================================
   HEADER OVERRIDES
   ============================================================ */

.offscreen-nav a {
  font-family: var(--ft-font-body);
  font-weight: 600;
}

.btn-auth {
  font-family: var(--ft-font-body);
}

/* Subsite header */
.farmtab-header-center .cart-total {
  font-family: var(--ft-font-body);
  font-weight: 700;
}

.height-line-name {
  font-family: var(--ft-font-body);
}

/* ============================================================
   FOOTER OVERRIDES
   ============================================================ */

.site-footer,
.site-footer p,
.site-footer a,
.site-footer h3,
.footer-navigation-links a {
  font-family: var(--ft-font-body);
}

.text-footer-slogan h3 {
  font-family: var(--ft-font-display);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  font-weight: 400;
}

/* ============================================================
   DEFAULT CONTENT PAGE OVERRIDES
   ============================================================ */

.site-content h1 {
  font-family: var(--ft-font-display);
  letter-spacing: -0.02em;
}

.site-content .entry-content {
  font-family: var(--ft-font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: #3d5c42;
}

/* ============================================================
   CSA ORDER FORM OVERRIDES
   ============================================================ */

#csa-order-form,
#csa-order-form h2,
#csa-order-form h3,
#csa-order-form p,
#csa-order-form label,
#csa-order-form button {
  font-family: var(--ft-font-body);
}

#csa-order-form h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============================================================
   CONTACT FORMS
   ============================================================ */

.wpcf7-form,
.wpcf7-form input,
.wpcf7-form textarea,
.wpcf7-form select,
.wpcf7-form button,
.wpcf7-form label {
  font-family: var(--ft-font-body);
}

/* ============================================================
   GLOBAL LINK CONSISTENCY
   ============================================================ */

a {
  color: var(--ft-green);
  transition: color 0.15s ease;
}

a:hover {
  color: var(--ft-green-mid);
}

/* ============================================================
   GLOBAL BUTTON BASE
   Buttons across the theme use DM Sans
   ============================================================ */

button,
.button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  font-family: var(--ft-font-body);
}

/* ============================================================
   NOTICE / ALERT CONSISTENCY
   ============================================================ */

.farmtab-csa-notice p,
.farmtab-csa-notice a {
  font-family: var(--ft-font-body);
}

/* ============================================================
   CSA NOTICE BAR SUBSITE
   ============================================================ */

.csa-message-wrap p {
  font-family: var(--ft-font-body);
}
