/**
 * @file
 * Button component styles.
 *
 * Values come from two sources:
 * - Figma 2026 Landing Page Updates, node 333:2990 / 333:2992 (padding, radius,
 *   font size, line height, fills).
 * - The existing Site Studio "Red button" custom style
 *   (cohesion_custom_styles.cohesion_custom_style.fd769c62), which is where the
 *   hover colour #961f00 comes from — the Figma frame has no hover state.
 *
 * Padding follows Figma (10px/16px) rather than Site Studio (8px/16px); the
 * design is the newer spec.
 *
 * The primary button's colours and geometry now come from css/tokens.css, because
 * the form block's submit button has to be the same button and cannot share this
 * class — see the note on --ln-cta-* there. The fallbacks in each var() are the
 * literals this file used before, so the component still renders correctly if the
 * token sheet is ever not loaded.
 */

.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.
 *
 * Figma 333:2990 / 333:2992 both set the label layer to 191.669px inside 16px
 * of horizontal padding, so each button measures ~224px and the pair reads as
 * equal-width regardless of label length.
 *
 * This is min-width, not width. The site translates content through TMGMT, and
 * German and French labels routinely run 30-40% longer than English — a hard
 * width would overflow or clip them. min-width holds the designed size for
 * normal labels and lets longer ones grow.
 *
 * Below 62rem the buttons size to their content: the comp only specifies the
 * wide desktop case, and 224px is a large share of a narrow viewport.
 */
@media (min-width: 62rem) {
  .ln-button {
    --ln-button-min-width: var(--ln-cta-min-width, 224px);
  }
}

/**
 * Outlined variant.
 *
 * Resting state is Figma 333:2992 exactly — #1c1c1c text and border on white.
 *
 * Hover mirrors the primary's transition rather than inverting. In HSL the
 * primary goes #cf0000 (L 40.6%) -> #961f00 (L 29.4%): darker by 11.2 lightness
 * points, a 27.5% relative drop. The same logic is applied here so both buttons
 * deepen by a comparable amount instead of one button transforming:
 * - white fill takes the absolute drop, L 100% -> 88.8% (#e2e2e2); a relative
 *   drop would be far too heavy on a near-white surface.
 * - #1c1c1c text and border take the relative drop, L 11.0% -> 8.0% (#141414);
 *   an absolute drop would go past black.
 */
.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;
}

/* Not in the Figma frame; added so keyboard users get a visible focus ring. */
.ln-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

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