/* rtl.css — right-to-left layout (Arabic). Loaded by js/i18n.js only when the
 * page is sent with <html dir="rtl">. The page text flows right-to-left by
 * itself; this file mirrors the app shell: the sidebar sits on the right and
 * the content column, fixed panes and side borders follow it. */

[dir="rtl"] body { text-align: right; }

/* Sidebar on the right */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: 0;
    border-left: 1px solid var(--border-subtle);
}
[dir="rtl"] .sidebar-chevron,
[dir="rtl"] .menu-badge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .sidebar-chevron { transform: scaleX(-1); }
[dir="rtl"] .sidebar-group[open] > .sidebar-group-summary .sidebar-chevron { transform: rotate(90deg); }
[dir="rtl"] .sidebar-group-items {
    margin-left: 0;
    margin-right: var(--space-5);
    border-left: 0;
    border-right: 1px solid var(--border-subtle);
    padding: var(--space-1) var(--space-2) var(--space-2) 0;
}
[dir="rtl"] .menu-item::before { left: auto; right: 0; }

@media (max-width: 992px) {
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    [dir="rtl"] .sidebar.open { transform: translateX(0); }
}
@media (min-width: 993px) {
    [dir="rtl"] .page-with-sidebar { padding-left: 0; padding-right: var(--sidebar-width); }
}

/* Content column beside the sidebar */
[dir="rtl"] .main-content { margin-left: 0; margin-right: var(--sidebar-width); }
@media (max-width: 992px) {
    [dir="rtl"] .main-content { margin-right: 0; }
}

/* Studio and Edit: fixed full-viewport panes */
[dir="rtl"] .studio-main,
[dir="rtl"] .edit-main { left: 0; right: var(--sidebar-width); }
@media (max-width: 992px) {
    [dir="rtl"] .studio-main,
    [dir="rtl"] .edit-main { right: 0; }
}
[dir="rtl"] body.studio-focus-mode .studio-main { right: 0; }

/* "Go on" arrows point the reading direction. Chevrons are left alone: they
   steer carousels and timelines, which still run left-to-right. */
[dir="rtl"] .fa-arrow-right, [dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-long-arrow-alt-right, [dir="rtl"] .fa-sign-out-alt { transform: scaleX(-1); }

/* Inputs keep numbers, links and code readable */
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"],
[dir="rtl"] input[type="number"], [dir="rtl"] code { direction: ltr; text-align: right; }

/* Toasts and the floating assistant move to the left corner */
[dir="rtl"] .av-toast-container { right: auto !important; left: 24px !important; }
[dir="rtl"] .fast-assistant { right: auto; left: calc(30px + env(safe-area-inset-left, 0px)); }

/* Studio focus mode slides the sidebar out to the right */
[dir="rtl"] body.studio-focus-mode .sidebar { transform: translateX(100%) !important; }
