.a11y {
  position: fixed;
  left: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 60;
}

.a11y-toggle {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 6px 20px rgba(0, 37, 90, 0.35);
  cursor: pointer;
}

.a11y-toggle svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.a11y-toggle:hover {
  background: var(--blue-dark);
}

.a11y-panel {
  position: absolute;
  left: 0;
  bottom: 64px;
  width: min(300px, calc(100vw - 2rem));
  padding: 1.25rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.a11y-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.a11y-head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.a11y-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.a11y-size,
.a11y-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: 0.65rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.a11y-size div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.a11y-size button {
  width: 40px;
  height: 36px;
  border: 2px solid var(--blue);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--blue);
  font-family: var(--font-head);
  font-weight: 800;
  cursor: pointer;
}

.a11y-size button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.a11y-size output {
  min-width: 3.2em;
  text-align: center;
  font-size: 0.9rem;
}

.a11y-switch {
  cursor: pointer;
}

.a11y-switch input {
  appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  padding: 0;
  border: 2px solid var(--muted);
  border-radius: 999px;
  background: var(--bg-alt);
  cursor: pointer;
  transition: background 0.15s;
}

.a11y-switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s;
}

.a11y-switch input:checked {
  border-color: var(--blue);
  background: var(--blue);
}

.a11y-switch input:checked::after {
  background: #fff;
  transform: translateX(20px);
}

.a11y-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.a11y-reset {
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

/* Modes */

html.a11y-contrast {
  --ink: #000;
  --muted: #1c2740;
  --line: #53607a;
  --bg-alt: #ffffff;
  --blue: #003a8c;
}

.a11y-contrast .hero,
.a11y-contrast .page-hero {
  background: var(--blue-deep);
}

.a11y-contrast .hero .lead,
.a11y-contrast .page-hero .lead,
.a11y-contrast .donate .lead {
  color: #fff;
}

.a11y-contrast .section-alt {
  border-block: 2px solid var(--line);
}

.a11y-contrast .btn-outline-light {
  border-color: #fff;
}

.a11y-contrast .gallery figcaption {
  background: rgba(0, 0, 0, 0.85);
}

.a11y-contrast input,
.a11y-contrast select,
.a11y-contrast textarea,
.a11y-contrast .event-card,
.a11y-contrast .news-card,
.a11y-contrast .product-card {
  border: 2px solid var(--line);
}

.a11y-contrast a:not(.btn):not(.brand):not(.social):not(.action-card),
.a11y-contrast .action-card .text-link {
  text-decoration: underline;
}

html.a11y-font {
  --font-head: 'Atkinson Hyperlegible', Verdana, sans-serif;
  --font-body: 'Atkinson Hyperlegible', Verdana, sans-serif;
  letter-spacing: 0.02em;
  word-spacing: 0.08em;
}

.a11y-font body {
  line-height: 1.8;
}

.a11y-links a:not(.btn):not(.brand):not(.social):not(.action-card),
.a11y-links .action-card .text-link {
  text-decoration: underline !important;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.a11y-links .site-nav a:not(.btn) {
  text-decoration: underline !important;
}

html.a11y-motion {
  scroll-behavior: auto;
}

.a11y-motion *,
.a11y-motion *::before,
.a11y-motion *::after {
  transition: none !important;
  animation: none !important;
}

.a11y-motion .hero-media img,
.a11y-motion .gallery figure:hover img {
  transform: none;
}
