/**
 * Harvest — Buttons (C8).
 *
 * One button system, two surfaces: the theme's own `.hrv-btn*` classes (used by
 * Harvest templates) AND Magento core button classes (`.action.primary`,
 * `.action.tocart`, `.action.secondary`, and the generic `button`/`.action`)
 * so real catalog / cart / checkout pages get the Harvest look without touching
 * core templates. All colour comes from --hrv-* tokens (palette + dark safe).
 *
 * Comp reference: solid accent fill / white text / 8px radius (primary),
 * transparent + accent border (secondary), 13–14px, weight 600.
 */

/* SPECIFICITY REPAIR — Blank was winning the corner radius.
   Magento Blank's `styles-m.css` carries `a.action.primary { border-radius: 3px }` at
   (0,2,1). The theme's own `.action.primary` below is (0,2,0), so on any button that
   happens to be an <a> Blank won and the theme's radius never applied. S7 caught it on
   T2: the hero CTA "Shop the season" rendered at 3px beside three "Add to Cart"
   buttons at 14px — same colour, same height, two different corner shapes on one page.
   This is the same (0,2,1)-beats-(0,2,0) class that beat the theme on `width` on Home,
   where `float` in the SAME declaration block won and the block read as fully applied.
   A DECLARATION BLOCK IS NOT AN ALL-OR-NOTHING UNIT.
   Adding the element qualifier makes the theme's own selector (0,2,1) and puts it
   after Blank in source order, so it wins on both counts rather than relying on either.

   NOT CHANGED HERE, deliberately: the comp specifies a 999px pill for these CTAs
   (12 pill declarations against 9 at 14px, so the artboard genuinely mixes the two).
   Choosing WHICH buttons become pills is a theme-wide design decision affecting every
   one of the 434 pages, and I am not making it inside a T2 fix. This change restores
   the radius the theme already declares; the pill question is filed separately. */
.hrv-btn,
a.hrv-btn,
.action.primary,
a.action.primary,
.action.tocart,
a.action.tocart,
.action.submit,
.action.submit.primary,
.action.select,
.action.secondary,
a.action.secondary,
button.action-primary,
.actions-toolbar .action.primary,
.actions-toolbar a.action.primary,
  /* N-16: enumerated from the SERVED Blank sheets rather than patched one at a time as each
     page review surfaced one. These are the Blank/Luma button rules that set border-radius
     and outrank the theme block above:
       styles-l.css  .block.newsletter .action.subscribe            (0,3,0)  <- N-16, global footer
       styles-m.css  .cart.table-wrapper .actions-toolbar > .action (0,4,0)
       styles-m.css  a.pagebuilder-button-primary / -secondary      (0,1,1)
       styles-m.css  .minicart-wrapper .action.showcart .counter.qty(0,4,0)  (a badge, not a button)
     Two instances had already been found by two reviews of ONE page, which is the signal to
     enumerate rather than keep repairing. The theme block now names them. */
.block.newsletter .action.subscribe,
.cart.table-wrapper .actions-toolbar > .action,
a.pagebuilder-button-primary,
a.pagebuilder-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--hrv-font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 13px 28px;
  border-radius: var(--hrv-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Primary — solid accent.
   ------------------------------------------------------------------------------
   `a.action.primary` AND `.actions-toolbar a.action.primary` ARE LOAD-BEARING HERE,
   for the same reason `a.action.secondary` is on the secondary rule below. This is
   the second half of that repair — filed as register #20, "register #1 is HALF-done".

   THE BUG. The base rule at the top of this file lists BOTH `a.action.primary`
   (0,2,1) and `.actions-toolbar a.action.primary` (0,3,1) and sets the SHORTHAND
   `border: 1px solid transparent`. This rule used to list only the un-qualified
   `.action.primary` (0,2,0) and `.actions-toolbar .action.primary` (0,3,0), so on an
   <a> the base won `border-color` and every anchor-based primary in the theme carried
   a transparent border. `background` and `color` still landed, because the base rule
   sets neither.

   RETRACTED: "THE DEFECT CLASS HAS FOUR MEMBERS, NOT ONE" - the count was itself an
     undercount, and this is the THIRD time in one task that this claim has been stated too
     narrowly. The sequence: fixed `.primary` alone and wrote "FIXED THEME-WIDE"; two reviewers
     measured three more; the corrected claim said FOUR; an S8 re-derivation enumerated the base
     rule mechanically rather than reading the four named, and found EIGHT element-qualified
     selectors of which two anchors still computed `rgba(0, 0, 0, 0)`.

     What kept going wrong is not the arithmetic. Each pass enumerated from the previous pass's
     list instead of from the base rule itself. The list is now derived from the rule.

     MEASURED, by a probe proven to discriminate both ways (control A: a repaired member reads
     repaired; control B: a forced-transparent member reads transparent):
       repaired    a.hrv-btn · a.action.primary · a.action.tocart · a.action.secondary
                   button.action-primary · .actions-toolbar a.action.primary
       WAS BROKEN  a.pagebuilder-button-secondary · a.pagebuilder-button-primary
                   .block.newsletter .action.subscribe        <- ships on 5/5 routes
       not proven  .cart.table-wrapper .actions-toolbar > .action  (cart empty; unreached live)

     The pagebuilder pair rendered 0 times across /, /farms, /checkout/cart, /about and /contact,
     so this was latent rather than visible - which is why a live census reading "10 anchor
     buttons, 0 transparent" was true as scoped and still missed them. Scope was the defect.
      The base rule element-qualifies
   `a.hrv-btn` (0,1,1), `a.action.primary` (0,2,1), `a.action.tocart` (0,2,1) and
   `a.action.secondary` (0,2,1) — every one of them inheriting `border: 1px solid
   transparent`. Register #1 repaired the secondary; register #20 named only
   `a.action.primary`. A review applied CLAUDE.md §3.18 ("how many instances does this
   class have?") and the answer, MEASURED live on basil at 1440 with a `<button>` control
   opaque in every row, was that THREE were still broken after the primary-only fix:
       a.action.tocart        anchor rgba(0,0,0,0)  vs  button rgb(76,122,63)
       a.hrv-btn--primary     anchor rgba(0,0,0,0)  vs  button rgb(76,122,63)
       a.hrv-btn--secondary   anchor rgba(0,0,0,0)  vs  button rgb(76,122,63)
   All are repaired here and on the secondary rule below, so the register row can be
   closed honestly rather than closed for one member. Shipped call-sites for the
   `hrv-btn` pair: `t37/store-locator.phtml:124-125` and `t32/faq.phtml:178` and `:208`.

   EVERY ONE OF THESE PAIRS IS A SOURCE-ORDER TIE, AND THE FIRST DRAFT OF THIS NOTE GOT
   THAT WRONG. RETRACTED: "Moving either block past the other silently reopens the bug on
   toolbar anchors alone." False, and dangerously narrow. `a.action.primary` in the base
   (0,2,1) and `a.action.primary` here (0,2,1) are ALSO an exact tie, as are `a.hrv-btn`
   (0,1,1) / `a.hrv-btn` and `.actions-toolbar a.action.primary` (0,3,1) / itself. NONE of
   these qualifiers wins on specificity — every one of them wins ONLY because this rule
   sits below the base rule IN THIS FILE. Reordering the two blocks reopens the bug on
   EVERY anchor-based button in the theme, not on toolbar anchors alone. The earlier
   wording framed the first qualifier as a specificity win and only the second as
   order-dependent; both are order-dependent, and a reader acting on the old sentence
   would have believed the common case was safe.

   MEASURED, not reasoned (`scripts/harvest/basil-t9-primary-border.js`, live at 1440
   on basil, three routes). Injecting an <a> and a <button> carrying identical classes
   returned borderTopColor `rgba(0, 0, 0, 0)` for the anchor and `rgb(76, 122, 63)`
   for the button on the same page — with the button doubling as the control that
   proves this sheet was loaded and matching at all. The field census found the defect
   SHIPPING on Home: the visible "Shop the pantry" CTA measured transparent. The cart's
   "Browse the aisles" measured the accent only because `_cart.css` carried a
   page-local workaround for exactly this, which this change retires.

   THE HOVER RULE BELOW IS DELIBERATELY NOT QUALIFIED, and this was measured rather
   than copied from the secondary's docblock. `.action.primary:hover` is (0,3,0),
   which already outranks the base's `a.action.primary` (0,2,1), so anchors receive
   the hover border today. THE SECOND CLAUSE MATTERS AND WAS MISSING: inside an
   `.actions-toolbar` the base matches at (0,3,1), which BEATS (0,3,0) — the hover
   state survives there only because the hover list separately carries
   `.actions-toolbar .action.primary:hover` at (0,4,0). Anyone applying the first
   sentence's reasoning inside a toolbar, without that second rule, would get it wrong.
   The measurement below was taken on the cart CTA, which is NOT in a toolbar, so it
   does not exercise this case. Confirmed on the live cascade with CDP-forced :hover
   (render-rig `--hover`, `trustworthy: true`, read after the 150ms transition
   settled): borderTopColor moved transparent -> `oklab(0.451486 -0.0649868
   0.0564204)`. Adding `a.` there would be a no-op, and a no-op selector is a claim
   that something was needed. */
.hrv-btn,
a.hrv-btn,
.hrv-btn--primary,
a.hrv-btn--primary,
.action.primary,
a.action.primary,
.action.tocart,
a.action.tocart,
.action.submit,
.action.submit.primary,
.action.select,
button.action-primary,
.actions-toolbar .action.primary,
.actions-toolbar a.action.primary,
/* THE N-16 ENUMERATION REACHED THE BASE RULE AND NOT THIS ONE, WHICH IS THE SAME BLIND SPOT IT
   WAS WRITTEN TO CLOSE. N-16 added four Blank/Luma selectors to the shared base above so they
   would pick up the theme's geometry - and the base sets `border: 1px solid transparent`. It did
   not add them here, so they inherited a transparent border and no colour ever replaced it.
   Measured live by the S8 gate on the deployed sheet: `a.pagebuilder-button-primary` and
   `a.pagebuilder-button-secondary` computed `rgba(0, 0, 0, 0)` while their `<button>` twins were
   opaque - the exact anchor/button asymmetry register #20 exists for.
   Specificity: each ties its base declaration and wins on source order, because this block
   follows it. Verified rather than assumed. */
.block.newsletter .action.subscribe,
/* :not(.action-delete) - THE DESTRUCTIVE CONTROL IS NOT A PRIMARY BUTTON.
   This selector exists for the cart's real primary actions, but .action-delete is also an
   .action inside .actions-toolbar, so Remove took the accent FILL from here while
   pages/_cart.css set its label to --hrv-text-muted. Muted on accent measures 1.28:1 - four
   instances on a populated cart, one per row - which is invisible rather than merely low.
   The two rules disagreed about what the control IS, and _cart.css states the intent in its
   own comment: a text control, deliberately not accent, because accent-on-bg fails AA on
   wheat. That reasoning was right and was simply being overridden here.
   ONLY THE PRIMARY LIST IS EXCLUDED. The same selector appears in the secondary list above,
   which sets only a radius and a transparent border and no background, so the control keeps
   its shape and takes its colour from _cart.css - muted on the white row, about 5.8:1.
   Found by tomato-T16. */
.cart.table-wrapper .actions-toolbar > .action:not(.action-delete),
a.pagebuilder-button-primary {
  background: var(--hrv-accent);
  border-color: var(--hrv-accent);
  color: var(--hrv-accent-text);
}
.hrv-btn:hover,
.hrv-btn--primary:hover,
.action.primary:hover,
.action.tocart:hover,
.action.submit:hover,
.action.submit.primary:hover,
.action.select:hover,
button.action-primary:hover,
.actions-toolbar .action.primary:hover {
  background: var(--hrv-accent-hover);
  border-color: var(--hrv-accent-hover);
  color: var(--hrv-accent-text);
}

/* Secondary — outline.
   ------------------------------------------------------------------------------
   `a.action.secondary` IS LOAD-BEARING HERE. Do not "tidy" it away as a duplicate of
   the line above it.

   THE BUG IT FIXES. The base rule at the top of this file lists BOTH `.action.secondary`
   and `a.action.secondary` and sets the SHORTHAND `border: 1px solid transparent`. This
   rule used to list only `.action.secondary`. On an <a> that is:
       base    a.action.secondary  (0,2,1)  border-color: transparent   <- won
       colour  .action.secondary   (0,2,0)  border-color: accent
   so every anchor-based secondary button in the theme had a fully transparent border.
   `background` and `color` still landed, because the base rule never sets those — which
   is exactly why the control looked ALMOST right (accent label, correct padding, correct
   box) and survived every review: the outline is the only thing missing, and no
   measurement of the properties this rule was thought to own would show it.
   This is the same (0,2,1)-beats-(0,2,0) trap the docblock at the top of this file
   describes for `border-radius`, recurring on a different property, and it is the third
   time on this theme. A DECLARATION BLOCK IS NOT AN ALL-OR-NOTHING UNIT.

   MEASURED, not reasoned (render-rig `__hrvSecondarySelfTest`, live at 1440): injecting
   an <a> and a <button> carrying identical classes returned borderColor
   `rgba(0, 0, 0, 0)` for the anchor and `rgb(192, 138, 45)` for the button on the same
   page. The <button> was never affected — nothing in the base rule is element-qualified
   for it — which is why the repair is the `a.` qualifier and not a specificity bump.

   THE HOVER RULE BELOW IS DELIBERATELY NOT QUALIFIED. It sets only `background` and
   `color`, and the base rule sets neither, so it is uncontested on anchors already.
   Verified on the live cascade with forced :hover (render-rig `--hover`), reading AFTER
   the 150ms transition above has settled — read during it, computed style returns the
   interpolation's first frame and the tint looks like `oklab(0 0 0 / 0)`, i.e. a
   convincing false report of a transparent hover background. Adding `a.` there would be
   a no-op today, and a no-op selector is a claim that something was needed.
   Border-colour on hover is inherited from THIS rule, so fixing it here fixes both states.

   WIDTH STAYS 1px, AGAINST A COMP THAT SAYS 1.5px. The Wheat artboards draw the outlined
   secondary as `border: 1.5px solid var(--ac)`. Rendered, that is the SAME LINE: Chrome
   floors a fractional border-width to whole device pixels, so at DPR 1 the comp's own
   declared 1.5px computes to 1px — measured on the artboard itself, with a declared 2px
   control alongside it that computed to 2px, so the probe demonstrably distinguishes
   widths. The only place 1.5px would differ is HiDPI, where nothing here is reviewed, and
   taking it would split the shared button base into a 1px primary and a fractional
   secondary. The pill radius (999px vs 14px) and the 15px/700 type are the same class of
   theme-wide artboard question this file's top docblock already files for separate design
   resolution; the width joins them rather than being settled inside a bug fix. */
.hrv-btn--secondary,
a.hrv-btn--secondary,
.action.secondary,
a.action.secondary,
/* Same N-16 gap as the primary block above. This one is the VISIBLE shape: a secondary is an
   outline button, so its border IS the affordance - a transparent border leaves a floating
   label with nothing around it. `a.pagebuilder-button-secondary` is (0,1,1), identical to its
   base declaration, and wins here on source order. */
a.pagebuilder-button-secondary {
  background: transparent;
  border-color: var(--hrv-accent);
  color: var(--hrv-accent);
}
.hrv-btn--secondary:hover,
.action.secondary:hover {
  background: var(--hrv-accent-tint);
  color: var(--hrv-accent-hover);
}

/* Ghost / neutral outline (e.g. "All deals" on a dark hero, quiet actions). */
.hrv-btn--ghost {
  background: transparent;
  border-color: var(--hrv-border-strong);
  color: var(--hrv-text);
}
.hrv-btn--ghost:hover {
  border-color: var(--hrv-text);
  color: var(--hrv-text);
}

/* Icon-only square button (wishlist ♡ / compare in the product card, nav arrows). */
.hrv-btn--icon {
  padding: 10px 13px;
  min-width: 40px;
}

/* Sizes. */
.hrv-btn--sm { padding: 10px 16px; font-size: 13px; }
.hrv-btn--lg { padding: 15px 34px; font-size: 15px; }
.hrv-btn--block { display: flex; width: 100%; }

/* Disabled / loading. */
.hrv-btn:disabled,
.hrv-btn.disabled,
.action.primary:disabled,
.action.tocart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Text/link button. */
.hrv-btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--hrv-accent);
  cursor: pointer;
}
.hrv-btn-link:hover { color: var(--hrv-accent-hover); text-decoration: underline; }

@media (max-width: 767px) {
  /* EVERY button clears 44px on mobile, set on the CLASS rather than the instance (3.18). The
     newsletter Subscribe measured 112x43 - one pixel short, which is exactly the kind of miss
     that gets waved through per-instance and then recurs on the next button someone adds. */
  button,
  .action.primary,
  .action.secondary,
  .action.subscribe { min-height: 44px; }
  .hrv-btn,
  .action.primary,
  .action.tocart { padding: 12px 22px; }
}

/* ---------------------------------------------------------------- N-16
   Blank/Luma rules that outrank the theme's button rules.

   N-16 asked for the SYSTEMIC answer rather than a third one-off, because two separate
   reviews of the same page had each surfaced one instance. So the cascade was enumerated
   instead of guessed: for every button-like control on Home, every rule in every loaded
   stylesheet was matched against the element, ranked by specificity the way the cascade
   ranks it, and the winner named. At 1440 and at 375, on live 0.1.28.

   THE ENUMERATION RETURNED EXACTLY ONE REMAINING CONFLICT — the pair below. Everything else
   the theme styles, it wins.

   AND N-16's OWN EXAMPLE NO LONGER REPRODUCES. The ticket records the footer Subscribe
   button at 3px radius >=768 and 0px 14px 14px 0px at 375. Measured now, at both widths:
   radius 14px, padding 13px 28px, font-size 14px — all the theme's values. Later work on
   this file fixed it and the ticket was never closed. A ticket is a record of a past
   measurement, not a live one.

   What DOES still lose: the authentication popup's Sign In button. Blank's
   `.block-authentication .action.action-login` is (0,3,0) and beat `.action.secondary` at
   (0,2,0), so the button rendered 96x52 at padding 14px 17px / font-size 18px instead of the
   theme's 13px 28px / 14px. Confirmed on the REVEALED popup, not inferred from the closed
   one — while it is shut the element measures 0x0, and a 0x0 box says nothing about how it
   renders when opened.

   Matching (0,3,0) would already win on source order, since the theme's CSS loads after
   styles-m.css. That leaves it to chance rather than stating it, so the selector below is
   deliberately (0,4,0): specificity decides, and source order gets no vote. */
.block-authentication .action.action-login.secondary,
.block-authentication button.action.action-login {
  padding: 13px 28px;
  font-size: 14px;
}
