/* Keep language and navigation in separate, flow-sized columns. */
.navigation-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) 44px;
  align-items:center;
  gap:clamp(.5rem,1.5vw,1.5rem);
  min-width:0;
  width:100%;
  direction:ltr;
}
html:root:root:root body .navigation-row > nav {
  position:static!important;
  inset:auto!important;
  width:auto!important;
  max-width:none!important;
  height:auto!important;
  min-width:0;
  flex:none!important;
  display:flex;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:.25rem clamp(.8rem,1.35vw,1.45rem)!important;
  margin:0!important;
  transform:none!important;
}
html:root:root:root body .navigation-row > button {
  position:static!important;
  inset:auto!important;
  order:0;
  min-width:44px;
  width:44px;
  min-height:44px;
  margin:0!important;
  padding:0;
  border:0;
  background:transparent;
  color:rgba(242,233,218,.76);
  cursor:pointer;
  font-family:"Bebas Neue","Vazirmatn",sans-serif!important;
  font-size:clamp(.88rem,1vw,1rem)!important;
  letter-spacing:.08em!important;
  line-height:1.25!important;
}
html:root:root:root body .navigation-row > button#frameLanguage,
html:root:root:root body .navigation-row > button#language,
html:root:root:root body .navigation-row > button#landingLanguage {
  font-size:clamp(.88rem,1vw,1rem)!important;
  font-family:"Bebas Neue","Vazirmatn",sans-serif!important;
  letter-spacing:.08em!important;
}
#frameLanguage,#language,#landingLanguage {
  font-family:"Bebas Neue","Vazirmatn",sans-serif!important;
  font-size:clamp(.88rem,1vw,1rem)!important;
  letter-spacing:.08em!important;
}
html[dir="rtl"] #frameLanguage,html[dir="rtl"] #language,html[dir="rtl"] #landingLanguage {
  font-family:"Vazirmatn",Tahoma,sans-serif!important;
  letter-spacing:0!important;
}
html[dir="rtl"]:root:root:root body .navigation-row > button {font-family:"Vazirmatn",Tahoma,sans-serif!important;letter-spacing:0!important}
html:root:root:root body .navigation-row > button:focus-visible {
  outline:1px solid #9b111e;
  outline-offset:2px;
}
html:root:root:root body .navigation-row > nav a[data-menu] {order:0}
html:root:root:root body .frame-header,
html:root:root:root body .site-header,
html:root:root:root body .reveal-hero.is-menu-open .reveal-hero__header {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:clamp(1rem,3vw,3rem);
  height:auto;
  min-height:0!important;
  padding:24px 6vw!important;
  direction:ltr;
}
.frame-shell {grid-template-rows:auto minmax(0,1fr)}
html:root:root:root body .frame-brand,
html:root:root:root body .site-header .site-home-link,
html:root:root:root body .site-header .archive-brand,
html:root:root:root body .reveal-hero.is-menu-open .reveal-hero__identity h1 {
  position:static;
  inset:auto;
  grid-column:2;
  grid-row:1;
  margin:0!important;
  width:max-content;
  transform:none;
  font-size:clamp(1.08rem,2.56vw,3.04rem)!important;
}
html:root:root:root body .reveal-hero.is-menu-open .reveal-hero__identity {
  top:0;
  right:0;
  left:0;
  width:100%;
  padding:0;
  transform:none;
}
.reveal-hero__header > .navigation-row {grid-column:1;grid-row:1}
html:root:root:root body .reveal-hero:not(.is-menu-open) .navigation-row > button {
  position:fixed!important;
  top:20px!important;
  left:6vw!important;
}
@media(max-width:1000px) {
  html:root:root:root body .frame-header,
  html:root:root:root body .site-header,
  html:root:root:root body .reveal-hero.is-menu-open .reveal-hero__header {
    grid-template-columns:minmax(0,1fr);
    gap:.5rem;
    padding:16px 6vw!important;
  }
  html:root:root:root body .frame-brand,
  html:root:root:root body .site-header .site-home-link,
  html:root:root:root body .site-header .archive-brand,
  html:root:root:root body .reveal-hero.is-menu-open .reveal-hero__identity h1 {
    grid-column:1;
    grid-row:1;
    justify-self:end;
    font-size:clamp(1rem,5.46vw,1.68rem)!important;
  }
  html:root:root:root body .navigation-row {grid-column:1;grid-row:2}
  html:root:root:root body .navigation-row > nav {justify-content:flex-start!important}
}

/* Keep readable line lengths on wide monitors. */
html:root:root:root body main {
  width:min(100% - 12vw, 1500px);
  margin-inline:auto;
}
html:root:root:root body.frame-shell > .frame-content,
html:root:root:root body:has(> .reveal-hero) > main.reveal-hero {
  width:100%;
  margin:0;
}
html:root:root:root body .page-intro {padding-inline:0}
html:root:root:root body .archive-main {padding-inline:0}
@media(max-width:700px) {
  html:root:root:root body main {width:calc(100% - 12vw)}
  html:root:root:root body .navigation-row > nav {gap:.25rem .8rem!important}
}
/* Embedded pages use the shell header, never their standalone header. */
html.is-frame-content:root:root:root body .site-header,
html.is-frame-content:root:root:root body .archive-header {
  display:none!important;
}

/* English editorial alignment: content begins exactly below Biography. */
@media(min-width:1001px) {
  html[lang="en"]:root {--page-gutter:6vw}
  html[lang="fa"]:root {--page-gutter:6vw}
  html[dir="rtl"]:root:root:root body .navigation-row > nav {
    height:29.375px!important;
    flex-wrap:nowrap!important;
    justify-content:space-between!important;
    padding-left:max(0px,calc(var(--menu-start,42vw) - 6vw))!important;
  }
  html[dir="rtl"]:root:root:root body .navigation-row > nav a[data-menu] {
    min-height:29.375px;
    height:29.375px;
    padding:0;
    line-height:1.25;
  }
  html[lang="en"] body .page-intro {
    margin-left:calc(var(--menu-start, 42vw) - 13vw);
    width:calc(100% - var(--menu-start, 42vw));
  }
  html[lang="en"] body.archive-page .page-intro {
    margin-left:calc(var(--menu-start, 42vw) - var(--page-gutter));
  }
  html[lang="en"] body.archive-page .archive-heading {
    margin-left:calc(var(--menu-start, 42vw) - var(--page-gutter));
  }
  html[lang="en"] body.archive-page .archive-list {
    margin-left:calc(var(--menu-start, 42vw) - var(--page-gutter) - 6rem);
  }
  html[lang="en"] body.about-page .profile-grid {
    grid-template-columns:calc(var(--menu-start, 42vw) - 13vw - 1.5rem) minmax(0,1fr);
    gap:1.5rem;
    margin-left:0;
  }
  html[lang="en"] body.contact-page .contact-layout {
    max-width:none;
    margin-left:calc(var(--menu-start, 42vw) - 13vw);
    width:calc(100% - var(--menu-start, 42vw));
  }
  html[lang="en"] body.contact-page .contact-details {
    width:min(100%,32rem);
    margin-left:0;
  }
  html[lang="fa"] body .page-intro {
    margin-right:calc(var(--menu-start,42vw) - 13vw);
    margin-left:0;
    width:calc(100% - var(--menu-start,42vw));
  }
  html[lang="fa"] body.archive-page .page-intro {
    margin-right:calc(var(--menu-start,42vw) - var(--page-gutter));
  }
  html[lang="fa"] body.archive-page .archive-heading {
    margin-right:calc(var(--menu-start,42vw) - var(--page-gutter));
    margin-left:0;
  }
  html[lang="fa"] body.archive-page .archive-list {
    margin-right:calc(var(--menu-start,42vw) - var(--page-gutter) - 6rem);
    margin-left:0;
  }
  html[lang="fa"] body.about-page .profile-grid {
    grid-template-columns:calc(var(--menu-start,42vw) - 13vw - 1.5rem) minmax(0,1fr);
    gap:.75rem;
    margin-inline:0;
  }
  html[lang="fa"] body.contact-page .contact-layout {
    max-width:none;
    margin-right:calc(var(--menu-start,42vw) - 13vw);
    margin-left:0;
    width:calc(100% - var(--menu-start,42vw));
  }
  html[lang="fa"] body.contact-page .contact-details {
    width:min(100%,32rem);
    margin-right:0;
  }
}

/* Keep direct-page menus in the same grid column as the framed menu. */
html:root:root:root body .navigation-row > nav {order:0!important}
