/* Reset and element defaults
   :where() makes classes override */

@layer wp {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable;
  }

  :where(body) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    font-family: var(--wp-font);
    font-size: var(--wp-font-size-base);
    line-height: 1.5;
    color: var(--wp-text);
    overflow-wrap: break-word;
    background: var(--wp-bg);
  }

  :where(main) {
    flex: 1 0 auto;
    width: 100%;
  }

  :where(h1, h2, h3, h4) {
    margin: 0 0 0.5em;
    line-height: 1.2;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  /* Keep bold at 700 inside 600-weight text */
  :where(b, strong) {
    font-weight: 700;
  }

  :where(h1) {
    font-size: var(--wp-font-size-2xl);
  }
  :where(h2) {
    font-size: var(--wp-font-size-xl);
  }
  :where(h3) {
    font-size: var(--wp-font-size-lg);
  }

  :where(p) {
    margin: 0 0 1em;
  }

  :where(img) {
    max-width: 100%;
    height: auto;
  }

  :where(code, kbd, pre) {
    font-family: var(--wp-font-mono);
    font-size: 0.9375em;
  }

  :where(pre code) {
    font-size: inherit;
  }

  :where(a) {
    color: var(--wp-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }

  :where(a:hover) {
    color: var(--wp-link-hover);
  }

  /* Transparent outline for forced colors */
  :focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: var(--wp-focus-ring);
  }

  /* Keep [hidden] elements hidden when a class sets display */
  [hidden]:not([hidden="until-found" i]) {
    display: none !important;
  }

  .wp-subtle {
    color: var(--wp-text-subtle);
  }

  /* Needs a width limit, its own or its parent's */
  .wp-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wp-visually-hidden,
  .wp-visually-hidden-focusable:not(:focus, :focus-within) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .wp-skip-link {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    translate: 0 calc(-100% - 1px); /* extra pixel hides a rounding sliver */
    z-index: 1001; /* above a site's fixed header */
    padding: var(--wp-space-xs) var(--wp-space-md);
    color: var(--wp-link);
    background: var(--wp-card-bg);
    border-end-end-radius: var(--wp-radius);
  }

  .wp-skip-link:focus {
    translate: none;
  }

  /* 0.01ms keeps transitionend firing */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      transition-duration: 0.01ms !important;
    }
  }
}
