/**
 * @file
 * Button component styles.
 *
 * The primary colours and geometry come from the shared --ln-cta-* tokens in
 * css/tokens.css, because the form block's submit button has to be the same
 * button and cannot share this class — its markup comes from Webform. The
 * var() fallbacks are the literals this file used before the tokens existed.
 */

.ln-button {
  --ln-button-bg: var(--ln-color-red, #cf0000);
  --ln-button-fg: #ffffff;
  --ln-button-border: transparent;
  --ln-button-bg-hover: var(--ln-color-red-hover, #961f00);
  --ln-button-fg-hover: #ffffff;
  --ln-button-border-hover: transparent;
  --ln-button-font: var(--ln-font-sans, Outfit, sans-serif);
  --ln-button-min-width: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: var(--ln-button-min-width);
  padding: var(--ln-cta-padding-block, 10px) var(--ln-cta-padding-inline, 16px);
  border: 1px solid var(--ln-button-border);
  border-radius: var(--ln-cta-radius, 4px);
  background-color: var(--ln-button-bg);
  color: var(--ln-button-fg);
  font-family: var(--ln-button-font);
  font-size: var(--ln-cta-font-size, 18px);
  font-weight: var(--ln-cta-font-weight, 400);
  line-height: var(--ln-cta-line-height, 1.5);
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: var(--ln-cta-transition, background-color 0.15s ease-in-out,
    color 0.15s ease-in-out, border-color 0.15s ease-in-out);
}

/**
 * Fixed desktop width. min-width, not width, so longer translated labels grow
 * rather than clip.
 *
 * The 62rem breakpoint is duplicated in every consumer of --ln-cta-min-width,
 * because a media query cannot read a custom property.
 */
@media (min-width: 62rem) {
  .ln-button {
    --ln-button-min-width: var(--ln-cta-min-width, 224px);
  }
}

/* Outlined variant. Hover deepens by an amount comparable to the primary's
   rather than inverting. */
.ln-button--secondary {
  --ln-button-bg: #ffffff;
  --ln-button-fg: #1c1c1c;
  --ln-button-border: #1c1c1c;
  --ln-button-bg-hover: #e2e2e2;
  --ln-button-fg-hover: #141414;
  --ln-button-border-hover: #141414;
}

.ln-button:hover,
.ln-button:focus {
  background-color: var(--ln-button-bg-hover);
  border-color: var(--ln-button-border-hover);
  color: var(--ln-button-fg-hover);
  text-decoration: none;
}

.ln-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ln-button {
    transition: none;
  }
}
