/* ==========================================================================
   SF BioActives — brand stylesheet
   Aligned to the Sahyadri Farms brand system:
     · Nunito (site typeface, weights 400/600/700)
     · Fresh green #6b9c2f + lime #afc83b (site palette)
     · Deep forest + gold accent (SF BioActives sub-brand)
     · Pill buttons (100px) and 20px card radii (site component language)
   ========================================================================== */

.ba {
  --forest: #13301f;
  --forest-deep: #0d2417;
  --green: #6b9c2f;
  --green-dark: #557d24;
  --lime: #afc83b;
  --gold: #e3a83a;
  --cream: #f8f9f4;
  --sage: #f0f4e9;
  --paper: #fff;
  --ink: #253020;
  --body: #55634f;
  --line: #e3e8dc;

  color: var(--body);
  background: var(--paper);
  font-family: Nunito, Segoe UI, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.ba * { box-sizing: border-box }
/* :where() keeps this at zero specificity so component link colours below still win */
.ba :where(a) { color: inherit }
.ba img { display: block; max-width: 100% }
.ba em { font-style: italic }

.ba h1, .ba h2, .ba h3, .ba h4 {
  font-family: Nunito, Segoe UI, sans-serif;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.18;
  margin: 0 0 20px;
}
.ba h1 { font-size: clamp(34px, 4.4vw, 56px); letter-spacing: -1px; line-height: 1.1 }
.ba h2 { font-size: clamp(27px, 3vw, 40px); letter-spacing: -.5px }
.ba h3 { font-size: 22px }
.ba h4 { font-size: 17px; margin-bottom: 10px }
.ba p { margin: 0 0 20px }
.ba strong { font-weight: 700; color: var(--ink) }

/* Matches the site header and footer edge for edge at every width.
   The header is .header-section-2 (3% padding each side) wrapping
   .main-header-container (width:99%; max-width:1272px), which composes to
   min(0.99 x 0.94, 1272px) = min(93.06%, 1272px) of the document width.
   Verified against the nav at 1440 / 1000 / 375. Do not add a narrower
   override in a media query - this one formula is correct at all sizes. */
.ba-wrap { width: min(93.06%, 1272px); margin-inline: auto }

/* Every in-page anchor target has to clear the shared sticky site header,
   which measures up to 120px tall. The stacked cards override this with
   their own per-card offsets further down. */
.ba, .ba-section, .ba-cta, .ba-stack, .ba-jumps { scroll-margin-top: 140px }

/* --- sub-brand bar ------------------------------------------------------ */
.ba-bar { border-bottom: 1px solid var(--line); background: var(--paper) }
.ba-bar .ba-wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 16px 0; flex-wrap: wrap;
}
.ba-brand { display: block; flex: none }
.ba-brand img { height: 32px; width: auto }
.ba-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.ba-nav a {
  font-size: 14px; font-weight: 600; text-decoration: none;
  padding: 8px 18px; border-radius: 100px; color: var(--ink);
}
.ba-nav a:hover { background: var(--sage); color: var(--green-dark) }
.ba-nav a[aria-current="page"] { background: var(--sage); color: var(--green-dark); font-weight: 700 }
.ba-nav a.ba-nav-cta { background: var(--green); color: #fff }
.ba-nav a.ba-nav-cta:hover { background: var(--green-dark); color: #fff }

.ba a:hover { color: var(--green-dark) }
.ba a:focus-visible, .ba summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px }

.ba-crumbs { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; padding: 24px 0 4px; color: #7c8878 }
.ba-crumbs a { text-decoration: none }

/* --- shared bits -------------------------------------------------------- */
.ba-eyebrow {
  text-transform: uppercase; letter-spacing: 2px; font-size: 12px;
  font-weight: 700; color: var(--green); margin-bottom: 16px;
}
.ba-lead { font-size: 18px; line-height: 1.72; color: var(--body); max-width: 600px }

.ba-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 13px 30px; border-radius: 100px;
  background: var(--green); color: #fff !important;
  font-size: 15px; font-weight: 700; text-decoration: none;
}
.ba-button:hover { background: var(--green-dark); color: #fff !important }
.ba-button.outline { background: transparent; color: var(--ink) !important; box-shadow: inset 0 0 0 2px var(--line) }
.ba-button.outline:hover { background: var(--sage); box-shadow: inset 0 0 0 2px var(--green); color: var(--green-dark) !important }
.ba-button.light { background: #fff; color: var(--forest) !important }
.ba-button.light:hover { background: var(--lime); color: var(--forest) !important }
.ba-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 28px }

.ba-text-link { font-size: 15px; font-weight: 700; color: var(--green-dark); text-underline-offset: 5px }

/* validation / application pills */
.ba-badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px }
.ba-badge {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 100px; padding: 7px 16px; background: var(--sage);
  font-size: 13px; font-weight: 700; color: var(--green-dark);
}
.ba-badge.gold { background: #fbf1dc; color: #96690f }
.ba-badge::before { content: "●"; font-size: 8px; line-height: 1 }
.ba-badges.on-dark .ba-badge { background: #ffffff1f; color: #e8f0dc }

/* --- hero --------------------------------------------------------------- */
.ba-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; padding: 34px 0 72px }
.ba-hero-media { position: relative }
.ba-hero-media img { width: 100%; height: 470px; object-fit: cover; border-radius: 20px }
.ba-hero-media.tint { background: var(--cream); border: 1px solid var(--line); border-radius: 20px; padding: 26px }
.ba-hero-media.tint img { height: 420px; object-fit: contain; border-radius: 12px }
.ba-caption {
  position: absolute; left: 20px; bottom: 20px; right: 20px;
  padding: 11px 20px; border-radius: 100px; background: #13301fe6;
  color: #fff; font-size: 13px; font-weight: 600;
}

/* proof strip */
.ba-strip { background: var(--forest); color: #dfe9d4 }
.ba-strip .ba-wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; padding: 30px 0 }
.ba-strip b { display: block; color: #fff; font-size: 22px; font-weight: 700; line-height: 1.3 }
.ba-strip span { font-size: 13px; line-height: 1.5 }

/* --- sections ----------------------------------------------------------- */
.ba-section { padding: 84px 0 }
.ba-section.sage { background: var(--sage) }
.ba-section.cream { background: var(--cream) }
.ba-section.forest { background: linear-gradient(140deg, var(--forest-deep), #1d4429); color: #d8e4cc }
.ba-section.forest h2, .ba-section.forest h3 { color: #fff }
.ba-section.forest .ba-eyebrow { color: var(--gold) }
.ba-section.forest .ba-lead { color: #cfdcc2 }
.ba-intro { max-width: 680px; margin-bottom: 44px }

/* --- category cards ----------------------------------------------------- */
.ba-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 28px }
.ba-category {
  text-decoration: none; background: var(--paper); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
}
.ba-category:hover { border-color: var(--green) }
.ba-category img { height: 270px; width: 100%; object-fit: cover }
.ba-category-body { padding: 30px 30px 32px }
.ba-category h3 { margin: 6px 0 12px; font-size: 25px }
.ba-category p { color: var(--body); font-size: 15px }

/* --- value-chain steps -------------------------------------------------- */
.ba-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px }
.ba-step { background: var(--paper); border-radius: 20px; overflow: hidden; border: 1px solid var(--line) }
.ba-section.forest .ba-step { background: #ffffff0f; border-color: #ffffff24 }
.ba-section.forest .ba-step p { color: #c7d6ba }
.ba-step img { height: 180px; width: 100%; object-fit: cover }
.ba-step-body { padding: 22px 24px 26px }
.ba-step h3 { font-size: 19px; margin-bottom: 8px }
.ba-step p { font-size: 14.5px; line-height: 1.65; margin: 0 }
.ba-number {
  display: inline-block; margin-bottom: 12px; padding: 3px 12px; border-radius: 100px;
  background: var(--sage); color: var(--green-dark); font-size: 12px; font-weight: 700; letter-spacing: 1px;
}
.ba-section.forest .ba-number { background: #ffffff1f; color: var(--lime) }

/* --- feature cards ------------------------------------------------------ */
.ba-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px }
.ba-cards.four { grid-template-columns: repeat(4, 1fr) }
.ba-card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 28px }
.ba-card p { font-size: 14.5px; line-height: 1.65; margin: 0 }
.ba-card .ba-number { margin-bottom: 14px }
.ba-section.forest .ba-card { background: #ffffff0f; border-color: #ffffff24 }
.ba-section.forest .ba-card p { color: #c7d6ba }

/* feature cards nested inside a product column read as a compact stack */
.ba-product .ba-cards { grid-template-columns: 1fr; gap: 12px }
.ba-product .ba-card { padding: 18px 22px; background: var(--cream) }
.ba-product .ba-card h4 { color: var(--green-dark) }

/* photo grid (visual storytelling band) */
.ba-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px }
.ba-gallery figure { margin: 0; position: relative; border-radius: 20px; overflow: hidden }
.ba-gallery img { width: 100%; height: 230px; object-fit: cover }
.ba-gallery figcaption {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  padding: 8px 16px; border-radius: 100px; background: #13301fe0;
  color: #fff; font-size: 12.5px; font-weight: 700;
}
.ba-gallery figure.tall { grid-row: span 2 }
.ba-gallery figure.tall img { height: 476px }

/* --- product rows ------------------------------------------------------- */
.ba-jumps { border-bottom: 1px solid var(--line); background: var(--cream); padding: 18px 0 }
.ba-jumps .ba-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.ba-jumps strong { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--body); margin-right: 8px }
.ba-jumps a {
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  padding: 7px 16px; border-radius: 100px; background: var(--paper); border: 1px solid var(--line);
}
.ba-jumps a:hover { background: var(--green); border-color: var(--green); color: #fff }

.ba-product {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: center;
  padding: 64px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 140px;
}
.ba-product:last-child { border-bottom: 0 }
.ba-product-media {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; padding: 22px;
}
.ba-product-media img { width: 100%; height: 340px; object-fit: contain }
.ba-product-media.photo { padding: 0; border: 0 }
.ba-product-media.photo img { height: 380px; object-fit: cover }
.ba-product h2 { font-size: clamp(26px, 2.6vw, 34px); margin-bottom: 8px }
.ba-subtitle { font-size: 17px; font-weight: 700; color: var(--green-dark) !important; margin-bottom: 18px !important }

.ba-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 }
.ba-tags span {
  border-radius: 100px; padding: 6px 15px; font-size: 12.5px; font-weight: 700;
  color: var(--ink); background: var(--cream); border: 1px solid var(--line);
}
.ba-tags span.lead { background: var(--green); border-color: var(--green); color: #fff }

.ba-details { border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 22px; font-size: 15px }
/* the site stylesheet forces summary{display:block}, which kills the native marker — draw our own */
.ba-details summary {
  cursor: pointer; font-weight: 700; color: var(--ink); padding: 6px 0;
  display: flex; align-items: center; gap: 12px; list-style: none;
}
.ba-details summary::-webkit-details-marker { display: none }
.ba-details summary::before {
  content: "+"; flex: none; width: 24px; height: 24px; border-radius: 100px;
  background: var(--sage); color: var(--green-dark);
  font-size: 16px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.ba-details[open] summary::before { content: "–" }
.ba-details summary:hover::before { background: var(--green); color: #fff }
.ba-details ul { padding-left: 20px; margin: 14px 0 0 }
.ba-details li { margin: 8px 0 }

/* --- split -------------------------------------------------------------- */
.ba-split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center }
.ba-split img { width: 100%; height: 400px; object-fit: cover; border-radius: 20px }

/* --- groups & tables ---------------------------------------------------- */
.ba-group { padding-top: 64px; scroll-margin-top: 140px }
.ba-group > p { max-width: 720px }
.ba-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; margin: 22px 0 }
.ba table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 440px }
.ba caption { text-align: left; font-size: 13px; margin-bottom: 12px; color: #7c8878 }
.ba th, .ba td { padding: 13px 18px; border-bottom: 1px solid var(--line); text-align: left }
.ba thead th { background: var(--sage); color: var(--ink); font-weight: 700 }
.ba tbody th { font-weight: 600; color: var(--ink) }
.ba tr:last-child th, .ba tr:last-child td { border-bottom: 0 }

/* --- CTA ---------------------------------------------------------------- */
.ba-cta { background: linear-gradient(140deg, var(--forest-deep), #1d4429); color: #d8e4cc; padding: 72px 0 }
.ba-cta .ba-wrap { display: flex; gap: 48px; justify-content: space-between; align-items: center; flex-wrap: wrap }
.ba-cta h2 { color: #fff }
.ba-cta .ba-eyebrow { color: var(--gold) }
.ba-cta p { color: #cfdcc2; margin: 0 }
.ba-cta a { color: #fff; overflow-wrap: anywhere }
.ba-contact { font-size: 17px; font-weight: 700; margin-top: 20px !important }
.ba-small { font-size: 14px }

.ba-disclaimer { padding: 26px 0; font-size: 12.5px; color: #8b957f }
/* the space below is what keeps this link off the dark CTA band that
   follows it — it replaces the hardcoded spacer divs that used to do this */
.ba-back {
  display: inline-block; margin: 24px 0 72px;
  font-size: 15px; font-weight: 700; color: var(--green-dark); text-underline-offset: 5px;
}

/* --- responsive --------------------------------------------------------- */
@media (max-width: 1100px) {
  .ba-gallery, .ba-steps, .ba-cards.four { grid-template-columns: repeat(2, 1fr) }
  .ba-gallery figure.tall { grid-row: span 1 }
  .ba-gallery figure.tall img { height: 230px }
}
@media (max-width: 991px) {
  .ba-hero, .ba-product, .ba-split { gap: 36px }
  .ba-hero-media img { height: 400px }
  .ba-strip .ba-wrap { grid-template-columns: repeat(2, 1fr) }
  .ba-cards { grid-template-columns: 1fr 1fr }
}
@media (max-width: 767px) {
  .ba-bar .ba-wrap { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 0 }
  .ba-brand img { height: 28px }
  .ba-nav { gap: 6px }
  .ba-nav a { padding: 7px 14px; font-size: 13px }
  .ba-hero { grid-template-columns: 1fr; gap: 30px; padding: 10px 0 44px }
  .ba-hero-media img { height: 300px }
  .ba-section { padding: 54px 0 }
  .ba-categories, .ba-product, .ba-split, .ba-steps, .ba-cards, .ba-cards.four, .ba-gallery { grid-template-columns: 1fr }
  .ba-category img { height: 220px }
  .ba-product { padding: 44px 0; gap: 26px }
  .ba-product-media img, .ba-product-media.photo img { height: 260px }
  .ba-gallery img, .ba-gallery figure.tall img { height: 220px }
  .ba-split img { height: 260px }
  .ba-cta { padding: 52px 0 }
  .ba-cta .ba-wrap { flex-direction: column; align-items: flex-start; gap: 26px }
  .ba-lead { font-size: 16.5px }
  .ba-group { padding-top: 44px }
}

/* No `html { scroll-behavior: smooth }`: the jump links travel up to ~3,500px,
   and the browser's smooth scroll over that distance reads as lag. Anchor
   jumps are instant; bio-actives-stack.js adds a short, distance-capped
   glide where it is loaded. */
@media (prefers-reduced-motion: no-preference) {
  .ba-button, .ba-nav a, .ba-jumps a, .ba-category { transition: background .2s, color .2s, border-color .2s }
  .ba-category img { transition: transform .35s }
  .ba-category:hover img { transform: scale(1.03) }
}

/* ==========================================================================
   Stacked product cards — each card pins under the site header and the next
   one slides over it. Pure CSS: position:sticky for the stack, scroll-driven
   animations for the motion. Enabled only where there is room for it.
   ========================================================================== */

/* --stack-top must clear the shared sticky header, which measures up to 120px
   (101px at ~1000px wide, 120px at 1440px). 156px leaves it 36px of air. */
.ba-stack { --stack-top: 156px; --stack-step: 14px; padding-bottom: 40px }

@media (min-width: 992px) and (min-height: 680px) {
  .ba-stack {
    padding-top: 56px;    /* lead-in, so the first card clears the jump nav */
    /* Purely visual breathing room before the back-link. It does NOT extend
       the sticky range: the last card sits at the end of the containment box
       and slides straight through its offset either way (verified at 80px and
       400px — identical). Keep it balanced with .ba-back's bottom margin. */
    padding-bottom: 48px;
  }
  .ba-stack .ba-product {
    position: sticky;
    top: var(--stack-top);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 44px 48px;
    margin-bottom: 30px;
    box-shadow: 0 26px 50px -30px #13301f59;
  }
  /* each card rests a little lower than the one it covers, so the stack
     keeps a visible edge of every card beneath it */
  .ba-stack .ba-product:nth-child(2) { top: calc(var(--stack-top) + var(--stack-step)) }
  .ba-stack .ba-product:nth-child(3) { top: calc(var(--stack-top) + var(--stack-step) * 2) }
  .ba-stack .ba-product:nth-child(4) { top: calc(var(--stack-top) + var(--stack-step) * 3) }
  .ba-stack .ba-product:nth-child(5) { top: calc(var(--stack-top) + var(--stack-step) * 4) }
  .ba-stack .ba-product:nth-child(6) { top: calc(var(--stack-top) + var(--stack-step) * 5) }
  .ba-stack .ba-product:last-child { margin-bottom: 0; border-bottom: 1px solid var(--line) }
  /* Each card must land on the anchor at its OWN resting offset. With a single
     shared value the last card lands past the point the stack can still hold
     it, so it arrives already sliding out from under the deck. */
  .ba-stack .ba-product:nth-child(1) { scroll-margin-top: var(--stack-top) }
  .ba-stack .ba-product:nth-child(2) { scroll-margin-top: calc(var(--stack-top) + var(--stack-step)) }
  .ba-stack .ba-product:nth-child(3) { scroll-margin-top: calc(var(--stack-top) + var(--stack-step) * 2) }
  .ba-stack .ba-product:nth-child(4) { scroll-margin-top: calc(var(--stack-top) + var(--stack-step) * 3) }
  .ba-stack .ba-product:nth-child(5) { scroll-margin-top: calc(var(--stack-top) + var(--stack-step) * 4) }
  .ba-stack .ba-product:nth-child(6) { scroll-margin-top: calc(var(--stack-top) + var(--stack-step) * 5) }

  /* Motion. --c is set by bio-actives-stack.js: 0 = uncovered, 1 = fully
     covered by the next card. The card recedes as the next one slides over. */
  @media (prefers-reduced-motion: no-preference) {
    .ba-stack .ba-product {
      --c: 0;
      transform-origin: 50% 0;
      scale: calc(1 - .05 * var(--c));
      filter: brightness(calc(1 - .11 * var(--c)));
    }
    /* .ba-stack-js is only added once the script runs, so the cards stay
       fully visible if it never does */
    .ba-stack-js .ba-product {
      opacity: 0;
      translate: 0 44px;
      transition: opacity .6s ease, translate .7s cubic-bezier(.22, .68, .26, 1);
    }
    .ba-stack-js .ba-product.is-in { opacity: 1; translate: 0 0 }
  }
}
