/**
 * @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;
}

/**
 * Pill variant. The Owner Hub comps (Figma 4361:1393) draw the CTA fully
 * rounded, at 32px inline padding and weight 600, sized to its label.
 *
 * Every value is restated rather than tokenised: the --ln-cta-* tokens describe
 * the Site Studio red button that the form's Webform submit has to match, and
 * moving them would silently redraw that button too.
 *
 * The min-width reset has to be inside the same 62rem query that sets it,
 * because the property is set on .ln-button at that width.
 */
.ln-button--pill {
  padding: 10px 32px;
  border-radius: 94px;
  font-weight: 600;
}

@media (min-width: 62rem) {
  .ln-button--pill {
    --ln-button-min-width: 0;
  }
}

.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;
}

/* Two-tone, because currentColor is white on the primary button and a white
   ring on the creme card measured 1.03:1. One tone always holds. */
.ln-button:focus-visible {
  outline: 2px solid var(--ln-color-ink, #1c1c1c);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #ffffff;
}

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