/* ==========================================================================
   FTS: buttons.css
   Purpose:
   - Variants + accessibility for Beaver Builder Button module buttons.
   - Default button appearance is owned by Beaver Builder Global Settings.

   Editor rules:
   - Use BB global button defaults for standard buttons.
   - Only use FTS variants by adding a class to the anchor OR the wrap.
   - Avoid setting “text background” or “padding” inside the Button module.

   Variant API (add class to anchor OR wrap):
   - fts-btn--secondary
   - fts-btn--outline
   - fts-btn--outline-secondary
   - fts-btn--outline-white
   - fts-btn--small
   ========================================================================== */

:root {
  --fts-btn-radius: 0px;
  --fts-btn-font-weight: 600;
  --fts-btn-line-height: 1.1;

  --fts-btn-pad-y: 12px;
  --fts-btn-pad-x: 30px;

  --fts-btn-border: 2px;
  --fts-btn-transition: 160ms;
}

/* --------------------------------------------------------------------------
   Base alignment + UX polish
   NOTE: Do NOT set default background colors here.
   Those come from Beaver Builder Global Settings.
   -------------------------------------------------------------------------- */

.fl-builder-content a.fl-button,
.fl-builder-content a.fl-button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  font-family: inherit;
  font-weight: var(--fts-btn-font-weight);
  line-height: var(--fts-btn-line-height);

  text-align: center !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;

  padding: var(--fts-btn-pad-y) var(--fts-btn-pad-x);
  border-radius: var(--fts-btn-radius);

  border-width: var(--fts-btn-border);
  border-style: solid;
  border-color: inherit;

  text-decoration: none;
  cursor: pointer;
  user-select: none;

  transition:
    transform var(--fts-btn-transition) ease,
    background-color var(--fts-btn-transition) ease,
    border-color var(--fts-btn-transition) ease,
    color var(--fts-btn-transition) ease,
    box-shadow var(--fts-btn-transition) ease;
}

/* Ensure inner text follows the anchor color (variants set color on the anchor). */
.fl-builder-content a.fl-button .fl-button-text {
  color: inherit !important;
}

/* Hover motion (disabled for reduced motion) */
.fl-builder-content a.fl-button:hover { transform: translateY(-1px); }
.fl-builder-content a.fl-button:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .fl-builder-content a.fl-button:hover,
  .fl-builder-content a.fl-button:active {
    transform: none;
  }
}

/* Focus */
.fl-builder-content a.fl-button:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

@media (forced-colors: active) {
  .fl-builder-content a.fl-button:focus-visible {
    outline: 2px solid CanvasText;
    outline-offset: 2px;
  }
}

/* Mobile full-width */
@media (max-width: 767.98px) {
  .fl-builder-content a.fl-button {
    display: flex;
    width: 100% !important;
  }
}

/* --------------------------------------------------------------------------
   Guardrail: prevent the “highlight bar” behind the inner text span
   Some BB/theme skins apply background/padding to `.fl-button-text`.
   We always want the anchor to be the visual button.
   Scoped to Beaver Builder Button modules only.
   -------------------------------------------------------------------------- */

.fl-builder-content .fl-module-button a.fl-button > .fl-button-text {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  color: inherit !important;

  padding: 0 !important;
  margin: 0;

  box-shadow: none !important;
  border-radius: 0 !important;
}

.fl-builder-content .fl-module-button a.fl-button > .fl-button-text * {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.fl-builder-content .fl-module-button a.fl-button > .fl-button-text::before,
.fl-builder-content .fl-module-button a.fl-button > .fl-button-text::after {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   Variants
   Pattern:
   - Support class on anchor OR on wrap.
   - Use background-color (not shorthand) so overrides are predictable.
   -------------------------------------------------------------------------- */

/* Secondary (filled) */
.fl-builder-content a.fl-button.fts-btn--secondary,
.fl-builder-content .fts-btn--secondary a.fl-button {
  background-color: var(--midnight) !important;
  color: var(--white) !important;
  border-color: transparent !important;
}

.fl-builder-content a.fl-button.fts-btn--secondary:hover,
.fl-builder-content .fts-btn--secondary a.fl-button:hover {
  background-color: var(--denim) !important;
}

/* Outline primary (Ocean) */
.fl-builder-content a.fl-button.fts-btn--outline,
.fl-builder-content .fts-btn--outline a.fl-button {
  background-color: transparent !important;
  color: var(--ocean) !important;
  border-color: var(--ocean) !important;
}

.fl-builder-content a.fl-button.fts-btn--outline:hover,
.fl-builder-content .fts-btn--outline a.fl-button:hover {
  background-color: transparent !important;
  color: var(--sky) !important;
  border-color: var(--sky) !important;
}

/* Outline secondary (Midnight) */
.fl-builder-content a.fl-button.fts-btn--outline-secondary,
.fl-builder-content .fts-btn--outline-secondary a.fl-button {
  background-color: transparent !important;
  color: var(--midnight) !important;
  border-color: var(--midnight) !important;
}

.fl-builder-content a.fl-button.fts-btn--outline-secondary:hover,
.fl-builder-content .fts-btn--outline-secondary a.fl-button:hover {
  background-color: transparent !important;
  color: var(--ocean) !important;
  border-color: var(--ocean) !important;
}

/* Outline white */
.fl-builder-content a.fl-button.fts-btn--outline-white,
.fl-builder-content .fts-btn--outline-white a.fl-button {
  background-color: transparent !important;
  color: var(--white) !important;
  border-color: var(--white) !important;
}

.fl-builder-content a.fl-button.fts-btn--outline-white:hover,
.fl-builder-content .fts-btn--outline-white a.fl-button:hover {
  background-color: transparent !important;
  color: var(--sky) !important;
  border-color: var(--sky) !important;
}

/* Small */
.fl-builder-content a.fl-button.fts-btn--small,
.fl-builder-content .fts-btn--small a.fl-button {
  padding: 8px 20px !important;
  font-size: 0.875rem !important;
}