@use "base/color";
@use "base/var";

// Some cherry-picked and ported from bootstrap/scss/reboot
// Use :where() to get specificity 0 https://developer.mozilla.org/en-US/docs/Web/CSS/:where

// General style reboot selector for custom element, shadow dom and all classes starting with wy-
:where(:host, :host > *, [class^='wy-'], [class*=' wy-']) {

  box-sizing: border-box;
  text-align: initial;
  font-size: var.default(--wy-font-size);

  // See https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
  *::before, *::after {
    box-sizing: inherit;
  }
  // Self and descendants
  &, & * {
    // A
    &:where(a) {
      text-decoration: var.default(--wy-link-decoration);
      color: color.token(--wy-link);

      &:hover {
        text-decoration: var.default(--wy-link-hover-decoration);
      }

      &:where(:not([href]):not([class])) {

        &, &:hover {
          text-decoration: none;
        }
      }
    }

    // P
    &:where(p) {
      margin-top: 0;
      margin-bottom: var.wy-rem(1);
    }

    // LABEL
    &:where(label) {
      cursor: inherit;
    }

    @at-root :where(:host([hidden])), &[hidden] {
      display: none !important;
    }

    &:where([role="button"]) {
      cursor: pointer;
      user-select: none;
    }
  }
}