/* Accessibility: skip link, the accessibility menu and its display modes. */

.skip {
  position: absolute;
  top: -5rem;
  inset-inline-start: 0.6rem;
  z-index: 100;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 0.6rem;
}
main:focus {
  outline: none;
}

/* ---------- the corner button and its panel ---------- */
.a11y {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 60;
}
.a11y-toggle {
  display: grid;
  place-items: center;
  width: 3.3rem;
  height: 3.3rem;
  padding: 0;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 26px -10px rgb(0 0 0 / 0.6);
  cursor: pointer;
}
.a11y-toggle:focus-visible,
.a11y-panel :focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--paper);
}
.a11y-panel {
  position: absolute;
  bottom: 4rem;
  left: 0;
  display: grid;
  gap: 0.55rem;
  width: min(19rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 50px -20px rgb(0 0 0 / 0.55);
}
.a11y-head,
.a11y-row,
.a11y-size-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.a11y-title {
  font-size: 1.15rem;
}
.a11y-close {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.a11y-button {
  min-height: 2.6rem;
  padding: 0.3rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font: 600 1rem var(--font-body);
  cursor: pointer;
}
.a11y-button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
.a11y-button:disabled {
  opacity: 0.4;
  cursor: default;
}
.a11y-size-controls .a11y-button {
  min-width: 3rem;
}
.a11y-size {
  min-width: 3.2rem;
  text-align: center;
  font-weight: 600;
}
.a11y-statement {
  padding: 0.3rem 0;
  text-align: center;
  font-weight: 600;
}

/* ---------- high contrast ---------- */
html.a11y-contrast {
  --paper: #ffffff;
  --paper-deep: #ffffff;
  --card: #ffffff;
  --ink: #000000;
  --muted: #000000;
  --line: #000000;
  --danger: #a00000;
  --texture: none;
}
html.a11y-contrast .ambient,
html.a11y-contrast .breath {
  display: none;
}
html.a11y-contrast body {
  font-weight: 500;
}
html.a11y-contrast :is(h1, h2, h3) {
  font-weight: 600;
}
html.a11y-contrast :is(.stop article, .bubble, .series-card, .panel, .treatment, .day, .slot, .top) {
  border-color: #000;
  border-width: 2px;
}
html.a11y-contrast .tip::before {
  display: none;
}
html.a11y-contrast :focus-visible {
  outline: 4px solid #000;
  outline-offset: 3px;
}

/* ---------- link highlighting ---------- */
html.a11y-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 0.25em;
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ---------- no animations (the same as the visitor's own "reduce motion" setting) ---------- */
html.a11y-still *,
html.a11y-still *::before,
html.a11y-still *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.a11y-still.js .stop :is(article, .tip) {
  transform: none;
  filter: none;
  opacity: 1;
}
html.a11y-still.js .spine path {
  stroke-dasharray: none;
}
html.a11y-still.js .spine .vertebra {
  opacity: var(--draw, 0);
}
