/* Base styles for plain HTML in the page (the "light DOM").
 *
 * IMPORTANT: these styles do NOT reach inside a Lit component's shadow DOM.
 * That is deliberate — it is why one component can never break another. Styles
 * that components need live in `assets/js/lib/shared-styles.js`.
 *
 * Rule of thumb:
 *   - styling a page layout, header, or plain <a>/<h1>/<p>  ->  here
 *   - styling something inside a <vp-*> component            ->  that component
 *   - a color, size or spacing value                        ->  tokens.css
 */

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

body {
  margin: 0;
  font-family: var(--vp-font);
  background: var(--vp-bg);
  color: var(--vp-text);
  line-height: 1.5;
}

a {
  color: var(--vp-brand-light);
}
a:hover {
  color: var(--vp-brand);
}

/* Skip link — the first thing in the tab order on every page. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--vp-accent);
  color: var(--vp-brand);
  padding: var(--vp-space-2) var(--vp-space-4);
  z-index: 10;
}
.skip-link:focus {
  left: 0;
}

/* Every focusable thing gets a visible focus ring. Do not remove this. */
:focus-visible {
  outline: 2px solid var(--vp-brand-light);
  outline-offset: 2px;
}

.page {
  max-width: var(--vp-page-max);
  margin: 0 auto;
  padding: var(--vp-space-6) var(--vp-space-5) var(--vp-space-7);
}

.page-title {
  margin: 0 0 var(--vp-space-2);
  font-size: 1.75rem;
  color: var(--vp-brand);
}

.page-intro {
  margin: 0 0 var(--vp-space-6);
  color: var(--vp-muted);
  max-width: 60ch;
}

/* A panel of plain page content. `lib/shared-styles.js` defines a `.card` too,
 * with the same values — not by accident, and not something to deduplicate:
 * styles do not cross the shadow DOM boundary in either direction, so a card
 * rendered by a page and a card rendered inside a component genuinely need two
 * rules. (`:focus-visible` above is duplicated for the same reason.) The values
 * are tokens, so they only have to be kept in step in one place. */
.card {
  background: var(--vp-surface);
  border: 1px solid var(--vp-border);
  border-radius: var(--vp-radius);
  box-shadow: var(--vp-shadow);
  padding: var(--vp-space-5);
  margin-bottom: var(--vp-space-4);
}
.card > :first-child {
  margin-top: 0;
}
.card > :last-child {
  margin-bottom: 0;
}
.card h2 {
  font-size: var(--vp-text-lg);
  color: var(--vp-brand);
}

/* A heading that divides one page into sections, below the single .page-title.
 * Exists so pages never need an inline style to size a heading — rule 4 (no raw
 * color or spacing values) applies to markup as much as to stylesheets. */
.section-title {
  margin: var(--vp-space-6) 0 var(--vp-space-3);
  font-size: var(--vp-text-lg);
  color: var(--vp-brand);
}

/* Card grid used by the landing page. */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--vp-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-card {
  display: block;
  background: var(--vp-surface);
  border: 1px solid var(--vp-border);
  border-radius: var(--vp-radius);
  box-shadow: var(--vp-shadow);
  padding: var(--vp-space-5);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 120ms ease,
    transform 120ms ease;
}
.tool-card:hover {
  border-color: var(--vp-brand-light);
  transform: translateY(-2px);
}
.tool-card h2 {
  margin: 0 0 var(--vp-space-2);
  font-size: var(--vp-text-lg);
  color: var(--vp-brand);
}
.tool-card p {
  margin: 0;
  color: var(--vp-muted);
  font-size: var(--vp-text-sm);
}
