/* Shared control styling. Keep hit areas and the site's resting fills. */
body :is(
  button, summary, select, [role="button"], [role="tab"], [role="switch"],
  input:is([type="button"], [type="submit"], [type="reset"], [type="image"], [type="search"], [type="range"]),
  a:is(.btn, .button, .cta, [class*="-btn"], [class*="-button"]),
  [data-opening-enter] > span, [data-borderless-control],
  [data-borderless-region], [data-borderless-surface]
) {
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Focus is shown on the content, with an inner highlight for icon controls. */
body :is(
  button, summary, select, [role="button"], [role="tab"], [role="switch"],
  input:is([type="button"], [type="submit"], [type="reset"], [type="image"], [type="search"]),
  a:is(.btn, .button, .cta, [class*="-btn"], [class*="-button"]),
  [data-borderless-control]
):not([data-opening-enter], [type="range"]):focus-visible,
body [data-opening-enter]:focus-visible > span {
  text-decoration: underline solid currentColor 2px !important;
  text-underline-offset: .26em;
}

body :is(button, summary, select, [role="button"], [data-borderless-control]):focus-visible:has(> svg),
body :is(select, input[type="search"], input[type="image"]):focus-visible {
  --control-focus-tint: color-mix(in srgb, currentColor 14%, transparent);
  background-image: linear-gradient(var(--control-focus-tint), var(--control-focus-tint)) !important;
}

/* Keep the keyboard indicator on the range thumb, away from the track. */
body input[type="range"]:focus-visible::-webkit-slider-thumb {
  filter: drop-shadow(0 0 .22em currentColor);
}

body input[type="range"]:focus-visible::-moz-range-thumb {
  filter: drop-shadow(0 0 .22em currentColor);
}

body .karmen-opening :is(.karmen-opening__glass, .karmen-opening__mount, .karmen-opening__hero, .karmen-opening__poster) {
  border-color: transparent;
  outline: none;
  box-shadow: none;
}

@media (forced-colors: active) {
  /* Forced colors can replace even transparent author border colors. */
  body :is(
    button, summary, select, [role="button"], [role="tab"], [role="switch"],
    input:is([type="button"], [type="submit"], [type="reset"], [type="image"], [type="search"], [type="range"]),
    a:is(.btn, .button, .cta, [class*="-btn"], [class*="-button"]),
    [data-opening-enter] > span, [data-borderless-control],
    [data-borderless-region], [data-borderless-surface]
  ) {
    border-style: none !important;
  }

  /* The keyboard cue is the platform's selection fill, without a perimeter. */
  body :is(button, summary, select, input, [role="button"], [role="tab"],
    a:is(.btn, .button, .cta), [data-borderless-control]
  ):not([data-opening-enter]):focus-visible,
  body [data-opening-enter]:focus-visible > span {
    forced-color-adjust: none;
    color: HighlightText !important;
    background-color: Highlight !important;
  }
}
