/* One native language menu in each page header and in the studio's tool strip. */
.he-locale {
  position:relative; display:inline-flex; align-items:center; justify-content:center; gap:.27rem;
  min-width:44px; min-height:44px; padding:.2rem .45rem; flex:0 0 auto;
  border:1px solid var(--folio-edge,#8a9b9c); border-radius:.5rem;
  background:transparent; color:inherit; direction:ltr; cursor:pointer;
}
.he-locale svg { width:1.05rem; height:1.05rem; flex:none; }
.he-locale-code { font:600 .82rem/1.3 system-ui,sans-serif; }
.he-locale select {
  position:absolute; inset:0; width:100%; height:100%; margin:0; padding:0; opacity:0;
  appearance:auto; cursor:pointer; min-width:0;
}
.he-locale:focus-within { outline:2px solid currentColor; outline-offset:2px; }
.project-header .he-locale { margin-inline-start:auto; }
.s41-head .he-locale { margin-inline-start:auto; }
.he-language-status:not(:empty) {
  position:fixed; inset:auto 1rem 1rem; z-index:200; margin:auto; width:fit-content; max-width:calc(100% - 2rem);
  padding:.8rem 1rem; border-radius:.4rem; background:#173c40; color:white;
}
#handset-workspace-options .he-locale { display:flex; width:100%; color:inherit; }
@media (max-width:720px) {
  body[data-presentation="overview"] .app-header { gap:clamp(2px,1.1vw,8px); }
  body[data-presentation="overview"] .app-header .he-locale { margin-inline-start:auto; }
  body[data-presentation="overview"] .app-header .role-mobile-cv { margin-inline-start:0; }
}
@media (max-width:390px) {
  .app-header .he-locale { gap:.18rem; padding:.2rem; }
  .app-header .he-locale svg { width:.9rem; height:.9rem; }
  body[data-presentation="overview"] .app-header .role-cv-long { display:none; }
  body[data-presentation="overview"] .app-header .role-cv-short { display:inline; }
}
@container portfolio-header (max-width:15rem) {
  body[data-presentation="overview"] .app-header .brand span { display:none; }
  body[data-presentation="overview"] .app-header .he-locale-code { display:none; }
}
html[lang="fa"] {
  --persian-text: Tahoma,"Noto Sans Arabic",system-ui,sans-serif;
}
html[lang="fa"] body { font-family:var(--persian-text); }
html[lang="fa"] #profil :is(#role-name,.role-byline p,.role-lead,.role-proof-label,.role-proofs small),
html[lang="fa"] .project-page :is(.connection-context,.connection-prompt h1,.connection-contribution h2,.connection-attribution,.desk-caption),
html[lang="fa"] #hero-model :is(.orbit-heading,.orbit-drag-hint,.orbit-heading small) {
  font-family:var(--persian-text);
  line-height:1.6;
}
html[lang="fa"] #profil #role-name { line-height:1.28; }
html[lang="fa"] #profil .role-proofs small,
html[lang="fa"] .project-page .connection-context { font-size:.875rem; }
html[lang="fa"] .project-page .connection-prompt h1 { max-inline-size:22ch; line-height:1.45; }
html[dir="rtl"] #role-proof-note { padding-inline:.8rem 0; }
html[dir="rtl"] #profil .role-proofs a { text-align:start; }
@media (max-width:47rem) {
  html[lang="fa"] .project-page .connection-prompt h1 { max-inline-size:100%; }
  html[lang="fa"] #profil .portfolio-lead.role-lead { margin-block:.6rem .55rem; }
}
html[lang="fa"] :is(h1,h2,h3,h4,h5,p,a,button,summary,label,dd,dt,small,select,legend,figcaption,th,td) {
  letter-spacing:normal!important; word-spacing:normal;
}
html[lang="fa"] :is(h1,h2,h3,h4,.eyebrow,.role-byline,.portfolio-lead,.project-header) {
  font-family:Tahoma,"Noto Sans Arabic",system-ui,sans-serif; line-height:1.5;
}
html[lang="fa"] :is(.display-modes,.header-contact) { margin-left:0; }
html[lang="fa"] .display-modes { margin-inline-start:auto; }
html[lang="fa"] :is(.app-header,.project-header) a { text-align:start; }
html[lang="fa"] .project-header a svg { transform:scaleX(-1); }
html[lang="fa"] :is(.pw-mobile-menu nav,.portfolio-lead,.work-facts,.rd-copy,.case-story,.visit-compare) { text-align:start; }
html[lang="fa"] .pw-mobile-menu > summary { gap:.3em; }
html[lang="fa"] connection-atlas :is(.atlas-bar,.atlas-reader) { direction:rtl; }
/* Plans, model viewports, dimensions and CAD pointer coordinates use their original axes. */
html[dir="rtl"] :is(.rd-plan,.orbit-stage,.sheet-shell,connection-atlas,.pw-desk,#ew-app-dock,
  #case-image-stage,#wb-model-viewport,.h-document,.nw-cad-scroll,.rd-cut-view) { direction:ltr; }
html[dir="rtl"] :is(.sheet-aside,.sw-sidebar,#ew-heading,.pw-inspector) { direction:rtl; text-align:start; }
html[dir="rtl"] :is([type="email"],[type="url"],#ew-cmd,code,pre,a[href^="mailto:"]:not([class])) { unicode-bidi:isolate; }
html[dir="rtl"] :is([type="email"],[type="url"],#ew-cmd,code,pre) { direction:ltr; }
html[lang="fa"] :is(.portfolio-intro,.connection-intro,.rd-copy) p { line-height:1.75; }

@media (max-width:720px) {
  html[dir="rtl"] body[data-presentation="overview"] .app-header .pw-mobile-menu > nav {
    right:auto; left:0;
  }
  body[data-presentation="overview"] .app-header .brand {
    min-height:44px; max-height:100%;
  }
}

/* em media queries follow the reader’s default font size. When text takes more
   room, keep the project link on its own line and both controls together below. */
@media (max-width:14em) {
  .project-page .project-header {
    display:grid; grid-template-columns:auto minmax(0,1fr); gap:3px 8px;
    min-height:0; padding:4px clamp(8px,4vw,18px);
  }
  .project-page .project-header > a {
    grid-column:1 / -1; min-width:0; max-width:100%; min-height:44px;
    padding:0; gap:.25em; justify-self:start; text-align:start;
  }
  .project-page .project-header .he-locale {
    justify-self:start; margin:0; min-width:44px; min-height:44px; padding:2px 6px;
  }
  .project-page .project-header #project-theme {
    justify-self:start; min-width:44px; min-height:44px;
    padding:2px 8px; overflow-wrap:anywhere;
  }
  .connection-page .connection-actions, .project-page .evidence-desk .desk-panel {
    grid-template-columns:minmax(0,1fr);
  }
  .connection-page .connection-actions > *, .project-page .evidence-desk .desk-panel > * {
    min-width:0; max-width:100%; overflow-wrap:anywhere;
  }
  .project-page .evidence-desk { padding:clamp(10px,4vw,18px); }
  .project-page .evidence-desk header h2 { overflow-wrap:anywhere; }
  .project-page .evidence-desk .desk-tabs a { max-width:100%; overflow-wrap:anywhere; }
  .connection-page connection-atlas .atlas-bar { flex-wrap:wrap; }
  .connection-page connection-atlas .atlas-bar > div { max-width:100%; flex-wrap:wrap; }
  .connection-page connection-atlas .atlas-bar :is(button,a) { max-width:100%; overflow-wrap:anywhere; }
}
