/* Shared reading rhythm; controls, captions and postal addresses keep their native alignment. */
:root { --text-measure: 43rem; --reading-leading: 2.08; }
main :is(h1,h2,h3,h4), footer b { text-wrap: balance; word-break:normal; }
html[dir="rtl"] main :is(h1,h2,h3,h4) { letter-spacing:normal; }
main p { text-wrap:pretty; word-break:normal; }
main :is(article, section, aside, fieldset, figure, details, .wrap) { min-inline-size:0; }
main :is(.readerbody,.chapterlead,.history-story,.history-research,.archive-cover-copy,.intl-section,.patient-view) {
  overflow-wrap:break-word;
}
main :is(.readerbody,.chapterlead,.booklead>div,.history-founder>div,.history-story,.history-study>div,.history-research,.history-intro,.archive-cover-copy,.patient-view .panel,.intl-faq) p:not(.overline,.bookmeta,.readorigin,.field-help,.field-error,[dir]) {
  max-inline-size:var(--text-measure);
  line-height:var(--reading-leading);
  white-space:normal;
  margin-block:.7em;
}
main :is(.readerbody,.chapterlead) {max-inline-size:var(--text-measure);margin-inline:auto}
main .readerbody>p {font-size:clamp(1.03rem, .97rem + .3vw, 1.18rem)}
html[lang="fa"] main :is(.readerbody,.chapterlead,.history-study,.history-story,.history-research,.booklead,.history-founder) p:not(.overline,.bookmeta,.readorigin) {
  text-align:justify; text-align-last:start; text-justify:inter-word;
}
@media(max-width:560px) {
  html[lang="fa"] main :is(.readerbody,.chapterlead,.history-study,.history-story,.history-research,.booklead,.history-founder) p:not(.overline,.bookmeta,.readorigin) {text-align:start}
  :root {--reading-leading:2}
  .readerbody h1 {overflow-wrap:break-word}
}
main .bookreading :is(.booksource,.scanreader,.bookactions),
main .bookreading > nav {max-inline-size:var(--text-measure);margin-inline:auto}
:lang(fa) main :is(.chapterlist strong,.archive-caption h3,.form-field label,.guide p) {letter-spacing:normal}
.article,.readerbody,.chapterlead,.history {font-kerning:normal;}
@media print {
  .mast,.utility,.crumbs,footer,.tracklink,.bookactions,.history-jumps {display:none!important}
  .readerbody,.chapterlead,main .history-story {max-inline-size:none}
  p {orphans:3;widows:3}
  h1,h2,h3 {break-after:avoid}
}
.center-links{display:grid;grid-template-columns:1.4fr 1fr;align-items:center;gap:clamp(1rem,4vw,4rem);padding:1.8rem 0;margin:0 0 2rem;border-block:1px solid var(--line)}
.center-links h2{margin:0;font-size:clamp(1.6rem,3vw,2.1rem)}
.center-links p{max-inline-size:41rem;margin:.45rem 0}
.center-links nav{display:grid;gap:.2rem;border-inline-start:2px solid #b88963;padding-inline-start:1rem}
.center-links nav a{justify-self:start;padding:.15rem 0}
@media(max-width:620px){.center-links{grid-template-columns:1fr}}
html[lang="fa"] .history .history-topic p{line-height:var(--reading-leading);text-align:justify;text-align-last:start}
@media(max-width:560px){html[lang="fa"] .history .history-topic p{text-align:start}}
.intl .translated-text {margin:clamp(1.5rem,5vw,4rem) auto;line-height:1.85}
.intl .translated-text p {margin:1em 0}
.intl .translated-text header {margin-bottom:2rem}
.intl .translated-index {margin:2rem auto;max-width:52rem}
.intl .translated-index ol {padding-inline-start:0}
.intl .translated-index li a {display:flex;align-items:baseline;gap:1rem}
.intl .translated-index li small {min-width:5em}
.intl .translated-text .bookactions {display:flex;flex-wrap:wrap;justify-content:space-between;gap:.75rem}
/* Adapt the measure to each writing system and let translated titles use the available width. */
html:lang(en),html:lang(de){--text-measure:68ch;--reading-leading:1.75}
html:lang(ar){--text-measure:44rem;--reading-leading:1.95}
html:not(:lang(fa)) main :is(.readerbody,.chapterlead,.history-original-text,.bookfeature,.booklead,.history-story,.history-topic,.archive-cover-copy) p {white-space:normal;text-wrap:wrap;text-align:justify;text-align-last:start;line-height:var(--reading-leading)}
html:lang(de) main :is(h1,h2,h3,h4,p,.chapterlist strong){hyphens:auto;word-break:normal;overflow-wrap:break-word}
html[dir="ltr"] .hero h1,html[dir="ltr"] .sectionhead h2,html[dir="ltr"] .bookfeature h2{letter-spacing:-.02em}
html[dir="rtl"] .hero-copy em {display:block}
html[dir="ltr"] .hero-copy em {display:inline}
.bookfeature>div,.center-links>*,.booklead>div {min-inline-size:0}
@media(max-width:560px){
  .bookfeature{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem}
  .bookfeature>img{width:105px}
  .bookfeature h2{font-size:1.45rem}
}

/* Align continuous prose to a common measure, with a naturally ending last line. */
html:is([lang=en],[lang=de],[lang=ar]) body main p:not(.overline,.bookmeta,.readorigin,.history-byline,.field-help,.field-error,.booksource,[role=status],[dir]) {
  text-align:justify;text-align-last:start;text-wrap:wrap;
  white-space:normal;word-break:normal;overflow-wrap:break-word;
  letter-spacing:normal;word-spacing:normal;line-height:var(--reading-leading);
}
html:is([lang=en],[lang=de]) main p {hyphens:auto;-webkit-hyphens:auto}
html:is([lang=en],[lang=de],[lang=ar]) body main :is(.readerbody,.chapterlead,.history-source) {
  max-inline-size:var(--text-measure);margin-inline:auto;
}
html:is([lang=en],[lang=de],[lang=ar]) body main .history .history-source > .history-original-text {
  max-inline-size:100%;margin-block:.95em;line-height:var(--reading-leading);text-align:justify;text-align-last:start
}
