/**
 * ltr.css — English / LTR overrides for the Avaan theme.
 *
 * Loaded ONLY on English (/en/) pages, after style.css, scoped to body.is-ltr
 * (see inc/i18n-ltr.php). The base theme is Persian-first and RTL; on English
 * pages WordPress already emits dir="ltr" on <html>, so block direction flips
 * for free. This sheet handles what direction alone doesn't: a Latin font, a
 * few hard-coded right-alignments in the chrome, and the language switcher.
 *
 * Uses a FREE system Latin font stack — no licensed/paid web font.
 */

/* --- Latin font stack (free, self-hosting not required) ------------------ */
body.is-ltr,
body.is-ltr input,
body.is-ltr textarea,
body.is-ltr button,
body.is-ltr select,
body.is-ltr h1,
body.is-ltr h2,
body.is-ltr h3,
body.is-ltr h4,
body.is-ltr h5,
body.is-ltr h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* The homepage hero title (سُماموس) is the site's Persian brand name, not
   translated content — keep it in the Persian font even on English pages. */
body.is-ltr #intro h1 {
  font-family: "IRANSansX", sans-serif;
}

/* --- Direction / alignment ---------------------------------------------- */
/* The theme hard-codes a few right alignments that only suit RTL. Flip them. */
body.is-ltr .text-right {
  text-align: left;
}
body.is-ltr .text-left {
  text-align: right;
}

/* Article body + headings read left-to-right on English pages. */
body.is-ltr .post .entry-content,
body.is-ltr .single-content,
body.is-ltr article,
body.is-ltr .cover-content,
body.is-ltr .breadcrumb,
body.is-ltr .post .meta {
  direction: ltr;
  text-align: left;
}

/* Cover title/byline/breadcrumb: left-align on English. */
body.is-ltr .single-cover .cover-content,
body.is-ltr .single-cover .cover-content .breadcrumb,
body.is-ltr .single-cover .cover-content .meta {
  text-align: left;
}

/* Breadcrumb separator: the base theme floats the divider right and pads
   left for RTL reading order; both must flip for LTR or the float wins and
   the "/" ends up glued to the wrong side with no space. */
body.is-ltr .breadcrumb-item + .breadcrumb-item::before {
  float: none;
  display: inline-block;
  padding-right: 0.5rem;
  padding-left: unset;
}
body.is-ltr .breadcrumb-item + .breadcrumb-item {
  padding-right: unset;
  padding-left: 0.5rem;
}

/* --- Footer: back-to-top + copyright ------------------------------------ */
/* On RTL the button floats start (right). On LTR keep it visually sensible. */
body.is-ltr #return-to-top {
  direction: ltr;
}
body.is-ltr .copyright {
  direction: ltr;
  text-align: left;
}

/* Nav dropdown items: base theme hard-codes right-align (RTL). Flip for LTR. */
body.is-ltr .dropdown-menu,
body.is-ltr .dropdown-item {
  text-align: left !important;
}

/* Language-switcher base styles live in style.css (needed in both fa and en). */

/* --- Block-editor canvas: force native writing flow LTR on English posts --- */
/* The iframe <html dir> stays rtl (site locale); we override per-wrapper.     */
body.is-ltr .editor-styles-wrapper,
body.is-ltr .block-editor-writing-flow,
body.is-ltr .is-root-container,
body.is-ltr .wp-block-post-content {
  direction: ltr;
  text-align: left;
}

body.is-ltr .wp-block,
body.is-ltr [data-block],
body.is-ltr .block-editor-block-list__layout,
body.is-ltr .block-editor-rich-text__editable,
body.is-ltr .editor-styles-wrapper p,
body.is-ltr .editor-styles-wrapper h1,
body.is-ltr .editor-styles-wrapper h2,
body.is-ltr .editor-styles-wrapper h3,
body.is-ltr .editor-styles-wrapper h4,
body.is-ltr .editor-styles-wrapper h5,
body.is-ltr .editor-styles-wrapper h6,
body.is-ltr .editor-styles-wrapper ul,
body.is-ltr .editor-styles-wrapper ol,
body.is-ltr .editor-styles-wrapper blockquote {
  direction: ltr;
  text-align: left;
}

body.is-ltr .editor-styles-wrapper ul,
body.is-ltr .editor-styles-wrapper ol {
  padding-left: 1.3em;
  padding-right: 0;
}

body.is-ltr .block-editor-rich-text__editable[data-empty="true"]::before,
body.is-ltr .block-editor-default-block-appender__content {
  direction: ltr;
  text-align: left;
}

/* Post-title field: a separate React input (not a content block), so the rules
   above miss it. Left-align it on English posts; the dir="ltr" attribute set in
   inc/i18n-ltr.php handles caret/typing direction. */
body.is-ltr .editor-post-title__input,
body.is-ltr .wp-block-post-title {
  direction: ltr;
  text-align: left;
}
