.site-root {
  display: contents;
}

/*
 * Arabic must never depend on an operating-system fallback font. Using the
 * bundled Thmanyah faces here keeps shaping, line breaks, and reading rhythm
 * identical across browsers, CI, and Cloudflare's global audience.
 */
html[lang='ar'] body {
  font-family: 'Thmanyah Text', serif;
}

html[lang='ar'] :is(h1, h2, h3, h4, h5, h6) {
  font-family: 'Thmanyah Display', serif;
  letter-spacing: normal;
}

html:not(.theme-ready) *,
html:not(.theme-ready) *::before,
html:not(.theme-ready) *::after {
  transition: none !important;
}

/*
 * The source design uses intentionally quiet metadata. These interactive and
 * navigational labels need the full foreground token to retain WCAG AA contrast
 * across both the night and day palettes.
 */
.site-root
  :is(
    .crumb,
    .epistemic,
    .study__hint,
    .toc > h2,
    .sec > h2 .meta,
    .qs a,
    .stations .y,
    .foot a,
    .brand b,
    .colophon p,
    footer,
    footer a,
    #paletteBtn,
    .nav__brand b
  ) {
  color: var(--ink) !important;
  opacity: 1;
}

.translation-notice {
  position: relative;
  z-index: 1001;
  padding: 0.6rem 1rem;
  border-block-end: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  background: #f3f2ed;
  color: #262c31;
  font:
    500 0.76rem/1.4 system-ui,
    sans-serif;
  text-align: center;
}
.translation-notice strong {
  font-weight: 700;
}
.locale-menu {
  inline-size: min(42rem, calc(100vw - 2rem));
  max-block-size: min(48rem, calc(100dvh - 2rem));
  padding: 0;
  border: 1px solid #767069;
  background: #f3f2ed;
  color: #262c31;
  box-shadow: 0 2rem 6rem rgb(0 0 0 / 0.3);
}
.locale-menu::backdrop {
  background: rgb(15 19 25 / 0.72);
  backdrop-filter: blur(4px);
}
.locale-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-block-end: 1px solid #c8c2b9;
}
.locale-menu__head h2 {
  margin: 0;
  font:
    700 1.2rem/1.2 system-ui,
    sans-serif;
}
.locale-menu__head button {
  inline-size: 2.5rem;
  block-size: 2.5rem;
  border: 1px solid #767069;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
}
.locale-menu ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0.8rem;
  list-style: none;
}
.locale-menu li {
  min-inline-size: 0;
}
.locale-menu a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-block-size: 4rem;
  padding: 0.8rem;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
}
.locale-menu a:hover,
.locale-menu a:focus-visible,
.locale-menu a[aria-current='page'] {
  border-color: #767069;
  background: #e8e4dc;
  outline: none;
}
.locale-menu a span {
  font:
    700 1rem/1.2 system-ui,
    sans-serif;
}
.locale-menu a small {
  color: #625d57;
  font:
    500 0.72rem/1.35 system-ui,
    sans-serif;
}
@media (max-width: 34rem) {
  .locale-menu ul {
    grid-template-columns: 1fr;
  }
}
@media (prefers-color-scheme: dark) {
  .translation-notice,
  .locale-menu {
    background: #151a21;
    color: #efe7cf;
  }
  .locale-menu__head,
  .locale-menu a:hover,
  .locale-menu a:focus-visible,
  .locale-menu a[aria-current='page'] {
    border-color: #525b65;
  }
  .locale-menu a:hover,
  .locale-menu a:focus-visible,
  .locale-menu a[aria-current='page'] {
    background: #202730;
  }
  .locale-menu a small {
    color: #b6b0a3;
  }
}
.editorial-sources {
  width: min(760px, calc(100% - 2 * var(--pad, 24px)));
  margin: 2rem auto 4rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid color-mix(in srgb, var(--ink, #e8e4dc) 22%, transparent);
  background: color-mix(in srgb, var(--bg-2, #151a22) 88%, transparent);
}

.editorial-sources h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.editorial-sources p,
.editorial-sources li {
  line-height: 1.65;
}

.editorial-sources ol {
  margin-block: 0.8rem 0;
  padding-inline-start: 1.35rem;
}

.editorial-sources a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.abstract-grid.abstract-grid--single {
  grid-template-columns: minmax(0, 1fr);
}
