/* ===========================================================================
   Accessibility additions — loaded globally from templates/base.html
   Pairs with the accessibility widget (assets/js/accessibility-widget.js).
   =========================================================================== */

:root {
  /* Alias so accessibility rules stay readable; falls back if custom.css moves. */
  --theme-color: var(--color-blue, #085cb1);
}

/* --- Visible keyboard focus ------------------------------------------------ */
:focus-visible {
  outline: 3px solid var(--theme-color);
  outline-offset: 2px;
  background: #0447af1f;
}

/* --- Skip link ------------------------------------------------------------- */
/* Hidden until focused. Uses the clip pattern rather than `top: -40px` so it
   can never peek out of a positioned ancestor. */
.skip-link:not(:focus) {
  position: absolute;
  left: 0;
  top: 0;
  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;
  z-index: 2000;
}

.skip-link:focus {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 8px 16px;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  background: var(--theme-color);
  color: #fff;
  text-decoration: none;
  z-index: 2000;
}

/* The main landmark takes focus from the skip link but must not draw an
   outline when reached that way. */
#main-content:focus {
  outline: none;
}

/* --- Screen-reader-only text ----------------------------------------------- */
.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;
}

/* --- Honour the hidden attribute over utility display rules ---------------- */
[hidden] {
  display: none !important;
}
