/**
 * Accessibility Profile — стилі UI віджета.
 * Усі селектори з префіксом .ap11y- щоб не конфліктувати з темою сайту.
 * Оформлення самого віджета навмисно НЕ реагує на профілі доступності,
 * тому селектори винесені поза body.ap11y-* правила у profiles.css.
 */

.ap11y-toggle {
  position: fixed;
  z-index: 99998;
  bottom: 24px;
  inset-inline-start: 24px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1046b4;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, background .15s ease;
}

.ap11y-toggle:hover { background: #0d3990; transform: scale(1.05); }
.ap11y-toggle:focus-visible { outline: 3px solid #ffbf00; outline-offset: 3px; }
.ap11y-toggle svg { width: 30px; height: 30px; fill: currentColor; }

/* Панель */
.ap11y-panel {
  position: fixed;
  z-index: 99999;
  top: 0;
  inset-inline-start: 0;
  width: 380px;
  max-width: 92vw;
  height: 100vh;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 0 40px rgba(0, 0, 0, .35);
  transform: translateX(-102%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}
[dir="rtl"] .ap11y-panel { transform: translateX(102%); }
.ap11y-panel.is-open { transform: translateX(0); }

.ap11y-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: #1046b4;
  color: #fff;
  flex: 0 0 auto;
}
.ap11y-header h2 { margin: 0; font-size: 20px; font-weight: 700; color: #fff; }

.ap11y-close {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  line-height: 0;
}
.ap11y-close:hover { background: rgba(255, 255, 255, .18); }
.ap11y-close:focus-visible { outline: 3px solid #ffbf00; outline-offset: 2px; }
.ap11y-close svg { width: 22px; height: 22px; fill: currentColor; }

.ap11y-body { overflow-y: auto; padding: 16px; flex: 1 1 auto; }

.ap11y-reset {
  width: 100%;
  margin-bottom: 14px;
  padding: 12px;
  border: 2px solid #d02020;
  border-radius: 10px;
  background: #fff;
  color: #d02020;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.ap11y-reset:hover { background: #d02020; color: #fff; }
.ap11y-reset:focus-visible { outline: 3px solid #ffbf00; outline-offset: 2px; }

.ap11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ap11y-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border: 2px solid #e2e6ee;
  border-radius: 12px;
  background: #fff;
  color: #1a1a1a;
  text-align: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: border-color .12s ease, background .12s ease;
}
.ap11y-card:hover { border-color: #1046b4; }
.ap11y-card:focus-visible { outline: 3px solid #ffbf00; outline-offset: 2px; }
.ap11y-card .ap11y-icon { width: 34px; height: 34px; fill: #1046b4; }
.ap11y-card[aria-pressed="true"] {
  border-color: #1046b4;
  background: #eef3ff;
}
.ap11y-card[aria-pressed="true"] .ap11y-state { color: #1046b4; }
.ap11y-state { font-size: 12px; font-weight: 500; color: #6b7280; }

.ap11y-footer {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-top: 1px solid #e2e6ee;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

/* Затемнення тла під панеллю */
.ap11y-overlay {
  position: fixed;
  inset: 0;
  z-index: 99997;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.ap11y-overlay.is-open { opacity: 1; visibility: visible; }

@media (max-width: 480px) {
  .ap11y-toggle { width: 50px; height: 50px; bottom: 16px; inset-inline-start: 16px; }
}
