/* ============================================
   Components — Buttons, Hero, CTA, Cookie Banner, Forms
   ============================================ */

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  text-transform: uppercase;   /* OG pills are all-caps ("VIEW ALL RECIPES") */
  letter-spacing: 0.04em;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  text-align: center;
}

.btn--primary {
  background: var(--brand);
  color: var(--text-on-brand);
  border-color: var(--brand);
}
.btn--primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--text-on-brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
}
.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--brand-deep);
  border-color: var(--brand);
}
.btn--outline:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
}

/* Ghost — for use on dark surfaces (cookie banner decline) */
.btn--ghost {
  background: transparent;
  color: var(--text-on-dark);
  border-color: rgba(255, 255, 255, 0.4);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn--light { background: var(--white); color: var(--brand); border-color: var(--white); }
.btn--light:hover { background: rgba(255, 255, 255, 0.88); border-color: rgba(255, 255, 255, 0.88); color: var(--brand-deep); }

.btn--lg { padding: 1rem 2.25rem; font-size: var(--text-base); }
.btn--sm { padding: 0.5rem 1.25rem; font-size: var(--text-xs); }

/* --- Hero --- */
.hero {
  position: relative;
  padding: var(--space-5xl) 0;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-deep) 100%);
  color: var(--white);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(190, 38, 38, 0.16) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(190, 38, 38, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero__content { position: relative; z-index: 1; max-width: 720px; }

.hero--home .hero__content { max-width: 760px; }

.hero--centered .hero__content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero__eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-eyebrow);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--brand);
  margin-bottom: var(--space-sm);
  line-height: 1;
}

.hero__title { color: var(--white); margin-bottom: var(--space-lg); text-wrap: balance; }
.hero__title span { color: var(--brand); }

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--text-on-dark);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-2xl);
  opacity: 0.9;
}

.hero__actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }
.hero--centered .hero__actions { justify-content: center; }

/* Page hero variant (smaller, for interior pages) */
.hero--page { padding: var(--space-3xl) 0; }
.hero--page .hero__title { font-size: var(--text-4xl); }

/* Photo hero with white card overlay — the FVSP signature.
   Live-site geometry (re-measured 2026-08-29 across 1366→2560 viewports): the
   photo does NOT bleed to the viewport edge and is NOT capped — interior pages
   use calc(100% - 100px) with 16px rounded corners, the home slider uses 90%
   with square corners, and both keep growing with the viewport. The card sits
   FLUSH against the photo's edge, vertically centered.
   Variants: default = card left; .hero--flip = card right (the old promo slider
   alternated sides per slide); .hero--center = centered card. Text-only heroes
   use .hero--plain. */
/* Bottom margin for the same reason as .photo-band: on pages where a red or
   black section follows the banner, the inset rounded photo would otherwise sit
   flush against it (Joanne rev.2 #4). No top margin — the nav already separates. */
.hero--photo { position: relative; padding: 0; background: var(--white); overflow: hidden; margin-bottom: var(--space-3xl); }
.hero--photo::before, .hero--photo::after { content: none; }
.hero--photo .hero__bg,
.hero--photo .hero__scrim {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--banner-inset);
  border-radius: var(--banner-radius);
}
.hero--photo .hero__bg { background-size: cover; background-position: center; }
.hero--photo .hero__scrim { background: linear-gradient(90deg, rgba(20,24,28,0.30), rgba(20,24,28,0.04) 55%); }
.hero--photo .container {
  position: relative;
  z-index: 1;
  max-width: var(--banner-inset);
  padding-left: 0;
  padding-right: 0;
  min-height: var(--banner-min-h);
  display: flex;
  align-items: center;
}
.hero--flip .container,
.hero-slide--flip .container { justify-content: flex-end; }
.hero--flip .hero__scrim,
.hero-slide--flip .hero__scrim { background: linear-gradient(270deg, rgba(20,24,28,0.30), rgba(20,24,28,0.04) 55%); }
.hero--center .container { justify-content: center; }
.hero--center .hero__card { text-align: center; flex: 0 1 auto; width: 80%; max-width: 1440px; }
.hero--center .hero__scrim { background: rgba(20, 24, 28, 0.22); }
.hero--center .hero__actions { justify-content: center; }
.hero__card {
  background: var(--white);
  /* Live card widths, measured per page at 2048px (band 1948px):
       50% (974px) — quality-standards, about-us, farming-practices  [this base]
       46% (896px) — farm-store, recipes, contact                    [--compact]
       42% (774px) — home slider slides                              [.hero-slider]
     All sit flush against the banner's leading edge. flex-basis pins the width
     so a card with short copy still fills its share, as live does. */
  flex: 0 0 50%;
  max-width: 50%;
  padding: var(--space-xl);
  /* The card attaches flush to the photo's edge: square corners and no shadow
     on the attaching side — it reads as sliding in from the page gutter (OG). */
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: 18px 10px 36px -18px rgba(32, 39, 44, 0.35);
}
.hero__card--compact { flex-basis: 46%; max-width: 46%; }
.hero-slider .hero__card { flex-basis: 42%; max-width: 42%; }
.hero--flip .hero__card,
.hero-slide--flip .hero__card {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  box-shadow: -18px 10px 36px -18px rgba(32, 39, 44, 0.35);
}
.hero--center .hero__card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
/* ONE consistent hero-card treatment site-wide — matches the home page card.
   Smaller-than-hero title keeps each designed <br> line intact; --wide only
   widens the card for a long heading (it inherits this same font + padding). */
.hero__card .hero__title { color: var(--text-primary); font-size: var(--text-display); line-height: 1; margin-bottom: var(--space-sm); }
.hero__card .hero__subtitle { color: var(--text-secondary); opacity: 1; font-size: var(--text-body); margin-bottom: 0; }
.hero__card .hero__subtitle:last-child { margin-bottom: 0; }
.hero__card .hero__actions { margin-top: var(--space-lg); }
/* Back-compat: --compact now equals the default card (kept so existing markup is valid). */

/* Text-only hero on white (live where-to-buy/events pattern) */
.hero--plain { position: relative; background: var(--white); color: var(--text-primary); padding: var(--space-3xl) 0 var(--space-2xl); overflow: visible; }
.hero--plain::before, .hero--plain::after { content: none; }
.hero--plain .hero__content { max-width: 760px; margin: 0 auto; text-align: center; }
.hero--plain .hero__title { color: var(--text-primary); }
.hero--plain .hero__title span { color: var(--brand); }
.hero--plain .hero__subtitle { color: var(--text-secondary); opacity: 1; font-size: var(--text-body); }
.hero--plain .hero__actions { justify-content: center; }

/* Tablet: live keeps the inset banner but widens the card to ~76% of it
   (measured 508/668 at 768 and 669/880 at 980). Live's boundaries are Divi's:
   full width at ≤767, 76% from 768–980, 50% from 981 — matching them here keeps
   the card from jumping 26 points at the wrong pixel. */
@media (max-width: 980px) and (min-width: 768px) {
  .hero__card,
  .hero__card--compact,
  .hero-slider .hero__card { flex-basis: 76%; max-width: 76%; }
}



/* --- Hero slider (home) ---
   Slides stack in one grid cell; the tallest defines the section height.
   Crossfade via opacity; slide 1 ships .is-active so no-JS users see it. */
.hero-slider { display: grid; }

/* Home slider runs wider and taller than the interior banners, with square
   corners — matching the live home hero (90%, ~630px, radius 0). */
.hero-slider .hero__bg,
.hero-slider .hero__scrim { width: var(--banner-home); border-radius: 0; }
.hero-slider .container { max-width: var(--banner-home); min-height: var(--banner-min-h-home); }
.hero-slider > .hero-slide {
  grid-area: 1 / 1;
  position: relative;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0.9s;
}
.hero-slider > .hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-slider__dots {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 2;
}
/* Dots: 24x24 hit area (WCAG 2.5.8 target size) with a 10px visual circle */
.hero-slider__dot,
.testi-carousel__dot {
  position: relative;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.hero-slider__dot::after,
.testi-carousel__dot::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid #fff;
  /* halo keeps white dots legible over pale photo areas */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
  transition: background var(--transition-fast);
}
.hero-slider__dot.is-active::after, .hero-slider__dot:hover::after,
.testi-carousel__dot.is-active::after, .testi-carousel__dot:hover::after { background: #fff; }

/* --- Testimonial carousel (home) — the original rotated quotes in a card
   carousel; no-JS falls back to the .testimonial-grid-style static grid. --- */
.testi-carousel { overflow: hidden; }
.testi-carousel__track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}
.js .testi-carousel__track {
  display: flex;
  align-items: stretch;
  transition: transform 0.6s ease;
}
.js .testi-carousel__track > .testimonial { flex: 0 0 calc((100% - 2 * var(--space-xl)) / 3); }
.testi-carousel__dots { display: flex; justify-content: center; gap: 10px; margin-top: var(--space-xl); }
@media (max-width: 1024px) {
  .testi-carousel__track { grid-template-columns: repeat(2, 1fr); }
  .js .testi-carousel__track > .testimonial { flex-basis: calc((100% - var(--space-xl)) / 2); }
}
@media (max-width: 768px) {
  .testi-carousel__track { grid-template-columns: 1fr; }
  .js .testi-carousel__track > .testimonial { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slider > .hero-slide { transition: none; }
  .js .testi-carousel__track { transition: none; }
}

/* Red full-width section band (signature).
   Rescope the color tokens so ALL descendant text (labels, prose, muted copy,
   list markers) is legible on red without per-element overrides. */
.section--red {
  background: var(--brand);
  color: #fff;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.92);
  --text-light: rgba(255, 255, 255, 0.78);
  --brand-deep: #ffffff;
  --border: rgba(255, 255, 255, 0.25);
  --border-light: rgba(255, 255, 255, 0.2);
}
.section--red h2, .section--red h3, .section--red h4 { color: #fff; }
.section--red .section__header p, .section--red p { color: rgba(255, 255, 255, 0.92); }
.section--red a:not(.btn) { color: #fff; text-decoration: underline; }

/* White surfaces nested INSIDE a red band get the light-theme tokens back —
   without this, the band-level rescope above paints their text white-on-white
   (e.g. the home-page testimonial cards). Values mirror :root in tokens.css —
   keep in sync. */
.section--red .testimonial {
  --text-primary: #1e1e1e;
  --text-secondary: #666666;
  --text-light: #666c72;
  --brand-deep: #9e1f1f;
  --border: #e2e4e6;
  --border-light: #eef0f1;
  color: var(--text-primary);
}
.section--red .testimonial p,
.section--red .testimonial blockquote { color: var(--text-secondary); }

/* Feature card grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}
.features-grid--2col { grid-template-columns: repeat(2, 1fr); }
.features-grid--4col { grid-template-columns: repeat(4, 1fr); }

.feature-card {
  padding: var(--space-xl);
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.feature-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  background: rgba(190, 38, 38, 0.10);
  color: var(--brand);
}
.feature-card__icon .material-icons-outlined { font-size: 1.75rem; }
.feature-card__title { font-size: var(--text-card-title); line-height: 1.3; margin-bottom: var(--space-sm); }
.feature-card__text { color: var(--text-secondary); font-size: var(--text-card-body); line-height: 1.6; }

@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .features-grid, .features-grid--2col { grid-template-columns: 1fr; }
}

/* Red feature cards (for use on white or red bands) */
.feature-card--red { background: var(--brand); border: none; color: #fff; }  /* live cards are #be2626, not brand-deep */
.feature-card--red .feature-card__title { color: #fff; }
.feature-card--red .feature-card__text { color: rgba(255, 255, 255, 0.9); }
.feature-card--red .feature-card__icon { background: rgba(255, 255, 255, 0.16); color: #fff; }
.section--red .feature-card--red { background: rgba(0, 0, 0, 0.12); }

/* --- CTA Banner --- */
.cta-banner {
  position: relative;
  padding: var(--space-4xl) 0;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-deep) 100%);
  color: var(--white);
  text-align: center;
  overflow: hidden;
}

.cta-banner::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(190, 38, 38, 0.18) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

.cta-banner h2 { color: var(--white); margin-bottom: var(--space-md); }

.cta-banner p {
  font-size: var(--text-lg);
  opacity: 0.92;
  margin: 0 auto var(--space-2xl);
  max-width: 600px;
}

.cta-banner__actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--ink-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-md) 0;
}

.cookie-banner[hidden] { display: none; }

.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.cookie-banner__text {
  font-size: var(--text-sm);
  color: var(--text-on-dark);
  margin: 0;
}
/* White underlined link — brand red fails contrast on the dark banner */
.cookie-banner__text a { color: #fff; text-decoration: underline; }
.cookie-banner__text a:hover { opacity: 0.85; }

.cookie-banner__actions { display: flex; gap: var(--space-sm); flex-shrink: 0; }

/* --- Contact Form (used by the contact page, built in Phase 3) --- */
.form-group { margin-bottom: var(--space-lg); }

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(190, 38, 38, 0.15);
}

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }

.form-required { color: var(--brand); }
.form-optional { color: var(--text-light); font-weight: 400; }
.contact-form__note { font-size: var(--text-xs); color: var(--text-light); margin-top: var(--space-md); }
/* Honeypot — visually removed, still in the DOM for bots to find */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

@media (max-width: 768px) {
  .hero { padding: var(--space-4xl) 0; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { text-align: center; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---- Store-shutdown announcement bar (partials/store-notice.njk) ---- */
.store-notice {
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--brand);
}
.store-notice[hidden] { display: none; }
.store-notice__inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}
.store-notice__text {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.store-notice__text strong { color: #fff; }
.store-notice__text a {
  color: #fff;
  text-decoration: underline;
  font-weight: 600;
  white-space: nowrap;
}
.store-notice__text a:hover { color: var(--accent); }
.store-notice__close {
  flex-shrink: 0;
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--transition-fast);
}
.store-notice__close:hover { background: var(--brand); }

/* Mobile: live does NOT use the desktop card-over-photo pattern on phones. It
   stacks — a rounded photo block, then the text below it on white, left-aligned,
   both in a ~40px-gutter column. Joanne's 3rd round asked for this seven times
   ("a graphic banner followed by and not covered with a text block"); we had
   shipped the desktop overlay just made full-width, which is why every banner
   read wrong on a phone. */
@media (max-width: 767px) {
  .hero--photo { margin-bottom: var(--space-2xl); }

  /* the photo leaves the absolute layer and becomes a block in normal flow */
  .hero--photo .hero__bg,
  .hero-slider .hero__bg {
    position: static;
    transform: none;
    left: auto;
    width: var(--mobile-content);
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--banner-radius);
  }
  /* nothing sits over the photo any more, so the darkening scrim goes */
  .hero--photo .hero__scrim,
  .hero-slider .hero__scrim { display: none; }

  .hero--photo .container,
  .hero-slider .container {
    display: block;
    max-width: var(--mobile-content);
    margin: 0 auto;
    min-height: 0;
    padding: 0;
  }

  /* the card loses its card-ness: it is just the text block under the photo */
  .hero__card,
  .hero__card--compact,
  .hero-slider .hero__card,
  .hero--center .hero__card,
  .hero--flip .hero__card,
  .hero-slide--flip .hero__card {
    flex: none;
    width: 100%;
    max-width: 100%;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: var(--space-xl) 0 0;   /* the gap live leaves between photo and text */
    text-align: left;
  }
  .hero__card .hero__actions,
  .hero--center .hero__actions { justify-content: flex-start; }

  /* text-only heroes get the same column */
  .hero--plain .container { max-width: var(--mobile-content); padding: 0; }
  .hero--plain .hero__content { max-width: 100%; text-align: left; }
  .hero--plain .hero__actions { justify-content: flex-start; }

  /* The home slider keeps live's wider 90% inset (371@21 at 412px) rather than
     the 40px-gutter column, but still needs the rounded corners every other
     mobile photo block has, and must drop its desktop 630px min-height. */
  .hero-slider .hero__bg { width: var(--banner-home); border-radius: var(--banner-radius); }
  .hero-slider .container { max-width: var(--banner-home); min-height: 0; }
}
