/* Accessibility panel
   ========================================================================== */

.a11y {
  --a11y-width: min(20rem, 86vw);
}

/* The handle on the left edge; it rides out with the panel */
.a11y__tab {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 96;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-1);
  border: 0;
  border-radius: 0 8px 8px 0;
  background-color: var(--color-gold);
  color: var(--color-crust);
  font-family: var(--font-body);
  font-size: var(--text-micro);
  font-weight: var(--weight-ui);
  line-height: 1;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 8px 0 24px -8px var(--color-shadow-a60);
  transform: translate3d(0, -50%, 0);
  transition: transform 0.45s var(--ease-out);
}

.a11y__tab svg {
  width: 24px;
  height: 24px;
}

.a11y.is-open .a11y__tab {
  transform: translate3d(var(--a11y-width), -50%, 0);
}

.a11y__panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: var(--a11y-width);
  padding:
    calc(var(--space-5) + env(safe-area-inset-top, 0px))
    var(--space-3)
    calc(var(--space-5) + env(safe-area-inset-bottom, 0px))
    calc(var(--space-3) + env(safe-area-inset-left, 0px));
  overflow-y: auto;
  background-color: var(--color-night);
  color: var(--color-ivory);
  border-right: 1px solid var(--color-gold-a35);
  box-shadow: 24px 0 64px -24px var(--color-shadow-a60);
  transform: translate3d(-100%, 0, 0);
  visibility: hidden;
  transition:
    transform 0.45s var(--ease-out),
    visibility 0s 0.45s;
}

.a11y.is-open .a11y__panel {
  transform: none;
  visibility: visible;
  transition:
    transform 0.45s var(--ease-out),
    visibility 0s;
}

.a11y__panel:focus {
  outline: none;
}

.a11y__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.a11y__title {
  font-size: 1.5rem;
}

.a11y__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-cream-a45);
  border-radius: 50%;
  background-color: transparent;
  color: inherit;
  cursor: pointer;
}

.a11y__close svg {
  width: 20px;
  height: 20px;
}

.a11y__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}

.a11y__label {
  font-size: var(--text-small);
  color: var(--color-cream-a90);
}

.a11y__stepper {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: var(--space-1);
}

.a11y__value {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.a11y__step,
.a11y__toggle,
.a11y__reset {
  min-height: 48px;
  border: 1px solid var(--color-cream-a45);
  border-radius: 8px;
  background-color: transparent;
  color: var(--color-ivory);
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-ui);
  cursor: pointer;
  transition:
    border-color var(--duration-ui) var(--ease-out),
    background-color var(--duration-ui) var(--ease-out);
}

.a11y__step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.a11y__step:hover:not(:disabled),
.a11y__toggle:hover,
.a11y__reset:hover,
.a11y__close:hover {
  border-color: var(--color-gold);
}

/* Each toggle reads as a switch: the knob slides right and turns the
   track gold when pressed */
.a11y__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-2);
  text-align: left;
}

.a11y__toggle::after {
  content: "";
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background-color: var(--color-cream-a12);
  background-image: radial-gradient(circle at 12px 50%, var(--color-ivory) 7px, transparent 8px);
  box-shadow: inset 0 0 0 1px var(--color-cream-a45);
}

.a11y__toggle[aria-pressed="true"] {
  border-color: var(--color-gold);
}

.a11y__toggle[aria-pressed="true"]::after {
  background-color: var(--color-gold);
  background-image: radial-gradient(circle at 28px 50%, var(--color-crust) 7px, transparent 8px);
  box-shadow: none;
}

.a11y__reset {
  margin-top: var(--space-2);
  border-color: var(--color-gold-a55);
  color: var(--color-gold);
}

/* High contrast and underlined links, switched on from the panel */
:root.a11y-contrast {
  --color-cream-a60: var(--color-cream);
  --color-cream-a90: var(--color-ivory);
  --color-crust-soft: var(--color-crust);
  --color-bronze: var(--color-crust);
  --color-night-a25: var(--color-night-a45);
}

:root.a11y-links a:not(.button, .wordmark, .skip-link, .wa__avatar, .scroll-cue, .footer-hero-rewind, .site-footer__phone, .footer-desliza-btn) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
