/* ==========================================================================
   BUTTONS — primary (teal) & secondary (outline), light/dark variants
   Markup:
     <a class="btn btn--primary" href="#">
       <span>Label</span>
       <svg class="btn__icon" …>…</svg>
     </a>
   The icon is optional; it slides toward inline-end on hover and flips
   automatically in RTL (see [dir="rtl"] rule).
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-block-size: 3rem;          /* ≥ 44px touch target */
  padding-block: 0.875rem;
  padding-inline: 1.5rem;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font-family: var(--ff-body);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  transition:
    transform var(--dur-micro) var(--ease-out),
    box-shadow var(--dur-micro) var(--ease-out),
    background-color var(--dur-micro) var(--ease-out),
    border-color var(--dur-micro) var(--ease-out),
    color var(--dur-micro) var(--ease-out);
}

.btn__icon {
  inline-size: 1.125rem;
  block-size: 1.125rem;
  flex-shrink: 0;
  transition: transform var(--dur-micro) var(--ease-out);
}

/* Arrow icons point the other way in RTL. The individual `scale` property
   is applied before `transform`, so the hover translate below is mirrored
   too and always moves toward inline-end. */
[dir="rtl"] .btn__icon {
  scale: -1 1;
}

.btn:hover .btn__icon {
  transform: translateX(4px);
}

/* Focus: global :focus-visible outline (reset.css) — AA on light & dark */

/* --- Primary: teal fill, navy text (AA contrast) ------------------------ */
.btn--primary {
  background-color: var(--c-teal);
  color: var(--c-navy);
}

.btn--primary:hover {
  transform: translateY(-2px);
  background-color: #12B9C6;
  box-shadow: var(--shadow-md), 0 10px 30px -10px rgba(0, 169, 182, 0.55);
}

/* --- Secondary on light surfaces ----------------------------------------- */
.btn--secondary {
  background-color: transparent;
  color: var(--c-ink);
  border-color: var(--c-ink-a20);
}

.btn--secondary:hover {
  background-color: var(--c-teal-a08);
  border-color: var(--c-teal);
  transform: translateY(-2px);
}

/* --- Secondary on navy surfaces ------------------------------------------ */
.on-dark .btn--secondary,
.btn--secondary.btn--on-dark {
  color: var(--c-on-dark);
  border-color: rgba(255, 255, 255, 0.35);
}

.on-dark .btn--secondary:hover,
.btn--secondary.btn--on-dark:hover {
  background-color: var(--c-teal-a12);
  border-color: var(--c-teal);
}

/* Group of CTAs — stacks & centres on mobile, inline from tablet up */
.btn-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
}

@media (min-width: 30rem) {
  .btn-group {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
}

@media (min-width: 64rem) {
  .btn-group {
    justify-content: flex-start;
  }
}
