/* Dora accessibility: skip link, focus, contrast, text scale, motion */

.dora-skip-link {
  position: fixed;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 10000;
  transform: translateY(-200%);
  border-radius: 0.75rem;
  border: 2px solid #43307f;
  background: #fff;
  color: #0f172a;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease;
}

.dora-skip-link:focus {
  transform: translateY(0);
  outline: none;
}

html :focus-visible {
  outline: 2px solid #f79526;
  outline-offset: 2px;
}

html.a11y-enhanced-focus :focus-visible {
  outline: 3px solid #f79526;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(247, 149, 32, 0.35);
}

html.a11y-text-lg {
  font-size: 112.5%;
}

html.a11y-text-xl {
  font-size: 125%;
}

html.a11y-underline-links a:not(.dora-a11y-panel a):where(:not([class*="rounded"])) {
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
}

html.a11y-high-contrast {
  color-scheme: light;
}

html.a11y-high-contrast body {
  background: #fff !important;
  color: #000 !important;
}

html.a11y-high-contrast .bg-slate-50,
html.a11y-high-contrast .bg-white,
html.a11y-high-contrast .bg-slate-50\/50,
html.a11y-high-contrast [class*="bg-slate"] {
  background-color: #fff !important;
}

html.a11y-high-contrast [class*="text-slate"],
html.a11y-high-contrast [class*="text-brand"],
html.a11y-high-contrast p,
html.a11y-high-contrast li,
html.a11y-high-contrast label,
html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4 {
  color: #000 !important;
}

html.a11y-high-contrast a {
  color: #0000ee !important;
  text-decoration: underline !important;
}

html.a11y-high-contrast button,
html.a11y-high-contrast input,
html.a11y-high-contrast select,
html.a11y-high-contrast textarea {
  border: 2px solid #000 !important;
  background: #fff !important;
  color: #000 !important;
}

html.a11y-high-contrast .border,
html.a11y-high-contrast [class*="border-slate"],
html.a11y-high-contrast [class*="ring-"] {
  border-color: #000 !important;
  --tw-ring-color: #000 !important;
}

@media (prefers-reduced-motion: reduce) {
  html:not(.a11y-allow-motion) *,
  html:not(.a11y-allow-motion) *::before,
  html:not(.a11y-allow-motion) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

/* Hide images (keep UI icons in accessibility controls) */
html.a11y-hide-images img,
html.a11y-hide-images picture,
html.a11y-hide-images video,
html.a11y-hide-images canvas {
  display: none !important;
}

html.a11y-hide-images [style*="background-image"]:not(.dora-a11y-fab):not(.dora-a11y-panel) {
  background-image: none !important;
}

html.a11y-hide-images figure {
  min-height: 0;
}

html.a11y-hide-images figure:empty,
html.a11y-hide-images .dora-logo-wrap:empty {
  display: none;
}

/* Colour saturation */
html.a11y-saturate-low {
  --a11y-saturate: 0.45;
}

html.a11y-saturate-high {
  --a11y-saturate: 1.7;
}

html.a11y-saturate-low body,
html.a11y-saturate-high body {
  filter: saturate(var(--a11y-saturate));
}

html.a11y-saturate-low .dora-a11y-fab,
html.a11y-saturate-low .dora-a11y-panel,
html.a11y-saturate-high .dora-a11y-fab,
html.a11y-saturate-high .dora-a11y-panel {
  filter: saturate(calc(1 / var(--a11y-saturate)));
}

/* Large cursors (SVG data URIs) */
html.a11y-cursor-lg,
html.a11y-cursor-lg * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.25' d='M5 4v18l7-5 5 7 3-2-5-7h8z'/%3E%3C/svg%3E") 5 4, auto !important;
}

html.a11y-cursor-xl,
html.a11y-cursor-xl * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.5' d='M6 5v26l10-7 7 10 5-3-7-10h12z'/%3E%3C/svg%3E") 7 5, auto !important;
}

html.a11y-cursor-lg a,
html.a11y-cursor-lg button,
html.a11y-cursor-lg label,
html.a11y-cursor-lg [role="button"],
html.a11y-cursor-lg input[type="submit"],
html.a11y-cursor-lg input[type="button"],
html.a11y-cursor-lg select,
html.a11y-cursor-lg summary,
html.a11y-cursor-xl a,
html.a11y-cursor-xl button,
html.a11y-cursor-xl label,
html.a11y-cursor-xl [role="button"],
html.a11y-cursor-xl input[type="submit"],
html.a11y-cursor-xl input[type="button"],
html.a11y-cursor-xl select,
html.a11y-cursor-xl summary {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.25' d='M8 4l16 12-16 12z'/%3E%3C/svg%3E") 14 14, pointer !important;
}

html.a11y-cursor-xl a,
html.a11y-cursor-xl button,
html.a11y-cursor-xl label,
html.a11y-cursor-xl [role="button"],
html.a11y-cursor-xl input[type="submit"],
html.a11y-cursor-xl input[type="button"],
html.a11y-cursor-xl select,
html.a11y-cursor-xl summary {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.5' d='M12 6l20 16-20 16z'/%3E%3C/svg%3E") 20 20, pointer !important;
}

html.a11y-cursor-lg input[type="text"],
html.a11y-cursor-lg input[type="email"],
html.a11y-cursor-lg input[type="password"],
html.a11y-cursor-lg input[type="search"],
html.a11y-cursor-lg input[type="url"],
html.a11y-cursor-lg input[type="tel"],
html.a11y-cursor-lg input[type="number"],
html.a11y-cursor-lg textarea,
html.a11y-cursor-xl input[type="text"],
html.a11y-cursor-xl input[type="email"],
html.a11y-cursor-xl input[type="password"],
html.a11y-cursor-xl input[type="search"],
html.a11y-cursor-xl input[type="url"],
html.a11y-cursor-xl input[type="tel"],
html.a11y-cursor-xl input[type="number"],
html.a11y-cursor-xl textarea {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1' d='M5 4h2v16H5zm6 0h2v16h-2zm6 0h2v16h-2z'/%3E%3C/svg%3E") 12 12, text !important;
}

.dora-a11y-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
}

.dora-a11y-fab-pill-wrap,
.dora-a11y-fab-restore {
  pointer-events: auto;
}

.dora-a11y-fab-pill-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.dora-a11y-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 2px solid #43307f;
  background: #43307f;
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(67, 48, 127, 0.35);
}

.dora-a11y-fab-btn:hover {
  background: #362966;
}

/* Minimize "×" badge tucked to the top-right of the FAB */
.dora-a11y-fab-collapse {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  border: 2px solid #fff;
  background: #475569;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.dora-a11y-fab-collapse:hover,
.dora-a11y-fab-collapse:focus-visible {
  background: #1f2937;
  outline: none;
}

/* Small edge tab shown when the FAB is collapsed */
.dora-a11y-fab-restore {
  display: none !important;
  width: 30px;
  height: 44px;
  border: 2px solid #43307f;
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #43307f;
  color: #fff;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: -6px 8px 18px rgba(67, 48, 127, 0.3);
  cursor: pointer;
}

.dora-a11y-fab-restore:hover,
.dora-a11y-fab-restore:focus-visible {
  background: #362966;
  outline: none;
}

/* Collapsed state: hide the main pill + close badge, slide to the right edge,
   and reveal the slim restore tab. */
.dora-a11y-fab[data-collapsed="true"],
html.a11y-fab-collapsed .dora-a11y-fab {
  right: 0;
  bottom: 5rem;
}

.dora-a11y-fab[data-collapsed="true"] .dora-a11y-fab-pill-wrap,
html.a11y-fab-collapsed .dora-a11y-fab .dora-a11y-fab-pill-wrap {
  display: none !important;
}

.dora-a11y-fab[data-collapsed="true"] .dora-a11y-fab-btn,
.dora-a11y-fab[data-collapsed="true"] .dora-a11y-fab-collapse,
html.a11y-fab-collapsed .dora-a11y-fab .dora-a11y-fab-btn,
html.a11y-fab-collapsed .dora-a11y-fab .dora-a11y-fab-collapse {
  display: none !important;
}

.dora-a11y-fab[data-collapsed="true"] .dora-a11y-fab-restore,
html.a11y-fab-collapsed .dora-a11y-fab .dora-a11y-fab-restore {
  display: inline-flex !important;
}

.dora-a11y-fab-restore[hidden] {
  display: none !important;
}

/* Mobile: tighten the FAB to a 44×44 round icon-only target so it doesn't
   block content. Screen readers still read "Accessibility" via .dora-sr-only. */
@media (max-width: 640px) {
  .dora-a11y-fab {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .dora-a11y-fab-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .dora-a11y-fab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.dora-a11y-panel {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 9991;
  width: min(100vw - 2rem, 22rem);
  max-height: min(85vh, 36rem);
  overflow: auto;
  border-radius: 1rem;
  border: 2px solid #43307f;
  background: #fff;
  color: #0f172a;
  padding: 1rem;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
}

.dora-a11y-panel[hidden] {
  display: none !important;
}

.dora-a11y-panel h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.dora-a11y-panel fieldset {
  margin: 0.75rem 0 0;
  padding: 0;
  border: 0;
}

.dora-a11y-panel legend {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.dora-a11y-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.dora-a11y-switch-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.5rem;
}

.dora-a11y-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.dora-a11y-switch-label {
  flex: 1;
  font-weight: 600;
  color: #0f172a;
}

.dora-a11y-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.dora-a11y-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dora-a11y-switch-ui {
  position: relative;
  display: block;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}

.dora-a11y-switch-ui::after {
  content: "";
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease;
}

.dora-a11y-switch input:checked + .dora-a11y-switch-ui {
  background: #43307f;
}

.dora-a11y-switch input:checked + .dora-a11y-switch-ui::after {
  transform: translateX(1.25rem);
}

.dora-a11y-switch input:focus-visible + .dora-a11y-switch-ui {
  outline: 2px solid #f79526;
  outline-offset: 2px;
}

.dora-a11y-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

.dora-a11y-read-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.dora-a11y-read-controls[hidden] {
  display: none !important;
}

.dora-a11y-action-btn {
  border-radius: 0.5rem;
  border: 1px solid #43307f;
  background: #43307f;
  color: #fff;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.dora-a11y-action-btn:hover {
  background: #362966;
}

.dora-a11y-action-btn--muted {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}

.dora-a11y-action-btn--muted:hover {
  background: #f8fafc;
}

html.a11y-read-aloud #main-content ::selection {
  background: #fde68a;
  color: #0f172a;
}

.dora-a11y-seg-btn {
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.dora-a11y-seg-btn[aria-pressed="true"] {
  border-color: #43307f;
  background: #43307f;
  color: #fff;
}

.dora-a11y-panel-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dora-a11y-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #43307f;
  text-decoration: underline;
}

.dora-a11y-reset {
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.dora-a11y-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
