/* The pages PHP prints without the app: a notice where the app would mount,
   and the Setup and Accessibility screens with JavaScript off. They are
   wp-admin markup (`.notice`, `.button`), dressed here in the design system so
   that a screen does not change look when the app cannot run.

   Built by brand-assets.ts into `accessibit-fallback.css`, every rule confined
   to `.accessibit-fallback` (the page's box inside `.wrap`), with the tokens
   of ../styles/theme.css. Colours, radii and typefaces are written as those
   tokens and never as values: brand.test.ts fails on a literal colour or a
   variable the theme does not declare.

   Only the theme layer of Tailwind: no preflight and no utilities, since the
   markup carries wp-admin's classes, not ours. */
@import "tailwindcss/theme.css" layer(theme);
@import "../styles/theme.css";
@import "./fonts.css";

:root {
  --accessibit-gutter: clamp(1rem, 3vw, 2.5rem);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 0.75rem;
  padding: 0 var(--accessibit-gutter) 2rem;
}

/* A readable measure for the text, whatever the window's width. */
:root > * {
  max-width: 60rem;
}

/* The brand line every plugin screen opens with (Shell.tsx draws the same
   one above the app): white, edge to edge, over the page's tinted ground. */
:root > .accessibit-brand {
  display: flex;
  align-items: center;
  max-width: none;
  margin: 0 calc(-1 * var(--accessibit-gutter)) 2rem;
  padding: 0.75rem var(--accessibit-gutter);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.accessibit-brand img {
  display: block;
  height: 1.5rem;
  width: auto;
}

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

h1 {
  font-size: var(--text-page-title-phone);
  line-height: var(--text-page-title-phone--line-height);
  padding: 0;
  margin: 0 0 1rem;
}

h2 {
  font-size: var(--text-card-title);
  line-height: var(--text-card-title--line-height);
  margin: 1.5rem 0 0.5rem;
}

p,
li {
  font-size: 0.875rem;
  line-height: 1.5;
}

p.description {
  color: var(--muted-foreground);
  font-style: normal;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-primary-electric-blue-120);
}

code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--muted);
  color: var(--foreground);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.375rem;
}

/* wp-admin's notice, as the design system's Notice: a tinted ground, a
   hairline in the tone's colour, the message in the text colour. */
.notice {
  background: var(--color-primary-electric-blue-5);
  border: 1px solid var(--color-primary-electric-blue-20);
  border-radius: var(--radius-lg);
  box-shadow: none;
  color: var(--foreground);
  margin: 0 0 1rem;
  padding: 0.25rem 1rem;
}

.notice.notice-error {
  background: var(--color-semantic-error-10);
  border-color: var(--color-semantic-error-100);
}

.notice.notice-warning {
  background: var(--color-semantic-warning-10);
  border-color: var(--color-semantic-warning-100);
}

.notice.notice-success {
  background: var(--color-semantic-success-10);
  border-color: var(--color-semantic-success-100);
}

/* Room for wp-admin's dismiss button, which sits over the notice's corner. */
.notice.is-dismissible {
  padding-right: 2.5rem;
}

.notice p {
  margin: 0.5rem 0;
}

/* wp-admin's buttons, as the design system's: the outline button, and the
   Electric Blue one for the page's main action. */
.button,
.button-secondary {
  background: var(--card);
  border: 1px solid var(--color-primary-blue-20);
  border-radius: var(--radius-md);
  box-shadow: none;
  color: var(--color-primary-blue-100);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.button:hover,
.button-secondary:hover {
  background: var(--accent);
  border-color: var(--color-primary-blue-20);
  color: var(--color-primary-blue-100);
}

.button.button-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.button.button-primary:hover {
  background: var(--color-primary-electric-blue-120);
  border-color: var(--color-primary-electric-blue-120);
  color: var(--primary-foreground);
}

.button:focus,
.button.button-primary:focus,
a:focus {
  box-shadow: none;
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.button[aria-disabled="true"],
.button:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Unavailable, so it does not answer the pointer either. */
.button[aria-disabled="true"]:hover {
  background: var(--card);
  color: var(--color-primary-blue-100);
}

input[type="checkbox"]:focus {
  border-color: var(--ring);
  box-shadow: none;
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
