/* ════════════════════════════════════════════════════════════════
   Доступність для слабозорих: панель ♿ + читабельний шрифт,
   3 рівні збільшення, високий контраст.
   Ефекти вмикаються класами на <html>: a11y-font, a11y-size-1/2,
   a11y-contrast (їх ставить js/a11y.js до показу сторінки).
   Збільшення/контраст застосовуються до головного контейнера #main.
   Шрифт — PT Sans (має кирилицю); НЕ Atkinson Hyperlegible (без кирилиці).
   ════════════════════════════════════════════════════════════════ */

/* ── Кнопка-перемикач панелі ── */
.a11y-toggle {
  position: fixed;
  left: 0;
  top: 75%;
  transform: translateY(-50%);
  z-index: 10000;
  width: 46px;
  height: 48px;
  /* притулено до лівої стінки: плаский лівий край, заокруглений правий */
  border-radius: 0 24px 24px 0;
  border: 2px solid #f5d98a;
  border-left: none;
  background: #1a1206;
  color: #f5d98a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 4px 14px rgba(0,0,0,0.45);
  transition: padding-right 0.15s ease, background 0.15s ease;
}
/* кнопка завжди над панеллю, щоб лишалась клікабельною */
.a11y-toggle { z-index: 10001; }
.a11y-toggle:hover { padding-right: 4px; background: #241a0a; }
.a11y-toggle:focus-visible { outline: 3px solid #6db3ff; outline-offset: 2px; }

/* ── Панель ── */
.a11y-panel {
  position: fixed;
  left: 0;
  top: 75%;
  transform: translateY(-50%);
  z-index: 10000;
  width: min(290px, calc(100vw - 48px));
  background: #11131a;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-left: none;
  /* притулено до лівої стінки: заокруглений лише правий край */
  border-radius: 0 14px 14px 0;
  /* лівий відступ — щоб вміст не ховався за кнопкою ♿ */
  padding: 16px 16px 16px 54px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  font-family: "PT Sans", system-ui, -apple-system, sans-serif;
  display: none;
}
.a11y-panel[data-open="true"] { display: block; }

.a11y-panel h2 {
  font-size: 1rem;
  margin: 0 0 12px;
  color: #f5d98a;
  font-family: inherit;
}
.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.a11y-row:last-child { margin-bottom: 0; }
.a11y-row > span { font-size: 0.92rem; }

.a11y-panel button {
  font-family: inherit;
  font-size: 0.9rem;
  color: #fff;
  background: #20232e;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  min-width: 40px;
  min-height: 38px;
}
.a11y-panel button:hover { background: #2a2e3c; }
.a11y-panel button[aria-pressed="true"] {
  background: #f5d98a;
  color: #1a1206;
  border-color: #f5d98a;
  font-weight: 700;
}
.a11y-panel button:focus-visible { outline: 3px solid #6db3ff; outline-offset: 2px; }

.a11y-size-controls { display: flex; gap: 6px; }
.a11y-size-controls .a11y-size-level {
  min-width: 56px;
  pointer-events: none;
  background: transparent;
  border: 0;
  font-weight: 700;
  text-align: center;
}
.a11y-reset {
  width: 100%;
  margin-top: 4px;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.22);
}

/* ════════ ЕФЕКТИ ════════ */

/* ── Читабельний шрифт (PT Sans) ── */
html.a11y-font #main,
html.a11y-font #main h1,
html.a11y-font #main h2,
html.a11y-font #main h3,
html.a11y-font #main h4,
html.a11y-font #main p,
html.a11y-font #main span,
html.a11y-font #main a,
html.a11y-font #main li,
html.a11y-font #main button,
html.a11y-font #main input,
html.a11y-font #main textarea,
html.a11y-font #main label {
  font-family: "PT Sans", system-ui, -apple-system, sans-serif !important;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

/* ── Збільшення (3 рівні: 0 / +12% / +25%) ── */
html.a11y-size-1 #main { zoom: 1.12; }
html.a11y-size-2 #main { zoom: 1.25; }

/* ── Високий контраст (перевизначаємо змінні теми в межах #main) ── */
html.a11y-contrast #main {
  --bg-deep: #000;
  --bg-card: #0a0a0a;
  --bg-glass: #0d0d0d;
  --text-main: #ffffff;
  --text-soft: #f4f4f4;
  --text-dim: #e2e2e2;
  --accent-warm: #ffd680;
  background: #000;
}
html.a11y-contrast #main *,
html.a11y-contrast #main *::before,
html.a11y-contrast #main *::after { text-shadow: none !important; }
html.a11y-contrast #main a:not(.action-btn):not(.state-btn):not(.connect-card):not(.tool-card-link) {
  text-decoration: underline;
}
/* Картки/кнопки — чіткіша рамка */
html.a11y-contrast #main .track-card,
html.a11y-contrast #main .action-btn,
html.a11y-contrast #main .state-btn,
html.a11y-contrast #main .connect-card,
html.a11y-contrast #main .daily-card {
  border-color: rgba(255,255,255,0.5) !important;
}

/* Поважаємо вимкнену анімацію в системі */
@media (prefers-reduced-motion: reduce) {
  .a11y-toggle, .a11y-panel button { transition: none; }
}
