/* Locale typography is self-hosted; the existing same-origin CSP is unchanged. */
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('/fonts/noto-sans-arabic/noto-sans-arabic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans KR';
  src: url('/fonts/noto-sans-kr/noto-sans-kr.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Three ordinary links work with JavaScript disabled, outside the mobile menu. */
.language-selector { display: flex; justify-content: flex-end; margin-block: -4px 16px; }
.language-selector ul {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  list-style: none; padding: 0; margin: 0;
}
.language-selector a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 12px; border-radius: 6px;
  color: var(--teal); font: 14px/1.5 Arial, Tahoma, 'Apple SD Gothic Neo', sans-serif;
  text-underline-offset: 5px;
}
.language-selector a[aria-current='true'] { background: var(--mint); text-decoration: underline; font-weight: 700; }
.language-selector a:hover { background: var(--mint); }
.language-selector a:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

html[lang='fa'] { --locale-font: 'Noto Sans Arabic', Tahoma, Arial, sans-serif; }
html[lang='ko'] { --locale-font: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
html:is([lang='fa'], [lang='ko']) {
  --body-font-family: var(--locale-font);
  --heading-font: var(--locale-font);
}
/* The inherited template uses explicit Latin font shorthands on these elements.
   Scope this override to localized pages; icon glyphs keep Bootstrap Icons. */
html:is([lang='fa'], [lang='ko']) body,
html:is([lang='fa'], [lang='ko']) :is(h1,h2,h3,h4,p,span,a,label,input,textarea,button,legend,small) {
  font-family: var(--locale-font) !important;
  letter-spacing: normal;
}
html:is([lang='fa'], [lang='ko']) .brand small { letter-spacing: normal; font-size: 12px; }
html:is([lang='fa'], [lang='ko']) :is(h1,h2,h3,h4) { line-height: 1.5; }
html:is([lang='fa'], [lang='ko']) .warm-hero h1 { font-size: clamp(32px, 3.6vw, 50px); }
html:is([lang='fa'], [lang='ko']) .warm-hero h1 em { white-space: normal; }
html:is([lang='fa'], [lang='ko']) .hero-actions { flex-wrap: wrap; }
html:is([lang='fa'], [lang='ko']) .leadership-path h2 span { white-space: normal; }
html:is([lang='fa'], [lang='ko']) .leadership-path h2 { font-size: clamp(24px, 2.7vw, 34px); min-height: 0; }
html:is([lang='fa'], [lang='ko']) .biography blockquote { text-align: start; }
html:is([lang='fa'], [lang='ko']) .biography blockquote p { font-style: normal; }
html:is([lang='fa'], [lang='ko']) .leader-heading h2 { overflow-wrap: anywhere; }
html:is([lang='fa'], [lang='ko']) .signup { text-align: start; }
html:is([lang='fa'], [lang='ko']) .honeypot {
  left: auto; inset-inline-start: 0; clip-path: inset(50%); white-space: nowrap;
}
html[lang='ko'] body { word-break: keep-all; overflow-wrap: anywhere; }
html[lang='fa'] body { line-height: 1.9; }
bdi { unicode-bidi: isolate; }

/* Mirror directional layout details without changing the English stylesheet. */
html[dir='rtl'] .navbar-nav.ms-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir='rtl'] .navbar-expand-lg .navbar-nav .nav-link { margin-left: 0; margin-right: 28px; }
html[dir='rtl'] .navbar .nav-link::after { transform-origin: right; }
html[dir='rtl'] .leadership-submenu-toggle { margin-left: 0; margin-right: 4px; }
html[dir='rtl'] .leadership-submenu { right: auto; left: 0; text-align: start; }
html[dir='rtl'] .arrow { transform: scaleX(-1); }
html[dir='rtl'] .leadership-path:hover .arrow { transform: scaleX(-1) translateX(5px); }
html[dir='rtl'] .mission-rail a { border-right: 0; border-left: 1px solid #afc7bc; }
html[dir='rtl'] .mission-rail a:first-child { padding-right: 0; padding-left: 32px; }
html[dir='rtl'] .mission-rail a:last-child { border: 0; padding-right: 32px; padding-left: 0; }
html[dir='rtl'] .inner-mission .mission-statement { padding-right: 0; padding-left: 32px; }
html[dir='rtl'] .leader-heading { padding-right: 0; padding-left: 20px; }
html[dir='rtl'] .biography { border-left: 0; border-right: 1px solid var(--line); padding-left: 0; padding-right: 46px; }
html[dir='rtl'] .youth-page .leader-heading { padding: 0; }
html[dir='rtl'] .youth-page .biography { border-right: 0; padding: 24px 0 0; }
html[dir='rtl'] .leadership-path + .leadership-path { border-left: 0; border-right: 1px solid var(--line); }
html[dir='rtl'] .preview-note { border-left: 0; border-right: 2px solid var(--gold); border-radius: 8px 0 0 8px; }
html[dir='rtl'] .site-footer .site-footer-bottom { text-align: start; }
html[dir='rtl'] .contact-heading img { margin-left: 0; margin-right: -9px; }

@media (max-width: 991.98px) {
  html[dir='rtl'] .navbar-expand-lg .navbar-nav .nav-link { margin: 0; }
  html[dir='rtl'] .navbar .nav-link::after { left: auto; right: 0; }
  html[dir='rtl'] .leadership-submenu { margin: 2px 16px 8px 0; padding: 2px 12px 2px 0; border-left: 0; border-right: 2px solid var(--gold); }
  html[dir='rtl'] .biography { border: 0; padding: 0; }
  html[dir='rtl'] .inner-mission .mission-statement { padding: 0; }
  html[dir='rtl'] .contact-heading img { right: auto; left: 28px; margin: 0; }
  html:is([lang='fa'], [lang='ko']) .navbar .container { row-gap: 12px; }
}
@media (max-width: 650px) {
  .language-selector { margin-block: 0 12px; }
  html:is([lang='fa'], [lang='ko']) .warm-hero h1 { font-size: 34px; }
  html:is([lang='fa'], [lang='ko']) .page-title h1 { font-size: 38px; }
  html:is([lang='fa'], [lang='ko']) .community-band p { font-size: 25px; }
  html:is([lang='fa'], [lang='ko']) .invitation p:nth-child(2) { font-size: 28px; }
  html:is([lang='fa'], [lang='ko']) .status-page h1 { font-size: 34px; }
  html[dir='rtl'] .mission-rail a,
  html[dir='rtl'] .mission-rail a:first-child,
  html[dir='rtl'] .mission-rail a:last-child { padding: 17px 0; border: 0; border-bottom: 1px solid #bdd2c6; }
  html[dir='rtl'] .mission-rail a:last-child { border: 0; }
  html[dir='rtl'] .leadership-path + .leadership-path { border-right: 0; border-top: 1px solid var(--line); }
}

/* The original 70px leadership row gutter exceeds the 48px container gutter
   at small desktop widths. Keep all three languages inside the viewport. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .leadership-section .leader.row { --bs-gutter-x: 48px; }
}

/* Keep legal identifiers intact when a mixed-direction footer wraps. */
bdi.identifier { white-space: nowrap; }

/* The wordmark is the brand: keep its approved serif face in every language. */
html:is([lang='fa'], [lang='ko']) .brand bdi {
  font-family: Playfair, Georgia, serif !important;
  letter-spacing: -.025em;
}

/* Arabic-script glyphs sit smaller than Latin at the same size; the selector
   uses system fonts so English pages never download a locale font. */
.language-selector a[lang='fa'] { font-family: Tahoma, 'Geeza Pro', Arial, sans-serif; font-size: 16px; }

/* Wide desktop: the selector shares the navigation row instead of adding a
   second one. It stays a separate landmark of plain links after the main
   navigation. Four labels do not fit beside the six-item menu below 1400px, so
   narrower layouts keep the selector on its own row. */
@media (min-width: 1400px) {
  header { position: relative; }
  .language-selector {
    position: absolute; inset-block-start: 0; inset-inline: 0;
    height: 100%; margin-block: 0; align-items: center; pointer-events: none;
    z-index: 10; /* above the template navbar (z-index 9) */
  }
  .language-selector ul {
    flex-wrap: nowrap; gap: 0; pointer-events: auto;
    padding-inline-start: 14px; border-inline-start: 1px solid var(--line);
  }
  /* The list is always dir=ltr, so mirror its divider by hand on RTL pages. */
  html[dir='rtl'] .language-selector ul {
    padding-inline: 0 14px; border-inline-start: 0; border-inline-end: 1px solid var(--line);
  }
  .language-selector a { padding: 6px 8px; font-size: 13px; }
  .language-selector a[lang='fa'] { font-size: 15px; }
  .navbar .navbar-collapse { padding-inline-end: 276px; }
}

/* Persian body copy needs more size than the Latin template's small text. */
html[lang='fa'] .navbar-expand-lg .navbar-nav .nav-link { font-size: 16px; }
html[lang='fa'] .brand small { font-size: 13px; }
html[lang='fa'] .cause p { font-size: 17px; line-height: 1.9; }
html[lang='fa'] .contact-form label { font-size: 15px; }
html[lang='fa'] .preview-note { font-size: 14px; line-height: 1.9; }
html[lang='fa'] .contact-form .signup { font-size: 14px; line-height: 1.9; }
html[lang='fa'] .custom-form.contact-form button.send { font-size: 16px; }
html[lang='fa'] .site-footer .footer-menu-link { font-size: 15px; }
html[lang='fa'] .footer-nonprofit p { font-size: 14px; line-height: 1.9; }
html[lang='fa'] .footer-nonprofit .nonprofit-name { font-size: 15px; }
html[lang='fa'] .site-footer .copyright-text,
html[lang='fa'] .site-footer .site-credit { font-size: 13px; line-height: 1.9; }
html[lang='fa'] .navbar-toggler .menu-label { font-size: 14px; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  html[lang='fa'] .navbar-expand-lg .navbar-nav .nav-link { font-size: 14px; }
}
