/*
 * handytoolslab — כפתור ופאנל נגישות
 * תקן: WCAG 2.1 AA
 */

/* ===== כפתור נגישות קבוע בפינה ===== */
#hn-acc-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1e3a8a;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  transition: background 0.18s, transform 0.15s;
  padding: 0;
}
#hn-acc-btn:hover,
#hn-acc-btn:focus-visible {
  background: #1e40af;
  transform: scale(1.08);
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}
#hn-acc-btn[aria-expanded="true"] { background: #1d4ed8; }

/* ===== פאנל נגישות ===== */
#hn-acc-panel {
  position: fixed;
  bottom: 86px;
  left: 24px;
  z-index: 9001;
  background: #fff;
  border: 2px solid #1e3a8a;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  width: 236px;
  padding: 16px 14px 14px;
  font-family: var(--font-body, sans-serif);
  display: none;
}
#hn-acc-panel.is-open {
  display: block;
  animation: hn-acc-slide-in 0.18s ease;
}
@keyframes hn-acc-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#hn-acc-panel .hn-acc-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

#hn-acc-panel .hn-acc-group { margin-bottom: 10px; }
#hn-acc-panel .hn-acc-group-label {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

#hn-acc-panel .hn-acc-row { display: flex; gap: 6px; flex-wrap: wrap; }
#hn-acc-panel .hn-acc-row button {
  flex: 1;
  min-width: 66px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 500;
  white-space: nowrap;
}
#hn-acc-panel .hn-acc-row button:hover,
#hn-acc-panel .hn-acc-row button:focus-visible {
  background: #eff6ff;
  border-color: #1e3a8a;
  outline: none;
}
#hn-acc-panel .hn-acc-row button.is-active {
  background: #1e3a8a;
  color: #fff;
  border-color: #1e3a8a;
}

#hn-acc-panel .hn-acc-reset {
  width: 100%;
  margin-top: 10px;
  padding: 7px 0;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
#hn-acc-panel .hn-acc-reset:hover { background: #e2e8f0; color: #0f172a; }

/* ===== מצבי נגישות ===== */
body.hn-font-lg { font-size: 118% !important; }
body.hn-font-xl { font-size: 136% !important; }

body.hn-contrast { background: #000 !important; color: #fff !important; }
body.hn-contrast a { color: #ffe066 !important; }
body.hn-contrast *:not(#hn-acc-btn):not(#hn-acc-panel):not(#hn-acc-panel *) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #444 !important;
}
body.hn-contrast img { filter: grayscale(100%) contrast(1.1); }

body.hn-spacing p,
body.hn-spacing li { line-height: 2 !important; letter-spacing: 0.04em !important; }

body.hn-readable * { font-family: Arial, Helvetica, sans-serif !important; }

body.hn-no-anim *,
body.hn-no-anim *::before,
body.hn-no-anim *::after { animation: none !important; transition: none !important; }

/* ===== הגנה על הפאנל עצמו במצב ניגודיות ===== */
body.hn-contrast #hn-acc-btn { background: #1e3a8a !important; color: #fff !important; border-color: #93c5fd !important; }
body.hn-contrast #hn-acc-panel { background: #1a1a1a !important; border-color: #4a6fa5 !important; color: #fff !important; }
body.hn-contrast #hn-acc-panel .hn-acc-title { color: #93c5fd !important; }
body.hn-contrast #hn-acc-panel .hn-acc-row button { background: #222 !important; color: #fff !important; border-color: #555 !important; }
body.hn-contrast #hn-acc-panel .hn-acc-row button.is-active { background: #1e3a8a !important; }
body.hn-contrast #hn-acc-panel .hn-acc-reset { background: #222 !important; color: #aaa !important; }

/* קישור הצהרת נגישות */
.hn-acc-statement {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  text-decoration: none;
  padding: 4px 0;
}
.hn-acc-statement:hover { color: #1e3a8a; text-decoration: underline; }
body.hn-contrast .hn-acc-statement { color: #93c5fd !important; }

@media print {
  #hn-acc-btn, #hn-acc-panel { display: none !important; }
}
