/*
 * The deployment's own Persian pages (the homepage's main block, guide.html, session.html, tools.html and
 * about.html), laid over the fork by `5et site` (DESIGN §20). They share the sign-in pages' look
 * (worker/ui/src/layouts/AuthLayout.module.css): warm paper, white cards with soft shadows, the site's crimson as the only accent, and the mark above a centered
 * title. Night mode follows the fork's switch (`:root.ve-night-mode`, js/styleswitch.js) on the fork's pages and the
 * visitor's color scheme on about.html, which stands alone.
 * The file sits in a folder of its own because the fork swaps every `css/<name>.css` for a mirrored `css/<name>.rtl.css`
 * in right-to-left languages (`js/i18n.js`), which this file has no need of: it is written with logical properties.
 * The block's own size is set once in `px` and everything inside is in `em`: the fork's Bootstrap 3 sets the root font
 * size to 10px, so `rem` would be tiny.
 */
@font-face {
  font-family: Vazirmatn;
  src: url("../../fonts/vazirmatn/Vazirmatn-NL-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

.site-fa,
.site-standalone {
  --site-paper: #f7f3ee;
  --site-card: #fff;
  --site-ink: #1d1b19;
  --site-muted: #6b645c;
  --site-accent: #8a2c1b;
  --site-accent-ink: #fff;
  --site-border: rgb(40 20 10 / 12%);
  --site-shadow: 0 1px 2px rgb(40 20 10 / 6%), 0 24px 48px -24px rgb(40 20 10 / 22%);
}

.site-fa {
  direction: rtl;
  text-align: start;
  color: var(--site-ink);
  font-family: Vazirmatn, system-ui, sans-serif;
  font-size: 16px;
  line-height: 2;
}

/* Standalone pages carry no theme switch, and the site is dark by default. */
.site-standalone,
.site-standalone .site-fa {
  --site-paper: #1f1f1f;
  --site-card: #242424;
  --site-ink: #ece7e1;
  --site-muted: #aaa29a;
  --site-accent: #e0604a;
  --site-border: rgb(255 255 255 / 10%);
  --site-shadow: 0 24px 48px -24px rgb(0 0 0 / 70%);
}

/* The sign-in pages' dark surfaces (Mantine dark-8 and dark-7) and their primary shade. */
:root.ve-night-mode .site-fa {
  --site-paper: #1f1f1f;
  --site-card: #242424;
  --site-ink: #ece7e1;
  --site-muted: #aaa29a;
  --site-accent: #e0604a;
  --site-border: rgb(255 255 255 / 10%);
  --site-shadow: 0 24px 48px -24px rgb(0 0 0 / 70%);
}

/* -------------------------------------------- */
/* Page and text */

/* Inside the fork's pages the content sits on its own sheet of paper, like the sign-in pages. */
.site-page {
  margin-block: 1em 2em;
  padding: 1.5em 1.25em 2.5em;
  border-radius: 18px;
  background: var(--site-paper);
}

.site-fa a {
  color: var(--site-accent);
}

.site-fa h2 {
  margin: 0 0 0.5em;
  font-size: 1.45em;
  font-weight: 800;
  line-height: 1.5;
}

.site-fa h3 {
  margin: 1.25em 0 0.35em;
  font-size: 1.1em;
  font-weight: 700;
  line-height: 1.6;
}

.site-fa p,
.site-fa li {
  max-width: 44em;
}

.site-fa [lang="en"],
.site-fa kbd {
  direction: ltr;
  unicode-bidi: isolate;
}

.site-fa__accent {
  color: var(--site-accent);
}

.site-fa__note {
  color: var(--site-muted);
  font-size: 0.9em;
}

/* A link under a term grid needs room, because the grid has no bottom margin. */
.site-pairs + .site-fa__note {
  margin-top: 1em;
}

/* -------------------------------------------- */
/* Hero: the mark, a small badge, the title with one accented word, and a line under it */

.site-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5em auto 1.75em;
  text-align: center;
}

.site-hero__mark {
  width: 4.5em;
  height: 4.5em;
  margin-block-end: 0.5em;
}

.site-hero__badge {
  padding: 0 0.9em;
  border: 1px solid color-mix(in srgb, var(--site-accent) 40%, transparent);
  border-radius: 999px;
  color: var(--site-accent);
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.9;
}

.site-hero h1,
.site-hero h2 {
  margin: 0.4em 0 0;
  font-size: 2.3em;
  font-weight: 800;
  line-height: 1.45;
  text-wrap: balance;
}

.site-hero p {
  max-width: 30em;
  margin: 0.4em 0 0;
  color: var(--site-muted);
  font-size: 1.05em;
  text-wrap: balance;
}

/* -------------------------------------------- */
/* Cards: a page's sections, and the links between pages */

.site-card {
  max-width: 48em;
  margin: 0 auto 1.25em;
  padding: 1.25em 1.5em;
  border: 1px solid var(--site-border);
  border-radius: 18px;
  background: var(--site-card);
  box-shadow: var(--site-shadow);
}

.site-card > :last-child {
  margin-bottom: 0;
}

.site-fa__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13em, 100%), 1fr));
  gap: 0.75em;
  max-width: 48em;
  margin: 0 auto 1.25em;
}

.site-fa__card {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  padding: 0.9em 1.1em;
  border: 1px solid var(--site-border);
  border-radius: 14px;
  background: var(--site-card);
  box-shadow: var(--site-shadow);
  line-height: 1.7;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.site-fa .site-fa__card {
  color: var(--site-ink);
  text-decoration: none;
}

.site-fa__card:hover,
.site-fa__card:focus-visible {
  border-color: var(--site-accent);
  transform: translateY(-1px);
}

.site-fa__card strong {
  color: var(--site-accent);
  font-size: 1.05em;
}

.site-fa__card span {
  color: var(--site-muted);
  font-size: 0.9em;
}

/* The one way in a page wants most visitors to take: wide, and filled with the accent. */
.site-fa .site-fa__card--primary {
  grid-column: 1 / -1;
  padding: 1.25em 1.5em;
  border-color: transparent;
  background: var(--site-accent);
  color: var(--site-accent-ink);
}

.site-fa__card--primary strong {
  color: inherit;
  font-size: 1.35em;
}

.site-fa__card--primary span {
  color: inherit;
  font-size: 1em;
  opacity: 0.88;
}

.site-fa__card--primary:hover,
.site-fa__card--primary:focus-visible {
  border-color: transparent;
  filter: brightness(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .site-fa__card {
    transition: none;
  }

  .site-fa__card:hover,
  .site-fa__card:focus-visible {
    transform: none;
  }
}

/* -------------------------------------------- */
/* The homepage: a hero, one search box, four starting cards, the guide, and a quiet ending */

/* Upstream's category grid has its own page (lists.html), and the header menu already reaches every list. The header's
 * own search group goes too, so the page has one search; `:has` keys both rules to pages that carry the homepage block. */
body:has(.site-home) .home__stripe {
  display: none;
}

/* Upstream's footer opens with its own version number and copyright mark, which say nothing about this site; the
 * trademark notice below them stays. */
body:has(.site-home) footer.container .ve-text-center > div:first-child {
  display: none;
}

/* The fork's styles all sit in `@layer vetools`, where `.ve-flex` is `display: flex !important`; an important rule in a
 * layer beats an important rule outside one, so this one joins the layer and wins on specificity. */
@layer vetools {
  body:has(.site-home) #navbar .omni__wrp-input {
    /* biome-ignore lint/complexity/noImportantStyles: overrides the fork's own !important on `.ve-flex` */
    display: none !important;
  }
}

.site-home {
  display: grid;
  gap: 1.5em;
  max-width: 52em;
  margin-inline: auto;
  padding: 0.5em 1em 2em;
}

.site-home h2 {
  margin: 0;
  font-size: 1.8em;
  text-align: center;
}

.site-home__hero p {
  margin: 0.4em auto 0;
  color: var(--site-muted);
  text-align: center;
  text-wrap: balance;
}

.site-home h3 {
  margin: 0 0 0.5em;
  color: var(--site-muted);
  font-size: 0.9em;
  font-weight: 700;
}

.site-home__sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* The omnisearch's results panel, moved here by js/site-pages.js: it opens under the box across its width, and stays
 * there when the page scrolls (upstream pins it to the header's corner then). */
.site-home__search .site-fa__note {
  max-inline-size: none;
  margin: 0.4em 0.3em 0;
  text-align: center;
}

.site-home__field {
  position: relative;
}

.site-home__field .omni__output {
  position: absolute;
  inset-block-start: calc(100% + 0.4em);
  inset-inline: 0;
  inline-size: auto;
  min-inline-size: 0;
  max-inline-size: none;
  max-block-size: 60vh;
  overflow-y: auto;
  border-radius: 14px;
  box-shadow: var(--site-shadow);
  text-align: start;
}

.site-home__search input {
  inline-size: 100%;
  min-block-size: 3.5em;
  padding-inline: 1.1em;
  border: 2px solid var(--site-border);
  border-radius: 16px;
  background: var(--site-card);
  box-shadow: var(--site-shadow);
  color: var(--site-ink);
  font: inherit;
  font-size: 1.05em;
}

.site-home__search input:focus-visible {
  border-color: var(--site-accent);
  outline: 3px solid var(--site-accent);
  outline-offset: 2px;
}

.site-home__start {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border: 1px solid var(--site-border);
  border-radius: 18px;
  background: var(--site-card);
  box-shadow: var(--site-shadow);
}

.site-home__start a {
  display: grid;
  gap: 0.1em;
  min-block-size: 44px;
  padding: 1.1em 1.5em;
  border-block-end: 1px solid var(--site-border);
  color: var(--site-ink);
  text-decoration: none;
  transition: background 0.15s ease;
}

.site-home__start a:last-child {
  border-block-end: 0;
}

/* The corner cards follow the container's rounding so their focus outline is not clipped square by overflow: hidden. */
.site-home__start a:first-child {
  border-start-start-radius: 17px;
  border-start-end-radius: 17px;
}

.site-home__start a:last-child {
  border-end-start-radius: 17px;
  border-end-end-radius: 17px;
}

.site-home__start a:hover,
.site-home__start a:focus-visible {
  background: color-mix(in srgb, var(--site-accent) 7%, var(--site-card));
}

.site-home__start strong {
  font-size: 1.15em;
  font-weight: 800;
}

.site-home__start [data-site-card-line] {
  color: var(--site-muted);
  font-size: 0.92em;
  line-height: 1.8;
}

/* The starting entry is the only red on the page's first screen. */
.site-home__go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-start: 0.3em;
  color: var(--site-accent);
  font-weight: 700;
}

.site-home__go b {
  font-weight: 700;
}

/* The spotlight (src/spotlight.ts renders it, js/site-pages.js rotates it): one wide banner per item. Scene art shows
   at full strength, shaded only behind the text. An item with just a cover shows it upright at its own proportions, on
   a backdrop blurred from the same picture: a portrait cover stretched across a wide banner only turns soft. White
   text, not red, so the starting entries below stay the only red. */
.site-home__spotlight {
  --spotlight-accent: var(--site-accent);
  --spotlight-shade: 8 8 10;
  display: grid;
  gap: 0.5em;
}

/* Every slide in one cell, the shown one on top: the spotlight keeps the height of its tallest item, so the page
   below it does not jump each time the banner changes. */
.site-home__slides {
  display: grid;
}

a.site-home__slide {
  grid-area: 1 / 1;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-block-size: 16em;
  overflow: hidden;
  border-radius: 18px;
  background: color-mix(in srgb, var(--spotlight-accent) 35%, #111);
  box-shadow: var(--site-shadow);
  color: #fff;
  text-decoration: none;
}

.site-home__slide[hidden] {
  visibility: hidden;
}

.site-home__slide:focus-visible {
  outline: 3px solid var(--site-ink);
  outline-offset: 3px;
}

.site-home__slide-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* Oversized so the blur's soft edge falls outside the banner. */
.site-home__slide-ambient {
  position: absolute;
  inset: -12%;
  z-index: -2;
  inline-size: 124%;
  block-size: 124%;
  object-fit: cover;
  filter: blur(28px) saturate(1.2) brightness(0.55);
}

/* The shade sits behind the text, on the right: the page stays right to left under the EN button, which swaps text
   only. The art's other half stays untouched, with a faint wash of the item's accent along the bottom edge. */
.site-home__slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      to left,
      rgb(var(--spotlight-shade) / 82%) 0%,
      rgb(var(--spotlight-shade) / 55%) 38%,
      rgb(var(--spotlight-shade) / 0%) 72%
    ),
    linear-gradient(to top, color-mix(in srgb, var(--spotlight-accent) 45%, transparent), transparent 45%);
}

.site-home__slide--product::before {
  background: linear-gradient(to left, rgb(var(--spotlight-shade) / 45%), rgb(var(--spotlight-shade) / 10%));
}

.site-home__slide-body {
  display: grid;
  gap: 0.35em;
  max-inline-size: 26em;
  padding: 1.75em 2em;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgb(0 0 0 / 40%);
}

.site-home__slide-body strong {
  font-size: 1.6em;
  line-height: 1.3;
}

.site-home__slide-label {
  justify-self: start;
  padding: 0.1em 0.7em;
  border-radius: 999px;
  background: rgb(255 255 255 / 16%);
  font-size: 0.8em;
  font-weight: 700;
  text-shadow: none;
}

.site-home__slide .site-home__go {
  justify-content: start;
  gap: 0.5em;
  color: #fff;
}

/* Upright, at its own proportions and below its own resolution (covers are about 300–600 px wide), with the thin
   light edge and soft contact shadow of a printed object, not a sticker. */
.site-home__slide-cover {
  block-size: 12em;
  inline-size: auto;
  margin: 1.5em 2em;
  border-radius: 3px;
  outline: 1px solid rgb(255 255 255 / 12%);
  outline-offset: -1px;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 35%),
    0 18px 36px -12px rgb(0 0 0 / 70%);
}

.site-home__slide--product .site-home__slide-cover {
  block-size: 13em;
}

.site-home__spotlight-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}

.site-home__dots {
  display: flex;
}

/* A 24px target around a small pill (WCAG 2.5.8); the current one widens and fills up while it is on show. */
.site-home__dot {
  display: grid;
  place-items: center;
  min-inline-size: 24px;
  block-size: 24px;
  padding: 0 4px;
  border: 0;
  background: none;
  cursor: pointer;
}

.site-home__dot:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 1px;
  border-radius: 999px;
}

/* The pill eases between its short and long shape, and clips the fill so the fill keeps round ends. */
.site-home__track {
  display: block;
  overflow: hidden;
  inline-size: 0.6em;
  block-size: 0.6em;
  border-radius: 999px;
  background: var(--site-border);
  transition:
    inline-size 0.4s ease,
    background-color 0.4s ease;
}

.site-home__dot[aria-current] .site-home__track {
  inline-size: 2.2em;
  background: color-mix(in srgb, var(--site-accent) 30%, transparent);
}

/* The fill waits outside the pill on its start side (the right, as the page reads) and slides in. It moves with
   `translate`, which the browser animates apart from layout: an animated width is laid out again every frame and steps
   while the page is busy. */
.site-home__fill {
  display: block;
  block-size: 100%;
  border-radius: inherit;
  background: var(--site-accent);
  translate: 100% 0;
}

.site-home__fill:dir(ltr) {
  translate: -100% 0;
}

/* The fill is the timer: its end moves to the next item (js/site-pages.js), so pausing it pauses the rotation. */
.site-home__spotlight[data-rotating] .site-home__dot[aria-current] .site-home__fill {
  animation: site-spotlight-fill var(--spotlight-interval) linear;
}

.site-home__spotlight[data-rotating] .site-home__dot[aria-current] .site-home__fill:dir(ltr) {
  animation-name: site-spotlight-fill-ltr;
}

/* As specific as the rules above, whose `animation` shorthand would otherwise reset the play state to running. */
.site-home__spotlight[data-rotating]:is([data-paused], [data-tab-hidden], :has(:focus-visible))
  .site-home__dot[aria-current]
  .site-home__fill {
  animation-play-state: paused;
}

@media (hover: hover) {
  .site-home__spotlight[data-rotating]:hover .site-home__dot[aria-current] .site-home__fill {
    animation-play-state: paused;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-home__track {
    transition: none;
  }
}

@keyframes site-spotlight-fill {
  from {
    translate: 100% 0;
  }

  to {
    translate: 0 0;
  }
}

@keyframes site-spotlight-fill-ltr {
  from {
    translate: -100% 0;
  }

  to {
    translate: 0 0;
  }
}

.site-home__pause {
  display: grid;
  place-items: center;
  inline-size: 24px;
  block-size: 24px;
  padding: 0;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  background: var(--site-card);
  color: var(--site-muted);
  cursor: pointer;
}

.site-home__pause:hover,
.site-home__pause:focus-visible {
  color: var(--site-accent);
}

/* Two bars while rotating, a play triangle once paused; drawn, so no icon font or text needs translating. */
.site-home__pause::before {
  content: "";
  inline-size: 8px;
  block-size: 9px;
  border-inline: 3px solid currentColor;
}

.site-home__spotlight[data-paused] .site-home__pause::before {
  inline-size: 0;
  block-size: 0;
  border-block: 5px solid transparent;
  border-inline-start: 0;
  border-inline-end: 0;
  /* A play symbol points right in either direction of text. */
  border-left: 8px solid currentColor;
  margin-left: 2px;
}

@media (width < 600px) {
  /* Text runs across the whole banner, so the shade rises from the bottom instead. A cover beside scene art gives way
     to the text; a product's cover stays, smaller, since without it the banner shows only a blur. */
  a.site-home__slide {
    grid-template-columns: 1fr;
    align-items: end;
    min-block-size: 14em;
  }

  .site-home__slide::before {
    background: linear-gradient(
      to top,
      rgb(var(--spotlight-shade) / 88%) 0%,
      rgb(var(--spotlight-shade) / 60%) 45%,
      rgb(var(--spotlight-shade) / 0%) 80%
    );
  }

  .site-home__slide-body {
    padding: 1.25em 1.25em 1.4em;
  }

  /* Scene art gets a strip of its own above the text: laid under text that fills a phone-wide banner, it was hidden
     behind the shade, subject and all. The strip's bottom edge fades into the banner's tint, where the text sits. */
  a.site-home__slide:has(.site-home__slide-art) {
    --spotlight-tint: color-mix(in srgb, var(--spotlight-accent) 35%, #111);
    align-items: stretch;
    background: var(--spotlight-tint);
  }

  .site-home__slide:has(.site-home__slide-art)::before {
    content: none;
  }

  .site-home__slide-art {
    position: static;
    aspect-ratio: 16 / 9;
    block-size: auto;
  }

  .site-home__slide:has(.site-home__slide-art) .site-home__slide-body {
    position: relative;
    margin-block-start: -3em;
    padding-block-start: 2.5em;
    background: linear-gradient(to bottom, transparent, var(--spotlight-tint) 3em);
  }

  .site-home__slide-cover {
    display: none;
  }

  /* Above the text and off to the side, so the text keeps the banner's full width. */
  .site-home__slide--product .site-home__slide-cover {
    display: block;
    grid-row: 1;
    justify-self: end;
    block-size: 6.5em;
    margin: 1.25em 1.25em 0;
  }

  .site-home__slide-body strong {
    font-size: 1.35em;
  }
}

.site-home__more {
  display: grid;
  gap: 0.25em;
  color: var(--site-muted);
  font-size: 0.92em;
}

/* The guide is a row of its own below the cards, quieter than they are: no red, no fill. */
a.site-home__guide {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 0.75em;
  min-block-size: 44px;
  padding: 0.9em 1.25em;
  border: 1px solid var(--site-border);
  border-radius: 18px;
  background: var(--site-card);
  box-shadow: var(--site-shadow);
  color: var(--site-muted);
  line-height: 1.8;
  text-decoration: none;
  transition: background 0.15s ease;
}

a.site-home__guide:hover,
a.site-home__guide:focus-visible {
  background: color-mix(in srgb, var(--site-accent) 7%, var(--site-card));
}

.site-home__guide strong {
  color: var(--site-ink);
  font-size: 1.05em;
  font-weight: 800;
}

.site-home__guide > span[aria-hidden] {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--site-ink);
}

/* The channel row wears the guide's look; the gap keeps the two rows from reading as one card. */
a.site-home__channel {
  margin-block-start: 0.5em;
}

.site-home__channel strong {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.site-home__channel svg {
  flex: none;
  inline-size: 1.5em;
  block-size: 1.5em;
}

a.site-home__why {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-block-size: 44px;
  padding-inline: 0.3em;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--site-border);
  text-underline-offset: 0.35em;
}

a.site-home__why:hover,
a.site-home__why:focus-visible {
  color: var(--site-ink);
  text-decoration-color: currentcolor;
}

.site-home__lists {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5em;
  margin-block-start: 0.75em;
  padding: 0.25em 0.3em 0;
  border-block-start: 1px solid var(--site-border);
}

.site-home__lists a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  color: inherit;
  text-decoration: none;
}

.site-home__lists a:hover,
.site-home__lists a:focus-visible {
  color: var(--site-ink);
}

.site-home__fine {
  padding-inline: 0.3em;
  font-size: 1.05em;
  line-height: 1.9;
}

.site-home__fine p {
  margin: 0.5em 0;
  text-align: start;
}

.site-home__fine a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* Space for the coverage sentence, which loads after the page: the lines below it do not jump when it arrives. */
.site-home__coverage {
  min-block-size: 3.8em;
}

.site-home__fine .site-home__coverage {
  margin-block-start: 0;
}

@media (min-width: 760px) {
  .site-home h2 {
    font-size: 2.2em;
  }

  .site-home__start {
    grid-template-columns: 1fr 1fr;
  }

  .site-home__start a:nth-child(odd) {
    border-inline-end: 1px solid var(--site-border);
  }

  .site-home__start a:nth-last-child(-n + 2) {
    border-block-end: 0;
  }

  .site-home__start a:first-child {
    border-start-end-radius: 0;
  }

  .site-home__start a:nth-child(2) {
    border-start-start-radius: 0;
    border-start-end-radius: 17px;
  }

  .site-home__start a:nth-child(3) {
    border-end-start-radius: 17px;
    border-end-end-radius: 0;
  }

  .site-home__start a:last-child {
    border-end-start-radius: 0;
    border-end-end-radius: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-home__start a,
  a.site-home__guide {
    transition: none;
  }
}

/* -------------------------------------------- */
/* The about page's steps, and the guide's term pairs, tables, spell card and example sentences */

/* Numbered steps: each a title on its own line over a short paragraph, with the number in a disc. */
.site-steps {
  display: grid;
  gap: 0.9em;
  margin: 1em 0;
  padding: 0;
  list-style: none;
  counter-reset: site-step;
}

.site-steps li {
  position: relative;
  padding-inline-start: 2.6em;
  counter-increment: site-step;
}

.site-steps li::before {
  content: counter(site-step);
  position: absolute;
  inset-inline-start: 0;
  top: 0.15em;
  display: grid;
  place-items: center;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  background: color-mix(in srgb, var(--site-accent) 12%, transparent);
  color: var(--site-accent);
  font-weight: 800;
  line-height: 1;
}

.site-steps strong {
  display: block;
}

/* Persian terms with their English beside them, in as many columns as fit. */
.site-pairs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(9em, 100%), 1fr));
  gap: 0.35em 1em;
  margin: 0;
}

.site-pairs[hidden] {
  display: none;
}

.site-pairs--wide {
  grid-template-columns: repeat(auto-fill, minmax(min(16em, 100%), 1fr));
}

.site-pairs > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5em;
  border-bottom: 1px dashed var(--site-border);
}

.site-pairs dt {
  font-weight: 700;
}

.site-pairs dd {
  margin: 0;
  color: var(--site-muted);
  font-size: 0.85em;
}

/* A copy of the top of a class table, with each column's English under its Persian label. */
.site-table-wrap {
  overflow-x: auto;
}

.site-table {
  width: 100%;
  margin: 0.5em 0 1em;
  border-collapse: collapse;
  font-size: 0.95em;
}

.site-table th,
.site-table td {
  padding: 0.35em 0.75em;
  border-bottom: 1px solid var(--site-border);
  text-align: start;
}

.site-table th {
  background: var(--site-paper);
  line-height: 1.5;
}

.site-table__en {
  display: block;
  color: var(--site-muted);
  font-size: 0.8em;
  font-weight: 400;
}

/* A sentence as the site writes it, its terms in bold, and the English original under it. */
.site-sentence {
  margin: 0.75em 0;
  padding: 0.6em 1em;
  border-inline-start: 4px solid var(--site-accent);
  border-radius: 10px;
  background: var(--site-paper);
}

.site-sentence blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1em;
  line-height: 1.9;
}

.site-sentence b {
  color: var(--site-accent);
}

.site-sentence figcaption {
  margin-top: 0.25em;
  color: var(--site-muted);
  font-size: 0.85em;
  text-align: left;
}

/* A copy of the spell card spells.html shows, so the reader meets its labels before the real page. */
.site-spell {
  display: flex;
  flex-direction: column;
  max-width: 22em;
  margin: 0.75em 0;
  padding: 0.75em 1em;
  border-inline-start: 4px solid var(--site-accent);
  border-radius: 10px;
  background: var(--site-paper);
  line-height: 1.8;
}

.site-spell > strong {
  font-size: 1.2em;
}

.site-spell__line {
  font-size: 0.95em;
}

/* session.html: narration as plain paragraphs, each spoken line with its speaker, and the notes after a scene. */
.site-story p {
  max-width: 40em;
}

.site-line {
  margin: 0.2em 0;
  padding-inline-start: 0.9em;
  border-inline-start: 2px solid var(--site-border);
}

.site-line b {
  color: var(--site-accent);
}

/* A Persian term quoted in an English original reads as one unit; wrapped inside, its words land in reverse order */
.site-fa [data-i18n-original] bdi {
  white-space: nowrap;
}

.site-notes {
  max-width: 40em;
  margin-top: 1.25em;
  padding: 0.8em 1em;
  border-radius: 12px;
  border-inline-start: 3px solid var(--site-accent);
  background: var(--site-paper);
  font-size: 0.92em;
}

/* A pattern a note teaches, as a sum: the parts are underlined, the result stands apart. */
.site-notes .site-notes__pattern {
  margin: 0.6em 0;
  color: var(--site-ink);
}

.site-notes__pattern b {
  border-bottom: 2px dotted var(--site-accent);
}

/* Two short columns, each with a small label above its words. */
.site-notes__split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10em, 100%), 1fr));
  gap: 0.6em;
  margin: 0.6em 0;
}

.site-notes__split[hidden] {
  display: none;
}

.site-notes__split > div {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  padding: 0.5em 0.8em;
  border: 1px dashed var(--site-border);
  border-radius: 8px;
}

.site-notes__split b {
  align-self: flex-start;
}

.site-notes__caption {
  color: var(--site-muted);
  font-size: 0.85em;
}

.site-notes .site-notes__quote {
  margin: 0.6em 0;
  padding: 0 0.9em;
  border-inline-start: 2px solid var(--site-border);
  color: var(--site-ink);
  font-size: 1em;
}

.site-notes .site-notes__quote[hidden] {
  display: none;
}

.site-notes > strong {
  display: block;
  margin-bottom: 0.3em;
  color: var(--site-accent);
}

.site-notes p {
  margin: 0.5em 0 0;
  color: var(--site-muted);
}

.site-cast p {
  margin: 0.15em 0;
}

/* -------------------------------------------- */
/* Translation progress, one bar per collection (js/site-pages.js) */

.site-fa__progress {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: center;
  gap: 0.35em 0.75em;
  margin: 0.5em 0 0.25em;
  line-height: 1.6;
}

.site-fa__bar {
  height: 0.55em;
  border-radius: 99px;
  background: color-mix(in srgb, var(--site-ink) 12%, transparent);
  overflow: hidden;
}

.site-fa__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--site-accent);
}

.site-fa__percent {
  min-width: 3.2em;
  color: var(--site-muted);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

/* -------------------------------------------- */
/* The term cheat sheet (guide.html), filled from the pack's glossary by js/site-pages.js */

.site-fa__search {
  width: 100%;
  max-width: 24em;
  margin: 0.25em 0 1em;
  padding: 0.35em 0.9em;
  border: 1px solid var(--site-border);
  border-radius: 10px;
  background: var(--site-paper);
  color: var(--site-ink);
  font: inherit;
}

.site-fa__search:focus-visible {
  border-color: var(--site-accent);
  outline: 2px solid color-mix(in srgb, var(--site-accent) 25%, transparent);
}

.site-fa__terms {
  columns: 16em auto;
  column-gap: 2em;
}

.site-fa__group {
  break-inside: avoid;
  margin-bottom: 1.25em;
}

.site-fa__group h3 {
  margin-top: 0;
  color: var(--site-accent);
  font-size: 1em;
}

.site-fa__group dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.1em 1em;
  margin: 0;
  line-height: 1.8;
}

.site-fa__group dt {
  font-weight: 600;
}

.site-fa__group dd {
  margin: 0;
  color: var(--site-muted);
  direction: ltr;
  text-align: right;
}

/* -------------------------------------------- */
/* The tools page: a drawing of the language tools, so the text can point at them, and a plain button */

.site-fa__tools {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.5em;
  border-radius: 10px;
  background: var(--site-paper);
  vertical-align: middle;
}

.site-fa__tool {
  display: inline-grid;
  place-items: center;
  min-width: 2em;
  height: 2em;
  padding: 0 0.4em;
  border: 1px solid var(--site-border);
  border-radius: 8px;
  font-weight: 700;
  direction: ltr;
}

.site-fa__button {
  padding: 0.3em 1.2em;
  border: 0;
  border-radius: 999px;
  background: var(--site-accent);
  color: var(--site-accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.site-fa__button:hover,
.site-fa__button:focus-visible {
  filter: brightness(1.08);
}

.site-fa__disclaimer {
  max-width: 48em;
  margin: 2em auto 0;
  color: var(--site-muted);
  font-size: 0.85em;
  text-align: center;
}

/* -------------------------------------------- */
/*
 * about.html stands alone (no fork scripts or stylesheets, since signed-out visitors cannot load the language pack the
 * fork's interface needs), so it draws its own slim bar where the fork's navbar would be.
 */
.site-standalone {
  margin: 0;
  background: var(--site-paper);
  color: var(--site-ink);
  font-family: Vazirmatn, system-ui, sans-serif;
  font-size: 16px;
}

.site-standalone__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5em 1em;
  max-width: 48em;
  margin: 0 auto;
  padding: 0.9em 1em;
}

.site-standalone__bar a {
  color: var(--site-accent);
}

.site-standalone .site-standalone__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--site-ink);
  font-size: 1.15em;
  font-weight: 800;
  text-decoration: none;
}

.site-standalone__brand span {
  color: var(--site-accent);
}

.site-standalone__links {
  display: flex;
  gap: 0.4em;
  font-size: 0.9em;
  white-space: nowrap;
}

/* Chips rather than bare underlined words, so each link is a finger-sized target on a phone. */
.site-standalone__links a {
  padding: 0.35em 0.85em;
  border-radius: 999px;
  background: color-mix(in srgb, var(--site-accent) 10%, transparent);
  text-decoration: none;
}

.site-standalone__links a:hover,
.site-standalone__links a:focus-visible {
  background: color-mix(in srgb, var(--site-accent) 18%, transparent);
}

.site-standalone__main {
  max-width: 52em;
  margin: 0 auto;
  padding: 0 1em 3em;
}

@media (max-width: 48em) {
  /* A phone is too narrow for the full-size brand and both links on one line; a wrapped link row hangs off one side
     of the bar, so the bar shrinks to keep a single row */
  .site-standalone__bar {
    flex-wrap: nowrap;
    gap: 0.5em;
    padding: 0.75em;
  }

  .site-standalone .site-standalone__brand {
    gap: 0.35em;
    font-size: 1em;
  }

  .site-standalone__brand img {
    width: 24px;
    height: 24px;
  }

  .site-standalone__links {
    gap: 0.3em;
    font-size: 0.82em;
  }

  .site-standalone__links a {
    padding: 0.45em 0.7em;
  }

  .site-page {
    padding-inline: 0.75em;
    border-radius: 0;
  }

  /* Inside a page's container (the homepage block) the page reaches the screen edges past the container's padding;
     a page that is the container itself already spans the screen */
  .site-page:not(.container) {
    margin-inline: -15px;
  }

  /* The homepage's <main> is a flex item without a width, and below Bootstrap's breakpoint its container has none
     either, so it would grow to the block's longest unwrapped line instead of the screen's width */
  .container:has(> .site-page:not(.container)) {
    width: 100%;
    min-width: 0;
  }

  .site-card {
    padding: 1em 1.1em;
  }

  .site-hero h1,
  .site-hero h2 {
    font-size: 1.9em;
  }
}

/* The narrowest phones cannot fit even the shrunken bar on one line, so the brand and the links stack, both centered */
@media (max-width: 22em) {
  .site-standalone__bar {
    flex-direction: column;
  }
}
