/* Aktiv-Hus accessibility controls. Kept separate from the visual theme. */
#ah-a11y {
  --ah-a11y-ink: #17252c;
  --ah-a11y-paper: #fff;
  --ah-a11y-border: #cbd5d9;
  --ah-a11y-accent: #ef542f;
  position: fixed;
  z-index: 2147483647;
  top: 2vh;
  right: 18px;
  font-family: system-ui, sans-serif;
  color: var(--ah-a11y-ink);
}

#ah-a11y,
#ah-a11y * {
  box-sizing: border-box;
}

.ah-a11y-toggle {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ah-a11y-accent);
  color: #fff;
  box-shadow: 0 7px 22px rgb(23 37 44 / 22%);
  cursor: pointer;
  font: inherit;
  font-size: 1.65rem;
  line-height: 1;
}

.ah-a11y-icon {
  display: block;
  width: 28px;
  height: 28px;
  color: currentColor;
}

.ah-a11y-toggle:hover,
.ah-a11y-toggle:focus-visible {
  background: #c94125;
}

.ah-a11y-panel {
  position: absolute;
  top: 0;
  right: 62px;
  bottom: auto;
  width: min(360px, calc(100vw - 24px));
  max-height: 96vh;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px;
  border: 1px solid var(--ah-a11y-border);
  border-radius: 20px;
  background: var(--ah-a11y-paper);
  box-shadow: 0 18px 60px rgb(23 37 44 / 25%);
}

.ah-a11y-panel[hidden] {
  display: none;
}

.ah-a11y-header,
.ah-a11y-group-head,
.ah-a11y-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ah-a11y-header {
  margin-bottom: 16px;
}

.ah-a11y-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.ah-a11y-close,
.ah-a11y-reset {
  border: 1px solid var(--ah-a11y-border);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.ah-a11y-close {
  width: 36px;
  height: 36px;
  font-size: 1.35rem;
}

.ah-a11y-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8ea;
}

.ah-a11y-group-head {
  margin-bottom: 9px;
  font-size: .86rem;
  font-weight: 800;
}

.ah-a11y-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ah-a11y-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--ah-a11y-border);
  border-radius: 11px;
  background: #f8fafb;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  text-align: left;
}

.ah-a11y-option:hover,
.ah-a11y-option:focus-visible,
.ah-a11y-option[aria-pressed="true"] {
  border-color: var(--ah-a11y-accent);
  background: #fff1ed;
}

.ah-a11y-option[aria-pressed="true"]::after {
  margin-left: auto;
  content: '✓';
  color: var(--ah-a11y-accent);
  font-weight: 900;
}

.ah-a11y-status {
  min-height: 1.3em;
  margin: 14px 0 0;
  color: #52636a;
  font-size: .76rem;
}

.ah-a11y-reset {
  width: 100%;
  min-height: 42px;
  margin-top: 13px;
  background: var(--ah-a11y-ink);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

#ah-a11y :focus-visible {
  outline: 3px solid #0b75b8;
  outline-offset: 3px;
}

html.ah-a11y-text-110 { font-size: 110%; }
html.ah-a11y-text-125 { font-size: 125%; }
html.ah-a11y-text-150 { font-size: 150%; }

html.ah-a11y-readable body > *:not(#ah-a11y) {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: .015em;
}

html.ah-a11y-readable body > *:not(#ah-a11y) h1,
html.ah-a11y-readable body > *:not(#ah-a11y) h2,
html.ah-a11y-readable body > *:not(#ah-a11y) h3,
html.ah-a11y-readable body > *:not(#ah-a11y) h4 {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0;
}

html.ah-a11y-quick-view body > *:not(#ah-a11y) {
  line-height: 1.75 !important;
}

html.ah-a11y-quick-view body > *:not(#ah-a11y) :is(.hero-visual, .detail-image, .tile) {
  box-shadow: none !important;
}

html.ah-a11y-color-weakness body > *:not(#ah-a11y) {
  filter: saturate(.7) contrast(1.15) hue-rotate(-12deg) !important;
}

html.ah-a11y-underline-links body > *:not(#ah-a11y) a {
  text-decoration: underline !important;
  text-decoration-thickness: .12em;
  text-underline-offset: .16em;
}

html.ah-a11y-focus body > *:not(#ah-a11y) :focus-visible {
  outline: 4px solid #ff9f1c !important;
  outline-offset: 4px !important;
}

html.ah-a11y-hide-images body > *:not(#ah-a11y) img,
html.ah-a11y-hide-images body > *:not(#ah-a11y) picture,
html.ah-a11y-hide-images body > *:not(#ah-a11y) video,
html.ah-a11y-hide-images body > *:not(#ah-a11y) [style*="background-image"] {
  visibility: hidden !important;
}

html.ah-a11y-grayscale body > *:not(#ah-a11y) {
  filter: grayscale(1) !important;
}

html.ah-a11y-contrast body > *:not(#ah-a11y) {
  filter: contrast(1.35) !important;
}

html.ah-a11y-night body > *:not(#ah-a11y) {
  background-color: #11191e !important;
  color: #f5f7f8 !important;
}

html.ah-a11y-night {
  --ink: #f5f7f8 !important;
  --paper: #11191e !important;
  --muted: #d7e1e5 !important;
}

html.ah-a11y-night body > *:not(#ah-a11y) a {
  color: #b9e7ff !important;
}

/* Override the theme's own light gradients and white surfaces as well. */
html.ah-a11y-night body > *:not(#ah-a11y) :is(.hero, .detail-hero, .section, .band, .footer, .hero-note, .info-card, .feature-list li, .contact-form input, .contact-form textarea) {
  background-color: #11191e !important;
  background-image: none !important;
  color: #f5f7f8 !important;
}

html.ah-a11y-night body > *:not(#ah-a11y) :is(.hero p, .section-heading p, .detail-hero p, .content-grid p, .tile p, .footer small, .info-card span) {
  color: #d7e1e5 !important;
}

html.ah-a11y-night body > *:not(#ah-a11y) :is(h1, h2, h3, h4, p, li, strong, small, label, .hero-note) {
  color: #f5f7f8 !important;
}

html.ah-a11y-night body > *:not(#ah-a11y) :is(.hero-visual, .detail-image, .tile, img, picture, video) {
  filter: brightness(.62) saturate(.82) !important;
}

html.ah-a11y-night body > *:not(#ah-a11y) :is(.site-header, .nav, .btn:not(.primary)) {
  background-color: #1c2a31 !important;
  color: #f5f7f8 !important;
  border-color: #6f858d !important;
}

html.ah-a11y-blue-filter::after {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  pointer-events: none;
  background: rgb(255 180 80 / 15%);
  content: '';
}

html.ah-a11y-reduced-motion *,
html.ah-a11y-reduced-motion *::before,
html.ah-a11y-reduced-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

@media (max-width: 600px) {
  #ah-a11y {
    /* Leave the Contao/mobile navigation unobstructed. */
    top: 76px;
    right: 12px;
  }

  .ah-a11y-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
  }

  .ah-a11y-panel {
    top: 0;
    right: 60px;
    bottom: auto;
    width: min(360px, calc(100vw - 72px));
    max-height: min(96vh, calc(100vh - 92px));
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.ah-a11y-reduced-motion) * {
    scroll-behavior: auto !important;
  }
}
