/* Affiliate Control Plane — CTA + disclosure styles.
 *
 * Loaded by every tool that renders an affiliate CTA (and by the specimen).
 * Guarantees the disclosure is proximate and readable, and that the CTA is
 * keyboard- and mobile-accessible (native focus ring, 44px touch target).
 *
 * Uses the shared Backpack palette (CSS variables defined on each tool's
 * :root) with fallbacks, so it blends into light day-mode and dark variants.
 */
.aff-cta {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.aff-cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;              /* WCAG 2.5.5 target size for touch */
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--sky-blue, rgb(0, 98, 227));
  background: var(--surface-subtle, rgb(227, 240, 255));
  border: 1px solid var(--border, rgb(193, 199, 207));
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.aff-cta-link:hover {
  background: rgb(214, 233, 255);
  border-color: var(--sky-blue, rgb(0, 98, 227));
}

/* Keyboard users get an obvious focus ring (native anchors already focus). */
.aff-cta-link:focus-visible {
  outline: 3px solid var(--sky-blue, rgb(0, 98, 227));
  outline-offset: 2px;
}

.aff-cta-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aff-cta-ext {
  font-size: 0.85em;
  opacity: 0.7;
}

.aff-cta-icon {
  font-size: 1.1em;
}

.aff-cta-disclosure {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-secondary, rgb(98, 105, 113));
}

.aff-cta-merchant {
  font-weight: 600;
  color: var(--text-primary, rgb(22, 22, 22));
}

.aff-cta-sep {
  color: var(--text-tertiary, rgb(143, 144, 160));
}

.aff-cta-handoff {
  color: var(--text-secondary, rgb(98, 105, 113));
}

/* Affiliate (vs plain external) state gets a subtle sponsored tint. */
.aff-cta.is-affiliate .aff-cta-link {
  color: var(--green, rgb(12, 131, 138));
  background: rgb(233, 247, 246);
  border-color: var(--green, rgb(12, 131, 138));
}

/* Compact variant — dense leaderboards/cards. Keeps the 44px touch target. */
.aff-cta--sm .aff-cta-link {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}
.aff-cta--sm .aff-cta-disclosure {
  font-size: 0.64rem;
}

/* Primary variant — full-width, prominent (hero/detail CTA). */
.aff-cta--primary .aff-cta-link {
  width: 100%;
  background: var(--green, rgb(12, 131, 138));
  border-color: var(--green, rgb(12, 131, 138));
  color: #fff;
  font-weight: 800;
  border-radius: 0.75rem;
  padding: 14px 18px;
}
.aff-cta--primary .aff-cta-link:hover {
  background: rgb(10, 110, 116);
}
.aff-cta--primary .aff-cta-disclosure {
  justify-content: center;
}
