/* COSMOSYNTH register. Source Serif 4 for prose, Source Sans 3 for apparatus,
   Noto Naskh Arabic for Arabic prose and apparatus. SIL Open Font License. */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-serif-4-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-serif-4-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-serif-4-cyrillic-italic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-sans-3-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-sans-3-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-sans-3-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/noto-naskh-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/noto-naskh-arabic-600.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --paper: #f3efe6;
  --ink: #1c1915;
  --ink-soft: #3f3b34;
  --muted: #5c564c;
  --rule: #cfc6b6;
  --signal: #6e2822;
  --serif: "Source Serif 4", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --naskh: "Noto Naskh Arabic", "Source Serif 4", serif;
  --page: 76rem;
  --margin: 20px;
  --gap: 1.5rem;
  color-scheme: light;
}

@media (min-width: 600px) and (max-width: 1023px) {
  :root { --margin: 32px; }
}
@media (min-width: 1024px) {
  :root { --margin: 56px; }
}
@media (min-width: 1440px) {
  :root { --margin: 80px; }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 28px;
  font-weight: 400;
  letter-spacing: 0;
  font-variant-numeric: oldstyle-nums;
}

img, svg { max-width: 100%; height: auto; }

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  inset-inline-start: var(--margin);
  top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 20;
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.skip:focus { transform: none; }

.frame {
  width: min(var(--page), calc(100% - (var(--margin) * 2)));
  margin-inline: auto;
}

.mast {
  position: static;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.mast-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  min-height: 56px;
}

.mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
  direction: ltr;
  unicode-bidi: isolate;
}
a.mark:hover { text-decoration: none; }

.nav-desk,
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  align-items: baseline;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 22px;
}
.langs { direction: ltr; }
.nav-desk a,
.langs a,
.langs [aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--sans);
}
.nav-desk a[aria-current="page"],
.langs [aria-current="page"] {
  color: var(--signal);
  box-shadow: inset 0 -1px 0 var(--signal);
}

.nav-fold,
.lang-fold { display: none; }

summary {
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 22px;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }

h1, h2, h3, .lede {
  font-family: var(--serif);
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

h1 {
  margin: 0.35rem 0 0.8rem;
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 44px;
  max-width: 26ch;
}
h2 {
  margin: 0 0 0.75rem;
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 34px;
  max-width: 28ch;
}
h3 {
  margin: 1.2rem 0 0.35rem;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 28px;
  max-width: 36rem;
}

@media (min-width: 1200px) {
  h1 { font-size: 2.75rem; line-height: 48px; }
}

p { margin: 0.55rem 0; }
.lede {
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 30px;
  max-width: 32rem;
  margin: 0 0 0.85rem;
}
.edition, .meta, figcaption, .legend, .filters, .sort, .search, .index, .marg, time, .sid, caption, th, td, .nav-desk, .langs, .nav-fold, .lang-fold, .colophon, .card .meta {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0;
}
.edition, .meta {
  font-size: 0.8125rem;
  line-height: 18px;
  color: var(--ink-soft);
  max-width: 36rem;
}
.measure, .body p, .body li, .lede, .hero .body p {
  max-width: 36rem;
}
p.lede, .lede, .hero .body p.lede { max-width: 32rem; }
.body p, .body li, .hero .body p { text-wrap: pretty; }

html[lang="en"] .body p,
html[lang="en"] .body li,
html[lang="en"] .lede,
html[lang="ru"] .body p,
html[lang="ru"] .body li,
html[lang="ru"] .lede,
html[lang="ru"] .hero .body p {
  hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
}
html[lang="ru"] h1 {
  max-width: 24ch;
  hyphens: manual;
}

bdi[lang="en"] {
  direction: ltr;
  unicode-bidi: isolate;
}
table bdi[lang="en"],
.marg bdi[lang="en"],
.sid, .id bdi {
  font-family: var(--sans);
}

.sid, .id {
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums lining-nums;
}
a.sid {
  color: inherit;
  font-weight: 400;
  font-size: 0.8125rem;
  line-height: 18px;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, currentColor 45%, transparent);
}
a.sid:hover { border-bottom-color: currentColor; }

.rec {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 0.75rem;
  padding-block: 2.5rem;
}
.rec .marg {
  grid-column: 1 / 4;
  align-self: start;
  min-width: 0;
  padding-top: calc((34px - 18px) / 2);
  font-size: 0.8125rem;
  line-height: 18px;
  color: var(--muted);
  overflow-wrap: break-word;
}
.rec .marg p { margin: 0.2rem 0 0; }
.rec .body { grid-column: 4 / 11; min-width: 0; }
.rec.wide .body { grid-column: 4 / -1; }
.rec.hero {
  padding-top: 2.75rem;
  padding-bottom: 0;
  margin-bottom: 6rem;
}
.rec.hero .body { grid-column: 1 / 9; }
.rec.hero .index {
  grid-column: 9 / -1;
  grid-row: 1;
  align-self: start;
  min-width: 0;
  padding-top: 0.35rem;
}
.hero + .rec { padding-top: 0; }
.rec.wide { padding-block: 4rem 3rem; }
.hero + .rec.wide { padding-top: 0; }
.rec.status { border-top: 1px solid var(--ink); margin-top: 1rem; }

.rec.head .marg { padding-top: calc((44px - 18px) / 2); }
@media (min-width: 1200px) {
  .rec.head .marg { padding-top: calc((48px - 18px) / 2); }
}

.index ol { list-style: none; margin: 0; padding: 0; }
.index li + li { border-top: 1px solid var(--rule); }
.index a {
  display: grid;
  gap: 0.1rem;
  padding: 0.7rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 22px;
}
.index a:hover { text-decoration: underline; text-underline-offset: 0.14em; }
.index .count, .index time { color: var(--muted); font-size: 0.8125rem; line-height: 18px; }

ol.steps {
  margin: 0.4rem 0 0;
  padding-inline-start: 1.3rem;
  max-width: 36rem;
}
ol.steps li { margin: 0.35rem 0; padding: 0; }
ol.steps li::marker { font-family: var(--sans); font-variant-numeric: tabular-nums; }

.call {
  border-inline-start: 2px solid var(--signal);
  padding-inline-start: 0.9rem;
  margin: 0.9rem 0;
}
.reg {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.legend { margin: 0.8rem 0 0; }
.legend div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.35rem 0;
  max-width: 40rem;
}
.legend dt {
  margin: 0;
  min-width: 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 18px;
  letter-spacing: 0.02em;
  font-weight: 600;
  overflow-wrap: break-word;
}
.legend dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 22px;
  font-variant-numeric: tabular-nums lining-nums;
}
caption {
  caption-side: bottom;
  text-align: start;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 18px;
  padding-top: 0.55rem;
}
th {
  text-align: start;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding: 0.35rem 0.8rem 0.4rem 0;
  vertical-align: bottom;
  background: var(--paper);
  overflow-wrap: break-word;
}
thead th { position: sticky; top: 0; }
tr.group th, tbody th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9375rem;
  line-height: 22px;
  font-weight: 600;
  border-bottom: 0;
  padding-top: 1.15rem;
  position: static;
}
td {
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0.8rem 0.55rem 0;
  vertical-align: top;
  overflow-wrap: break-word;
}
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.name a { color: var(--ink); }

.filters, .sort, .search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
  align-items: baseline;
  margin: 0.3rem 0 0.8rem;
  font-size: 0.9375rem;
  line-height: 22px;
}
.filters label { display: inline-flex; gap: 0.4rem; align-items: baseline; }
.sort button {
  font: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.sort button[aria-pressed="true"] { font-weight: 600; text-decoration-color: currentColor; }
.search input {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.2rem 0;
  min-width: min(16rem, 60vw);
}
.live { color: var(--muted); font-size: 0.8125rem; min-height: 1.2em; }

.links, .sources { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.links li, .sources li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  max-width: 46rem;
}
.links li > span, .sources li > span {
  min-width: 0;
  overflow-wrap: break-word;
}

.diagram {
  margin: 0.6rem 0 0;
  overflow-x: auto;
  max-width: 100%;
}
.diagram svg {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  direction: ltr;
}
figcaption { max-width: 40rem; color: var(--ink-soft); font-size: 0.8125rem; line-height: 18px; margin-top: 0.7rem; }

.colophon {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(12rem, 0.7fr);
  gap: 1rem 2rem;
  border-top: 1px solid var(--ink);
  padding: 1.4rem 0 2.6rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 22px;
}
.colophon p { max-width: 38rem; }
.colophon .mark { font-size: 1.25rem; }

.card-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem var(--margin);
}
.card {
  width: min(26rem, 100%);
  border: 1px solid var(--ink);
  padding: 1.4rem 1.3rem 1.2rem;
  background: var(--paper);
}
.card h1 { font-size: 1.75rem; line-height: 34px; max-width: none; font-weight: 600; }
.card .qr { width: 9.5rem; height: auto; background: white; padding: 0.4rem; margin: 0.8rem 0; }
.card p { max-width: none; }

html[lang="ar"] body {
  font-family: var(--naskh);
  font-size: 19px;
  line-height: 34px;
  word-spacing: 0.05em;
  font-variant-numeric: lining-nums;
}
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .lede,
html[lang="ar"] .mark {
  font-family: var(--naskh);
  letter-spacing: 0;
  text-transform: none;
}
html[lang="ar"] .mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
}
html[lang="ar"] h1 { font-size: 36px; line-height: 54px; font-weight: 400; max-width: 18em; }
html[lang="ar"] h2 { font-size: 26px; line-height: 40px; font-weight: 400; max-width: 22em; }
html[lang="ar"] h3 { font-size: 20px; line-height: 34px; font-weight: 600; }
html[lang="ar"] .lede { font-size: 22px; line-height: 38px; max-width: 34rem; }
html[lang="ar"] .nav-desk,
html[lang="ar"] .langs,
html[lang="ar"] table,
html[lang="ar"] .filters,
html[lang="ar"] .sort,
html[lang="ar"] .search {
  font-family: var(--naskh);
  font-size: 16px;
  line-height: 26px;
}
html[lang="ar"] .marg,
html[lang="ar"] time,
html[lang="ar"] .meta,
html[lang="ar"] .edition,
html[lang="ar"] figcaption,
html[lang="ar"] .legend dt,
html[lang="ar"] th {
  font-family: var(--naskh);
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0;
  text-transform: none;
}
html[lang="ar"] .rec .marg { padding-top: calc((40px - 22px) / 2); }
html[lang="ar"] .rec.head .marg { padding-top: calc((54px - 22px) / 2); }
html[lang="ar"] .legend dd { font-family: var(--naskh); font-size: 19px; line-height: 34px; }
html[lang="ar"] table { line-height: 1.7; }
html[lang="ar"] bdi[lang="en"] { font-family: var(--sans); word-spacing: normal; }

@media (max-width: 800px) {
  .rec, .rec.hero { grid-template-columns: 1fr; }
  .rec .marg, .rec .body, .rec.wide .body, .rec.hero .body, .rec.hero .index { grid-column: 1 / -1; grid-row: auto; }
  .rec .marg { padding-top: 0; }
  .rec.hero { margin-bottom: 3rem; }
  .colophon { grid-template-columns: 1fr; }
  h1, html[lang="ru"] h1 { max-width: none; }
}

@media (max-width: 719px) {
  .nav-desk, .langs { display: none; }
  .nav-fold, .lang-fold { display: block; }
  .mast-row { min-height: 55px; height: auto; }
  .nav-fold[open] nav, .lang-fold[open] nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.2rem 0 0.7rem;
    font-family: var(--sans);
    font-size: 0.9375rem;
  }
  .lang-fold nav { direction: ltr; }
  .nav-fold a, .lang-fold a { color: var(--ink); text-decoration: none; }
}

@media (max-width: 720px) {
  .diagram svg { min-width: 760px; }
  table.stack { font-size: 0.9375rem; }
  table.stack thead { display: none; }
  table.stack tbody tr {
    display: grid;
    grid-template-columns: minmax(4.5rem, 11rem) minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 0.15rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
  }
  table.stack tbody tr > * {
    display: block;
    border: 0;
    padding: 0.1rem 0;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
  }
  table.stack tbody tr > :first-child {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }
  table.stack tbody tr > :not(:first-child) { grid-column: 2; }
  table.stack tbody tr > :not(:first-child)::before {
    content: attr(data-th);
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 18px;
  }
  table.stack tr.group { display: block; }
  table.stack tr.group th {
    display: block;
    grid-column: 1 / -1;
    grid-row: auto;
    padding: 0.8rem 0 0.2rem;
    border: 0;
  }
  html[lang="ar"] table.stack tbody tr > :not(:first-child)::before { font-size: 14px; line-height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  @page { size: A4; margin: 20mm 18mm; }
  .nav-desk, .nav-fold, .langs, .lang-fold, .skip, .filters, .search, .sort { display: none !important; }
  body { background: white; }
  a { color: var(--ink); }
  a[href^="http"]::after { content: " (" attr(href) ")"; font: 9pt var(--sans); word-break: break-all; }
  tr, .rec { break-inside: avoid; }
  .diagram svg { min-width: 0; }
  h1, h2, h3, p { orphans: 2; widows: 2; }
  .colophon { border-top: 1px solid var(--ink); }
}
