/* WP BAccessibility - כפתור וחלון הנגישות.
   מידות ב-px, כדי שהחלון לא יושפע מהגדלת הטקסט. ההתאמות מוחלות דרך מחלקות על <html>, לא על #wpba. */

#wpba {
  --wpba-bar-bg: #2563eb;
  --wpba-bar-text: #fff;
  --wpba-btn-bg: #2563eb;
  --wpba-btn-icon: #fff;
  --wpba-radius: 100px;
  --wpba-size: 56px;
  --wpba-off-x: 20px;
  --wpba-off-y: 20px;
  --wpba-ink: #1d2327;
  --wpba-tile: #f1f2f4;
  --wpba-z: 2147483000;
  font: 400 15px/1.4 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--wpba-ink);
  letter-spacing: normal;
  word-spacing: normal;
  text-align: right;
}

#wpba *,
#wpba *::before,
#wpba *::after {
  box-sizing: border-box;
}

#wpba .wpba-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#wpba button {
  margin: 0;
  font: inherit;
  color: inherit;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#wpba svg {
  display: block;
  flex: none;
}

/* ---------- הכפתור הצף ---------- */
#wpba .wpba-toggle {
  position: fixed;
  bottom: var(--wpba-off-y);
  z-index: var(--wpba-z);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--wpba-size);
  height: var(--wpba-size);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: var(--wpba-radius);
  background: var(--wpba-btn-bg);
  color: var(--wpba-btn-icon);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
  transition: transform .15s ease;
}

#wpba.wpba--right .wpba-toggle {
  right: var(--wpba-off-x);
}

#wpba.wpba--left .wpba-toggle {
  left: var(--wpba-off-x);
}

/* מסגרת פנימית, שעוקבת אחרי עיגול הפינות */
#wpba .wpba-toggle::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid var(--wpba-btn-icon);
  border-radius: max(0px, calc(var(--wpba-radius) - 4px));
  opacity: .9;
  pointer-events: none;
}

#wpba .wpba-toggle:hover {
  transform: scale(1.06);
}

#wpba .wpba-toggle:focus-visible {
  outline: 3px solid var(--wpba-btn-bg);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff, 0 4px 14px rgba(0, 0, 0, .28);
}

/* האייקון תמיד בתוך הכפתור */
#wpba .wpba-icon {
  display: block;
  width: 58%;
  height: 58%;
}

#wpba .wpba-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.8;
}

#wpba .wpba-icon--img {
  object-fit: contain;
  max-width: none;
  border: 0;
  box-shadow: none;
}

#wpba .wpba-icon--mask {
  background: var(--wpba-btn-icon);
  -webkit-mask: var(--wpba-icon-url) center / contain no-repeat;
  mask: var(--wpba-icon-url) center / contain no-repeat;
}

html.wpba-btn-hidden #wpba .wpba-toggle {
  display: none;
}

/* ---------- החלון ---------- */
#wpba .wpba-panel {
  position: fixed;
  bottom: 12px;
  z-index: calc(var(--wpba-z) + 1);
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: calc(100vw - 24px);
  height: 720px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
}

#wpba .wpba-panel[hidden] {
  display: none;
}

#wpba.wpba--right .wpba-panel {
  right: 12px;
}

#wpba.wpba--left .wpba-panel {
  left: 12px;
}

@media (max-width: 767px) {
  #wpba .wpba-panel {
    inset: 8px;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
  }
}

#wpba .wpba-head,
#wpba .wpba-foot {
  flex: none;
  background: var(--wpba-bar-bg);
  color: var(--wpba-bar-text);
}

#wpba .wpba-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}

#wpba .wpba-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
  text-transform: none;
  letter-spacing: normal;
}

#wpba .wpba-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  border: 2px solid var(--wpba-bar-text);
  border-radius: 50%;
  background: transparent;
  color: var(--wpba-bar-text);
}

#wpba .wpba-title-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

#wpba .wpba-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

#wpba .wpba-head-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
}

#wpba .wpba-head-btn:hover,
#wpba .wpba-head-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, .18);
}

#wpba .wpba-head-sep {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: currentColor;
  opacity: .45;
}

#wpba .wpba-head-btn:focus-visible,
#wpba .wpba-statement:focus-visible {
  outline: 3px solid var(--wpba-bar-text);
  outline-offset: 1px;
}

/* תפריט ההסתרה */
#wpba .wpba-hide-menu {
  flex: none;
  padding: 14px 18px;
  background: #fff8e1;
  border-bottom: 1px solid #e6d7a3;
}

#wpba .wpba-hide-menu[hidden] {
  display: none;
}

#wpba .wpba-hide-q {
  margin: 0 0 10px;
  font-weight: 700;
}

#wpba .wpba-hide-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#wpba .wpba-hide-options button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #1d2327;
  border-radius: 10px;
  background: #fff;
  color: #1d2327;
}

#wpba .wpba-hide-options button:hover {
  background: #1d2327;
  color: #fff;
}

#wpba .wpba-hide-options .wpba-hide-cancel {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
}

#wpba .wpba-hide-note {
  margin: 10px 0 0;
  font-size: 13px;
}

/* גוף החלון */
#wpba .wpba-body {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  background: #e9ebee;
}

#wpba .wpba-group {
  margin: 0 0 14px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

#wpba .wpba-group:last-of-type {
  margin-bottom: 0;
}

#wpba .wpba-group-title {
  margin: 0 0 12px;
  padding: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #50575e;
  text-transform: none;
  letter-spacing: normal;
}

/* minmax(0, 1fr): עמודות שוות שלא מתרחבות לפי המילה הארוכה, גם כשפס הגלילה תופס רוחב */
#wpba .wpba-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#wpba .wpba-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 76px;
  padding: 10px 12px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--wpba-tile);
  color: var(--wpba-ink);
  text-align: right;
  line-height: 1.25;
}

#wpba .wpba-tile:hover {
  border-color: #c3c4c7;
}

#wpba .wpba-tile:focus-visible {
  outline: 3px solid var(--wpba-ink);
  outline-offset: 2px;
}

#wpba .wpba-tile[aria-pressed="true"] {
  border-color: var(--wpba-ink);
  background: #fff;
}

#wpba .wpba-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--wpba-ink);
}

#wpba .wpba-tile[aria-pressed="true"] .wpba-tile-icon {
  background: var(--wpba-bar-bg);
  color: var(--wpba-bar-text);
}

#wpba .wpba-tile-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#wpba .wpba-tile-label {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

#wpba .wpba-tile-state {
  font-size: 12px;
  color: #50575e;
}

#wpba .wpba-tile-state:empty {
  display: none;
}

#wpba .wpba-steps {
  display: flex;
  gap: 3px;
}

#wpba .wpba-steps span {
  flex: 0 1 18px;
  min-width: 8px;
  height: 6px;
  border-radius: 3px;
  background: #c3c4c7;
}

#wpba .wpba-steps span.is-on {
  background: var(--wpba-ink);
}

@media (max-width: 360px) {
  #wpba .wpba-grid {
    grid-template-columns: 1fr;
  }
}

/* מבנה העמוד: רשימת הכותרות */
#wpba .wpba-structure {
  margin-top: 12px;
}

#wpba .wpba-structure[hidden] {
  display: none;
}

#wpba .wpba-structure ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#wpba .wpba-structure li {
  margin: 0;
  padding: 0;
}

#wpba .wpba-structure button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #e5e7ea;
  background: none;
  font-size: 14px;
  text-align: right;
}

#wpba .wpba-structure button:hover,
#wpba .wpba-structure button:focus-visible {
  background: var(--wpba-tile);
  outline: 2px solid var(--wpba-ink);
  outline-offset: -2px;
}

#wpba .wpba-structure .wpba-lvl {
  display: inline-block;
  min-width: 28px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #50575e;
}

#wpba .wpba-structure p {
  margin: 0;
  font-size: 14px;
}

/* הפס התחתון */
#wpba .wpba-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
  min-height: 48px;
  padding: 10px 18px;
}

#wpba .wpba-statement {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
}

#wpba .wpba-statement svg {
  width: 18px;
  height: 18px;
}

/* ---------- ההתאמות על העמוד (לא על #wpba) ---------- */

/* גווני אפור: שכבה מעל העמוד */
#wpba .wpba-gray-layer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--wpba-z) - 2);
  pointer-events: none;
  -webkit-backdrop-filter: grayscale(1);
  backdrop-filter: grayscale(1);
}

html.wpba-gray #wpba .wpba-gray-layer {
  display: block;
}

/* מסכת קריאה */
#wpba .wpba-mask[hidden] {
  display: none;
}

#wpba .wpba-mask-top,
#wpba .wpba-mask-bottom {
  position: fixed;
  right: 0;
  left: 0;
  z-index: calc(var(--wpba-z) - 1);
  background: rgba(0, 0, 0, .6);
  pointer-events: none;
}

#wpba .wpba-mask-top {
  top: 0;
}

#wpba .wpba-mask-bottom {
  bottom: 0;
}

/* גובה שורה */
html.wpba-line-1 body *:not(#wpba, #wpba *) {
  line-height: 1.8 !important;
}

html.wpba-line-2 body *:not(#wpba, #wpba *) {
  line-height: 2.2 !important;
}

/* יישור טקסט */
html.wpba-align-right body *:not(#wpba, #wpba *) {
  text-align: right !important;
}

html.wpba-align-center body *:not(#wpba, #wpba *) {
  text-align: center !important;
}

html.wpba-align-left body *:not(#wpba, #wpba *) {
  text-align: left !important;
}

/* גופן קריא (בלי לפגוע בגופני אייקונים) */
html.wpba-font body *:not(#wpba, #wpba *, i, [class*="icon"], [class*="fa-"], [class^="fa"], .dashicons, [class*="dashicons-"], [aria-hidden="true"]) {
  font-family: Arial, Helvetica, sans-serif !important;
}

/* ניגודיות כהה */
html.wpba-contrast-dark body,
html.wpba-contrast-dark body *:not(#wpba, #wpba *) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

html.wpba-contrast-dark body a:not(#wpba *),
html.wpba-contrast-dark body a:not(#wpba *) * {
  color: #ffeb3b !important;
}

/* ניגודיות בהירה */
html.wpba-contrast-light body,
html.wpba-contrast-light body *:not(#wpba, #wpba *) {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
  text-shadow: none !important;
}

html.wpba-contrast-light body a:not(#wpba *),
html.wpba-contrast-light body a:not(#wpba *) * {
  color: #0033cc !important;
}

/* הסתרת תמונות */
html.wpba-images body *:not(#wpba, #wpba *) {
  background-image: none !important;
}

html.wpba-images body :is(img, picture, video, canvas, [role="img"]):not(#wpba *) {
  visibility: hidden !important;
}

/* עצירת אנימציות: מסתיימות מיד במצב הסופי */
html.wpba-motion,
html.wpba-motion *:not(#wpba *),
html.wpba-motion *:not(#wpba *)::before,
html.wpba-motion *:not(#wpba *)::after {
  animation-duration: .001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}

/* הדגשת קישורים */
html.wpba-links body a:not(#wpba *) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  outline: 2px solid currentColor !important;
  outline-offset: 2px !important;
}

/* מסגרת מיקוד */
html.wpba-focus body *:not(#wpba *):focus-visible {
  outline: 3px solid #2563eb !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px #fff !important;
}

@media (prefers-reduced-motion: reduce) {
  #wpba .wpba-toggle {
    transition: none;
  }
}
