/**
 * Shared control surfaces.
 *
 * The prompt library speaks the WordPress admin vocabulary — `.button`,
 * `.button-primary`, `.button-small` — while the theme and the forum speak
 * `.mi-button`. On the front end nothing styled the first set, so links such as
 * "Log in" and "Join the community" rendered as bare text.
 *
 * Rather than rewriting the class names in a dozen plugin files (and missing
 * the ones generated in JavaScript), this maps one vocabulary onto the other in
 * a single place. Loaded after style.css, so ties in specificity resolve here.
 *
 * Front end only: the theme's stylesheets never load in wp-admin, where these
 * classes already have WordPress' own styling.
 */

/* --- Base: anchors that behave as buttons need the button box ----------- */
a.button,
a.button-primary,
a.button-secondary {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease,
              transform .18s ease, box-shadow .18s ease;
}

a.button:hover,
a.button-primary:hover,
a.button-secondary:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

/* --- Default (secondary) ------------------------------------------------ */
.button,
a.button,
.button-secondary,
a.button-secondary {
  background: var(--mi-surface, #fff);
  color: var(--mi-text, #192335);
  border-color: var(--mi-border-strong, #c8d5e6);
}

.button:hover,
a.button:hover,
.button-secondary:hover,
a.button-secondary:hover {
  border-color: var(--mi-primary, #2563eb);
  color: var(--mi-primary, #2563eb);
}

/* --- Primary ------------------------------------------------------------
 * Doubled class so this outranks the base sheet's `button:not([type=submit])`
 * rule, which would otherwise repaint a primary <button> as secondary.
 */
.button.button-primary,
a.button.button-primary,
button.button-primary,
.button-primary {
  background: var(--mi-primary, #2563eb);
  color: #fff;
  border-color: var(--mi-primary, #2563eb);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.button.button-primary:hover,
a.button.button-primary:hover,
button.button-primary:hover,
.button-primary:hover {
  background: var(--mi-primary-hover, #1d4ed8);
  border-color: var(--mi-primary-hover, #1d4ed8);
  color: #fff;
}

/* --- Small variant ------------------------------------------------------ */
.button.button-small,
a.button.button-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

/* --- Disabled ----------------------------------------------------------- */
.button.disabled,
.button:disabled,
a.button.disabled,
button.button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

/* --- Keyboard focus ----------------------------------------------------- */
.button:focus-visible,
a.button:focus-visible,
.mi-button:focus-visible,
button:focus-visible {
  outline: 2px solid var(--mi-primary, #2563eb);
  outline-offset: 2px;
}

/* --- Action rows -------------------------------------------------------- */
.ux360-pl-login-gate__actions,
.ux360-pl-guest-teaser__actions {
  align-items: center;
}

@media (max-width: 520px) {
  /* One action per row on narrow screens, each a full-width target. */
  .ux360-pl-login-gate__actions,
  .ux360-pl-guest-teaser__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ux360-pl-login-gate__actions > .button,
  .ux360-pl-login-gate__actions > a.button,
  .ux360-pl-guest-teaser__actions > .button,
  .ux360-pl-guest-teaser__actions > a.button {
    width: 100%;
  }
}
