/* Hebrew RTL Chess Board Coordinates - Clean RTL override without duplication */

/* ===== Files (עמודות) – מחליף רק את האותיות לא-ח ===== */
html[dir="rtl"] .cg-wrap coords.files coord {
  /* מסתיר את התו המקורי מבלי לשנות פריסה */
  color: transparent !important;
  text-shadow: none !important; /* מונע "רוח" מטקסט הצללה על האות האנגלית */
}





html[dir="rtl"] .cg-wrap coords.files coord::after {
  /* מציג את התו העברי במקום המקור, עם אותו גודל ומיקום מהבסיס */
  display: inline !important;
  font: inherit !important;
  line-height: inherit !important;
  position: static !important;
  transform: none !important;
  white-space: normal !important;
  text-align: inherit !important;
  pointer-events: none !important;
  user-select: none !important;
}
/* מיפוי אחיד לשתי האוריינטציות - row-reverse מטפל בהיפוך הויזואלי אוטומטית */
/* coord 1 = 'a' = א, coord 8 = 'h' = ח */
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(1)::after { content: "א" !important; }
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(2)::after { content: "ב" !important; }
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(3)::after { content: "ג" !important; }
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(4)::after { content: "ד" !important; }
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(5)::after { content: "ה" !important; }
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(6)::after { content: "ו" !important; }
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(7)::after { content: "ז" !important; }
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(8)::after { content: "ח" !important; }



/* צבעים ל-::after בהתאם לכללי הנושאים (odd/even), כדי לא לרשת צבע שקוף מההורה */
/* ברירת מחדל (לבן) */
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(odd)::after { color: var(--coord-dark-color, #F5DEB3) !important; }
html[dir="rtl"] .cg-wrap coords.files coord:nth-child(even)::after { color: var(--coord-light-color, #8B4513) !important; }
/* מצב שחור (כאשר מתווסף class black לקבצים) */
html[dir="rtl"] .cg-wrap coords.files.black coord:nth-child(odd)::after{ color: var(--coord-light-color, #F5DEB3) !important; }
html[dir="rtl"] .cg-wrap coords.files.black coord:nth-child(even)::after{ color: var(--coord-dark-color, #8B4513) !important; }
/* גיבוי לפי אוריינטציה */


/* ===== Ranks (שורות) – לא מחליפים את המספרים, רק מזיזים לשמאל ב-RTL ===== */
/* ביטול כל החלפה/הסתרה קודמת שהייתה על ranks */


/* מיקום המספרים לשמאל ב-RTL (לשתי האוריינטציות) */
html[dir="rtl"] .cg-wrap coords.ranks { left: 8px !important; right: auto !important; }
/*html[dir="rtl"] .cg-wrap.orientation-black coords.ranks { left: 8px !important; right: auto !important; }*/

/* סדר לוגי זהה לאנגלית */

html[dir="rtl"] .cg-wrap coords.ranks { direction: ltr !important; }


html[dir="rtl"] .cg-wrap coords coord::after {
    pointer-events: none !important;
    user-select: none !important;

}



html[dir="rtl"] .cg-wrap coords.files coord {
    flex: 1;
    display: flex;
    align-content: baseline;
    font-size: 0.9em;
    flex-direction: row;
    justify-content: start;
    margin-right: 0.1rem;
}

html[dir="rtl"] .cg-wrap.orientation-black coords.files coord {
    /* מסתיר את התו המקורי מבלי לשנות פריסה */
    color: transparent !important;
    text-shadow: none !important; /* מונע "רוח" מטקסט הצללה על האות האנגלית */

}

html[dir="rtl"] .cg-wrap.orientation-black coords.files, html[dir="rtl"] .cg-wrap coords.files {
    left: -2.5px !important;
}