/* ==========================================================================
   Anti - Reusable components
   Buttons, eyebrows, cards, icon tiles, form fields, tags.
   ========================================================================== */

/* --- Button ---------------------------------------------------------------
   One base + variants + sizes. Every variant keeps a 4.5:1 label contrast. */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--color-text);
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  letter-spacing: var(--tracking-snug);
  /* min-height, never a fixed height: a fixed height clips the label the
     moment it wraps, and labels do wrap at 320px. */
  min-height: 2.75rem;
  max-width: 100%;
  text-align: center;
  text-wrap: balance;
  cursor: pointer;
  transition:
    background-color var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  --btn-bg: var(--color-inverse-bg);
  --btn-fg: var(--color-inverse-text);
  --btn-border: var(--color-inverse-bg);
}
.btn--primary:hover { --btn-bg: var(--ink-800); --btn-border: var(--ink-800); }

.btn--accent {
  --btn-bg: var(--color-accent);
  --btn-fg: var(--color-on-accent);
  --btn-border: var(--color-accent);
}
.btn--accent:hover {
  --btn-bg: var(--color-accent-strong);
  --btn-border: var(--color-accent-strong);
}

.btn--outline {
  --btn-bg: var(--color-surface);
  --btn-fg: var(--color-text);
  --btn-border: var(--color-border-strong);
}
.btn--outline:hover { --btn-bg: var(--color-bg-alt); --btn-border: var(--ink-900); }

.btn--ghost {
  --btn-fg: var(--color-text);
  padding-inline: var(--space-2);
}
.btn--ghost:hover { --btn-fg: var(--ink-700); }

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn--block { width: 100%; }

.btn__icon { flex: none; width: 1.125rem; height: 1.125rem; }

/* Circular arrow that trails a ghost link, as in the hero. */
.btn__arrow {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  transition: background-color var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.btn--ghost:hover .btn__arrow {
  background-color: var(--color-inverse-bg);
  border-color: var(--color-inverse-bg);
  color: var(--color-inverse-text);
}

/* --- Eyebrow --------------------------------------------------------------
   The small outlined pill that labels each section. */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background-color: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-snug);
  line-height: 1.6;
}

.eyebrow--accent {
  border-color: transparent;
  background-color: var(--color-accent-soft);
  color: var(--ink-800);
}

/* --- Card ----------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  transition: border-color var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.card--interactive:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card__title {
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-snug);
}

.card__text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* --- Icon tile ------------------------------------------------------------
   The dark rounded square holding a line icon on feature cards. */

.icon-tile {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background-color: var(--color-inverse-bg);
  color: var(--color-accent);
  box-shadow: var(--shadow-tile);
  transition: box-shadow var(--duration-base) var(--ease-out);
}

/* The tile rises with the card it sits on, and goes into the surface when the
   card is pressed - the cast shadow disappears and the light flips inside. */
.card--interactive:hover .icon-tile,
.link-card:hover .icon-tile,
.channel:hover .icon-tile { box-shadow: var(--shadow-tile-hover); }

.link-card:active .icon-tile { box-shadow: var(--shadow-tile-press); }

.icon-tile svg { width: 1.375rem; height: 1.375rem; }

/* Product cards carry a bare icon rather than a tile, as in the reference.
   A larger, darker glyph reads stronger than a small one in a pale box. */
.card__icon {
  /* A viewBox-less <svg> in a flex column gets shrunk to zero width without
     an explicit minimum, so the size is pinned on both axes. */
  --icon-size: 1.625rem;
  flex: none;
  width: var(--icon-size);
  min-width: var(--icon-size);
  height: var(--icon-size);
  color: var(--ink-900);
  margin-bottom: var(--space-1);
}

/* --- Check list ----------------------------------------------------------- */

.check-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.check-list svg {
  width: 1rem;
  height: 1rem;
  margin-top: 0.28em;
  color: var(--ink-700);
  flex: none;
}

/* --- Rating ---------------------------------------------------------------
   Stars are decorative; the value lives in visually hidden text so the
   rating is never conveyed by colour or shape alone. */

.rating { display: inline-flex; gap: 2px; color: var(--signal-warm); }
.rating svg { width: 0.9375rem; height: 0.9375rem; }

/* --- Delta (price change) -------------------------------------------------
   Direction is carried by an arrow glyph and a sign, not only by colour. */

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
.delta--up   { color: var(--signal-up); }
.delta--down { color: var(--signal-down); }
.delta svg { width: 0.6875rem; height: 0.6875rem; }

/* --- Form field ----------------------------------------------------------- */

.field { display: grid; gap: var(--space-2); }

.field__control {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1);
  padding-left: var(--space-4);
  border: 1px solid var(--color-inverse-border);
  border-radius: var(--radius-pill);
  background-color: var(--color-surface);
  transition: border-color var(--duration-base) var(--ease-out);
}

.field__control:focus-within {
  border-color: var(--ink-700);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.field__input {
  flex: 1 1 auto;
  min-width: 0;
  padding-block: var(--space-2);
  border: 0;
  background: none;
  color: var(--color-text);
  font-size: var(--text-sm);
}
.field__input::placeholder { color: var(--color-text-subtle); }
.field__input:focus { outline: none; }

.field__submit {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-inverse-bg);
  color: var(--color-inverse-text);
  cursor: pointer;
  transition: background-color var(--duration-base) var(--ease-out);
}
.field__submit:hover { background-color: var(--ink-700); }
.field__submit svg { width: 1.0625rem; height: 1.0625rem; }

.field__message {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 1.25rem;
  padding-left: var(--space-4);
  font-size: var(--text-xs);
  line-height: 1.4;
}
.field__message svg { width: 0.875rem; height: 0.875rem; flex: none; }
.field__message[data-state="error"]   { color: #ffbcae; }
.field__message[data-state="success"] { color: var(--color-accent); }

.field__control[data-invalid="true"] { border-color: #ffbcae; }

/* The light tile gets the same three layers, lit from the same direction but
   in the stone family rather than the green one. */
.icon-tile--soft {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(12, 42, 27, 0.12),
    0 1px 2px rgba(12, 42, 27, 0.1);
}

/* --- Press feedback --------------------------------------------------------
   Hover tells you a thing is live; press tells you the tap registered. On
   touch there is no hover at all, so without this half the interface gives no
   response until the page changes under you. */

.card--interactive:active,
.link-card:active,
.article:active,
.pager__link:active {
  translate: 0 1px;
  box-shadow: var(--shadow-xs);
  transition-duration: var(--duration-fast);
}

/* Links that sit in body copy grow their underline rather than changing
   colour alone, so the feedback does not depend on seeing hue. */
.footer-col__link,
.site-footer__legal a,
.faq__a a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}
.footer-col__link:hover,
.site-footer__legal a:hover,
.faq__a a:hover { text-decoration-color: currentColor; }

/* Touch targets. WCAG 2.5.8 asks 24px; these are the controls small enough to
   be worth checking, and they are given the comfortable 44px instead. */
.primary-nav__link,
.footer-col__link,
.site-footer__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

@media (min-width: 900px) {
  /* The inline nav sets its own rhythm; the row would grow too tall at 44px
     per item, and these are never the only way to reach a page. */
  .primary-nav__link { min-height: 0; padding-block: var(--space-2); }
}
