/* Accessibility (Barrierefreiheit) Styles */

/* Skip Navigation */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  background: #81a1a2;
  color: white;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-nav:focus {
  top: 0;
}

/* ── Accessibility Widget ── */

/* Floating toggle button */
#a11y-toggle {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #81a1a2;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#a11y-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}
#a11y-toggle:focus-visible {
  outline: 2px solid #bc6a48;
  outline-offset: 2px;
}
#a11y-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Panel */
#a11y-panel {
  position: fixed;
  bottom: 5.5rem;
  left: 2rem;
  z-index: 9998;
  width: 280px;
  background: #ffffff;
  border: 1px solid rgba(190, 177, 166, 0.4);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  font-family: 'Montserrat', sans-serif;
}
#a11y-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#a11y-panel h3 {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: 500;
  color: #81a1a2;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(190, 177, 166, 0.3);
}

/* Section label */
.a11y-section {
  margin-bottom: 1rem;
}
.a11y-section:last-child {
  margin-bottom: 0;
}
.a11y-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5d5d57;
  margin-bottom: 0.5rem;
  display: block;
}

/* Font-size buttons */
.a11y-font-btns {
  display: flex;
  gap: 0.375rem;
}
.a11y-font-btns button {
  flex: 1;
  padding: 0.4rem 0;
  border: 1px solid rgba(190, 177, 166, 0.5);
  border-radius: 8px;
  background: transparent;
  color: #2f2f2f;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: 'Montserrat', sans-serif;
}
.a11y-font-btns button:hover {
  background: #81a1a2;
  color: #fff;
  border-color: #81a1a2;
}
.a11y-font-btns button:focus-visible {
  outline: 2px solid #81a1a2;
  outline-offset: 2px;
}
.a11y-font-btns button.active {
  background: #81a1a2;
  color: #fff;
  border-color: #81a1a2;
}

/* Toggle switch */
.a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.a11y-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.a11y-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.a11y-switch .slider {
  position: absolute;
  inset: 0;
  background: #beb1a6;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.a11y-switch .slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.a11y-switch input:checked + .slider {
  background: #81a1a2;
}
.a11y-switch input:checked + .slider::before {
  transform: translateX(20px);
}
.a11y-switch input:focus-visible + .slider {
  outline: 2px solid #bc6a48;
  outline-offset: 2px;
}

/* ── High Contrast Mode ── */
html.a11y-high-contrast {
  filter: contrast(1.25);
}
html.a11y-high-contrast body {
  background: #1a1a1a !important;
  color: #f0f0f0 !important;
}
html.a11y-high-contrast nav,
html.a11y-high-contrast footer {
  background: #222 !important;
  border-color: #555 !important;
}
html.a11y-high-contrast nav * {
  color: #e0e0e0 !important;
}
html.a11y-high-contrast footer * {
  color: #d0d0d0 !important;
}
html.a11y-high-contrast a {
  color: #8fd4b4 !important;
}
html.a11y-high-contrast .bg-surface,
html.a11y-high-contrast .bg-background,
html.a11y-high-contrast .bg-surface-container-low {
  background: #1a1a1a !important;
}
html.a11y-high-contrast .bg-primary {
  background: #3a7a5a !important;
}
html.a11y-high-contrast .sanctuary-gradient,
html.a11y-high-contrast .sanctuary-gradient-warm {
  background: #2a2a2a !important;
}
html.a11y-high-contrast .perspective-card {
  background: #2a2a2a !important;
  border: 1px solid #555 !important;
}
html.a11y-high-contrast .text-on-surface,
html.a11y-high-contrast .text-on-background,
html.a11y-high-contrast .text-tertiary,
html.a11y-high-contrast .text-outline {
  color: #e0e0e0 !important;
}
html.a11y-high-contrast .text-primary {
  color: #8fd4b4 !important;
}
html.a11y-high-contrast .text-secondary {
  color: #e1ab94 !important;
}
html.a11y-high-contrast #a11y-panel {
  background: #2a2a2a;
  border-color: #555;
  color: #e0e0e0;
}
html.a11y-high-contrast #a11y-panel h3 {
  color: #8fd4b4;
  border-color: #555;
}
html.a11y-high-contrast #a11y-panel .a11y-section-label {
  color: #bbb;
}
html.a11y-high-contrast #a11y-panel .a11y-font-btns button {
  border-color: #555;
  color: #e0e0e0;
}
html.a11y-high-contrast #cookieBanner {
  background: #2a2a2a !important;
  border-color: #555 !important;
}

/* ── Underline Links Mode ── */
html.a11y-underline-links a {
  text-decoration: underline !important;
  text-underline-offset: 2px;
}
html.a11y-underline-links .skip-nav,
html.a11y-underline-links #a11y-panel a {
  text-decoration: none !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  #a11y-toggle {
    bottom: 1.25rem;
    left: 1.25rem;
    width: 42px;
    height: 42px;
  }
  #a11y-toggle svg {
    width: 20px;
    height: 20px;
  }
  #a11y-panel {
    bottom: 4.75rem;
    left: 1.25rem;
    width: calc(100vw - 2.5rem);
    max-width: 320px;
  }
}

/* ── Print: hide widget ── */
@media print {
  #a11y-toggle, #a11y-panel { display: none !important; }
}
