/* =============================================================================
   NCDesign — Button System
   Source of truth: https://www.figma.com/design/cZnyTqwltkDZEztj2ZyC3u
   ============================================================================= */

/* ── Base ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;            /* 8px — matches Figma */
  padding: 0.5rem 1rem;   /* 8px 16px — matches Figma */
  border-radius: 1.5rem;  /* 24px pill */
  border: 2px solid transparent;
  font-family: var(--font-display);
  font-size: 1.5rem;      /* 24px — Figma spec */
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: var(--tracking-wide); /* 0.02em */
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Phosphor icons inside buttons inherit size from font-size */
.btn i[class^="ph"] {
  font-size: 1em;
  flex-shrink: 0;
  pointer-events: none;
  line-height: 1;
}

/* Focus ring */
.btn:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 3px;
}

/* Disabled */
.btn:disabled,
.btn.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}


/* ── Primary ──────────────────────────────────────────────────────────────── */
/*    Accent fill. Highest emphasis. Use for primary CTAs.                     */

.btn--primary {
  background-color: var(--color-accent-base);
  border-color: var(--color-accent-base);
  color: var(--color-text-inverse);
}

.btn--primary:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

.btn--primary:active {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}


/* ── Secondary ────────────────────────────────────────────────────────────── */
/*    Accent outline, transparent fill. Medium emphasis.                       */

.btn--secondary {
  background-color: transparent;
  border-color: var(--color-accent-base);
  color: var(--color-accent-base);
}

.btn--secondary:hover {
  background-color: var(--color-accent-base);
  color: var(--color-text-inverse);
}

.btn--secondary:active {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-text-inverse);
}


/* ── Ghost ────────────────────────────────────────────────────────────────── */
/*    No background or border. Low emphasis. Works on dark surfaces.           */

.btn--ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--color-text-inverse);
  padding-left: 0;
  padding-right: 0;
}

.btn--ghost:hover {
  color: var(--color-accent-base);
}

.btn--ghost:active {
  color: var(--color-accent-dark);
}


/* ── Link Button ──────────────────────────────────────────────────────────── */
/*    Inline, underlined. Primary brand color. Use in body copy or nav.        */

.btn--link {
  display: inline-flex;
  gap: 0.35em;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  padding-bottom: 0.1em;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-normal);
  color: var(--color-primary-light);
  border-bottom: 1px solid var(--color-primary-light);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.btn--link i[class^="ph"] {
  font-size: 1em;
  flex-shrink: 0;
  line-height: 1;
}

.btn--link:hover {
  color: var(--color-primary-base);
  border-bottom-color: var(--color-primary-base);
}

.btn--link:active {
  color: var(--color-secondary-light);
  border-bottom-color: var(--color-secondary-light);
}

.btn--link:disabled,
.btn--link.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}


/* ── Link Button — Neutral ────────────────────────────────────────────────── */
/*    Subdued link. Use in footers or secondary nav contexts.                  */

.btn--link-neutral {
  display: inline-flex;
  gap: 0.35em;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-normal);
  color: var(--color-neutral-light);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: transparent;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.btn--link-neutral i[class^="ph"] {
  font-size: 1em;
  flex-shrink: 0;
  line-height: 1;
}

.btn--link-neutral:hover {
  color: var(--color-text-inverse);
  text-decoration-color: var(--color-neutral-light);
}

.btn--link-neutral:active {
  color: var(--color-text-inverse);
  text-decoration-color: var(--color-text-inverse);
}


/* =============================================================================
   Icon slots
   Icons are Phosphor icons placed as children inside .btn.
   Position is determined by DOM order — first child = left, last child = right.
   No additional modifier class needed; flexbox + gap handles spacing.

   Weights: ph (regular), ph-bold, ph-fill, ph-thin, ph-light, ph-duotone
   Full icon list: https://phosphoricons.com

   Usage:
     Left icon only:   <button class="btn btn--primary"><i class="ph-bold ph-arrow-left"></i> Label</button>
     Right icon only:  <button class="btn btn--primary">Label <i class="ph-bold ph-arrow-up-right"></i></button>
     Both:             <button class="btn btn--primary"><i class="ph-bold ph-star"></i> Label <i class="ph-bold ph-arrow-right"></i></button>
     No icons:         <button class="btn btn--primary">Label</button>
   ============================================================================= */
