/* Global RTL styles for Hebrew layout - keeping header LTR */

/* Keep header always LTR */
[dir="rtl"] .main-header { direction: ltr; }
[dir="rtl"] .main-header .header-content { direction: ltr; }
[dir="rtl"] .logo { direction: ltr; }
[dir="rtl"] .header-title { direction: ltr; }

/* Apply RTL to main content container */
[dir="rtl"] .container { direction: rtl; }

/* Specific RTL styles for breadcrumbs */
[dir="rtl"] .page-header .breadcrumbs { direction: rtl; }
[dir="rtl"] .page-header .breadcrumbs a,
[dir="rtl"] .page-header .breadcrumbs span { direction: rtl; unicode-bidi: embed; }

/* RTL for toggle buttons */
[dir="rtl"] .view-toggle { direction: rtl; }
[dir="rtl"] .toggle-container { direction: rtl; }

/* RTL for grid items */
[dir="rtl"] .item-grid { direction: rtl; }

/* RTL for TOC items */
[dir="rtl"] .toc-container { direction: rtl; }
[dir="rtl"] .toc-top-row { direction: rtl; }
[dir="rtl"] .toc-main-title { direction: rtl; }
[dir="rtl"] .toc-leader { direction: rtl; }
[dir="rtl"] .toc-page-number { direction: rtl; }

/* --- 5. VIEWER PAGE OVERRIDE --- */
/* 
   We want the Viewer Page interface (Sidebar on left, settings, etc.) 
   to remain LTR even when the site is in Hebrew mode.
*/
[dir="rtl"] .viewer-container {
    direction: ltr;
}

/* However, the actual text content and the footnotes inside the viewer SHOULD be RTL */
[dir="rtl"] .text-content-wrapper,
[dir="rtl"] .side-panel-content {
    direction: rtl;
    text-align: right;
}

/* Fix specific alignment in viewer header for RTL mode */
[dir="rtl"] .viewer-header .header-content {
    direction: ltr;
}