/* ==========================================================================
   BUTTONS — Level 2. Replaces otbtv_theme/css/component/buttons.css.

   Primary   accent fill, --color-on-primary text
   Secondary 1.5px border in the current text colour
   Quiet     text with a 1px underline
   Icon      44px square, line border

   Colours come from the ground the button sits on; there are no on-dark
   variants.
   ========================================================================== */

.btn,
.button,
button[type="submit"],
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: var(--button-padding);
  border: var(--border-width-control) solid transparent;
  border-radius: var(--button-border-radius);
  font-family: var(--font-family-base);
  font-size: var(--font-size-ui);
  font-weight: var(--button-font-weight);
  line-height: var(--line-height-snug);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover,
.button:hover {
  text-decoration: none;
}

/* ---------- PRIMARY ---------- */

.btn--primary,
button[type="submit"],
input[type="submit"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.btn--primary:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-on-primary);
}

/* ---------- SECONDARY ---------- */
/* .btn--on-dark is the base theme's name for the same thing on dark. */

.btn--secondary,
.btn--on-dark {
  background: transparent;
  border-color: currentColor;
  color: var(--color-text-primary);
}

.btn--secondary:hover,
.btn--on-dark:hover {
  background: var(--color-text-primary);
  border-color: var(--color-text-primary);
  color: var(--color-bg-primary);
}

/* ---------- QUIET ---------- */

.btn--quiet {
  color: var(--color-text-primary);
  font-size: var(--font-size-ui);
  font-weight: var(--font-weight-medium);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.btn--quiet:hover {
  color: var(--color-primary);
}

/* ---------- ICON ---------- */

.otb-icon-btn {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  border: var(--border-width-thin) solid var(--color-border-light);
  border-radius: var(--border-radius-md);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.otb-icon-btn:hover {
  border-color: var(--color-text-primary);
}

/* ---------- DISABLED ---------- */

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