/* Scoped language UI + Persian typography + internal navigation improvements. */
.axi-lang-switch{position:fixed;z-index:9995;top:17px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:4px;padding:5px;background:rgba(13,17,28,.9);border:1px solid rgba(190,195,240,.27);box-shadow:0 10px 32px rgba(0,0,0,.3);border-radius:99px;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);font-family:Tahoma,Arial,sans-serif!important;direction:ltr!important}
.axi-lang-switch a{display:inline-flex;align-items:center;justify-content:center;min-width:37px;height:28px;padding:0 8px;font-size:11px;font-weight:700;letter-spacing:0;color:#a6abbe!important;text-decoration:none;border-radius:99px;transition:color .2s,background .2s}
.axi-lang-switch a:hover{color:#fff!important;background:#ffffff1a}
.axi-lang-switch a.is-active{color:#131222!important;background:#f0ebff}
.axi-lang-switch a:focus-visible,.axi-home-return:focus-visible{outline:2px solid #b6aaff;outline-offset:3px}
body.axi-lang-fa{--fa-font:Tahoma,Arial,sans-serif;direction:rtl}
body.axi-lang-fa .axi-app :is(h1,h2,h3,h4,p,span,small,b,strong,a,button,li,dt,dd,label,input,textarea,legend),body.axi-lang-fa .nf-app :is(h1,h2,h3,h4,p,span,small,b,strong,a,button,li){font-family:var(--fa-font)!important;letter-spacing:normal!important;text-transform:none!important}
body.axi-lang-fa :is(.pj-name,.pj-title,.pc-title,.bd-title,.ct-form-title,.ab-h1,.ab-h2,#h-title){overflow-wrap:anywhere;line-height:1.4!important}
body.axi-lang-fa .pj-desc,body.axi-lang-fa .pc-sub,body.axi-lang-fa .ab-lede{line-height:2!important}
body.axi-lang-fa .pj-row,body.axi-lang-fa .pj-head{text-align:right}
body.axi-lang-fa .pj-crumb{direction:rtl;justify-content:flex-start}
body.axi-lang-fa .pj-head .pj-crumb{justify-content:flex-end}
body.axi-lang-fa input,body.axi-lang-fa textarea{direction:rtl}
body.axi-lang-fa input[type=email]{direction:ltr;text-align:right}
body.axi-lang-fa .axi-lang-switch{direction:ltr!important}
.axi-home-return{position:fixed;left:30px;bottom:25px;z-index:75;display:inline-flex;align-items:center;gap:11px;min-width:122px;height:47px;padding:0 14px;color:#f1edff!important;text-decoration:none!important;background:rgba(16,19,33,.92);border:1px solid rgb(var(--acc-l)/.34);border-radius:9px;box-shadow:0 0 23px rgb(var(--acc)/.11),0 10px 26px #0008;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);font-family:var(--mono),monospace;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;transition:border-color .25s,transform .25s}
/* The HOME link sits outside .axi-app, so the general Persian typography
   selector cannot reach it. Inherit exactly the font picked for the site. */
body.axi-lang-fa .axi-home-return,
body.axi-lang-fa .axi-home-return > span:not(.axi-home-return-dot){font-family:var(--fa-font)!important;letter-spacing:normal!important;text-transform:none!important;line-height:1.5}
.axi-home-return:hover{transform:translateY(-3px);border-color:rgb(var(--acc))}
.axi-home-return-dot{width:7px;height:7px;flex:none;border-radius:50%;background:rgb(var(--acc));box-shadow:0 0 12px rgb(var(--acc)/.6)}
.axi-home-return svg{width:15px;height:15px;margin-inline-start:auto;fill:none;stroke:currentColor;stroke-width:1.5;flex:none}
/* Reserve a separate lane for the new HOME card instead of overlapping email. */
body.axi-pj .pj-foot{bottom:91px!important;left:30px!important}
body.axi-pj .pj-head{top:67px}
/* Center the infinitely-scrolling projects column between the rail and readout. */
body.axi-pj:not(.axi-pd):not(.axi-ab):not(.axi-ct):not(.axi-bl) .pj-list{max-width:850px;width:calc(100% - 54px);margin-inline:auto}
@media(min-width:1024px){body.axi-pj:not(.axi-pd):not(.axi-ab):not(.axi-ct):not(.axi-bl) .pj-list{width:74%;max-width:850px}}
@media(min-width:1280px){body.axi-pj:not(.axi-pd):not(.axi-ab):not(.axi-ct):not(.axi-bl) .pj-list{margin-left:auto;margin-right:auto;width:57%;max-width:850px;padding-left:0;padding-right:0}}
@media(min-width:1536px){body.axi-pj:not(.axi-pd):not(.axi-ab):not(.axi-ct):not(.axi-bl) .pj-list{width:55%;max-width:920px}body.axi-pj:not(.axi-pd):not(.axi-ab):not(.axi-ct):not(.axi-bl) .pj-guides .gl-1{left:22.5%}body.axi-pj:not(.axi-pd):not(.axi-ab):not(.axi-ct):not(.axi-bl) .pj-guides .gl-2{left:77.5%}}
/* Mobile: separate the HOME control and the menu into two non-overlapping lanes.
   Keep the language switch at the upper RIGHT, and move the page heading below
   it on internal templates (the brand remains on the left). */
@media (max-width: 767px) {
  .axi-lang-switch {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    left: auto;
    transform: none;
    z-index: 9995;
  }
  .axi-lang-switch a { min-width: 38px; min-height: 34px; }
  .axi-home-return {
    left: calc(14px + env(safe-area-inset-left, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    height: 42px;
    min-width: 92px;
    gap: 7px;
    padding: 0 11px;
    font-size: 10px;
  }
  /* Pages with the shared dock have a dedicated upper menu lane. No horizontal
     overlap is possible, regardless of the menu width or translation length. */
  body.axi-pj .axi-app > .axi-dock {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }
  body.axi-pj .axi-app > .axi-dock .menu.open .m-inner {
    max-height: max(130px, calc(100dvh - 220px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(200,200,220,.3) transparent;
  }
  /* 100vh for older mobile browsers without dynamic viewport units. */
  @supports not (height: 100dvh) {
    body.axi-pj .axi-app > .axi-dock .menu.open .m-inner { max-height: max(130px, calc(100vh - 220px)); }
  }
  body.axi-pj .pj-foot { left: 14px !important; bottom: 135px !important; }
  /* Keep the original spacing when multilingual mode is disabled. */
  body.axi-pj .pj-head { top: 64px !important; }
  body.axi-pj.axi-has-lang-switch .pj-head { top: 76px !important; }
  body.axi-bl.axi-has-lang-switch .bl-head { top: 76px !important; }
  body.axi-pj .pj-title { font-size: clamp(37px, 10vw, 60px) !important; }
  body.axi-lang-fa .pj-title { font-size: clamp(32px, 9vw, 52px) !important; }
  body.axi-lang-fa #h-title { font-size: clamp(38px, 9vw, 76px) !important; }
  /* Ordinary WordPress templates also have a top bar; avoid covering links. */
  body.axi-plain-page.axi-has-lang-switch .pl-bar { padding-top: 62px; }
}
@media (max-width: 520px) {
  body.axi-pj:not(.axi-has-lang-switch) .pj-head { top: 53px !important; }
  body.axi-lang-fa .pj-name { font-size: 23px !important; }
}

/* Ordinary WordPress pages share the language typography and return control. */
body.axi-lang-fa.axi-plain-page{font-family:var(--fa-font);line-height:1.9}
body.axi-lang-fa.axi-plain-page :is(h1,h2,h3,h4,p,a,label,button,input,textarea,li,span){font-family:var(--fa-font)!important;letter-spacing:normal!important}
body.axi-plain-page .axi-home-return{font-size:12px}
body.axi-plain-page .axi-plain{padding-bottom:74px}
