:root { --gap: 1.5rem; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  line-height: 1.5;
}

main { max-width: 72rem; margin: 0 auto; padding: var(--gap); }

/* Dash embeds are full-bleed within the content column. Give the mount point
   a min-height so the page doesn't jump when the app finishes rendering. */
.dash-embed-wrapper { margin: calc(var(--gap) * 2) 0; }

/* --dash-embed-height is set inline, per instance, by the package's template -
   it is the one thing that genuinely cannot live here, because it is a value
   rather than a rule. The fallback keeps the layout sane if it is ever absent. */
.dash-embed { width: 100%; min-height: var(--dash-embed-height, 600px); }
.dash-embed-status,
.dash-embed-loading,
.dash-embed-error,
.dash-embed-noscript {
  padding: 1rem;
  border: 1px dashed currentColor;
  border-radius: 4px;
  opacity: 0.7;
}
.dash-embed-error { color: #b00020; opacity: 1; }

/* Both of these belong to the DIAGNOSTIC variant now. Since package 0.13.0 the
   shipping template has no loading indicator at all - `dash-embed-status` is the
   status line the override keeps, `dash-embed-loading` its older placeholder
   inside the mount. They stay styled so the page looks right whichever way
   DASH_EMBED_DIAG is set. `dash-embed-error` is the one that still ships. */

/* The status and alert regions ship with the page and start EMPTY, so without
   this every embed would carry a visible empty box - a red dashed one, in the
   alert's case. Collapse them by removing the box, NOT with `display: none`: a
   live region hidden that way leaves the accessibility tree, and a message
   written into a hidden region is never announced. Zero padding and no border
   gives an empty element zero height while it stays present and announceable. */
.dash-embed-status:empty,
.dash-embed-error:empty { padding: 0; border: 0; }

/* ------------------------------------------------------------------ */
/* Site header and search                                              */
/* ------------------------------------------------------------------ */

/* Visible to assistive technology, not on screen. Note it is clipped rather
   than `display:none` or `visibility:hidden` - both of those remove it from
   the accessibility tree too, which defeats the purpose. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Off-screen until focused, then pinned to the top-left. A skip link that is
   permanently hidden fails WCAG 2.4.1 - it has to be reachable by keyboard. */
.skip-link {
  position: absolute;
  left: -100vw;
  top: 0;
  z-index: 10;
  background: #1565c0;
  color: #fff;
  padding: .6rem 1rem;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

main:focus { outline: none; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .75rem var(--gap);
  border-bottom: 1px solid #d7d7d7;
  background: #fafafa;
}

.site-header__home {
  font-weight: 700;
  font-size: 1.15rem;
  color: #14395c;          /* 8.6:1 on #fafafa - well past the 4.5:1 floor */
  text-decoration: none;
}
.site-header__home:hover,
.site-header__home:focus { text-decoration: underline; }

.site-search { display: flex; gap: .5rem; }

.site-search__input {
  font: inherit;
  padding: .45rem .6rem;
  border: 1px solid #6b6b6b;   /* 3:1 against the background, per WCAG 1.4.11 */
  border-radius: 4px;
  min-width: 16rem;
}

.site-search__button {
  font: inherit;
  padding: .45rem .9rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #14395c;
  color: #fff;
  cursor: pointer;
}
.site-search__button:hover { background: #0f2a44; }

/* A visible, high-contrast focus ring on everything interactive. Never
   `outline: none` without a replacement - that is WCAG 2.4.7 straight up. */
.site-search__input:focus-visible,
.site-search__button:focus-visible,
.skip-link:focus-visible,
.site-header__home:focus-visible,
.search-results a:focus-visible {
  outline: 3px solid #b8860b;
  outline-offset: 2px;
}

@media (max-width: 34rem) {
  .site-search { width: 100%; }
  .site-search__input { min-width: 0; flex: 1; }
}

/* ------------------------------------------------------------------ */
/* Search results                                                      */
/* ------------------------------------------------------------------ */

.search-summary { font-size: 1rem; font-weight: 400; color: #444; }

.search-results { list-style: none; padding: 0; }
.search-result { margin-bottom: 1.5rem; }
.search-result h3 { margin: 0 0 .25rem; font-size: 1.1rem; }
.search-result p { margin: 0 0 .2rem; }
.search-result__url { font-size: .85rem; color: #4a6a2f; }

.pagination { display: flex; gap: 1rem; align-items: center; margin-top: 2rem; }
