/* RTL fixes for /ar/ (and /fa/). scripts/i18n_build.py links this file on
   every page built for a right-to-left language; English pages never load it. */

/* ---- Photo heroes (course, program and professor pages) ----
   The photo leaves room for the copy on the left, so the copy column stays on
   the left; inside it everything is right-aligned. */
html[dir="rtl"] body .hero.hero-photo .hero-container { direction: ltr; }
html[dir="rtl"] body .hero .hero-text { direction: rtl; text-align: right; }
html[dir="rtl"] body .hero .hero-text > :not(.hero-lead-short) { text-align: right; }

/* ---- Home: learning-platform photo with floating badges ----
   Same arrangement as English (photo on the right, badges hanging off its
   right edge); only the text inside reads right-to-left. */
html[dir="rtl"] body.page-index .lms-grid { direction: ltr; }
html[dir="rtl"] body.page-index .lms-grid > * { direction: rtl; }
html[dir="rtl"] body.page-index .lms-badge-wrapper { direction: ltr; }
html[dir="rtl"] body.page-index .lms-badge span { direction: rtl; }

/* ---- Photo cards (Billy Graham School of Evangelism, Biblical Course in Israel) ----
   Mirrored: Billy Graham moves to the left (flipped so he faces the text),
   the Israel photo moves to the right. */
@media (min-width: 769px) {
    html[dir="rtl"] .ltr-section .ltr-bg-card:not(.ltr-israel-card) .ltr-bg-photo {
        right: auto;
        left: 0;
        transform: scaleX(-1);
    }
    html[dir="rtl"] .ltr-section .ltr-bg-card:not(.ltr-israel-card) .ltr-bg-body {
        margin-right: 0;
        margin-left: auto;
        padding: 52px 52px 52px 24px;
    }
    html[dir="rtl"] .ltr-section .ltr-israel-card .ltr-bg-photo {
        left: auto;
        right: 0;
        -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .2) 5%, rgba(0, 0, 0, .65) 11%, #000 19%);
        mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .2) 5%, rgba(0, 0, 0, .65) 11%, #000 19%);
    }
    html[dir="rtl"] .ltr-section .ltr-israel-card .ltr-bg-body {
        margin-left: 0;
        margin-right: auto;
        padding: 52px 20px 52px 52px;
    }
}
@media (max-width: 768px) {
    html[dir="rtl"] .ltr-section .ltr-bg-card:not(.ltr-israel-card) .ltr-bg-photo { transform: scaleX(-1); }
}

/* ---- Carousel headers ----
   global-components.css keeps the carousel tracks LTR so the JS can center the
   cards; the section headers inside them must read RTL again. */
html[dir="rtl"] .t-header,
html[dir="rtl"] .video-header,
html[dir="rtl"] .rnm-header { direction: rtl; }

/* ---- No sideways scroll ----
   In RTL, anything placed far to the left (off-screen honeypot fields,
   decorative blobs) makes the page scroll sideways; in LTR it is harmless. */
html[dir="rtl"], html[dir="rtl"] body { overflow-x: clip; }
