/* Доступність: skip-link, панель, фокус, режими для слабкозорих */

.a11y-skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100000;
  padding: 12px 20px;
  background: #000;
  color: #fff;
  font-size: 16px;
  text-decoration: underline; }
.a11y-skip-link:focus { top: 8px; }

/* Панель випадає під фіксованою шапкою */
.a11y-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  padding: 16px max(16px, calc((100% - 80rem) / 2 + 16px));
  background: #fff;
  color: #000;
  font-size: 16px;
  line-height: 1.4;
  border-bottom: 3px solid #021e30;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.a11y-panel[hidden] { display: none; }
.a11y-group {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center; }
.a11y-group legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 4px;
  font-weight: 700; }
.a11y-option, .a11y-reset {
  padding: 6px 12px;
  background: #fff;
  color: #000;
  border: 2px solid #021e30;
  border-radius: 4px;
  font: inherit;
  cursor: pointer; }
.a11y-option[aria-pressed="true"] {
  background: #021e30;
  color: #fff; }
.a11y-reset {
  align-self: flex-end;
  margin-left: auto; }

/* Видимий фокус з клавіатури */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ffbf00;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #000; }
#main-content:focus { outline: none; }

/* Підменю відкриваються з клавіатури (десктоп) */
.nav-dd-wrap:focus-within > .nav-dd-panel {
  opacity: 1 !important;
  visibility: visible !important; }

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

/* Розмір шрифту: Tailwind працює в rem, тож масштабуємо корінь */
html.a11y-font-1 { font-size: 125%; }
html.a11y-font-2 { font-size: 150%; }

/* Інтервали та гарнітура */
html.a11y-spacing body,
html.a11y-spacing body * {
  letter-spacing: 0.08em !important;
  word-spacing: 0.16em !important;
  line-height: 1.8 !important; }
html.a11y-family body,
html.a11y-family body * {
  font-family: Arial, Helvetica, sans-serif !important; }

/* Зображення */
html.a11y-images-gray img,
html.a11y-images-gray video,
html.a11y-images-gray .hero-bg,
html.a11y-images-gray [style*="url("] { filter: grayscale(1); }
html.a11y-images-off img,
html.a11y-images-off video { visibility: hidden; }
html.a11y-images-off body * { background-image: none !important; }

/* Кольорові схеми */
html[class*="a11y-scheme-"] body *:not(.hero-bg):not([style*="url("]) {
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important; }
html[class*="a11y-scheme-"] #site-header { backdrop-filter: none; }

html.a11y-scheme-bw body,
html.a11y-scheme-bw body *:not(img):not(video):not(svg):not(path):not(.hero-bg):not([style*="url("]) {
  background-color: #fff !important; color: #000 !important; border-color: #000 !important; }
html.a11y-scheme-wb body,
html.a11y-scheme-wb body *:not(img):not(video):not(svg):not(path):not(.hero-bg):not([style*="url("]) {
  background-color: #000 !important; color: #fff !important; border-color: #fff !important; }
html.a11y-scheme-yb body,
html.a11y-scheme-yb body *:not(img):not(video):not(svg):not(path):not(.hero-bg):not([style*="url("]) {
  background-color: #000 !important; color: #ffeb3b !important; border-color: #ffeb3b !important; }
html.a11y-scheme-bb body,
html.a11y-scheme-bb body *:not(img):not(video):not(svg):not(path):not(.hero-bg):not([style*="url("]) {
  background-color: #9dd1ff !important; color: #063462 !important; border-color: #063462 !important; }

html[class*="a11y-scheme-"] a { text-decoration: underline !important; }
html.a11y-scheme-bw svg, html.a11y-scheme-bw svg * { stroke: #000 !important; }
html.a11y-scheme-wb svg, html.a11y-scheme-wb svg * { stroke: #fff !important; }
html.a11y-scheme-yb svg, html.a11y-scheme-yb svg * { stroke: #ffeb3b !important; }
html.a11y-scheme-bb svg, html.a11y-scheme-bb svg * { stroke: #063462 !important; }
html[class*="a11y-scheme-"] .a11y-option[aria-pressed="true"] { outline: 3px solid currentColor; }

/* Фото-фони (hero, картки спеціальностей) лишаються; порожні декоративні накладки не перекривають фото */
html[class*="a11y-scheme-"] body .absolute.inset-0:empty:not([style*="url("]) {
  background-color: transparent !important; }

/* Hero: фон дають лише текстові елементи, контейнери прозорі — фото видно */
html[class*="a11y-scheme-"] body .hero-bg div:not([style*="url("]):not(#a11y),
html[class*="a11y-scheme-"] body .hero-bg section:not(#a11y) {
  background-color: transparent !important; }
html[class*="a11y-scheme-"] .hero-bg h1,
html[class*="a11y-scheme-"] .hero-bg p {
  width: fit-content;
  max-width: 100%;
  padding: 4px 12px; }

/* Картки з фото: підкладка під текст з відступами, не впритул до літер */
html[class*="a11y-scheme-"] body div:has(> [style*="url("]) > .relative.z-10:not(#a11y) {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 100%;
  box-sizing: border-box; }
html[class*="a11y-scheme-"] body div:has(> [style*="url("]) > .relative.z-10.flex-1:not(#a11y) {
  flex: 0 1 auto; }
