/* Stylesheet of the public site: ONE file for German (left to right) and Arabic (right to left).

   Design system of WP-26 (docs/workpackages/WP-26/design-system/): the custom properties below are its tokens (tokens.css,
   same names as tokens.json and tokens.dtcg.json, so that the app takes the same values), the rules are its reference
   stylesheet components.css with the class names of the page (version 2, 2026-10-19). Calm and readable like a well set
   book, in a setting of today: Source Serif 4 for reading, Public Sans for the interface, Noto Naskh Arabic for Arabic text
   and Noto Sans Arabic for the Arabic interface; ink blue (accent) means "can be used", green (verse) the Qur'an, gold
   (ornament) orders, yellow (mark) shows a hit. The ornaments: the double rule (jadwal) around a verse block, the ornate
   brackets around a verse in a German sentence, and the eight-pointed star once at the end of an answer.

   Design handover 2.1 (docs/workpackages/WP-26/design-v2.1/, WP-26b): the header (magnifier, menu of a phone), the footer, the start
   page, the patterns "label", "head of a section" and "row of a list", the side margin of 20 px on a phone. The sizes are the
   handover's, written as it writes them (the values are px there; here in rem where they are text, in px where they are boxes);
   where the stylesheet has a derived value instead of a token (--gutter, --display-size) it says so at the top of the file.
   WP-26c set the fatwa pages the same way: the head, the rail (contents, tools, terms), "Frage" and "Antwort", the margin of the
   paragraphs with the number and the mark of the Arabic paragraph, the signature, the related questions and the note at the end.

   Everything that depends on the reading direction is written with logical properties (margin-inline-start,
   padding-block, inset-inline-start, text-align: start, ...), so the same rule mirrors itself under dir="rtl".
   public/tests/test_css.py fails on physical sides in the rules.

   Mobile first: the base rules are made for a 375 px wide screen; media queries widen (min-width, and min-height for the rail
   of a fatwa, which sticks only in a window that is high enough), and the page header answers to its own width (container
   query). The one query that narrows is the breadcrumb on a phone (max-width: 47.99em, a way back of one step; test_css.py
   names it). No build step. */


/* --- Fonts ----------------------------------------------------------------------------------------------------- */

/* Served from this host, never from Google: a request to a font service would hand the reader's address to a third party.
   All four are under the SIL Open Font License 1.1 (the licence files are next to the fonts). Variable fonts for the
   weights, split by script as the Fontsource packages ship them, the files unchanged; a page downloads only the parts
   whose characters it shows (unicode-range): the Latin extension carries the transliteration (ā ī ū ḥ ṣ ḍ ṭ ẓ ʿ ʾ), the
   Arabic parts of the two Noto faces only come where Arabic text is. Source Serif 4 has the axis "optical size" (opsz
   8 to 60; font-optical-sizing: auto on the body): fine titles, strong reading text. Public Sans has no ʿ and ʾ, so the
   transliteration is always set in the reading face (class .translit). Until a file has arrived, or where it fails, the
   system faces of the stacks below take over (font-display: swap).

     Source Serif 4 (fonts/OFL-Source-Serif-4.txt)       @fontsource-variable/source-serif-4 5.3.1 (opsz), upright and italic
     Public Sans (fonts/OFL-Public-Sans.txt)             @fontsource-variable/public-sans 5.3.0, upright
     Noto Sans Arabic (fonts/OFL-Noto-Sans-Arabic.txt)   @fontsource-variable/noto-sans-arabic 5.3.0, its Arabic part only
     Noto Naskh Arabic (fonts/OFL.txt)                   @fontsource-variable/noto-naskh-arabic, its Arabic part only */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, 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: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-opsz-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, 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: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-opsz-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/public-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Only their Arabic parts: Latin letters and digits inside Arabic text stay with the next font of the stack. */
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/noto-sans-arabic-arabic-wght-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011,
    U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/noto-naskh-arabic-arabic-wght-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011,
    U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}


/* --- Tokens ---------------------------------------------------------------------------------------------------- */

/* The tokens of the design system, version 2 (tokens.css). Without a choice the system decides (light or dark);
   data-theme="light", "dark" or "sepia" on <html> (the reader's choice, prefs.js) forces a scheme. Every pair of text and
   background holds 4.5:1 in all three schemes (the formula 7:1), the lines of controls, the focus ring and the ornament
   3:1 (checked in test_css.py). */
:root {
  color-scheme: light dark;
  --background: #f6f5f1;
  --surface: #ffffff;
  --tint: #eeece5;
  --ink: #17191c;
  --ink-muted: #555a61;
  --rule: #e1ded5;
  --rule-strong: #85888d;
  --accent: #2b4b8c;
  --accent-strong: #1c3366;
  --on-accent: #ffffff;
  --focus: #b04a00;
  --verse: #1d5a47;
  --ornament: #a2803a;
  --ornament-ink: #6f5320;
  --formula: #4f4a42;
  --mark: #f6de8a;
  --reviewed: #1d5a47;
  --reviewed-tint: #dcebe3;
  --machine: #5e3d00;
  --machine-tint: #f6e6c2;
  --error: #9b2c1f;
  --error-tint: #f8e1dc;
  --shadow-pop: 0 1px 2px rgba(23, 25, 28, 0.08), 0 12px 32px rgba(23, 25, 28, 0.12);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 999px;
  --reading-width: 40rem;
  --fatwa-width: 44rem;
  --rail-width: 13rem;
  --page-width: 72rem;
  --tap-target: 44px;
  --focus-width: 3px;
  --scale-small: 0.9;
  --scale-large: 1.2;
  --font-text: "Source Serif 4", Charter, "Sitka Text", Cambria, Georgia, serif;
  --font-ui: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-arabic: "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", Amiri, serif;
  --font-arabic-ui: "Noto Sans Arabic", "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) {
    color-scheme: dark;
    --background: #111215;
    --surface: #191b1f;
    --tint: #212429;
    --ink: #ebeae5;
    --ink-muted: #a4a8af;
    --rule: #2b2e34;
    --rule-strong: #6e727a;
    --accent: #9fb6f5;
    --accent-strong: #c5d3fb;
    --on-accent: #0d1733;
    --focus: #f0b75a;
    --verse: #8ccfb3;
    --ornament: #b18f4b;
    --ornament-ink: #d8b56e;
    --formula: #cdc6b8;
    --mark: #5c4b10;
    --reviewed: #8ccfb3;
    --reviewed-tint: #193329;
    --machine: #f1cf86;
    --machine-tint: #3b2e12;
    --error: #f2a493;
    --error-tint: #3e1d17;
    --shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.50), 0 12px 32px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #111215;
  --surface: #191b1f;
  --tint: #212429;
  --ink: #ebeae5;
  --ink-muted: #a4a8af;
  --rule: #2b2e34;
  --rule-strong: #6e727a;
  --accent: #9fb6f5;
  --accent-strong: #c5d3fb;
  --on-accent: #0d1733;
  --focus: #f0b75a;
  --verse: #8ccfb3;
  --ornament: #b18f4b;
  --ornament-ink: #d8b56e;
  --formula: #cdc6b8;
  --mark: #5c4b10;
  --reviewed: #8ccfb3;
  --reviewed-tint: #193329;
  --machine: #f1cf86;
  --machine-tint: #3b2e12;
  --error: #f2a493;
  --error-tint: #3e1d17;
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.50), 0 12px 32px rgba(0, 0, 0, 0.55);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="sepia"] {
  color-scheme: light;
  --background: #f1e9d6;
  --surface: #f8f2e3;
  --tint: #e7dcc3;
  --ink: #2c2417;
  --ink-muted: #5a4c33;
  --rule: #d8caa7;
  --rule-strong: #8a7850;
  --accent: #2a4580;
  --accent-strong: #1b2f5c;
  --on-accent: #ffffff;
  --focus: #8f4500;
  --verse: #1c5240;
  --ornament: #92712d;
  --ornament-ink: #664c16;
  --formula: #4f4231;
  --mark: #ead079;
  --reviewed: #1c5240;
  --reviewed-tint: #d7e2c9;
  --machine: #573800;
  --machine-tint: #ecd7a4;
  --error: #8e2a1c;
  --error-tint: #f1d6c8;
  --shadow-pop: 0 1px 2px rgba(44, 36, 23, 0.10), 0 12px 32px rgba(44, 36, 23, 0.14);
}

/* Derived values (no tokens of their own: the design handover 2.1 names the sizes, not tokens). The size of the text that is read
   follows the reading setting (prefs.js sets data-size). The side margin of a page is 20px on a phone (24px from 48em), the title
   of the start page 42px on a phone, 56px from 48em and 68px from 64em, where it stands beside the fatwa of the day. The question of
   a fatwa is 22px on a phone and 27px from 48em; the column of the fatwa text is 680px (--reading-width and --fatwa-width stay: other
   pages use them). */
:root {
  --gutter: 20px;
  --display-size: 2.625rem;
  --text-size: 1.125rem;
  --text-leading: 1.62;
  --question-size: 1.375rem;
  --fatwa-text-width: 42.5rem;
  --term-line: 1.5px dotted var(--rule-strong);
  --ui-size: 1rem;
  --read-scale: 1;
  --jadwal: 3px double var(--ornament);
}

:root[data-size="small"] {
  --read-scale: var(--scale-small);
}

:root[data-size="large"] {
  --read-scale: var(--scale-large);
}

/* Arabic needs more room than Latin type: a larger size and a taller line, Naskh in the interface too. */
html[lang="ar"] {
  --font-text: var(--font-arabic);
  --font-ui: var(--font-arabic-ui);
  --text-size: 1.25rem;
  --text-leading: 1.9;
  --ui-size: 1rem;
}

@media (min-width: 48em) {
  :root {
    --gutter: var(--space-5);
    --display-size: 3.5rem;
    --text-size: 1.1875rem;
    --text-leading: 1.66;
    --question-size: 1.6875rem;
  }

  html[lang="ar"] {
    --text-size: 1.3125rem;
  }
}

@media (min-width: 64em) {
  :root {
    --display-size: 4.25rem;
  }
}


/* --- Base ------------------------------------------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-size);
  line-height: var(--text-leading);
  /* A long word or URL wraps instead of widening the page (no sideways scrolling). */
  overflow-wrap: break-word;
  font-optical-sizing: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.2;
  text-wrap: balance;
}

html[lang="ar"] :is(h1, h2, h3) {
  letter-spacing: 0;
  font-weight: 700;
  line-height: 1.6;
}

p {
  text-wrap: pretty;
  margin-block: 0 1em;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

/* The focus ring lies 3px off the element, on the background: never on accent. */
:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* An Arabic passage inside a German page (a category without German name, a citation). */
[lang="ar"] {
  font-family: var(--font-arabic);
}

.container {
  width: min(100% - 2 * var(--gutter), var(--page-width));
  margin-inline: auto;
}

/* Text for screen readers only: the labels of the search fields, the name of a link that the stylesheet stretches over a row.
   With JavaScript the bracket of "Umschrift (Erklärung)" too (task 27, the class "js" from prefs.js): screen readers still read
   it, the note of the term shows it, the printout has it back in the text (see Print). */
.visually-hidden,
.js .gloss {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: var(--gutter);
  z-index: 50;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-ui);
  font-size: var(--ui-size);
  text-decoration: none;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: none;
}


/* --- Page frame: header, main, footer (design handover 2.1) -------------------------------------------------- */

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.site-main {
  flex: 1;
  padding-block: var(--space-5) var(--space-7);
}

/* The start page sets its own spaces (the entry has its padding, the last section its end): <main> gives it none. */
.site-main:has(> .home) {
  padding-block: 0;
}

/* The header answers to its own width (a container query). Narrow, a phone: 56px, the brand, the other language as a word and
   the button of the menu, a <details> whose sheet opens under the header (no script needed). From 48rem: 64px, the brand, three
   entries, and on the end side the magnifier (a link to the search page) and the two languages. */
.site-header {
  container: header / inline-size;
  position: relative;
  border-block-end: 1px solid var(--rule);
  background: var(--background);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: normal;
}

.header-inner {
  display: flex;
  align-items: center;
  min-block-size: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-block-size: var(--tap-target);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: normal;
  text-decoration: none;
}

.brand:hover {
  color: var(--accent-strong);
}

html[lang="ar"] .brand {
  letter-spacing: 0;
}

/* The eight-pointed star: an upright square and the same one turned by 45 degrees, in the colour of use. Decorative. */
.brand-mark {
  position: relative;
  flex: none;
  inline-size: 16px;
  block-size: 16px;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--accent);
}

.brand-mark::after {
  transform: rotate(45deg);
}

.main-nav ul,
.lang-switch ul,
.footer-nav ul,
.footer-legal ul,
.chips,
.letters ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The entries are for a wide header; a phone has the menu. The current page and its area stand in ink, there is no bar. */
.main-nav {
  display: none;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap-target);
  color: var(--ink-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current] {
  color: var(--ink);
}

.header-tools {
  display: flex;
  align-items: center;
  margin-inline-start: auto;
}

/* The magnifier leads to the search page; a phone has "Suche" in the menu. */
.header-lupe {
  display: none;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  color: var(--ink-muted);
}

.header-lupe:hover {
  color: var(--ink);
}

/* The two languages. A phone shows the other one only, as a word; a wide header shows both with a rule between them: the current one
   in ink and bold, the other a link. */
.lang-switch ul {
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-3);
}

.lang-switch li {
  display: inline-flex;
  align-items: center;
}

.lang-switch .is-current {
  display: none;
}

.lang-switch a,
.lang-switch span {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap-target);
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch a {
  padding-inline: 10px;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.lang-switch a:hover {
  color: var(--ink);
}

.lang-switch span {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* The Arabic name is one word on every German page: it is set in the system fonts (the stack of --font-arabic-ui without
   Noto Naskh Arabic), so that no German page has to download the Arabic web font for it. */
.lang-switch [lang="ar"] {
  font-family: "Geeza Pro", "Segoe UI", Tahoma, system-ui, "Traditional Arabic", sans-serif;
  font-size: 0.9375rem;
}

html[lang="ar"] .lang-switch [lang="de"] {
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.92em;
}

/* No counterpart of this page in that language: the link goes to its start page. It says so in words under the name
   ("Startseite" / "الرئيسية", in the language of the page), where the dotted line with a title explained nothing on a phone
   (a title shows on hover only). The note is part of the link, so it is read with the name; the title stays for the mouse. It sits
   inside the 44 px of the link: the header does not grow. */
.lang-switch a.is-fallback {
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.lang-switch .lang-note {
  display: block;
  min-height: 0;
  color: inherit;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 400;
}

/* The menu of a phone: a button of 44 px with two bars (a cross while the sheet is open), the sheet under the header over the full
   width. The sheet hangs from the header (which is its containing block), not from the narrow column of the page. */
.menu {
  margin-inline-end: calc(8px - var(--gutter));
}

.menu-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  inline-size: var(--tap-target);
  block-size: var(--tap-target);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.menu-button::-webkit-details-marker {
  display: none;
}

.menu-button::before,
.menu-button::after {
  content: "";
  inline-size: 18px;
  block-size: 1.5px;
  background: currentColor;
}

.menu[open] > .menu-button::before {
  transform: translateY(3.25px) rotate(45deg);
}

.menu[open] > .menu-button::after {
  transform: translateY(-3.25px) rotate(-45deg);
}

.menu-panel {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 100%;
  z-index: 40;
  border-block-end: 1px solid var(--rule);
  background: var(--background);
  box-shadow: var(--shadow-pop);
}

.menu-panel ul {
  margin: 0;
  padding: 0 var(--gutter);
  list-style: none;
}

.menu-panel a {
  display: flex;
  align-items: center;
  min-block-size: 48px;
  border-block-start: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
}

.menu-panel a:hover {
  color: var(--accent);
}

.menu-panel a[aria-current] {
  font-weight: 600;
}

@container header (min-width: 48rem) {
  .header-inner {
    min-block-size: 64px;
    gap: 44px;
  }

  .brand {
    gap: 10px;
    font-size: 1.3125rem;
  }

  .brand-mark {
    inline-size: 18px;
    block-size: 18px;
  }

  .brand-mark::before,
  .brand-mark::after {
    inset: 2.5px;
  }

  .main-nav {
    display: block;
  }

  .main-nav ul {
    gap: 28px;
  }

  .header-tools {
    gap: 20px;
  }

  .header-lupe {
    display: grid;
  }

  .lang-switch li + li::before {
    content: "";
    display: inline-block;
    inline-size: 1px;
    block-size: 16px;
    margin-inline-end: var(--space-3);
    background: var(--rule-strong);
    vertical-align: middle;
  }

  .lang-switch .is-current {
    display: inline-flex;
  }

  .lang-switch a {
    padding-inline: 0;
  }

  .menu {
    display: none;
  }
}

/* The footer: a first row of the name and the legal pages (as in the handover), under it, quieter and in the same type, the pages the
   handover does not know and the site keeps, the source, and the note about the translations. A link of a phone is 44 px high; the
   negative margin keeps the rows as close as the handover has them. */
.site-footer {
  border-block-start: 1px solid var(--rule);
  background: var(--background);
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: normal;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-block: 24px 40px;
}

.footer-main,
.footer-more {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-name,
.footer-source,
.footer-note {
  margin: 0;
}

.footer-legal ul,
.footer-nav ul {
  gap: 0 20px;
}

.footer-legal a,
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap-target);
  color: inherit;
  text-decoration: none;
}

/* The two legal links stay on one line, so their 44 px do not need room of their own. The quiet row may wrap to several lines on a
   phone: there each link keeps its 44 px in the line. */
.footer-legal a {
  margin-block: -14px;
}

.footer-legal a:hover,
.footer-nav a:hover {
  color: var(--ink);
}

/* The address of the source is Latin text in an Arabic sentence too. */
.footer-source a {
  color: inherit;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.25em;
}

.footer-source a:hover {
  color: var(--ink);
}

.footer-source a[dir="ltr"] {
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.footer-note {
  max-width: 46rem;
  line-height: 1.55;
}

@media (min-width: 48em) {
  .footer-inner {
    gap: 16px;
    padding-block: 32px 48px;
  }

  .footer-main,
  .footer-more {
    flex-flow: row wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2) var(--space-5);
  }

  .footer-legal ul,
  .footer-nav ul {
    column-gap: 24px;
  }

  .footer-legal a,
  .footer-nav a {
    min-block-size: 24px;
    margin-block: -4px;
  }
}


/* --- Search: field, suggestions, hits (WP-15, WP-26) ------------------------------------------------------------ */

/* The form is the same markup in the header and on the search page. The input runs in the direction of the page (the dir
   attribute is set by the template), so Arabic is typed right to left and the placeholder sits at the right. */
.search-form {
  position: relative;
  display: flex;
  gap: var(--space-2);
  margin: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap-target);
  padding-inline: var(--space-4);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--ui-size);
}

.search-input::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

.search-input:focus-visible {
  border-color: var(--accent);
}

.search-submit,
.button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-target);
  padding-inline: var(--space-5);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-ui);
  font-size: var(--ui-size);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.search-submit:hover,
.button:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.button-quiet {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  color: var(--accent-strong);
}

.button-quiet:hover {
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-strong);
}

/* The search page: the form is the main thing there, so it is a little larger and no wider than a line of text. (The header has
   no field since the design handover 2.1: a magnifier leads here. The field of the start page is under "Start page" below.) */
.search-panel {
  max-width: var(--reading-width);
}

.search-panel .search-input,
.search-panel .search-submit {
  min-height: 3.25rem;
  font-size: 1.0625rem;
}

/* Suggestions while typing (suggest.js). The list opens under the field and is part of the form. */
.suggest-list {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(100% + var(--space-1));
  z-index: 30;
  margin: 0;
  padding: var(--space-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-family: var(--font-ui);
  list-style: none;
}

.suggest-list[hidden] {
  display: none;
}

.suggest-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
}

.suggest-list [aria-selected="true"] a,
.suggest-list a:hover {
  background: var(--tint);
}

.suggest-hint {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.search-summary {
  margin-block: var(--space-5) var(--space-1);
  font-family: var(--font-ui);
  font-size: var(--ui-size);
}

.search-note {
  margin-block: var(--space-1) 0;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
}

.search-panel + .notice {
  margin-block-start: var(--space-5);
}

.search-summary + .notice,
.search-note + .notice {
  margin-block-start: var(--space-4);
}

/* The filter by topic: one row that scrolls sideways in its own box on every width (three dozen topics would fill five
   rows). The padding keeps the focus ring inside the box, the negative margin keeps the first chip in line with the text.
   The row runs out at its end edge (a mask; only the alpha of its colour counts), so a chip cut off there says "more".
   The room at the end is as wide as the fade, so the last chip lies clear of it once the row is scrolled to the end (also
   when it is focused: scroll-padding). */
.topics {
  margin-block: var(--space-4) var(--space-5);
}

.topics .chips {
  --chips-fade: 2.5rem;
  --chips-fade-to: right;
  flex-wrap: nowrap;
  margin-inline: calc(-1 * var(--space-2));
  padding: var(--space-2);
  padding-inline-end: var(--chips-fade);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline-end: var(--chips-fade);
  scrollbar-width: thin;
  mask-image: linear-gradient(to var(--chips-fade-to), var(--ink) calc(100% - var(--chips-fade)), transparent);
}

html[dir="rtl"] .topics .chips {
  --chips-fade-to: left;
}

.topics .chips a {
  white-space: nowrap;
}

.search-results {
  margin-block-start: var(--space-3);
}

/* The words of the query in a title and a snippet: a warm tone, the text keeps the ink (contrast of ink on mark checked
   in test_css.py); the mark follows a word that wraps onto the next line. */
mark {
  padding-inline: 0.12em;
  border-radius: var(--radius-sm);
  background: var(--mark);
  color: var(--ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}


/* --- Breadcrumb, head of a list page, pager (WP-14) ------------------------------------------------------------ */

.breadcrumb {
  margin-block-end: var(--space-3);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.4;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

/* The separator is a slash, the same in both directions. */
.breadcrumb li + li::before {
  content: "/";
  margin-inline: var(--space-2);
  color: var(--rule-strong);
}

/* On a phone only the way one step back ("‹ Ratschläge und Hinweise"). The arrow is U+2039 in both directions: it is a
   mirrored character (Bidi_Mirrored), so the browser draws it as "›" in a line that runs right to left, and in both
   languages it points to the start side, away from the text. (U+203A for Arabic would be drawn as "‹": inwards.) */
@media (max-width: 47.99em) {
  .breadcrumb li {
    display: none;
  }

  .breadcrumb li:nth-last-child(2) {
    display: inline-flex;
  }

  .breadcrumb li:nth-last-child(2)::before {
    content: "\2039";
    margin-inline: 0 var(--space-2);
    color: var(--accent);
  }

  .breadcrumb li:nth-last-child(2) a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-target);
    padding-block: 0;
    color: var(--accent);
    text-decoration: none;
  }

  /* The breadcrumb of a fatwa ends with the category (the title below is the page): the way back is the last step, in the muted ink of the
     handover. */
  .breadcrumb--up li:nth-last-child(2):not(:last-child) {
    display: none;
  }

  .breadcrumb--up li:last-child {
    display: inline-flex;
  }

  .breadcrumb--up li:last-child::before {
    content: "\2039";
    margin-inline: 0 4px;
    color: var(--ink-muted);
  }

  .breadcrumb--up li:last-child a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-target);
    padding-block: 0;
    margin-block: 0;
    color: var(--ink-muted);
    text-decoration: none;
  }
}

.breadcrumb a {
  padding-block: var(--space-2);
  color: var(--ink-muted);
  text-decoration-color: var(--rule-strong);
}

.breadcrumb a:hover {
  color: var(--accent-strong);
}

/* The last step is the page itself and may be long. */
.breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The breadcrumb of a fatwa (design handover 2.1): the steps in the muted ink, the slash in it too and 10px to each side, no
   underline; the hover is ink. The room to tap is padding that the margin takes back, so the line stays as high as the type. */
.breadcrumb--up {
  margin-block-end: 0;
  color: var(--ink-muted);
  line-height: normal;
}

.breadcrumb--up li + li::before {
  margin-inline: 10px;
  color: var(--ink-muted);
}

.breadcrumb--up a {
  padding-block: 4px;
  margin-block: -4px;
  text-decoration: none;
}

.breadcrumb--up a:hover {
  color: var(--ink);
}

.page-head {
  margin-block-end: var(--space-6);
}

.page-head h1,
.page > h1 {
  max-width: 28ch;
  font-size: clamp(1.9375rem, 1.2rem + 2.4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.08;
}

html[lang="ar"] :is(.page-head h1, .page > h1) {
  letter-spacing: 0;
  line-height: 1.6;
}

.page > h1 {
  margin-block-end: var(--space-4);
}

.lead {
  max-width: var(--reading-width);
  margin-block: var(--space-3) 0;
  color: var(--ink-muted);
  font-size: 1.0625em;
}

.pager {
  margin-block-start: var(--space-6);
  font-family: var(--font-ui);
}

.pager-status {
  margin-block: 0 var(--space-3);
  color: var(--ink-muted);
  font-size: 0.875rem;
  text-align: center;
}

.pager-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager-list a,
.pager-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-target);
  min-height: var(--tap-target);
  padding-inline: var(--space-2);
  border-radius: var(--radius-md);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.pager-list a {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  color: var(--ink);
}

.pager-list a:hover {
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-strong);
}

.pager-current {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.pager-gap {
  min-width: 1rem;
  color: var(--ink-muted);
  text-align: center;
}

/* No link at the first page (previous) and the last page (next): the empty item must not leave a gap behind. */
.pager-step:empty {
  display: none;
}

/* On a phone the pager is "previous, first page, current page, last page, next" in one row, with "…" where pages are left
   out (a list of 124 pages does not fit otherwise; public/paging.py marks the items "on-phone"); the numbers around the
   current page come with the wider screens. */
.pager-num {
  display: none;
}

.pager-num.on-phone {
  display: list-item;
}

/* The row fits 375 px also with three-digit pages ("Zurück 1 … 103 … 124 Weiter"): on a phone the numbers keep the size
   of a tap target, but with less padding, and the gaps are narrower; the wider screens have the full sizes. */
.pager-num a,
.pager-current {
  padding-inline: var(--space-1);
}


/* --- Categories: cards and tree (WP-14) ------------------------------------------------------------------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 0 var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Name and count on one line: compact on a phone, where a few dozen categories otherwise make a very long page. */
.category-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  height: 100%;
  min-height: var(--tap-target);
  padding: var(--space-3) 0;
  border-block-end: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}

.category-card:hover {
  border-block-end-color: var(--accent);
  color: var(--accent-strong);
}

.category-name {
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
}

/* A name wraps between words and never in the middle of an ordinary word ("un-gültig", "Eigenschaf-ten" in a narrow
   column). Only a very long word may be hyphenated (20 letters and more: "Charaktereigenschaften" is 22 and wider than the
   name in the four columns of a desktop); the browsers that cannot limit it (Safari) do not hyphenate at all, and such a
   word then breaks at the edge by the rule of the body. */
@supports (hyphenate-limit-chars: 20 5 5) {
  .category-name {
    hyphens: auto;
    hyphenate-limit-chars: 20 5 5;
  }
}

.category-count,
.tree-count {
  flex: none;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A card per top-level category. Its subcategories open inside it (<details>), indented by a line on the start side.
   The arrow in front of a name opens the branch, the name itself is a link to the category page. */
.tree {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree-root > .tree {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-2) var(--space-4);
  align-items: start;
}

.tree-root > .tree > .tree-item {
  --tree-inset: 0;
  padding-inline: 0;
  border-block-start: 1px solid var(--rule);
}

.tree .tree {
  margin-block: 0 var(--space-2);
  margin-inline-start: 1.1rem;
  padding-inline-start: var(--space-3);
  border-inline-start: 1px solid var(--rule);
}

.tree-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap-target);
}

/* The box in front of every row: the room of the arrow, the same for a leaf, so names line up. The arrow of a branch is
   drawn by its toggle (a <summary> after the row), which lies over that room. */
.tree-row::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-inline: 0.6rem;
}

.tree-item--branch {
  position: relative;
}

.tree-toggle {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: var(--tree-inset, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 1.75rem;
  block-size: var(--tap-target);
  list-style: none;
  cursor: pointer;
}

.tree-toggle::-webkit-details-marker {
  display: none;
}

.tree-toggle::before {
  content: "";
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-block-end: 2px solid var(--accent);
  border-inline-end: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.tree-branch[open] > .tree-toggle::before {
  transform: rotate(45deg);
}

/* The corner of the arrow sits on the other side in a right-to-left page, so the turns are mirrored. */
html[dir="rtl"] .tree-toggle::before {
  transform: rotate(45deg);
}

html[dir="rtl"] .tree-branch[open] > .tree-toggle::before {
  transform: rotate(-45deg);
}

.tree-name {
  min-width: 0;
  padding-block: var(--space-1);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.tree .tree .tree-name {
  font-weight: 400;
}

.tree-name:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.tree-count {
  margin-inline-start: auto;
}


/* --- Fatwa: frame, head, standing (WP-14, WP-26, design handover 2.1 / WP-26c) -------------------------------------- */

/* The spaces of the page: 8px under the header on a phone (the way back has 44px of its own), 28px above and 120px below from 48em.
   <main> would give it more; it is the same rule as for the start page. */
.site-main:has(> .fatwa-page) {
  padding-block: 8px 56px;
}

/* The page is one column. Its parts have their place by `order`: the rail has no box of its own below 75em (display: contents), so
   its three blocks are children of the page, and the terms (the last block of the rail) close the page behind the related questions,
   as a closed line; the sources, the note and the printout follow. From 75em the rail stands beside the text (see the end of this
   block). The tools are one row under the head. */
.fatwa {
  display: flex;
  flex-direction: column;
  margin-block-start: 30px;
}

.fatwa > * {
  min-width: 0;
}

.fatwa-terms {
  order: 1;
}

.fatwa-foot,
.fatwa-feedback,
.print-foot {
  order: 2;
}

/* The rail beside the fatwa (the markup: <div class="fatwa-rail"> around the tools, which hold the contents, and the terms). Below
   75em it is no box: everything flows as on a phone. */
.fatwa-rail {
  display: contents;
}

/* The head: the label (number and category), the title, the standing and the dates. */
.fatwa-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fatwa-label {
  display: flex;
  gap: 16px;
  font-variant-numeric: normal;
}

/* A phone names the number only; from 48em the category stands next to it. */
.fatwa-category {
  display: none;
}

.fatwa-head h1 {
  font-size: 2.125rem;
  font-weight: 400;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.024em;
  line-height: 1.08;
}

html[lang="ar"] .fatwa-head h1 {
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.5;
}

/* The line under the title: the day of the publication, the minutes of reading and "Wie wir prüfen", small and muted (the owner,
   2026-11-13). Only a text published without a review (an old import) has a sign in front: over the line on a phone, in the same row
   from 48em. The sign says it in words and in its shape (dashed, a half circle); the colour only supports. */
.fatwa-standing {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  line-height: normal;
}

.standing-sign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 24px;
  padding-inline: 8px;
  border-radius: var(--radius-md);
  font-weight: 600;
  line-height: 1.35;
}

.standing-sign::before {
  content: "";
  flex: none;
}

.fatwa-standing--machine .standing-sign {
  border: 1px dashed var(--machine);
  background: var(--machine-tint);
  color: var(--machine);
}

.fatwa-standing--machine .standing-sign::before {
  inline-size: 10px;
  block-size: 10px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.fatwa-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
}

/* "Wie wir prüfen" and the link to the translation: muted like the line, a thin underline in the colour of the rules says it is a
   link; the accent on hover. The room to tap is padding that the margin takes back, so the line does not grow. */
.meta-link {
  padding-block: 4px;
  margin-block: -4px;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.meta-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

@media (min-width: 48em) {
  .site-main:has(> .fatwa-page) {
    padding-block: 28px 120px;
  }

  /* A tablet: one column as wide as the text and the room for the numbers in the margin (32px), left-aligned like the breadcrumb. */
  .fatwa {
    max-width: calc(var(--fatwa-text-width) + 32px);
    margin-block-start: 56px;
  }

  .fatwa-head {
    gap: 28px;
  }

  .fatwa-category {
    display: inline;
  }

  .fatwa-head h1 {
    font-size: 2.75rem;
    letter-spacing: -0.028em;
    line-height: 1.04;
  }

  .fatwa-standing {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
  }
}

@media (min-width: 64em) {
  .fatwa-head h1 {
    font-size: 3.5rem;
  }
}

/* From 75em the rail stands beside the fatwa: 208px, a gap of 112px, the text 680px (design handover 2.1). Its three blocks (contents,
   tools, terms) are 40px apart. The rail itself does not scroll (the menus of the tools reach out of it): the list of the paragraphs of a
   long fatwa and the list of the terms do, each in a box of its own. */
@media (min-width: 75em) {
  .fatwa {
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, var(--fatwa-text-width));
    column-gap: 112px;
    max-width: none;
    margin-block-start: 80px;
  }

  .fatwa > * {
    grid-column: 2;
  }

  .fatwa-rail {
    display: flex;
    flex-direction: column;
    gap: 40px;
    grid-column: 1;
    grid-row: 1 / span 12;
    align-self: start;
    padding-block-start: 8px;
  }
}

/* The rail runs along while one reads (24px from the top) - where it fits into the window. A stuck rail that is taller than the window
   is cut off at its bottom for good, so it sticks only from a window of 48rem, and the rail of a long fatwa (it has the list of the
   paragraphs) from 51.5rem; below that it scrolls away with the page and its two lists (the paragraphs, the terms) may be 24rem high.
   Stuck, they share the room that is left: 39.5rem is the rest of the rail (the blocks, the gaps, the head of the terms and some air at
   the bottom), 45% of what is left of the window go to the list of the paragraphs and 55% to the terms (a long fatwa without terms gives
   the list all of it). The Arabic page has the tools only, which fit into any window. */
@media (min-width: 75em) {
  .fatwa-ar .fatwa-rail {
    position: sticky;
    inset-block-start: 24px;
  }
}

@media (min-width: 75em) and (min-height: 48rem) {
  .fatwa:not(:has(.toc-list)) .fatwa-rail {
    position: sticky;
    inset-block-start: 24px;
  }

  .fatwa:not(:has(.toc-list)) .terms-box {
    max-block-size: max(11rem, calc(100vh - 39.5rem));
  }
}

@media (min-width: 75em) and (min-height: 51.5rem) {
  .fatwa:has(.toc-list) .fatwa-rail {
    position: sticky;
    inset-block-start: 24px;
  }

  .fatwa:has(.toc-list) .toc-list {
    max-block-size: max(6rem, calc((100vh - 39.5rem) * 0.45));
  }

  .fatwa:has(.toc-list) .terms-box {
    max-block-size: max(9rem, calc((100vh - 39.5rem) * 0.55));
  }

  .fatwa:has(.toc-list):not(:has(.fatwa-terms)) .toc-list {
    max-block-size: max(12rem, calc(100vh - 34.5rem));
  }
}

/* --- Tools: Arabic on, contents, share, more (save, cite, print, reading settings) (WP-26, design handover 2.1) ---------- */

/* ONE markup for the rail and for the row of a phone. Below 75em: a row of buttons (44px, 8px apart) under the head - "Arabisch" with a
   small switch, "Inhalt" (a menu with the sections), "Teilen" and "Mehr", which holds the rest in one menu; the menus float under the row.
   Without JavaScript the buttons that need it stay hidden (the attribute), the links and the menus (<details>) work. From 75em the same
   elements are the blocks "Inhalt" and "Lesen" of the rail (see the end of this block). */
.fatwa-tools {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block-start: 24px;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: normal;
}

/* The block "Lesen" has no box of its own below 75em: its buttons are cells of the row. Its head is for the rail. */
.rail-read {
  display: contents;
}

.rail-read > .rail-head {
  display: none;
}

.rail-toc {
  display: contents;
}

/* The labels of the blocks "Inhalt" and "Begriffe" are for the rail, where the browser keeps the <details> open (see the end of the
   block of the tools); a phone has the summary as a button or a line. */
.rail-toc > .rail-head,
.fatwa-terms > .rail-head {
  display: none;
}

.tool-arabic {
  order: 1;
}

.rail-toc > .toc {
  order: 2;
}

.tool-share {
  order: 3;
}

.tool-more {
  order: 4;
}

/* "Mehr" is a button of 44 by 44 with three dots (a fourth word would not fit the row at 375px); the word is for screen readers, a row of
   the rail shows it (see the end of this block). */
.tool-more > summary {
  justify-content: center;
  inline-size: var(--tap-target);
  padding-inline: 0;
}

.tool-more > summary::before {
  content: "";
  inline-size: 4px;
  block-size: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -7px 0 0 currentColor, 7px 0 0 currentColor;
}

.more-label {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The padding of a button is 14px (the handover); on a phone narrower than 375px it gives up to 2px on each side, so that the four
   buttons of the row still fit at 360px (a common width), where they would wrap with 14px. */
.tool,
.tool-menu > summary,
.toc > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-target);
  padding-inline: clamp(12px, calc(12px + (100vw - 360px) * 0.1333), 14px);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  list-style: none;
}

.tool-menu > summary::-webkit-details-marker,
.toc > summary::-webkit-details-marker {
  display: none;
}

.tool:hover,
.tool-menu > summary:hover,
.toc > summary:hover {
  background: var(--tint);
  color: var(--accent-strong);
}

.tool[aria-expanded="true"],
.tool[aria-pressed="true"],
.tool-menu[open] > summary,
.toc[open] > summary {
  border-color: var(--accent);
  background: var(--tint);
}

.tool[hidden] {
  display: none;
}

/* "Arabisch einblenden" shows its state as a switch (28 by 16 on a phone, 30 by 18 in the rail). A phone says "Arabisch" only. */
.tool-long {
  display: none;
}

.tool-arabic::after {
  content: "";
  flex: none;
  inline-size: 28px;
  block-size: 16px;
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1.5px var(--rule-strong);
  background: radial-gradient(circle at 8px 50%, var(--rule-strong) 0 4.5px, transparent 4.9px);
}

.tool-arabic[aria-expanded="true"]::after {
  box-shadow: none;
  background: radial-gradient(circle at calc(100% - 8px) 50%, var(--on-accent) 0 5px, transparent 5.4px) var(--accent);
}

html[dir="rtl"] .tool-arabic::after {
  background: radial-gradient(circle at calc(100% - 8px) 50%, var(--rule-strong) 0 4.5px, transparent 4.9px);
}

html[dir="rtl"] .tool-arabic[aria-expanded="true"]::after {
  background: radial-gradient(circle at 8px 50%, var(--on-accent) 0 5px, transparent 5.4px) var(--accent);
}

/* The menus float under the row. Share hangs at the end of its button (the third of the row: from its start the list would run out of
   a phone); the contents, "Mehr", the citation and the reading settings take the width of the row (up to 32rem). Without a script
   <details> opens them the same way. */
.tool-share {
  position: relative;
}

.tool-list,
.cite-box,
.settings-box,
.more-box,
.toc-box {
  position: absolute;
  inset-block-start: calc(100% + 4px);
  z-index: 20;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.tool-list {
  inset-inline-end: 0;
  display: grid;
  gap: 2px;
  min-width: 13rem;
  padding: var(--space-1);
  list-style: none;
}

/* "Teilen" is the third button of the row ("Arabisch", "Inhalt", "Teilen"), so its list hangs from the end of the button and stays in
   the window. Without the button "Arabisch" (a text that is not paired, no script, the Arabic page) the button stands further to the
   start and the list hangs from its start instead. */
.fatwa-tools:not(:has(.tool-arabic:not([hidden]))) .tool-list {
  inset-inline: 0 auto;
}

.tool-list a,
.tool-list .tool {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.75rem;
  padding-inline: var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
}

.tool-list a:hover,
.tool-list .tool:hover {
  background: var(--tint);
  color: var(--accent-strong);
}

/* "Link kopieren" and "Teilen …" need the script and carry the attribute hidden until it shows them; the row above must not win. */
.tool-list .tool[hidden] {
  display: none;
}

.cite-box,
.settings-box,
.more-box,
.toc-box {
  inset-inline: 0;
  max-width: 32rem;
  padding: var(--space-4);
}

.more-box {
  display: flex;
  flex-direction: column;
  padding: var(--space-1);
}

.toc-box {
  max-block-size: 70vh;
  padding: var(--space-2);
  overflow-y: auto;
}

/* In "Mehr" the rows are rows of a menu, and the citation and the settings open inside it, not as menus of their own. */
.more-box > .tool,
.more-box > .tool-menu > summary {
  justify-content: flex-start;
  inline-size: 100%;
  min-height: 2.75rem;
  padding-inline: var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
}

.more-box > .tool-menu[open] > summary {
  background: var(--tint);
}

.more-box .cite-box,
.more-box .settings-box {
  position: static;
  max-width: none;
  padding: var(--space-1) var(--space-3) var(--space-3);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.cite-heading,
.reading-settings legend {
  margin-block: 0 var(--space-2);
  padding: 0;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

html[lang="ar"] :is(.cite-heading, .reading-settings legend) {
  font-size: 0.875rem;
  letter-spacing: 0;
  text-transform: none;
}

.cite-text {
  margin-block: 0 var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--background);
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
}

.settings-box {
  display: grid;
  gap: var(--space-4);
}

.reading-settings fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.reading-settings legend:not(.visually-hidden) {
  width: 100%;
}

/* One segmented control per group. */
.settings-box .tool {
  margin-inline-end: -1px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  color: var(--ink);
}

.settings-box .tool:first-of-type {
  border-start-start-radius: var(--radius-md);
  border-end-start-radius: var(--radius-md);
}

.settings-box .tool:last-of-type {
  margin-inline-end: 0;
  border-start-end-radius: var(--radius-md);
  border-end-end-radius: var(--radius-md);
}

.settings-box .tool[aria-pressed="true"] {
  position: relative;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.reading-settings[hidden] {
  display: none;
}

/* From 75em: the rail. "Inhalt" and "Lesen" are blocks of it, each under a rule in ink; the buttons are rows of 44px with a hairline
   between them ("Arabisch einblenden" with its switch, share, save, cite, print, the reading settings), "Mehr" is not a button but its
   rows (where the browser can keep a closed <details> open: ::details-content; the others keep the button, and site.js opens the
   block of the contents). */
@media (min-width: 75em) {
  .fatwa-tools {
    display: contents;
  }

  .tool-arabic,
  .tool-share,
  .tool-more {
    order: 0;
  }

  .rail-read {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-block-start: 14px;
    border-block-start: 1px solid var(--ink);
    font-family: var(--font-ui);
    font-size: 0.90625rem;
    line-height: normal;
  }

  .rail-read > .rail-head {
    display: block;
    margin-block-end: 6px;
    color: var(--ink);
  }

  .tool-long {
    display: inline;
  }

  .tool-short {
    display: none;
  }

  .tool-arabic::after {
    inline-size: 30px;
    block-size: 18px;
    background: radial-gradient(circle at 9px 50%, var(--rule-strong) 0 5.5px, transparent 5.9px);
  }

  .tool-arabic[aria-expanded="true"]::after {
    background: radial-gradient(circle at calc(100% - 9px) 50%, var(--on-accent) 0 6px, transparent 6.4px) var(--accent);
  }

  html[dir="rtl"] .tool-arabic::after {
    background: radial-gradient(circle at calc(100% - 9px) 50%, var(--rule-strong) 0 5.5px, transparent 5.9px);
  }

  html[dir="rtl"] .tool-arabic[aria-expanded="true"]::after {
    background: radial-gradient(circle at 9px 50%, var(--on-accent) 0 6px, transparent 6.4px) var(--accent);
  }

  .rail-read > .tool,
  .rail-read > .tool-menu > summary,
  .more-box > .tool,
  .more-box > .tool-menu > summary {
    justify-content: space-between;
    inline-size: 100%;
    min-height: var(--tap-target);
    padding-inline: 0;
    border: 0;
    border-block-end: 1px solid var(--rule);
    border-radius: 0;
    background: none;
    text-align: start;
  }

  .tool-more > summary::before {
    content: none;
  }

  .more-label {
    position: static;
    inline-size: auto;
    block-size: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  .more-box > .tool:last-child,
  .more-box > .tool-menu:last-child > summary {
    border-block-end: 0;
  }

  .rail-read > .tool:hover,
  .rail-read > .tool-menu > summary:hover,
  .more-box > .tool:hover,
  .more-box > .tool-menu > summary:hover {
    background: none;
    color: var(--accent);
  }

  .rail-read > .tool[aria-expanded="true"],
  .rail-read > .tool-menu[open] > summary,
  .more-box > .tool[aria-pressed="true"],
  .more-box > .tool-menu[open] > summary {
    border-color: var(--rule);
    background: none;
  }

  .rail-read > .tool-menu[open] > summary,
  .more-box > .tool[aria-pressed="true"],
  .more-box > .tool-menu[open] > summary {
    color: var(--accent-strong);
    font-weight: 600;
  }

  .more-box {
    position: static;
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .more-box .cite-box,
  .more-box .settings-box {
    position: absolute;
    padding: var(--space-4);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
  }

  .rail-read :is(.tool-list, .cite-box, .settings-box) {
    inset-inline: 0 auto;
    inline-size: 22rem;
    max-width: none;
  }

  /* Where ::details-content is known, a block of the rail is a <details> whose content stays visible whether it is open or not: its
     summary is gone (no button that does nothing, no stop of the keyboard) and a label of its own, an element before it, is the
     head. The other browsers keep the summary as the head (it opens and closes) and the script opens the blocks. */
  @supports selector(::details-content) {
    .rail-details::details-content {
      content-visibility: visible;
      block-size: auto;
    }

    details.rail-details > summary {
      display: none;
    }

    .rail-toc > .rail-head {
      display: block;
    }

    .fatwa-terms > .rail-head {
      display: flex;
    }

    /* "Mehr" is no menu in the rail: the boxes of its <details> and of its content give way (display: contents), so that its rows stand
       in the block "Lesen" in the order of the handover: Arabisch einblenden, Merken, Teilen, Zitieren, Drucken, Leseeinstellungen. (A
       browser that keeps the box of the content shows "Mehr" as one block behind "Teilen": order 4.) */
    .tool-more,
    .tool-more::details-content,
    .more-box {
      display: contents;
    }

    .tool-arabic {
      order: 1;
    }

    .more-box > .tool[data-action="save"] {
      order: 2;
    }

    .tool-share {
      order: 3;
    }

    .tool-more::details-content {
      order: 4;
    }

    .more-box > .tool-cite {
      order: 5;
    }

    .more-box > .tool[data-action="print"] {
      order: 6;
    }

    .more-box > .reading-settings {
      order: 7;
    }
  }
}

/* --- Contents of a fatwa: the sections of the page (design handover 2.1) ---------------------------------------------- */

/* A phone: the button "Inhalt" is a summary of the row of the tools (its look is in the block above) and the list of the sections is a
   menu under the row. The list is rows of 44px. */
.toc-sections,
.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-sections > li > a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--tap-target);
  padding: var(--space-3);
  border-inline-start: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
  text-decoration: none;
}

.toc-sections > li > a:hover {
  background: var(--tint);
  color: var(--accent-strong);
}

.toc-sections > li > a[aria-current] {
  border-inline-start-color: var(--accent);
}

.toc-count {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

/* The paragraphs of a long fatwa under "Antwort": the number and the first words, one line each. */
.toc-list {
  display: grid;
  gap: 2px;
  padding-block: var(--space-1) var(--space-2);
  padding-inline: var(--space-4) var(--space-2);
}

.toc-list a {
  display: flex;
  gap: var(--space-3);
  padding-block: var(--space-1);
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc-list a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.toc-no {
  flex: none;
  min-width: 1.75rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.toc-verse {
  color: var(--verse);
}

/* The anchors of the three sections are the headings; the rule over each section stays in view when one jumps to it. */
#question-heading,
#answer-heading,
#related-heading {
  scroll-margin-block-start: 40px;
}

/* From 75em: the first block of the rail. "Inhalt" is its head (a label over a rule in ink), the sections are rows of 14.5px with a mark
   of 2px at the start for the current one (site.js sets aria-current; without a script none is marked); the paragraphs of a long
   fatwa stand under "Antwort", indented, and are the only part that scrolls (the rail itself does not: the menus of the tools reach out
   of it). */
@media (min-width: 75em) {
  .rail-toc {
    display: block;
    padding-block-start: 14px;
    border-block-start: 1px solid var(--ink);
    font-family: var(--font-ui);
    line-height: normal;
  }

  .rail-toc > .rail-head {
    margin-block-end: 12px;
    color: var(--ink);
  }

  .toc > summary {
    display: block;
    min-height: 0;
    margin-block-end: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--ink);
    font-size: 0.78125rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    cursor: default;
  }

  .toc > summary:hover {
    background: none;
    color: var(--ink);
  }

  html[lang="ar"] .toc > summary {
    font-size: 0.875rem;
    letter-spacing: 0;
    text-transform: none;
  }

  .toc-box {
    position: static;
    max-width: none;
    max-block-size: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
  }

  .toc-sections {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .toc-sections > li > a {
    min-height: 0;
    margin-inline-start: -14px;
    padding-block: 7px;
    padding-inline: 12px 0;
    border-radius: 0;
    color: var(--ink-muted);
    font-size: 0.90625rem;
  }

  .toc-sections > li > a:hover,
  .toc-sections > li > a[aria-current] {
    background: none;
    color: var(--ink);
  }

  .toc-list {
    grid-template-columns: minmax(0, 1fr);
    margin: calc(-1 * var(--space-1));
    margin-inline-start: calc(var(--space-2) - var(--space-1));
    padding: var(--space-1);
    max-block-size: 24rem;
    overflow-y: auto;
  }

  /* One line per paragraph, cut with "…" (the markup is the number and the text; the text is no element of its own). */
  .toc-list a {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toc-no {
    display: inline-block;
    min-width: 1.25rem;
    text-align: start;
  }
}

/* --- Question and answer (design handover 2.1) ----------------------------------------------------------------------- */

/* Two sections, each under a rule in ink and a label ("Frage", "Antwort"). The word of the source at the start of the text ("Frage:",
   "Antwort:") is cut when the page is built (reading.py), the label carries it. The question is read at the size of the reading
   setting, like the answer. */
.fatwa-question,
.fatwa-answer {
  margin-block-start: 40px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--ink);
}

.fatwa-question {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fatwa-question p {
  margin: 0;
  font-size: calc(var(--question-size) * var(--read-scale));
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.fatwa-answer > .label {
  margin-block-end: 20px;
}

.fatwa-body,
.fatwa-original {
  font-size: calc(var(--text-size) * var(--read-scale));
}

.fatwa-original {
  margin-block-start: 40px;
}

.fatwa-body > :last-child {
  margin-block-end: 0;
}

/* The numbered paragraphs of the answer. In the margin of each: the number (a link to the paragraph) and under it the mark "ع", which
   shows the Arabic paragraph (the summary of a <details>, so it works with the keyboard and without a script; the button of the rail
   opens all of them). A phone and a tablet: the text is indented by 32px and the margin hangs 10px into the page margin; from 75em the
   margin is a column of 40px, 64px in front of the text. */
.fatwa-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 22px;
  line-height: 1.64;
}

.para {
  position: relative;
  padding-inline-start: 32px;
  scroll-margin-block-start: var(--space-4);
}

/* The margin of a paragraph with a mark (number, gap, mark) is 56px high: a paragraph of one line leaves room for it. */
.para--ar {
  min-block-size: 36px;
}

.para:target {
  border-radius: var(--radius-md);
  background: var(--tint);
  box-shadow: 0 0 0 var(--space-2) var(--tint);
}

.para-no {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: -10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  inline-size: 30px;
  block-size: 24px;
  padding-inline-end: 6px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-decoration: none;
}

.para-no:hover,
.para:target .para-no {
  color: var(--accent-strong);
  text-decoration: underline;
}

.para-text > p,
.para-text > blockquote {
  margin-block: 0;
}

.para-ar {
  margin-block: 0;
}

/* The mark "ع": 30px on a phone, 24px in the wide layout; closed it has the hairline of a phone (nothing when wide, a border on hover),
   open the border of the accent and the ground of the tint. The hit area is 44px, the mark itself is smaller. */
.para-ar > summary {
  position: absolute;
  inset-block-start: 26px;
  inset-inline-start: -10px;
  display: grid;
  place-items: center;
  inline-size: 30px;
  block-size: 30px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink-muted);
  font-size: 0;
  cursor: pointer;
  list-style: none;
}

.para-ar > summary::-webkit-details-marker {
  display: none;
}

.para-ar > summary::before {
  content: "\0639" / "";
  font-family: var(--font-arabic);
  font-size: 0.875rem;
  line-height: 1;
}

.para-ar > summary::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.para-ar > summary:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.para-ar[open] > summary {
  border-color: var(--accent);
  background: var(--tint);
  color: var(--ink);
}

/* The Arabic paragraph, right-to-left, under the German one. Its Qur'an quotations stand in the colour of the verses, between the
   ornate brackets (the plain text has none: they are drawn, like those of the original). */
.para-ar-text {
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-arabic);
  font-size: calc(1.1875rem * var(--read-scale));
  line-height: 1.9;
}

.ar-verse {
  color: var(--verse);
}

.ar-verse::before {
  content: "\FD3F" / "";
  margin-inline-end: 0.2em;
}

.ar-verse::after {
  content: "\FD3E" / "";
  margin-inline-start: 0.2em;
}

/* The signature at the end (the name and the titles of the sheikh): quiet, in the face of the interface, without a mark. A phone sets
   the lines as one sentence and shows no number; from 75em they stand one under the other with the numbers "7–8" in the margin. */
.signature {
  position: relative;
  padding-inline-start: 32px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.5;
}

.signature > .para-no {
  display: none;
}

.signature-line,
.signature-line > p {
  display: inline;
  margin: 0;
}

/* The end of the answer: the star, once, in the middle of the column. */
.end-mark {
  display: flex;
  justify-content: center;
  margin-block-start: 48px;
  color: var(--ornament);
}

.end-mark svg {
  flex: none;
  inline-size: 14px;
  block-size: 14px;
  fill: currentColor;
}

@media (min-width: 48em) {
  .fatwa-question,
  .fatwa-answer {
    padding-block-start: 20px;
  }

  .fatwa-question {
    gap: 16px;
    margin-block-start: 64px;
  }

  .fatwa-question p {
    font-variation-settings: "opsz" 32;
    letter-spacing: -0.012em;
  }

  .fatwa-answer {
    margin-block-start: 56px;
  }

  .fatwa-answer > .label {
    margin-block-end: 24px;
  }

  .fatwa-original {
    margin-block-start: 64px;
  }

  .fatwa-paragraphs {
    gap: 24px;
    line-height: 1.68;
  }

  .para-ar-text {
    margin-block-start: 16px;
    padding: 14px 18px;
    font-size: calc(1.25rem * var(--read-scale));
    line-height: 1.95;
  }

  .signature {
    font-size: 0.9375rem;
  }

  .end-mark {
    margin-block-start: 72px;
  }

  .end-mark svg {
    inline-size: 16px;
    block-size: 16px;
  }
}

@media (min-width: 75em) {
  .para {
    padding-inline-start: 0;
  }

  .para--ar {
    min-block-size: 32px;
  }

  .para-no {
    inset-block-start: 2px;
    inset-inline-start: -64px;
    inline-size: 40px;
    padding-inline-end: 0;
    font-size: 0.78125rem;
  }

  .para-ar > summary {
    inset-block-start: 33px;
    inset-inline-start: -48px;
    inline-size: 24px;
    block-size: 24px;
    border-color: transparent;
  }

  .para-ar > summary::after {
    inset: -11px;
  }

  .signature {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-block-start: 8px;
    padding-inline-start: 0;
  }

  .signature > .para-no {
    display: flex;
    inset-block-start: 0;
  }

  .signature-line,
  .signature-line > p {
    display: block;
  }
}

/* --- Verse and formula -------------------------------------------------------------------------------------------- */

/* A block: the paragraph is the verse, between double rules like the frame (jadwal) of a manuscript. The text is the
   translation's own (its quotation marks stay), so the browser's quotation marks for <q> are switched off. */
blockquote.verse {
  margin: var(--space-2) 0 var(--space-4);
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-block: var(--jadwal);
  color: var(--verse);
  font-style: normal;
}

blockquote.verse p {
  margin-block: 0 var(--space-2);
}

blockquote.verse footer {
  margin: 0;
  color: var(--verse);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-style: normal;
  text-align: end;
}

/* Inside a sentence: upright in the colour of the verse between gold brackets, the place small and in the colour of the verse too. */
q.verse {
  quotes: none;
  color: var(--verse);
  font-style: normal;
}

q.verse::before,
q.verse::after {
  content: none;
}

/* In the German sentence the verse stands between the ornate brackets of the Qur'an in gold: U+FD3E opens, U+FD3F closes
   (the brackets are decoration, screen readers skip them; in the Arabic original they stand the other way round, see
   .fatwa-original .aaya). */
q.verse:lang(de)::before,
q.verse:lang(de)::after {
  color: var(--ornament);
  font-family: var(--font-arabic);
  font-size: 0.95em;
}

q.verse:lang(de)::before {
  content: "\FD3E" / "";
  margin-inline-end: 0.12em;
}

q.verse:lang(de)::after {
  content: "\FD3F" / "";
  margin-inline-start: 0.12em;
}

.verse-ref {
  color: var(--verse);
  font-family: var(--font-ui);
  font-size: 0.8125em;
  font-style: normal;
  white-space: nowrap;
}

/* A formula: written out in its own colour; with the setting "sign" the Arabic sign (site.js), the wording as its label. */
.formula {
  color: var(--formula);
  font-style: italic;
}

.formula[data-sign] {
  color: var(--ink);
  font-family: var(--font-arabic);
  font-size: 1.15em;
  font-style: normal;
  line-height: 1;
  cursor: help;
}


/* --- A term with its explanation (the note, the bubble) ------------------------------------------------------------ */

dfn {
  font-style: normal;
}

dfn a {
  color: inherit;
  text-decoration: underline dotted var(--rule-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
}

dfn a:hover,
dfn a[aria-expanded="true"] {
  color: var(--accent-strong);
  text-decoration-style: solid;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
}

/* The note next to a term (site.js), also for "Umschrift (Erklärung)": the bracket of the text, under it the explanation of
   the glossary where it says something else (.term-pop-note). */
.term-pop {
  --pop-arrow: 1.25rem;
  position: absolute;
  z-index: 40;
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-style: normal;
  line-height: 1.5;
}

/* The point of the note, under the middle of the term (site.js sets --pop-arrow). */
.term-pop::before {
  content: "";
  position: absolute;
  inset-block-start: -6px;
  inset-inline-start: var(--pop-arrow);
  width: 10px;
  height: 10px;
  border-block-start: 1px solid var(--rule);
  border-inline-start: 1px solid var(--rule);
  background: var(--surface);
  transform: rotate(45deg);
}

html[dir="rtl"] .term-pop::before {
  transform: rotate(-45deg);
}

.term-pop p {
  margin-block: 0 var(--space-2);
}

.term-pop p:last-child {
  margin-block-end: 0;
}

.term-pop-name {
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.125rem;
  font-weight: 600;
}

.term-pop-name [lang="ar"] {
  margin-inline-start: var(--space-2);
  color: var(--ink-muted);
  font-size: 1.1em;
  font-weight: 400;
}

.term-pop-note {
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--rule);
  color: var(--ink-muted);
}


/* --- Under the fatwa: related questions, terms, sources (design handover 2.1) ---------------------------------------------- */

.section h2 {
  margin-block-end: var(--space-4);
  font-family: var(--font-text);
  font-size: 1.625rem;
  font-weight: 500;
}

/* Related questions, right after the star: the head of a section (the rule in ink over it) and up to five rows. A row is one link: the
   title carries it and the stylesheet stretches it over the row, so the name of the link is the title and not the text of the row. */
.related {
  margin-block-start: 48px;
}

.related-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.related-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-block: 18px;
  border-block-end: 1px solid var(--rule);
}

.related-meta {
  display: flex;
  gap: 12px;
  font-variant-numeric: normal;
}

/* The number stays on one line; a long category is what wraps. */
.related-meta > :first-child,
.fatwa-number {
  flex: none;
  white-space: nowrap;
}

.related-title {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1.1875rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  line-height: 1.3;
  text-wrap: pretty;
}

.related-title a {
  color: var(--ink);
  text-decoration: none;
}

.related-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.related-title a:focus-visible {
  outline: none;
}

.related-title a:focus-visible::after {
  border-radius: var(--radius-sm);
  outline: var(--focus-width) solid var(--focus);
  outline-offset: 3px;
}

.related-row:hover .related-title a {
  color: var(--accent);
}

/* A phone shows no question; from 48em two lines of it. */
.related-question {
  display: none;
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.55;
}

html[lang="ar"] .related-question {
  line-height: 1.9;
}

html[lang="ar"] .related-title {
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.6;
}

/* The terms of the fatwa. A phone: a closed line below the related questions, "Begriffe in dieser Fatwa · N" and a plus (a minus when it
   is open), as a button of 48px that spans the width; opened it lists the terms as rows. The notes stand once in the document, and the
   links in the text jump to them (the same ids). */
.fatwa-terms {
  margin-block-start: 32px;
  font-family: var(--font-ui);
}

.terms-head {
  display: flex;
  align-items: center;
  min-height: 48px;
  border-block-end: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
}

.terms-head::-webkit-details-marker {
  display: none;
}

.terms-count::before {
  content: "·";
  margin-inline: 6px;
}

.terms-head::after {
  content: "+" / "";
  margin-inline-start: auto;
  font-size: 1.125rem;
  line-height: 1;
}

.terms-details[open] > .terms-head::after {
  content: "\2212" / "";
}

.terms-wide {
  display: none;
}

.term-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.term-row {
  position: relative;
  padding-block: 14px;
  border-block-end: 1px solid var(--rule);
}

.term-row:target {
  background: var(--tint);
}

.term-note p {
  margin: 0;
}

.fatwa-terms .term-pop-name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

.fatwa-terms .term-pop-name [lang="ar"] {
  margin-inline-start: 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  font-weight: 400;
}

.fatwa-terms .term-note-text {
  margin-block-start: 4px;
  color: var(--ink-muted);
  font-size: 0.84375rem;
  line-height: 1.5;
}

/* The row is the link: "Mehr zum Begriff" is stretched over it and has no text of its own to see (it names the term for screen readers
   and stands in the note that site.js shows). A term without a page has a row of text. */
.fatwa-terms .term-note-more {
  font-size: 0;
  line-height: 0;
}

.fatwa-terms .term-note-more a {
  text-decoration: none;
}

.fatwa-terms .term-note-more a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.fatwa-terms .term-note-more a:focus-visible {
  outline: none;
}

.fatwa-terms .term-note-more a:focus-visible::after {
  border-radius: var(--radius-sm);
  outline: var(--focus-width) solid var(--focus);
  outline-offset: 3px;
}

.term-row:has(.term-note-more):hover .term-pop-name {
  color: var(--accent);
}

/* More than six terms: the rest stands behind "Alle N Begriffe". */
.terms-more > summary {
  display: flex;
  align-items: center;
  min-height: var(--tap-target);
  border-block-end: 1px solid var(--rule);
  color: var(--accent);
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
}

.terms-more > summary::-webkit-details-marker {
  display: none;
}

.terms-more > summary:hover {
  text-decoration: underline;
}

/* The facts under a fatwa: the categories, the source, the citations. Quiet: the face of the interface, no frame. */
.fatwa-foot {
  margin-block-start: 40px;
  font-family: var(--font-ui);
}

.fatwa-meta {
  display: grid;
  gap: var(--space-4);
  margin: 0;
}

.fatwa-meta dt {
  margin-block-end: var(--space-2);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

html[lang="ar"] .fatwa-meta dt {
  font-size: 0.875rem;
  letter-spacing: 0;
  text-transform: none;
}

.fatwa-meta dd {
  margin: 0;
  font-size: 0.9375rem;
}

.chips {
  gap: var(--space-2);
}

.chips a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  padding-inline: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: none;
}

.chips a:hover {
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-strong);
}

.chips a[aria-current] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* The categories of a fatwa are chips of 36px on a phone and underlined words when wide, like "Oft gesucht" on the start page. */
.fatwa-foot .chips a {
  min-height: 36px;
  padding-inline: 14px;
  font-size: 0.875rem;
}

/* An Arabic citation on a German page: its own right-to-left line, but the box sits at the start of the page's direction
   instead of being pushed to the far edge. */
.fatwa-citation {
  display: block;
  width: fit-content;
  max-width: 100%;
  font-size: 1.2em;
  line-height: 1.8;
}

.fatwa-citation-de {
  display: block;
  color: var(--ink-muted);
  font-size: 0.875em;
}

@media (min-width: 48em) {
  .related {
    margin-block-start: 72px;
  }

  .related-list {
    margin-block-start: 8px;
  }

  .related-row {
    gap: 8px;
    padding-block: 24px;
  }

  .related-meta {
    gap: 14px;
  }

  .related-title {
    font-size: 1.4375rem;
    line-height: 1.28;
  }

  .related-question {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }

  .fatwa-foot {
    margin-block-start: 56px;
  }

  .fatwa-foot .chips {
    gap: 4px 20px;
  }

  .fatwa-foot .chips a {
    min-height: 24px;
    padding-inline: 0;
    border-radius: 0;
    box-shadow: none;
    text-decoration: underline;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 4px;
  }

  .fatwa-foot .chips a:hover {
    box-shadow: none;
    color: var(--accent);
  }
}

/* From 75em the terms are the third block of the rail: a head (the label "Begriffe" over a hairline, the number at the end), then rows of
   the name and the Arabic word on one line and the explanation in two lines at most, without frames, 14px apart. */
@media (min-width: 75em) {
  .fatwa-terms {
    margin-block-start: 0;
    padding-block-start: 14px;
    border-block-start: 1px solid var(--rule);
  }

  .fatwa-terms > .rail-head {
    justify-content: space-between;
    margin-block-end: 14px;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
  }

  .terms-head {
    justify-content: space-between;
    min-height: 0;
    margin-block-end: 14px;
    border: 0;
    font-size: 0.78125rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    cursor: default;
  }

  html[lang="ar"] .terms-head {
    font-size: 0.875rem;
    letter-spacing: 0;
    text-transform: none;
  }

  .terms-head::after,
  .terms-count::before {
    content: none;
  }

  .terms-wide {
    display: inline;
  }

  .terms-narrow {
    display: none;
  }

  /* The rail does not scroll (the menus of the tools reach out of it), but the terms may: their box takes what is left of the height of
     the window (see the rail above). The padding gives the focus rings room inside, the negative margin keeps the rows where they were. */
  .terms-box {
    max-block-size: 24rem;
    margin: calc(-1 * var(--space-1));
    padding: var(--space-1);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .term-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .term-row {
    padding-block: 0;
    border: 0;
  }

  .fatwa-terms .term-pop-name {
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9375rem;
  }

  .fatwa-terms .term-pop-name [lang="ar"] {
    font-size: 0.875rem;
  }

  .fatwa-terms .term-note-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    margin-block-start: 3px;
    overflow: hidden;
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  .terms-more > summary {
    min-height: 24px;
    border: 0;
  }

  .terms-more[open] > summary {
    margin-block-end: 14px;
  }
}

/* --- Lists of fatwas (entries, hits, related questions) ------------------------------------------------------------ */

.entry-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--space-7);
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  padding-block: var(--space-5);
  border-block-start: 1px solid var(--rule);
}

.entry-title {
  font-family: var(--font-text);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
}

.entry-title a {
  color: var(--ink);
  text-decoration: none;
}

.entry-title a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.entry-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  margin-block: var(--space-2) 0;
  overflow: hidden;
  font-family: var(--font-text);
  font-size: 0.9375em;
}

/* A snippet of a hit may need a line more than a list entry: the marked word is not always in its first line. */
.search-results .entry-excerpt {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  margin-block: var(--space-2) 0;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

@media (min-width: 48em) {
  .entry-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* --- The end of a fatwa: the note, "Fehler melden", "helpful?" (design handover 2.1) ----------------------------------------- */

/* One row under a hairline: the note on the start side ("Übersetzung aus dem Arabischen ..." and the link to the original), the link
   "Fehler melden" on the end side (under each other on a phone). The link leads to #fehler-melden; the form shows while that is the
   target of the address (:target): no script and nothing to open. */
.fatwa-feedback {
  margin-block-start: 32px;
  font-family: var(--font-ui);
}

.fatwa-foot + .fatwa-feedback {
  margin-block-start: 24px;
}

.notice-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-block: 24px;
  border-block-start: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: normal;
}

.fatwa-notice {
  margin: 0;
}

.fatwa-notice a,
.report-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 4px;
}

.fatwa-notice a:hover,
.report-link:hover {
  color: var(--accent);
}

.report-link {
  flex: none;
  padding-block: 4px;
  margin-block: -4px;
}

/* The jump to the form leaves the note row above it in view (the link that opened it). */
.report {
  scroll-margin-block-start: 96px;
}

.report-panel {
  display: none;
  margin-block-end: 24px;
}

.report:target .report-panel {
  display: block;
}

/* The answer to a form is part of the page (WP-27: the pages of the public site are files and keep no state) and shows while it is the target
   of the address: the thanks after a report (#gemeldet) or a vote (#abgestimmt), and on the page of the form the reason why a report
   was refused (#fehler-schnell ...). Without a target they are hidden. */
.fatwa-feedback .feedback-thanks:not(:target),
.report-reasons .form-error:not(:target) {
  display: none;
}

.fatwa-feedback .feedback-thanks,
.report-reasons .form-error {
  scroll-margin-block-start: 96px;
}

.report-reasons .form-error {
  margin-block-end: var(--space-4);
}

/* After a vote the thanks stand in place of the question; after a report the link that opens the form has done its work. */
.helpful .feedback-thanks:target + .helpful-form {
  display: none;
}

.fatwa-feedback:has(.report .feedback-thanks:target) .report-link {
  display: none;
}

.helpful {
  margin-block-start: 8px;
}

@media (min-width: 48em) {
  .fatwa-feedback {
    margin-block-start: 56px;
  }

  .fatwa-foot + .fatwa-feedback {
    margin-block-start: 32px;
  }

  .notice-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}

.helpful-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.helpful-question {
  margin: 0;
  font-weight: 600;
}

.helpful-buttons {
  display: inline-flex;
  gap: var(--space-2);
}

.helpful-buttons .button {
  padding-inline: var(--space-4);
}

.feedback-thanks {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--tint);
  color: var(--accent-strong);
}

.report-intro {
  max-width: 36rem;
  margin-block: 0 var(--space-4);
  color: var(--ink-muted);
}

.report-form {
  display: grid;
  gap: var(--space-4);
  max-width: 36rem;
}

.report-form .field {
  display: grid;
  gap: var(--space-1);
  margin: 0;
}

.report-form label {
  font-weight: 600;
}

.report-form textarea,
.report-form select,
.report-form input[type="email"] {
  width: 100%;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.report-form textarea {
  min-height: 7rem;
  resize: vertical;
}

.report-form :is(textarea, select, input):focus-visible {
  border-color: var(--accent);
}

.report-form [aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

.field-hint,
.form-note {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.form-note {
  margin: 0;
}

.field-error {
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 600;
}

.form-error {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--error-tint);
  color: var(--error);
  font-weight: 600;
}

/* The trap for robots: out of sight and out of the way. A person never reaches it (hidden, no tab stop). */
.hp {
  position: absolute;
  inset-inline-start: -10000px;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

.report-page {
  max-width: 36rem;
  margin-inline: auto;
}


/* --- Patterns of the design handover 2.1: label, head of a section, row of a list ----------------------------------------- */

/* The label ("Etikett"): small capitals in the interface face, spaced, in the ink of the ornament (a second part in ink-muted, or
   the whole label in ink). Arabic has no capitals and no spacing (it would break the letters apart), like the number of a fatwa. */
.label {
  margin: 0;
  color: var(--ornament-ink);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: normal;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.label strong {
  font-weight: inherit;
}

.label--ink {
  color: var(--ink);
}

.label-muted {
  color: var(--ink-muted);
}

html[lang="ar"] .label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: normal;
  text-transform: none;
}

@media (min-width: 48em) {
  .label {
    font-size: 0.78125rem;
  }
}

/* The head of a section: a rule in ink over it, the title in the reading face, and a link on the end side. (The sections of a
   category page and of a term page keep the older head, `.section > h2`.) */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  padding-block-start: 16px;
  border-block-start: 1px solid var(--ink);
}

.section-head h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 450;
  letter-spacing: -0.02em;
  line-height: normal;
}

.section-link {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: normal;
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

/* The link of a head has a long text on a wide screen and a short one on a phone ("Alle 37 Themen" and "Alle 37"). */
.link-long {
  display: none;
}

.section-link--wide {
  display: none;
}

@media (min-width: 48em) {
  .section-head {
    padding-block-start: 20px;
  }

  .section-head h2 {
    font-size: 2.25rem;
  }

  .section-link {
    font-size: 0.9375rem;
  }

  .link-long,
  .section-link--wide {
    display: inline;
  }

  .link-short {
    display: none;
  }
}

/* A row of a list: the whole row is a link (the title carries it, a link stretched over the row by ::after, so that the name of the
   link is the title and not the text of the row, and the focus ring goes round the row). Phone and tablet: the title, then the
   start of the question in one line (not on a phone), then number, topic and date in one line (.list-meta); from 64em a table of
   four columns, number, title with question, topic, date. */
.list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.list-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-block: 18px;
  border-block-end: 1px solid var(--rule);
}

.list-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.list-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.list-topic {
  min-width: 0;
}

.list-title {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: pretty;
}

.list-title a {
  color: var(--ink);
  text-decoration: none;
}

.list-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.list-title a:focus-visible {
  outline: none;
}

.list-title a:focus-visible::after {
  border-radius: var(--radius-sm);
  outline: var(--focus-width) solid var(--focus);
  outline-offset: 3px;
}

.list-row:hover .list-title a {
  color: var(--accent);
}

.list-question {
  display: none;
  margin: 0;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-no {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.list-topic,
.list-date {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  line-height: normal;
}

html[lang="ar"] .list-no {
  font-size: 0.875rem;
}

html[lang="ar"] :is(.list-title, .day-title) {
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.6;
}

/* On a phone only the first four rows of the newest. */
.list--latest .list-row:nth-child(n + 5) {
  display: none;
}

@media (min-width: 48em) {
  .list {
    margin-block-start: 24px;
  }

  .list-row {
    padding-block: 24px;
  }

  .list-title {
    font-size: 1.3125rem;
    letter-spacing: -0.005em;
  }

  .list-question {
    display: block;
  }

  .list-no {
    font-size: 0.78125rem;
    letter-spacing: 0.09em;
  }

  .list-topic,
  .list-date {
    font-size: 0.875rem;
  }

  .list--latest .list-row:nth-child(n + 5) {
    display: flex;
  }
}

@media (min-width: 64em) {
  .list-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 240px 120px;
    align-items: baseline;
    gap: 32px;
  }

  .list-meta {
    display: contents;
  }

  .list-no,
  .list-main,
  .list-topic,
  .list-date {
    grid-row: 1;
  }

  .list-no {
    grid-column: 1;
  }

  .list-main {
    grid-column: 2;
  }

  .list-topic {
    grid-column: 3;
  }

  .list-date {
    grid-column: 4;
    text-align: end;
  }

  .list--latest .list-row:nth-child(n + 5) {
    display: grid;
  }

  .list-row:hover {
    background: var(--surface);
  }
}

html[lang="ar"] .list-question {
  line-height: 1.9;
}

/* The list on its own page ("Neu übersetzt"): it is the page, so no head of a section over it. */
.list--page {
  margin-block-start: 0;
  border-block-start: 1px solid var(--ink);
}

/* The wide button of a phone under the newest ("Alle neuen Übersetzungen"); a wide screen has the link in the head. */
.button-wide {
  display: flex;
  align-items: center;
  justify-content: center;
  block-size: 48px;
  margin-block-start: 20px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.button-wide:hover {
  background: var(--tint);
}

@media (min-width: 48em) {
  .button-wide {
    display: none;
  }
}


/* --- Start page (design handover 2.1) --------------------------------------------------------------------------------- */

/* The entry: the search comes first. Beside the field, from 64em, the fatwa of the day (bottom to bottom with the field and the words
   under it); below that, one column with the card of the day under the field. */
.hero {
  display: grid;
  gap: 64px;
  padding-block: 56px 64px;
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.hero h1 {
  font-size: var(--display-size);
  font-weight: 400;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

html[lang="ar"] .hero h1 {
  line-height: 1.4;
}

.hero-lead {
  max-width: 36rem;
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* The field: a box with the magnifier, the input and the button inside, 56px high on a phone and 64px from 48em. The box takes
   the ring of the focus (the border turns ink, the ring goes round the box), not the input in it. */
.home-search {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-block-start: 6px;
}

.home-search .search-form {
  align-items: center;
  gap: 12px;
  block-size: 56px;
  padding-inline: 16px 6px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.home-search .search-form:focus-within {
  border-color: var(--ink);
  outline: var(--focus-width) solid var(--focus);
  outline-offset: 3px;
}

.search-icon {
  flex: none;
  inline-size: 18px;
  block-size: 18px;
  color: var(--ink-muted);
}

.search-field {
  position: relative;
  display: flex;
  flex: 1;
  align-self: stretch;
  min-width: 0;
}

.home-search .search-input {
  min-height: 0;
  padding-block: 0;
  padding-inline: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1rem;
}

.home-search .search-input:focus-visible {
  outline: none;
}

.home-search .search-submit {
  block-size: 44px;
  min-height: 0;
  padding-inline: 16px;
  font-size: 0.9375rem;
}

/* The hint with an example stands in place of the short placeholder (from 48em, while the field is empty). */
.search-hint {
  display: none;
}

/* The words under the field: a row of chips that moves sideways on a phone (the first stands at the margin, the last may run out),
   a line of words with an underline on a wide screen. */
.popular {
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: normal;
}

.popular-label {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.popular-list {
  display: flex;
  gap: 8px;
  margin-block: -6px;
  margin-inline: calc(-1 * var(--gutter));
  padding-block: 6px;
  padding-inline: var(--gutter);
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.popular-list::-webkit-scrollbar {
  display: none;
}

.popular-list a {
  display: flex;
  flex: none;
  align-items: center;
  block-size: 36px;
  padding-inline: 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  text-decoration: none;
}

.popular-list a:hover {
  color: var(--accent);
}

/* The fatwa of the day: a rule in ink over it, the label and the number, the title (the link, stretched over the card), the start of
   the question, the topic. */
.day {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--ink);
}

.day-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.day-title {
  margin: 0;
  font-size: 1.4375rem;
  font-weight: 500;
  font-variation-settings: "opsz" 32;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.day-title a {
  color: var(--ink);
  text-decoration: none;
}

.day-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.day-title a:focus-visible {
  outline: none;
}

.day-title a:focus-visible::after {
  border-radius: var(--radius-sm);
  outline: var(--focus-width) solid var(--focus);
  outline-offset: 3px;
}

.day:hover .day-title a {
  color: var(--accent);
}

.day-question {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  margin: 0;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.day-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: normal;
}

/* "Lesen →" is a hint, the card itself is the link; the arrow points to the end side in both directions. */
.day-read {
  display: none;
  color: var(--accent);
  font-weight: 600;
}

.day-read::after {
  content: " \2192" / "";
}

html[dir="rtl"] .day-read::after {
  content: " \2190" / "";
}

.day:hover .day-read {
  text-decoration: underline;
}

html[lang="ar"] .day-question {
  line-height: 1.9;
}

/* The sections below the entry: the head, then the content. */
.area {
  padding-block-end: 64px;
}

.area:last-child {
  padding-block-end: 56px;
}

.area > .notice {
  margin-block-start: 16px;
}

/* The topics: the four with the most fatwas as big numbers (two by two on a phone), the others as a register of names with the
   number on the end side. A phone shows the first six of the register; the link of the head leads to all. */
.topic-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 0;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.topic-cards li {
  display: flex;
}

.topic-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding-inline-start: 14px;
  border-inline-start: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}

.topic-card:hover {
  color: var(--accent);
}

.topic-number {
  font-size: 2.5rem;
  font-weight: 300;
  font-feature-settings: "lnum";
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.03em;
  line-height: 1;
}

.topic-name {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

.register {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.register li:nth-child(n + 7) {
  display: none;
}

.register a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-block-size: var(--tap-target);
  padding-block: 10px;
  border-block-end: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: normal;
  text-decoration: none;
}

.register a:hover {
  color: var(--accent);
}

.register-count {
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

html[lang="ar"] .register a {
  line-height: 1.7;
}

@media (min-width: 48em) {
  .hero {
    gap: 80px;
    padding-block: 80px 96px;
  }

  .hero-main {
    gap: 32px;
  }

  .hero-lead {
    font-size: 1.25rem;
  }

  .home-search {
    gap: 16px;
    margin-block-start: 8px;
  }

  .home-search .search-form {
    gap: 14px;
    block-size: 64px;
    padding-inline: 22px 8px;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent);
  }

  .search-icon {
    inline-size: 20px;
    block-size: 20px;
  }

  .home-search .search-input {
    font-size: 1.0625rem;
  }

  .home-search .search-input::placeholder {
    color: transparent;
  }

  .home-search .search-submit {
    block-size: 48px;
    padding-inline: 22px;
  }

  .search-hint {
    position: absolute;
    inset-inline: 2px 0;
    inset-block-start: 50%;
    display: block;
    overflow: hidden;
    color: var(--ink-muted);
    font-family: var(--font-ui);
    font-size: 1.0625rem;
    line-height: 1.4;
    pointer-events: none;
    text-overflow: ellipsis;
    transform: translateY(-50%);
    white-space: nowrap;
  }

  .search-input:not(:placeholder-shown) + .search-hint {
    visibility: hidden;
  }

  .popular {
    flex-flow: row wrap;
    align-items: baseline;
    gap: 8px 20px;
  }

  .popular-label {
    position: static;
    inline-size: auto;
    block-size: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    color: var(--ink-muted);
    white-space: normal;
  }

  .popular-list {
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-block: 0;
    margin-inline: 0;
    padding-block: 0;
    padding-inline: 0;
    overflow: visible;
  }

  .popular-list a {
    display: inline;
    padding-block: 4px;
    padding-inline: 0;
    border: 0;
    border-radius: 0;
    text-decoration: underline;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 4px;
  }

  .popular-list a:hover {
    text-decoration-color: var(--accent);
  }

  .day {
    gap: 16px;
    padding-block-start: 20px;
  }

  .day-title {
    font-size: 1.625rem;
    line-height: 1.22;
  }

  .day-question {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    font-size: 1.0625rem;
  }

  .day-read {
    display: inline;
  }

  .area {
    padding-block-end: 120px;
  }

  .area:last-child {
    padding-block-end: 120px;
  }

  .topic-cards {
    margin-block-start: 40px;
  }

  .topic-card {
    gap: 12px;
    padding: 4px 28px 8px;
  }

  .topic-number {
    font-size: 3.75rem;
  }

  .topic-name {
    font-size: 1.1875rem;
  }

  .register {
    columns: 2;
    column-gap: 48px;
    margin-block-start: 56px;
  }

  .register li {
    break-inside: avoid;
  }

  .register li:nth-child(n + 7) {
    display: block;
  }

  .register a {
    min-block-size: 0;
    padding-block: 11px;
  }
}

@media (min-width: 64em) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 352px;
    column-gap: 96px;
    align-items: end;
    padding-block: 112px 120px;
  }

  .hero h1 {
    letter-spacing: -0.03em;
    line-height: 1.02;
  }

  /* Without a fatwa of the day the entry is one column, as wide as the left column is beside the card (44rem = 704px). */
  .hero--single {
    grid-template-columns: minmax(0, 44rem);
  }

  .topic-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }

  .register {
    columns: 3;
  }
}


/* --- The number on a category page, and the sections of a category page and of a term page ------------------------------ */

/* The number of fatwas of a category: the words quiet. */
.stat {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-block: var(--space-4) 0;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
}

.section {
  margin-block-start: var(--space-7);
}

/* These sections keep their head over one rule in ink (the double rule stays with the verse); the head of the start page is the
   .section-head above, with the rule over it. */
.section > h2 {
  margin-block-end: var(--space-2);
  padding-block-end: var(--space-3);
  border-block-end: 1px solid var(--ink);
}


/* --- Terms: A to Z and the page of a term (WP-26) -------------------------------------------------------------------- */

.term-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-block: 0 var(--space-5);
  font-family: var(--font-ui);
}

/* The label has a row of its own on a phone, the field and the button share the next one (a field squeezed between the
   label and the button was 85 px wide there); from 48em all three stand in one row. */
.term-filter label {
  flex: 1 0 100%;
  font-weight: 600;
}

.term-filter .search-input {
  flex: 1 1 10rem;
}

/* The letters wrap like text, with the line balanced: 26 letters make two rows of 13 on a desktop and not 25 and a lone
   "Z" (a browser without balancing wraps as before). The spacing is the margin of the item, so it follows the direction. */
.letters ul {
  display: block;
  margin-block-end: var(--space-5);
  text-wrap: balance;
}

.letters li {
  display: inline-block;
  margin-block-end: var(--space-1);
  margin-inline-end: var(--space-1);
  vertical-align: top;
}

.letters a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-target);
  min-height: var(--tap-target);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 500;
  text-decoration: none;
}

.letters a:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.term-group h2 {
  margin-block: var(--space-6) var(--space-2);
  padding-block-end: var(--space-1);
  border-block-end: 1px solid var(--rule);
  color: var(--ornament-ink);
  font-size: 1.75rem;
}

.term-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 0 var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.term-links li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  padding-block: var(--space-2);
}

.term-other,
.term-arabic {
  color: var(--ink-muted);
}

/* The Arabic spellings of a term side by side: a gap that does not depend on the direction of the spans. */
.term-facts dd:has(> .term-arabic) {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
}

.term-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-4) var(--space-6);
  margin: 0 0 var(--space-6);
  padding-block: var(--space-4);
  border-block: 1px solid var(--rule);
  font-family: var(--font-ui);
}

.term-facts dt {
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

html[lang="ar"] .term-facts dt {
  font-size: 0.875rem;
  letter-spacing: 0;
  text-transform: none;
}

.term-facts dd {
  margin: var(--space-1) 0 0;
}

.term-facts .term-arabic {
  color: var(--ink);
  font-size: 1.5em;
  line-height: 1.6;
}

/* The transliteration always in the reading face (Public Sans has no ʿ and ʾ). Class on the <dd> of the transliteration. */
.translit {
  font-family: var(--font-text);
}


/* --- Notices, empty states, error pages, offline, pages about the project ------------------------------------------- */

.notice {
  margin-block: 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--tint);
  font-family: var(--font-ui);
  font-size: var(--ui-size);
}

/* The owner's text is still to come: dashed like the sign "machine translated", with the word saying it. */
.placeholder-note {
  margin-block-end: var(--space-5);
  background: var(--machine-tint);
  box-shadow: inset 0 0 0 1px var(--machine);
  color: var(--machine);
}

.info-page {
  max-width: var(--fatwa-width);
  margin-inline: auto;
}

.info-section h2 {
  margin-block: var(--space-6) var(--space-3);
  font-size: 1.375rem;
}

.error-page {
  max-width: 36rem;
  padding-block: var(--space-6);
}

.error-code {
  margin-block: 0 var(--space-2);
  color: var(--ornament-ink);
  font-family: var(--font-text);
  font-size: 4rem;
  font-weight: 600;
  font-variant-numeric: lining-nums;
  line-height: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block: var(--space-5) 0;
}


/* --- The original text of binbaz.org.sa (Arabic), WP-14 ---------------------------------------------------------- */

/* The markup comes from binbaz.org.sa and passes content.html.clean_html, which keeps only these classes. What they
   mean (counted in the first 4 738 articles):

     span.aaya            Qur'an verse (3 738). The reference "[الأنعام:3]" follows as plain text, outside the span.
     span.aya-separator   end-of-verse sign ۝ between two verses inside one span.aaya (530)
     span.hadith          words of the Prophet or another hadith text (5 134)
     span.arabisque       an eulogy that binbaz.org.sa prints with an icon font (2 607): the span holds a glyph code of
                          that font, which is no text without the font. public/original.py puts the words of the
                          eulogy in place of the code before cleaning (WP-16c); the span stays, as a hook, and is
                          ordinary Arabic text, so no rule here
     section.footnotes    the footnotes at the end (4 731), with <ol><li id="footnote-N"><cite>source</cite></li>
                          and, in 492 articles, an empty <header><h2></h2></header> (the tag goes, the <h2> stays
                          empty)
     sup > a[href="#footnote-N"]
                          the mark [N] in the text (6 746), jumps to the li (ids carry the prefix of clean_html)
     table.poetry         a poem of two columns (15); one more table (a prize list) has no class
     div.article-content  wrapper of the answer (4 738), needs nothing
     h2 (first child)     the question (4 738), with an empty <i> from the icon and a <div> inside

   Everything is scoped to .fatwa-original, so a class of the original can never restyle a component of the site. One
   article carries the markup of an audio player (bootstrap and jPlayer classes: row, col-sm-9, jp-*); it has no rules
   and shows as plain text and a download link. The question is set like the German one, without an area and with a
   hairline under it; a verse has the colour of the verses there, a hadith is semibold without a box. */
.fatwa-original > h2 {
  margin-block: 0 var(--space-6);
  padding: 0 0 var(--space-6);
  border-block-end: 1px solid var(--rule);
  font-size: 1.08em;
  font-weight: 400;
  line-height: var(--text-leading);
  text-wrap: wrap;
}

.fatwa-original > h2 > div {
  margin: 0;
}

/* Empty leftovers of the original: the icon (<i>), the heading of the footnotes. */
.fatwa-original i:empty,
.fatwa-original h2:empty {
  display: none;
}

.fatwa-original .aaya {
  color: var(--verse);
}

/* The ornate brackets of the Qur'an. In reading order the verse opens with U+FD3F and closes with U+FD3E (the glyphs
   are not mirrored, so in a right-to-left line the opening one stands on the right). */
.fatwa-original .aaya::before {
  content: "\FD3F";
  margin-inline-end: 0.2em;
}

.fatwa-original .aaya::after {
  content: "\FD3E";
  margin-inline-start: 0.2em;
}

.fatwa-original .aya-separator {
  color: var(--ornament-ink);
  font-size: 0.85em;
}

.fatwa-original .hadith {
  font-weight: 600;
}

.fatwa-original strong,
.fatwa-original b {
  font-weight: 700;
}

.fatwa-original ul,
.fatwa-original ol {
  padding-inline-start: 1.6rem;
}

.fatwa-original blockquote {
  margin-inline: 0;
  padding-inline-start: var(--space-4);
  border-inline-start: 3px solid var(--rule);
}

/* The marks [1] in the text: small, raised, with room to tap. */
.fatwa-original sup {
  line-height: 0;
}

.fatwa-original sup a {
  display: inline-block;
  min-width: 1.6em;
  padding-block: 0.1em;
  text-align: center;
  text-decoration: none;
}

.fatwa-original .footnotes {
  margin-block-start: var(--space-6);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.88em;
  line-height: 1.7;
}

.fatwa-original .footnotes ol {
  margin: 0;
}

.fatwa-original .footnotes li {
  margin-block-end: var(--space-1);
  padding: 0.1rem var(--space-2);
  border-radius: var(--radius-sm);
}

.fatwa-original .footnotes li:target {
  background: var(--tint);
  color: var(--ink);
}

.fatwa-original cite {
  font-style: normal;
}

/* Tables. A poem is centred and, on a phone, set as one line under the other; a table with data keeps its grid and
   scrolls sideways inside its own box instead of widening the page. */
.fatwa-original table {
  border-collapse: collapse;
}

.fatwa-original table:not(.poetry) {
  display: block;
  max-width: 100%;
  margin-block: var(--space-4);
  overflow-x: auto;
}

.fatwa-original table:not(.poetry) :is(td, th) {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule);
  vertical-align: top;
}

.fatwa-original table:not(.poetry) th {
  background: var(--tint);
}

.fatwa-original .poetry,
.fatwa-original .poetry tbody,
.fatwa-original .poetry tr,
.fatwa-original .poetry td {
  display: block;
}

.fatwa-original .poetry {
  margin-block: var(--space-5);
  text-align: center;
}

.fatwa-original .poetry tr {
  margin-block-end: var(--space-3);
}

.fatwa-original .poetry td {
  padding: 0.05rem var(--space-2);
}


/* --- Wider screens --------------------------------------------------------------------------------------------- */

@media (min-width: 48em) {
  .site-main {
    padding-block: var(--space-7) var(--space-8);
  }

  .pager-num {
    display: list-item;
  }

  .pager-num.phone-only {
    display: none;
  }

  .pager-list a,
  .pager-current {
    padding-inline: var(--space-3);
  }

  .pager-gap {
    min-width: 1.5rem;
  }

  /* The terms filter: label, field and button in one row. */
  .term-filter label {
    flex: none;
  }

  /* A poem: the two halves of a line side by side. */
  .fatwa-original .poetry {
    display: table;
    margin-inline: auto;
  }

  .fatwa-original .poetry tbody {
    display: table-row-group;
  }

  .fatwa-original .poetry tr {
    display: table-row;
  }

  .fatwa-original .poetry td {
    display: table-cell;
    padding: var(--space-1) var(--space-5);
  }
}


/* --- Print ------------------------------------------------------------------------------------------------------- */

/* Only the printout shows the footer with source, address and date. */
.print-foot {
  display: none;
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .site-header,
  .site-footer,
  .skip-link,
  .breadcrumb,
  .fatwa-tools,
  .toc,
  .report-link,
  .report,
  .helpful,
  .related,
  .para-no,
  .fatwa-notice a,
  .end-mark {
    display: none !important;
  }

  .site-main {
    padding: 0;
  }

  /* "Umschrift (Erklärung)": the bracket is back in the text. */
  .js .gloss {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  /* The page is a column in print (the terms come after the answer, by `order`, the note and the printout footer last). */
  .fatwa {
    display: flex;
    flex-direction: column;
    max-width: none;
    margin-block-start: 0.6rem;
  }

  .fatwa-rail {
    display: contents;
  }

  .notice-row {
    padding-block: 0.6rem 0;
    border: 0;
  }

  .para {
    display: block;
    padding-inline-start: 0;
    break-inside: avoid;
  }

  .signature {
    display: block;
    padding-inline-start: 0;
  }

  /* The terms are printed open (where the browser can show the content of a closed <details>), as notes after the answer. */
  .fatwa-terms,
  .terms-more {
    display: block;
  }

  .fatwa-terms {
    margin-block-start: 1.2rem;
  }

  .terms-details::details-content,
  .terms-more::details-content {
    content-visibility: visible;
    block-size: auto;
  }

  .terms-head::after,
  .terms-more > summary {
    display: none;
  }

  .fatwa-terms .term-note-text {
    display: block;
  }

  .para-ar:not([open]),
  .para-ar > summary {
    display: none;
  }

  .para-ar-text {
    padding: 0;
    border: 0;
    background: none;
  }

  blockquote.verse {
    border-block: 3px double #000;
    color: #000;
    break-inside: avoid;
  }

  q.verse,
  .verse-ref,
  .formula,
  .label,
  .label-muted,
  q.verse:lang(de)::before,
  q.verse:lang(de)::after {
    color: #000;
  }

  a,
  dfn a {
    color: inherit;
    text-decoration: none;
  }

  .print-foot {
    display: block;
    margin-block-start: 1.5rem;
    padding-block-start: 0.6rem;
    border-block-start: 3px double #000;
    font-family: var(--font-ui);
    font-size: 9pt;
  }

  .print-foot p {
    margin-block: 0.1rem;
  }
}


/* --- Motion: little, and none for those who ask for none ---------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .category-card,
  .main-nav a,
  .lang-switch a,
  .header-lupe,
  .menu-panel a,
  .footer-legal a,
  .footer-nav a,
  .topic-card,
  .register a,
  .list-title a,
  .day-title a,
  .popular-list a,
  .button-wide,
  .search-submit,
  .button,
  .tool,
  .tool-menu > summary,
  .chips a,
  .letters a,
  .para-ar > summary,
  .para-no,
  .report-link,
  .meta-link,
  .breadcrumb--up a,
  .related-title a,
  .toc-sections > li > a,
  .toc-list a,
  .terms-more > summary {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  }

  .menu-button::before,
  .menu-button::after {
    transition: transform 0.15s ease;
  }

  .term-pop {
    animation: pop-in 0.12s ease-out;
  }

  @keyframes pop-in {
    from {
      opacity: 0;
      transform: translateY(-2px);
    }
  }
}
