.hs-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hs-space-8);
  padding: var(--hs-space-12) var(--hs-space-24);
  border: 1px solid transparent;
  border-radius: var(--hs-radius-md);
  font-family: var(--hs-font-family-base);
  font-size: var(--hs-font-size-button);
  font-weight: var(--hs-font-weight-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--hs-transition-fast) var(--hs-ease),
    border-color var(--hs-transition-fast) var(--hs-ease),
    color var(--hs-transition-fast) var(--hs-ease),
    box-shadow var(--hs-transition-fast) var(--hs-ease),
    transform var(--hs-transition-fast) var(--hs-ease);
}

.hs-btn:active {
  transform: scale(.98);
}

.hs-btn:disabled,
.hs-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
}

/* Variants */
/* !important on background/color below: Blocksy's own main.min.css ships
   a bare-class/attribute rule - ".button, .ct-button, ..., [type=submit],
   .wp-element-button, .wp-block-button__link, ..." - at the exact same
   (0,1,0) specificity as ".hs-btn--primary", set to Blocksy's own accent
   custom property (currently resolving green on this site, clashing with
   the brand orange). Because that stylesheet is enqueued by the parent
   theme and - like every other Blocksy-vs-child cascade fight already
   documented in this codebase (see typography.css) - prints AFTER every
   child-theme stylesheet regardless of our own enqueue order, it wins on
   equal specificity without this. This is the same precedented fix
   pattern used there, not a new one. */
.hs-btn--primary {
  /* -fill, not the raw -500 scale value - see design-tokens.php */
  background: var(--hs-color-primary-fill) !important;
  color: #fff !important;
}
.hs-btn--primary:hover:not(:disabled) {
  background: var(--hs-color-primary-fill-hover) !important;
}
.hs-btn--primary:active:not(:disabled) {
  background: var(--hs-color-primary-fill-active) !important;
}

/* Same Blocksy-cascade reasoning as .hs-btn--primary above applies to
   every variant below - each is a bare (0,1,0) class selector Blocksy's
   own [type=submit]/.wp-element-button/.wp-block-button__link rule can
   match and beat on print order alone. */
.hs-btn--secondary {
  background: var(--hs-color-surface-sunken) !important;
  color: var(--hs-color-text) !important;
}
.hs-btn--secondary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--hs-color-text) 12%, var(--hs-color-surface-sunken)) !important;
}

.hs-btn--outline {
  background: transparent !important;
  border-color: var(--hs-color-border-strong);
  color: var(--hs-color-text) !important;
}
.hs-btn--outline:hover:not(:disabled) {
  background: var(--hs-color-surface-sunken) !important;
  border-color: var(--hs-color-text-muted);
}

.hs-btn--ghost {
  background: transparent !important;
  color: var(--hs-color-text) !important;
}
.hs-btn--ghost:hover:not(:disabled) {
  background: var(--hs-color-surface-sunken) !important;
}

.hs-btn--danger {
  background: var(--hs-color-danger-500) !important;
  color: #fff !important;
}
.hs-btn--danger:hover:not(:disabled) {
  background: var(--hs-color-danger-600) !important;
}

/* Sizes */
.hs-btn--sm {
  padding: var(--hs-space-8) var(--hs-space-16);
  font-size: var(--hs-font-size-caption);
}

.hs-btn--lg {
  padding: var(--hs-space-16) var(--hs-space-32);
  font-size: var(--hs-font-size-body);
}

.hs-btn--icon {
  padding: var(--hs-space-12);
  aspect-ratio: 1;
}
.hs-btn--icon.hs-btn--sm {
  padding: var(--hs-space-8);
}

.hs-btn--block {
  display: flex;
  width: 100%;
}

/* Loading state: hide the label, show a spinner in its place */
.hs-btn--loading {
  color: transparent !important;
  pointer-events: none;
}
.hs-btn--loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-inline-end-color: transparent;
  color: inherit;
  animation: hs-spin .7s linear infinite;
}
.hs-btn--primary.hs-btn--loading::after,
.hs-btn--danger.hs-btn--loading::after {
  color: #fff;
}
