/* The WordPress bundle's stylesheet. Every rule here is rewritten at build
   time to apply only under `#accessibit-admin-root` (scope-css.ts) — an id, so
   it outranks wp-admin's class-based form styles — and its cascade layers are
   flattened: wp-admin's own CSS is unlayered, and unlayered rules beat every
   layered one whatever their specificity.

   Tailwind's preflight IS included — the utilities assume it (`border` sets a
   width and relies on preflight for the style) — but scoped like the rest, so
   it resets our root and nothing else on the page. */
@import "tailwindcss";
@import "tw-animate-css";
@import "../styles/theme.css";
@import "./fonts.css";

/* Scan the package itself; v4's automatic detection starts from the CWD. */
@source "../";

/* What the dashboard's base layer (its globals.css) gives every element: the
   borders and outlines in the theme's colours, titles in the heading typeface
   and navy. Scoped by id they still lose to any utility, as in a base layer:
   `#accessibit-admin-root .border-input` outranks `#accessibit-admin-root *`. */
* {
  border-color: var(--border);
  outline-color: var(--ring);
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--heading-color, var(--color-primary-blue-100));
}

/* `.wp-core-ui select` turns the browser's arrow off and draws its own, with
   a 40px floor, and wp-admin's forms.css gives text inputs a 30px floor (40px
   on narrow screens). Scoped by id, this outranks them on hover and focus too.
   The browser's arrow comes back, as the dashboard shows it: removing only
   wp-admin's left the px/% unit select looking like plain text (ACC-411). */
select {
  appearance: auto;
  background-image: none;
  min-height: 0;
}

input,
textarea {
  min-height: 0;
}

/* wp-admin's common.css sizes every paragraph at 13px and shades every `code`
   grey; preflight resets neither. A paragraph takes its size from where it
   sits, as in the dashboard, and `code` has no background of its own: a
   shortcode shown on a tinted block had a grey band behind it (ACC-411). Both
   still lose to a utility (`text-sm`, `bg-*`). */
p {
  font-size: inherit;
  line-height: inherit;
}

code,
kbd {
  background: none;
}

/* wp-admin's forms.css rings a focused field in its theme blue with a
   box-shadow, under our own focus outline: a field it matches by `type`
   (email, number, date, text, color), a textarea or a select drew two rings
   where an untyped input drew one. Still under any `shadow-*` or `ring-*`
   utility, which a class outranks. */
input,
textarea,
select {
  box-shadow: none;
}

/* wp-admin's `a:focus` rings every focused link in blue, a mouse click
   included; ours draw their own ring on keyboard focus. `:where` keeps this at
   the id's weight, under any utility (a link-button's `focus-visible:ring`). */
:where(a:focus) {
  box-shadow: none;
}

/* The primitives' overlays sit at `z-50`, under wp-admin's top bar (99999)
   and side menu (9990): a dialog left them undimmed, and a select menu could
   open under the bar. Above both here, and under the notices (Notices.tsx),
   so a toast stays readable over an open dialog. */
[data-slot="dialog-overlay"],
[data-slot="dialog-content"],
[data-slot="alert-dialog-overlay"],
[data-slot="alert-dialog-content"],
[data-slot="select-content"] {
  z-index: 100000;
}
