/*
RTL stylesheet — automatically loaded by WordPress when site_language is RTL
(e.g. when Polylang / WPML switches the site to Arabic).
Mirrors the editorial Latin layout into a proper right-to-left reading flow.
*/

/* ---- Global flip ---- */
body.rtl,
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
  font-family: "Noto Naskh Arabic", "Amiri", "Inter", system-ui, sans-serif;
}

/* Headlines: prefer a quality Arabic display serif over Playfair */
html[dir="rtl"] .serif,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] .hero-title,
html[dir="rtl"] .section-title,
html[dir="rtl"] .foot-big,
html[dir="rtl"] .mast-brand,
html[dir="rtl"] .review-item .body,
html[dir="rtl"] .review-side .big-score,
html[dir="rtl"] .bio-text .pull,
html[dir="rtl"] .specs-row .name,
html[dir="rtl"] .edu-feature h3,
html[dir="rtl"] .edu-item-title,
html[dir="rtl"] .news-card h3,
html[dir="rtl"] .tl-title,
html[dir="rtl"] .lang-name,
html[dir="rtl"] .post-title,
html[dir="rtl"] .hero-lede,
html[dir="rtl"] .hero-num,
html[dir="rtl"] .section-num {
  font-family: "Amiri", "Noto Naskh Arabic", "Playfair Display", Georgia, serif;
}

/* Italics don't exist in Arabic — keep the red color, drop the slant */
html[dir="rtl"] em,
html[dir="rtl"] .italic-red,
html[dir="rtl"] .hero-title em,
html[dir="rtl"] .section-title em,
html[dir="rtl"] .foot-big em,
html[dir="rtl"] .bio-text .pull em,
html[dir="rtl"] .hero-lede em,
html[dir="rtl"] .review-item .body em,
html[dir="rtl"] .hero-title .ampersand,
html[dir="rtl"] .hero-num,
html[dir="rtl"] .section-num,
html[dir="rtl"] .tl-year,
html[dir="rtl"] .specs-row .num,
html[dir="rtl"] .review-item .idx,
html[dir="rtl"] .bio-side .caption .sig {
  font-style: normal !important;
}

/* Arabic looks better a touch larger than Latin at small sizes — lift body */
html[dir="rtl"] body { font-size: 17px; line-height: 1.85; }
html[dir="rtl"] .hero-meta .row,
html[dir="rtl"] .mast-row-1,
html[dir="rtl"] .creds-row,
html[dir="rtl"] .edu-meta,
html[dir="rtl"] .news-card .meta,
html[dir="rtl"] .post-meta,
html[dir="rtl"] .review-item .author-block .when,
html[dir="rtl"] .review-item .author-block .name,
html[dir="rtl"] .breadcrumb,
html[dir="rtl"] .label-line,
html[dir="rtl"] .total,
html[dir="rtl"] .lang-level,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .edu-item-cat,
html[dir="rtl"] .news-card .cat,
html[dir="rtl"] .foot-grid h5,
html[dir="rtl"] .brand-sub,
html[dir="rtl"] .foot-bot {
  letter-spacing: 0 !important; /* tracking doesn't apply to Arabic */
}

/* ---- Masthead ---- */
html[dir="rtl"] .mast-row-1 .left { flex-direction: row-reverse; }
html[dir="rtl"] .mast-row-1 .right { flex-direction: row-reverse; }
html[dir="rtl"] .mast-row-1 .left span,
html[dir="rtl"] .mast-row-1 .right span,
html[dir="rtl"] .mast-cta a,
html[dir="rtl"] .hero-meta .row,
html[dir="rtl"] .creds-row span,
html[dir="rtl"] .trust-item,
html[dir="rtl"] .edu-feature .meta,
html[dir="rtl"] .post-meta {
  flex-direction: row-reverse;
}
html[dir="rtl"] .mast-row-2 { grid-template-columns: auto 1fr auto; }
html[dir="rtl"] .mast-nav { flex-direction: row-reverse; }
html[dir="rtl"] .mast-cta { flex-direction: row-reverse; }

/* ---- Eyebrow line decoration ---- */
html[dir="rtl"] .eyebrow-line { flex-direction: row-reverse; }

/* ---- Hero ---- */
html[dir="rtl"] .hero-bottom { direction: rtl; }
html[dir="rtl"] .hero-actions { justify-self: start; justify-content: flex-start; }
html[dir="rtl"] .hero-img-bleed .caption-strip { flex-direction: row-reverse; }
html[dir="rtl"] .hero-img-bleed .label { left: auto; right: 56px; }
html[dir="rtl"] .hero-img-bleed .credentials { text-align: left; }
html[dir="rtl"] .hero-title { letter-spacing: 0; }
html[dir="rtl"] .hero-num { direction: rtl; }

/* ---- Reviews ---- */
html[dir="rtl"] .review-side .big-score { letter-spacing: 0; }
html[dir="rtl"] .review-item { direction: rtl; }
html[dir="rtl"] .review-item .idx { text-align: right; }
html[dir="rtl"] .review-item .body { font-size: 23px; line-height: 1.7; }
html[dir="rtl"] .review-item .author-block .stars-mini { direction: ltr; } /* stars stay LTR */

/* ---- About / Bio ---- */
html[dir="rtl"] .bio-text .pull { font-size: 38px; line-height: 1.5; }
html[dir="rtl"] .bio-side .caption { flex-direction: row-reverse; }
html[dir="rtl"] .bio-side .caption > div:last-child:not(:first-child) { text-align: left; }

/* ---- Specialties ---- */
html[dir="rtl"] .specs-head { grid-template-columns: 1fr 1.5fr; }
html[dir="rtl"] .specs-head p { justify-self: start; }
html[dir="rtl"] .specs-row { direction: rtl; }
html[dir="rtl"] .specs-row:hover { padding-left: 0; padding-right: 16px; }
html[dir="rtl"] .specs-row:hover .specs-arrow { transform: translateX(-8px) rotate(-90deg); }
html[dir="rtl"] .specs-arrow { text-align: left; }
html[dir="rtl"] .specs-arrow .material-symbols-outlined { transform: scaleX(-1); }
html[dir="rtl"] .specs-row .name { font-size: 36px; line-height: 1.35; }

/* ---- Patient Education ---- */
html[dir="rtl"] .edu-layout { grid-template-columns: 1fr 1.4fr; } /* feature on the right */
html[dir="rtl"] .edu-feature .play-big { left: auto; right: 24px; }
html[dir="rtl"] .edu-feature .tag { left: auto; right: 24px; }
html[dir="rtl"] .edu-feature h3 { font-size: 38px; line-height: 1.4; }
html[dir="rtl"] .edu-item { direction: rtl; }

/* ---- Languages ---- */
html[dir="rtl"] .langs-grid { grid-template-columns: 1.4fr 1fr; }
html[dir="rtl"] .lang-row { direction: rtl; }
html[dir="rtl"] .lang-name { font-size: 30px; }
html[dir="rtl"] .lang-name .native { margin-left: 0; margin-right: 12px; }
html[dir="rtl"] .lang-level { text-align: left; }
html[dir="rtl"] .lang-level .bar { margin-left: 0; margin-right: 12px; }

/* ---- Experience / CV timeline ---- */
html[dir="rtl"] .cv-grid { grid-template-columns: 1.3fr 0.7fr; }
html[dir="rtl"] .tl-item { direction: rtl; grid-template-columns: 140px 1fr; }
html[dir="rtl"] .tl-title { font-size: 24px; line-height: 1.4; }
html[dir="rtl"] .tl-year { direction: ltr; text-align: right; } /* year ranges stay LTR */

/* ---- Footer ---- */
html[dir="rtl"] .foot-grid { direction: rtl; }
html[dir="rtl"] .foot-block p { max-width: 320px; }
html[dir="rtl"] .foot-bot { flex-direction: row-reverse; }

/* ---- News archive / single ---- */
html[dir="rtl"] .news-card { direction: rtl; }
html[dir="rtl"] .breadcrumb { direction: rtl; }
html[dir="rtl"] .single-news .post-content blockquote {
  border-left: none;
  border-right: 3px solid var(--red);
  padding: 8px 24px 8px 0;
}
html[dir="rtl"] .post-title { font-size: 56px; line-height: 1.35; }
html[dir="rtl"] .post-content { font-size: 19px; line-height: 1.95; }

/* ---- Numerals and stars stay LTR ---- */
html[dir="rtl"] .stars,
html[dir="rtl"] .stars-mini,
html[dir="rtl"] .big-score,
html[dir="rtl"] .tl-year,
html[dir="rtl"] .creds-row,
html[dir="rtl"] .creds-strip {
  unicode-bidi: isolate;
}

/* ---- Icon mirroring for directional symbols ---- */
html[dir="rtl"] .material-symbols-outlined.arrow_outward,
html[dir="rtl"] [class*="arrow_forward"] .material-symbols-outlined,
html[dir="rtl"] .edu-link .material-symbols-outlined {
  transform: scaleX(-1);
}

/* ---- Responsive RTL ---- */
@media (max-width: 1100px) {
  html[dir="rtl"] .reviews-grid,
  html[dir="rtl"] .bio-grid,
  html[dir="rtl"] .cv-grid,
  html[dir="rtl"] .langs-grid,
  html[dir="rtl"] .edu-layout,
  html[dir="rtl"] .specs-head { grid-template-columns: 1fr; }
  /* collapse the 3-col masthead to brand | burger so the burger sits at the edge */
  html[dir="rtl"] .mast-row-2 { grid-template-columns: 1fr auto; }
}
@media (max-width: 760px) {
  html[dir="rtl"] .hero-img-bleed .label { left: auto; right: 22px; }
  html[dir="rtl"] .specs-head p { justify-self: start; }
  html[dir="rtl"] .lang-row { grid-template-columns: 44px 1fr; }
  html[dir="rtl"] .lang-level { grid-column: 2 / -1; text-align: right; margin-top: 6px; }
}
