/*!
 * UWC accessibility toolbar (ELLE-214), styles for a11y-toolbar.js.
 * Version 1.1.0 (ELLE-307): larger launcher at the top right, set off more strongly.
 *
 * Self-contained: every value falls back to the UWC design guideline when the page
 * does not define the custom property, so the file works on uwc365.de and in the
 * WordPress plugin for uwc24.de alike. Classes carry the prefix `uwc-a11y-`; the
 * settings are classes on <html> set by the script.
 *
 * The launcher sits at the top of the right edge, just below the page header, where bottom
 * bars (selection bar, cookie notes, chat buttons) do not reach. Its top edge is
 * `--uwc-a11y-top` plus a small gap; the script keeps that value at the bottom of an element
 * marked `data-uwc-a11y-anchor` (the header), otherwise it is the usual header height of 4rem.
 * Its layer is `--uwc-a11y-z-index` (default 65: above a sticky header at 50, below dialogs and
 * slide-in menus from 70 upwards).
 */

/* =========================================================
 * Settings chosen by the visitor
 * ========================================================= */

/* Text size in three steps; pages sized in rem grow with it. */
html.uwc-a11y-font-1 { font-size: 112.5% !important; }
html.uwc-a11y-font-2 { font-size: 125% !important; }
html.uwc-a11y-font-3 { font-size: 150% !important; }
/* Long compound words (Unterweisungscenter) would otherwise widen narrow screens. */
html.uwc-a11y-font-1 body,
html.uwc-a11y-font-2 body,
html.uwc-a11y-font-3 body {
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* High contrast: black text on white, links dark blue and underlined, every edge black.
 * Pictures and icons keep their form; SVG elements are left out so that drawings keep their fills. */
html.uwc-a11y-contrast body,
html.uwc-a11y-contrast body *:not(svg):not(svg *) {
  color: #000000 !important;
  background-color: #ffffff !important;
  border-color: #000000 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  /* Colors switch at once; a fading button would pass through low contrast. */
  transition: none !important;
}
/* :any-link lifts these rules above the general one, whose :not() arguments count as type selectors. */
html.uwc-a11y-contrast body a:any-link,
html.uwc-a11y-contrast body a:any-link * {
  color: #00007a !important;
  text-decoration: underline !important;
}
html.uwc-a11y-contrast body svg { color: #000000 !important; }
html.uwc-a11y-contrast button,
html.uwc-a11y-contrast input,
html.uwc-a11y-contrast select,
html.uwc-a11y-contrast textarea {
  border: 2px solid #000000 !important;
}

/* Spacing per WCAG 1.4.12: line height 1.5 or more, letter spacing 0.12em, word spacing 0.16em,
 * paragraph spacing twice the text size. */
html.uwc-a11y-spacing body *:not(svg):not(svg *) {
  line-height: 1.8 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
html.uwc-a11y-spacing body p { margin-bottom: 2em !important; }

/* Highlighted links: underlined and on a yellow ground with black text (19.6:1). */
html.uwc-a11y-links body a:any-link {
  color: #000000 !important;
  background-color: #fff176 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 0.125em !important;
  text-underline-offset: 0.15em !important;
}
/* Parts inside a link (icons, spans) show the yellow ground, also in high contrast. */
html.uwc-a11y-links body a:any-link * {
  color: #000000 !important;
  background-color: transparent !important;
}

/* Animations off: the same rule the site applies for prefers-reduced-motion. */
html.uwc-a11y-motion *,
html.uwc-a11y-motion *::before,
html.uwc-a11y-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
html.uwc-a11y-motion { scroll-behavior: auto !important; }

/* =========================================================
 * The toolbar itself
 * ========================================================= */

.uwc-a11y-toolbar {
  /* Launcher size: the large icon tile of the guideline, well above the 2.75rem touch target. */
  --uwc-a11y-launcher-size: var(--size-icon-tile-grid, 3.5rem);
  --uwc-a11y-launcher-top: calc(var(--uwc-a11y-top, var(--size-navigation, 4rem)) + var(--space-2, 0.5rem));
  position: fixed;
  right: 0;
  top: var(--uwc-a11y-launcher-top);
  z-index: var(--uwc-a11y-z-index, 65);
  font-family: var(--font-body, 'Atkinson Hyperlegible Next', 'Segoe UI', Arial, sans-serif);
  font-size: var(--text-body, 1rem);
  line-height: var(--text-body--line-height, 1.625rem);
  color: var(--color-text-primary, #0b1736);
}

.uwc-a11y-toolbar *,
.uwc-a11y-toolbar *::before,
.uwc-a11y-toolbar *::after {
  box-sizing: border-box;
}

.uwc-a11y-launcher {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  justify-content: center;
  min-width: var(--uwc-a11y-launcher-size);
  min-height: var(--uwc-a11y-launcher-size);
  margin: 0;
  padding: var(--space-2, 0.5rem);
  /* Set off from any background: white edge on brand blue, a navy ring around it and the
   * floating shadow (white on brand blue 9.3:1, navy ring against white 17.6:1). */
  border: 2px solid var(--color-on-accent, #ffffff);
  border-right: 0;
  border-radius: var(--radius-large, 1rem) 0 0 var(--radius-large, 1rem);
  background: var(--color-accent, #003bb1);
  color: var(--color-on-accent, #ffffff);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--color-brand-navy, #0b1736), var(--shadow-overlay, 0 0.5rem 1.5rem rgba(11, 23, 54, 0.12));
}
.uwc-a11y-launcher:hover,
.uwc-a11y-launcher[aria-expanded='true'] { background: var(--color-accent-hover, #002a85); }

.uwc-a11y-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.uwc-a11y-launcher .uwc-a11y-icon {
  width: 2.25rem;
  height: 2.25rem;
}

/* The launcher shows only its icon; the text is its name for screen readers. */
.uwc-a11y-launcher-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.uwc-a11y-panel {
  /* Opens to the left of the launcher, top edges aligned, and scrolls inside when the window is low. */
  position: fixed;
  right: calc(var(--uwc-a11y-launcher-size) + var(--space-2, 0.5rem));
  top: var(--uwc-a11y-launcher-top);
  width: min(22rem, calc(100vw - var(--uwc-a11y-launcher-size) - var(--space-6, 1.5rem)));
  max-height: calc(100vh - var(--uwc-a11y-launcher-top) - var(--space-4, 1rem));
  overflow-y: auto;
  padding: var(--space-4, 1rem);
  border: 1px solid var(--color-border-strong, #7d8597);
  border-radius: var(--radius-large, 1rem);
  background: var(--color-background-surface, #ffffff);
  box-shadow: var(--shadow-overlay, 0 0.5rem 1.5rem rgba(11, 23, 54, 0.12));
}
.uwc-a11y-panel[hidden] { display: none; }
/* On narrow screens the panel takes the full width and covers the launcher; it closes itself. */
@media (max-width: 29.99rem) {
  .uwc-a11y-panel {
    right: var(--space-2, 0.5rem);
    left: var(--space-2, 0.5rem);
    width: auto;
  }
}

.uwc-a11y-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 0.5rem);
  margin-bottom: var(--space-3, 0.75rem);
}

.uwc-a11y-heading,
.uwc-a11y-subheading {
  margin: 0;
  font-family: var(--font-heading, 'Montserrat', 'Segoe UI', Arial, sans-serif);
  font-weight: 700;
  color: var(--color-text-primary, #0b1736);
}
.uwc-a11y-heading {
  font-size: var(--text-heading-4, 1.125rem);
  line-height: var(--text-heading-4--line-height, 1.625rem);
}
.uwc-a11y-subheading {
  margin-bottom: var(--space-2, 0.5rem);
  font-size: var(--text-label, 0.9375rem);
  line-height: var(--text-label--line-height, 1.25rem);
}

.uwc-a11y-group {
  margin: 0 0 var(--space-4, 1rem);
  padding: 0;
  border: 0;
}
.uwc-a11y-group legend {
  margin-bottom: var(--space-2, 0.5rem);
  padding: 0;
  font-size: var(--text-label, 0.9375rem);
  font-weight: 700;
}

.uwc-a11y-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2, 0.5rem);
}

.uwc-a11y-step,
.uwc-a11y-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  min-height: var(--size-touch-target, 2.75rem);
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  border: 1px solid var(--color-border-strong, #7d8597);
  border-radius: var(--radius-small, 0.375rem);
  cursor: pointer;
}
.uwc-a11y-step:has(input:checked),
.uwc-a11y-toggle:has(input:checked) {
  border-color: var(--color-accent, #003bb1);
  background: var(--color-accent-light, #eef4fc);
}
.uwc-a11y-step input,
.uwc-a11y-toggle input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--color-accent, #003bb1);
}

.uwc-a11y-toggles {
  display: grid;
  gap: var(--space-2, 0.5rem);
  margin-bottom: var(--space-4, 1rem);
}

.uwc-a11y-read-aloud { margin-bottom: var(--space-4, 1rem); }

.uwc-a11y-close { flex-shrink: 0; }
/* Labels inside the toolbar are not hyphenated when the visitor enlarges the text. */
.uwc-a11y-toolbar { overflow-wrap: normal; hyphens: manual; }

.uwc-a11y-button,
.uwc-a11y-close {
  min-height: var(--size-touch-target, 2.75rem);
  margin: 0;
  padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
  border: 2px solid var(--color-accent, #003bb1);
  border-radius: var(--radius-medium, 0.625rem);
  background: var(--color-accent, #003bb1);
  color: var(--color-on-accent, #ffffff);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.uwc-a11y-button:hover { background: var(--color-accent-hover, #002a85); border-color: var(--color-accent-hover, #002a85); }
.uwc-a11y-button:disabled {
  border-color: var(--color-border-strong, #7d8597);
  background: var(--color-background-page-warm, #f6f3ee);
  color: var(--color-text-secondary, #4a5570);
  cursor: not-allowed;
}
.uwc-a11y-button-secondary,
.uwc-a11y-close {
  background: var(--color-background-surface, #ffffff);
  color: var(--color-accent, #003bb1);
}
.uwc-a11y-button-secondary:hover,
.uwc-a11y-close:hover {
  background: var(--color-accent-light, #eef4fc);
  color: var(--color-accent-hover, #002a85);
}

.uwc-a11y-note,
.uwc-a11y-status {
  margin: var(--space-2, 0.5rem) 0 0;
  font-size: var(--text-small, 0.875rem);
  line-height: var(--text-small--line-height, 1.375rem);
  color: var(--color-text-secondary, #4a5570);
}
.uwc-a11y-status:empty { display: none; }

/* Visible focus on every control (guideline: focus ring in brand sky, 2px plus offset). */
.uwc-a11y-toolbar :focus-visible,
.uwc-a11y-step:has(input:focus-visible),
.uwc-a11y-toggle:has(input:focus-visible) {
  outline: 2px solid var(--color-border-focus, #0984e3);
  outline-offset: 2px;
}
.uwc-a11y-heading:focus { outline: none; }

/* In forced colors (Windows high contrast) the system colors take over. */
@media (forced-colors: active) {
  .uwc-a11y-launcher,
  .uwc-a11y-button,
  .uwc-a11y-close,
  .uwc-a11y-step,
  .uwc-a11y-toggle,
  .uwc-a11y-panel {
    border: 2px solid CanvasText;
  }
}

@media print {
  .uwc-a11y-toolbar { display: none; }
}
