/* La Bible annotée: calm reading page. The AELF texts (serif, paper) and the generated notes
   (sans-serif, cool tint) must never be mistaken for one another. */

:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --paper: #fffdf8;
  --ink: #2a2420;
  --muted: #6d6259;
  --line: #e2d8c8;
  --accent: #8b5a2b;
  --accent-ink: #6f4520;
  --notes-bg: #f0f0ee;
  --notes-paper: #f8fbfc;
  --notes-ink: #1d2a31;
  --notes-muted: #52646e;
  --notes-line: #c9d8df;
  --notes-accent: #2d5f75;
  /* One tone per reading: pale sky blue, pale water green, linen, pale gold for the Gospel. */
  --tone-first-bg: #eaf2fb;
  --tone-first-line: #c5d9ef;
  --tone-first-ink: #2f5f8f;
  --tone-psalm-bg: #e7f4f1;
  --tone-psalm-line: #bfe0d8;
  --tone-psalm-ink: #2b6a60;
  --tone-second-bg: #f4efe6;
  --tone-second-line: #e0d4bf;
  --tone-second-ink: #75592f;
  --tone-gospel-bg: #fbf3d9;
  --tone-gospel-line: #ead9a3;
  --tone-gospel-ink: #7a5c12;
  --fait: #2f6b45;
  --fait-bg: #e3f0e7;
  --hypothese: #8a5a00;
  --hypothese-bg: #f8ecd2;
  --wrong: #a8372f;
  --wrong-bg: #f8e1de;
  --warning-bg: #fbefd9;
  --warning-line: #e6c88f;
  --info-bg: #eef1f7;
  --info-line: #c8d2e6;
  --ok: #2f6b45;
  --lit: #8a8076;
  --lit-vert: #3d7a4f;
  --lit-violet: #6b4c8a;
  --lit-rouge: #a8372f;
  --lit-blanc: #b8973e;
  --lit-rose: #c8749a;
  --lit-noir: #3b3b3b;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 10px;
  --measure: 40rem;
  --toggle-top: 0.375rem;
  --toggle-height: 1.75rem;
  --band-height: calc(var(--toggle-height) + 2 * var(--toggle-top));
  /* The buttons of the bands of the readings and the notes (« Note », « Lecture ») and the chips beside them. */
  --band-button: 1.55rem;
  /* The shadows that tell more is to read beyond an edge (under a header that sticks, at the ends of the drawer). */
  --scroll-shadow: rgb(0 0 0 / 0.22);
  /* Under a band: its deep colour, faint, over nothing on a light page; a touch of it over a dark shade on a dark one. */
  --band-shade-share: 28%;
  --band-shade-base: transparent;
}

/* Dark: the reader's choice (the theme picker of the header), or their device's while they have chosen nothing. The
   two blocks hold the same declarations; src/__tests__/styles.test.ts keeps them so. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #1b1916;
  --paper: #23201c;
  --ink: #ece4d8;
  --muted: #b3a797;
  --line: #3a342c;
  --accent: #d39b62;
  --accent-ink: #e6b27c;
  --notes-bg: #1a1b1c;
  --notes-paper: #1c272c;
  --notes-ink: #dde9ee;
  --notes-muted: #9fb3bd;
  --notes-line: #2f4149;
  --notes-accent: #7fbfd8;
  --tone-first-bg: #1b2533;
  --tone-first-line: #2f4560;
  --tone-first-ink: #9fc3ea;
  --tone-psalm-bg: #1a2b28;
  --tone-psalm-line: #2e4c46;
  --tone-psalm-ink: #8fd3c4;
  --tone-second-bg: #2a251d;
  --tone-second-line: #4a4031;
  --tone-second-ink: #dcc39a;
  --tone-gospel-bg: #2d2715;
  --tone-gospel-line: #574a22;
  --tone-gospel-ink: #e8cd7c;
  --scroll-shadow: rgb(0 0 0 / 0.65);
  --fait: #8fd3a5;
  --fait-bg: #1f3427;
  --hypothese: #f0c46d;
  --hypothese-bg: #3a2f17;
  --wrong: #ff9b8f;
  --wrong-bg: #3d1f1c;
  --warning-bg: #3a2f17;
  --warning-line: #6b5426;
  --info-bg: #1f2531;
  --info-line: #34405a;
  --ok: #8fd3a5;
  --lit-blanc: #e0c46a;
  --lit-noir: #9a9a9a;
  --band-shade-share: 12%;
  --band-shade-base: rgb(0 0 0 / 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #1b1916;
    --paper: #23201c;
    --ink: #ece4d8;
    --muted: #b3a797;
    --line: #3a342c;
    --accent: #d39b62;
    --accent-ink: #e6b27c;
    --notes-bg: #1a1b1c;
    --notes-paper: #1c272c;
    --notes-ink: #dde9ee;
    --notes-muted: #9fb3bd;
    --notes-line: #2f4149;
    --notes-accent: #7fbfd8;
    --tone-first-bg: #1b2533;
    --tone-first-line: #2f4560;
    --tone-first-ink: #9fc3ea;
    --tone-psalm-bg: #1a2b28;
    --tone-psalm-line: #2e4c46;
    --tone-psalm-ink: #8fd3c4;
    --tone-second-bg: #2a251d;
    --tone-second-line: #4a4031;
    --tone-second-ink: #dcc39a;
    --tone-gospel-bg: #2d2715;
    --tone-gospel-line: #574a22;
    --tone-gospel-ink: #e8cd7c;
    --scroll-shadow: rgb(0 0 0 / 0.65);
    --fait: #8fd3a5;
    --fait-bg: #1f3427;
    --hypothese: #f0c46d;
    --hypothese-bg: #3a2f17;
    --wrong: #ff9b8f;
    --wrong-bg: #3d1f1c;
    --warning-bg: #3a2f17;
    --warning-line: #6b5426;
    --info-bg: #1f2531;
    --info-line: #34405a;
    --ok: #8fd3a5;
    --lit-blanc: #e0c46a;
    --lit-noir: #9a9a9a;
    --band-shade-share: 12%;
    --band-shade-base: rgb(0 0 0 / 0.7);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* The page keeps its width when the drawer hides its scrollbar. */
  scrollbar-gutter: stable;
  /* What a link or the keyboard brings into view is never left under the band of a reading. */
  scroll-padding-top: 4rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--notes-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.8rem;
  background: var(--paper);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Site frame */

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer {
  margin-top: 3rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

/* ---- Date picker */

.date-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin: 0.25rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

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

.date-picker input[type='date'] {
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.day-step {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-decoration: none;
  font-weight: 700;
}

.to-today {
  margin-left: auto;
  font-weight: 600;
}

/* ---- Days offered to everyone: today and next Sunday */

/* Under the site's header (and its 0.5rem): 0.75rem, as between the parts of the top of the page. */
.day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.25rem 0 0;
}

.day-tab {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
}

.day-tab[aria-current='page'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
  font-weight: 600;
}

.day-tab-more {
  margin-left: auto;
  color: var(--muted);
}

.day-tab-more span {
  font-size: 0.8rem;
}

/* ---- Access for the holders of a code */

.access {
  margin-top: 1.5rem;
  padding: 1.25rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.access h1 {
  margin: 0.2rem 0 0.5rem;
  font-family: var(--serif);
}

.access-form {
  max-width: 22rem;
  margin: 1rem 0;
}

/* ---- Language of the site: the one picker, in the header */

.site-lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.88rem;
}

.site-lang select {
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

/* ---- The mode switch and the theme picker, side by side in the line at the bottom of the screen: icons in a pill each (the
   adults' and the children's modes; the device's theme, light, dark), the chosen one filled. Each target is
   2rem × 1.75rem (over the 24px minimum of WCAG 2.5.8); the focus ring shows on the icon of the radio button that has
   it. */
.site-switches {
  display: flex;
  grid-column: 2;
  align-items: center;
  gap: 0.4rem;
}

:is(.site-mode, .site-theme) {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* They are in a line of their own at the bottom of the screen, centred, the button that reloads the page at its far
   left and the one back to the top at its far right, over everything: the page, and the drawers of the notes (40), of
   the timeline and of the maps (60), which end above it. The server puts it there, so that nothing moves when the page
   comes. Its height (--switches-bar: its padding, a pill, its border), measured again by public/app.js should a pill
   wrap, is kept at the bottom of what scrolls. */
:root {
  --switches-bar: calc(2rem + 7px + max(0.25rem, env(safe-area-inset-bottom)));
}

.switches-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.25rem max(1rem, env(safe-area-inset-right)) max(0.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

/* All three on one row. */
.switches-bar > * {
  grid-row: 1;
}

.switches-bar .to-reload {
  grid-column: 1;
  justify-self: start;
}

.switches-bar .to-top {
  grid-column: 3;
  justify-self: end;
}

body {
  padding-bottom: var(--switches-bar);
}

/* Reloading, back to the top: round buttons as high as the pills, a round arrow, an arrow up. */
.switches-bar :is(.to-top, .to-reload) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(1.75rem + 6px);
  height: calc(1.75rem + 6px);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
}

/* « Actualiser » at work: its arrow turns, half a second at least (public/app.js). */
.switches-bar .to-reload.is-refreshing .theme-icon {
  animation: oral-wheel 0.5s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .switches-bar .to-reload.is-refreshing .theme-icon {
    animation-duration: 1.5s;
  }
}

.switches-bar :is(.to-top, .to-reload):hover {
  color: var(--ink);
}

.switches-bar :is(.to-top, .to-reload):focus-visible {
  outline: 3px solid var(--notes-accent);
  outline-offset: 2px;
}

/* A choice tapped gets the focus: always in view, it must not move the page, as the room kept above the focus for the
   readings' header (scroll-padding-top) would otherwise do. */
.site-switches input {
  scroll-margin-top: -100vh;
}

:is(.site-mode, .site-theme) fieldset {
  display: inline-flex;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.theme-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.75rem;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}

.theme-choice:hover {
  color: var(--ink);
}

.theme-choice:has(input:checked) {
  background: var(--accent);
  color: var(--paper);
}

.theme-choice:has(input:focus-visible) {
  outline: 3px solid var(--notes-accent);
  outline-offset: 2px;
}

.theme-icon {
  width: 1rem;
  height: 1rem;
}

/* The buttons that send a choice without script: hidden as soon as the page can script, from its first paint
   (scripting), or once the script runs where that query is unknown (.js). */
@media (scripting: enabled) {
  :is(.site-mode, .site-theme, .site-lang) button {
    display: none;
  }
}

.js :is(.site-mode, .site-theme, .site-lang) button {
  display: none;
}

/* Phones: the site's name takes the rest of the line (no more than its own width, as a link) and wraps rather than push
   the language picker down; the tagline under both. */
@media (max-width: 47.99rem) {
  .brand {
    flex: 1 1 0;
    min-width: 0;
    max-width: max-content;
  }

  .brand-sub {
    order: 2;
    flex-basis: 100%;
  }
}

.mass-name {
  margin: 1.5rem 0 0.9rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--line);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---- Day header */

/* The top of the day page on one scale: 0.75rem between its parts (tabs, the bar of the liturgical colour, the date,
   the chips), 1rem between its blocks (the day, the notices, the readings); the date and its lines close together. */
.day {
  margin-top: 0.75rem;
  padding: 0.75rem 0 0;
  border-top: 4px solid var(--lit);
}

.color-vert {
  --lit: var(--lit-vert);
}
.color-violet {
  --lit: var(--lit-violet);
}
.color-rouge {
  --lit: var(--lit-rouge);
}
.color-blanc {
  --lit: var(--lit-blanc);
}
.color-rose {
  --lit: var(--lit-rose);
}
.color-noir {
  --lit: var(--lit-noir);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day h1 {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 600;
  line-height: 1.15;
}

.liturgical {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.feast {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
}

.day-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}

.day-meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.color-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--lit);
}

.day-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* ---- Notices */

.date-check {
  margin: 0.75rem 0 0;
  color: var(--ok);
  font-size: 0.9rem;
}

.notice {
  margin: 1rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--info-line);
  border-radius: var(--radius);
  background: var(--info-bg);
  font-size: 0.92rem;
}

/* The notices of the page, under the day: 1rem above each, nothing under (the readings keep their own 1rem). */
.day-intro > .notice {
  margin: 1rem 0 0;
}

.notice-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.notice-demo {
  border: 1px dashed var(--hypothese);
  background: var(--hypothese-bg);
}

/* ---- Readings (AELF) */

.flag {
  display: inline-block;
  margin: 0 0 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* A link to the day's readings on aelf.org, in a new tab: underlined, as a link. */
.flag-aelf {
  color: var(--accent-ink);
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.flag-aelf:hover {
  border-color: var(--accent-ink);
}

.readings {
  margin-top: 1rem;
}

.readings-header h2,
.notes-header h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

/* The notes' title in the letter of the readings', so that the two headers read the same. */
.readings-header h2,
.notes-header h2,
.drawer-title {
  font-family: var(--serif);
}

.notes-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
}

/* The readings' table of contents, like the notes': one line per reading, its name and its short reference. */
.readings-toc {
  margin: 0.4rem 0 0;
}

.readings-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.readings-toc ol a {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.1rem 0;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
}

.readings-toc ol a:hover .jump-type,
.readings-toc ol a:focus-visible .jump-type {
  color: var(--accent-ink);
  text-decoration: underline;
}

.readings-toc .jump-type {
  font-size: 0.9rem;
  font-weight: 600;
}

.readings-toc .jump-ref {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Like the notes' header, the readings' header stays at the top of the screen: title and table of contents in a box,
   the band of the reading being read sticking just under it. Its height, measured by public/app.js, places the bands. */
.readings-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
  padding: max(var(--toggle-top), env(safe-area-inset-top)) 1rem 0.4rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.readings-header .flag {
  margin: 0;
}

.readings-header h2 {
  order: -1;
  min-height: var(--toggle-height);
  font-size: 1.2rem;
  line-height: var(--toggle-height);
}

.readings-toc {
  flex-basis: 100%;
  margin-top: 0.15rem;
}

/* On every screen, the title of the readings' or the notes' header is the button that folds its table of contents
   (public/app.js): folded, the header is as tall as a band (its title line, the same margins, its border within). */
.toc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: var(--toggle-height);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.toc-chevron {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.25s ease;
}

.is-folded .toc-chevron {
  transform: rotate(-90deg);
}

/* Without script, the title is no button: no chevron (the table stays open). */
@media (scripting: none) {
  .toc-chevron {
    display: none;
  }
}

/* The fold slides: each table is a grid of one row, from 1fr to 0fr (an auto height does not transition, a grid row
   does), its list cut to the row. Folded, it is hidden once the slide is over, so that its links leave the keyboard
   and the screen readers; the header shrinks with it, and the bands follow (public/app.js measures it each frame). */
.readings-toc,
.drawer-toc {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.25s ease,
    margin-top 0.25s ease,
    visibility 0s linear 0s;
}

.readings-toc > ol,
.drawer-toc > ol {
  min-height: 0;
  overflow: hidden;
}

.readings-header,
.drawer-header {
  transition: padding-bottom 0.25s ease;
}

/* Only the delay of the hiding changes (once the slide is over): the transitions themselves stay those of the table,
   which .toc-instant and less motion can turn off. */
.readings-header.is-folded .readings-toc,
.drawer-header.is-folded .drawer-toc {
  grid-template-rows: 0fr;
  margin-top: 0;
  visibility: hidden;
  transition-delay: 0s, 0s, 0.25s;
}

.readings-header.is-folded,
.drawer-header.is-folded {
  padding-bottom: calc(var(--toggle-top) - 1px);
}

/* Without script, nothing could open them again: the tables stay open, whatever the cookie says (src/app.ts). */
@media (scripting: none) {
  .readings-header.is-folded,
  .drawer-header.is-folded {
    padding-bottom: 0.4rem;
  }

  .readings-header.is-folded .readings-toc,
  .drawer-header.is-folded .drawer-toc {
    grid-template-rows: 1fr;
    margin-top: 0.15rem;
    visibility: visible;
  }
}

/* No slide when the fold is set as the page comes (public/app.js), nor for a reader who asks for less motion. */
.toc-instant :is(.toc-chevron, .readings-toc, .drawer-toc, .readings-header, .drawer-header) {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .toc-chevron,
  .readings-toc,
  .drawer-toc,
  .readings-header,
  .drawer-header,
  .readings-header.is-folded .readings-toc,
  .drawer-header.is-folded .drawer-toc {
    transition: none;
  }
}

html:has(.readings-header) {
  scroll-padding-top: calc(var(--readings-head, 7rem) + 0.5rem);
}

/* Phones: from one edge of the screen to the other, as the readings and the drawer's header. */
@media (max-width: 40rem) {
  .readings-header {
    margin-inline: -1rem;
  }
}

.reading {
  padding: 1.25rem 0 0.75rem;
  border-bottom: 1px solid var(--line);
}

.reading:last-of-type {
  border-bottom: 0;
}

/* ---- One pastel tone per reading, the same on its text and on its note: the reader sees which one they are in. */
.tone-first {
  --tone-bg: var(--tone-first-bg);
  --tone-line: var(--tone-first-line);
  --tone-ink: var(--tone-first-ink);
}

.tone-psalm {
  --tone-bg: var(--tone-psalm-bg);
  --tone-line: var(--tone-psalm-line);
  --tone-ink: var(--tone-psalm-ink);
}

.tone-second {
  --tone-bg: var(--tone-second-bg);
  --tone-line: var(--tone-second-line);
  --tone-ink: var(--tone-second-ink);
}

.tone-gospel {
  --tone-bg: var(--tone-gospel-bg);
  --tone-line: var(--tone-gospel-line);
  --tone-ink: var(--tone-gospel-ink);
}

.reading:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel) {
  --card-pad: 1rem;
  margin: 0;
  padding: var(--card-pad);
  background: var(--tone-bg);
  border: 1px solid var(--tone-line);
}

/* Like the notes, the first reading right under the readings' header and each one right after the other: the band of
   each marks where it starts. */
.readings-header + .reading:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel),
.reading:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel) + .reading:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel) {
  border-top: 0;
}

.reading:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel) .reading-type {
  color: var(--tone-ink);
}

/* The swatch of a reading in the tables of contents: the one being read (public/app.js) has a smaller square of its ink
   inside, the pastel around it. Elsewhere, the pastel covers the ink, which shows as the square grows. */
.tone-swatch {
  display: inline-block;
  flex: none;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.35em;
  border: 1px solid var(--tone-ink);
  border-radius: 3px;
  background: var(--tone-ink);
  box-shadow: inset 0 0 0 0.5em var(--tone-bg);
  vertical-align: -0.02em;
  transition: box-shadow 0.15s ease;
}

[aria-current] > .tone-swatch {
  box-shadow: inset 0 0 0 0.13em var(--tone-bg);
}

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

/* The name of the reading: a band that stays at the top of the screen, under the readings' header, while its reading
   scrolls by, until the band of the next reading takes its place. The name tells what the colour shows. */
.reading-header {
  position: sticky;
  top: var(--readings-head, 7rem);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem 0.75rem;
  min-height: var(--band-height);
  margin: 0 0 0.6rem;
  padding: 0;
  background: var(--bg);
}

.reading:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel) .reading-header {
  margin: calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad)) 0.6rem;
  padding: 0 var(--card-pad);
  background: var(--tone-bg);
  border-bottom: 1px solid var(--tone-line);
}

/* Phones: each reading from one edge of the screen to the other, for the widest lines. */
@media (max-width: 40rem) {
  .reading:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel) {
    --card-pad: 0.75rem;
    margin-inline: -1rem;
    border-inline: 0;
  }
}

/* The « Note » button of a reading's band and the « Lecture » button of a note's band, at their right: each leads to
   the start of the other one, and both look the same (`.note .note-reading` outweighs the colour of the notes' links). */
.reading-note,
.note .note-reading {
  display: inline-flex;
  align-items: center;
  min-height: var(--band-button);
  margin-left: auto;
  padding: 0 0.55rem;
  border: 1px solid var(--tone-ink, var(--accent));
  border-radius: 999px;
  color: var(--tone-ink, var(--accent));
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
}

/* Narrower, in smaller type, on phones only, where the band is short of room; their height stays that of the chips. */
@media (min-width: 48rem) {
  .reading-note,
  .note .note-reading {
    padding: 0 0.7rem;
    font-size: 0.8rem;
  }
}

.reading-note:hover,
.note .note-reading:hover {
  background: var(--tone-line, var(--line));
}

.reading-note:focus-visible,
.note .note-reading:focus-visible {
  outline: 2px solid var(--tone-ink, var(--accent));
  outline-offset: 2px;
}

/* The name of a reading or of a note, in its band: a link back to its start (public/app.js), in the name's colour,
   over the links of the notes (.notes a), and underlined as a link; thicker under the pointer. */
:is(.reading-type, .note-kind) > .band-title {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.band-title:hover,
.band-title:focus-visible {
  text-decoration-thickness: 2px;
}

.reading-type {
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reading-headline {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.35;
}

.reading-ref {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.reading-text {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.reading-text p {
  margin: 0 0 0.9rem;
}

/* Phones: as compact as on aelf.org (Open Sans 15px, tight lines, 10px between paragraphs). A serif of 16px is about as
   wide as that sans of 15px, so the lines of the text break where AELF's do; 16px stays the least for running text. */
@media (max-width: 40rem) {
  .reading-text {
    font-size: 1rem;
    line-height: 1.5;
  }

  .reading-text p {
    margin-bottom: 0.65rem;
  }
}

/* ---- Notes (generated) */

.notes {
  margin-top: 1rem;
  padding: 1.25rem 1rem 1rem;
  background: var(--notes-bg);
  color: var(--notes-ink);
  border: 1px solid var(--notes-line);
  border-left: 5px solid var(--notes-accent);
  border-radius: var(--radius);
}

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

.notes-intro {
  margin: 0.4rem 0 0;
  color: var(--notes-muted);
}

/* In the colours of the notes, the notice of how they were written in the page too (under the day's notices). */
.notes .notice,
.day-intro > .notice-ai {
  background: var(--notes-paper);
  border-color: var(--notes-line);
}

.notes .notice-demo,
.day-intro > .notice-demo {
  border: 1px dashed var(--hypothese);
  background: var(--hypothese-bg);
}

/* The AI tag opens the notice, in the line of its text. */
.notice-ai .ai-tag {
  margin-right: 0.15em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--notes-muted);
}

.kind {
  display: inline-block;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.5;
  vertical-align: 0.08em;
  white-space: nowrap;
}

.kind-fait {
  color: var(--fait);
  background: var(--fait-bg);
}

.kind-hypothese {
  color: var(--hypothese);
  background: var(--hypothese-bg);
}

.refs {
  margin-left: 0.15rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

.refs a {
  text-decoration: none;
  font-weight: 650;
}

.note h3 {
  margin: 0;
  font-size: 1.15rem;
}

/* The timeline of a note, oldest first. */
.timeline {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--notes-line);
}

.timeline li {
  position: relative;
  margin: 0 0 0.85rem;
  padding-left: 1rem;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -0.4rem;
  top: 0.4rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--notes-accent);
  border: 2px solid var(--notes-paper);
}

.timeline .when {
  margin: 0;
  font-weight: 650;
  font-size: 0.9rem;
}

.timeline .what {
  margin: 0.1rem 0 0;
}

/* What the item is to the passage, beside its dating: the scene, the writing of the book, a landmark. */
.timeline-role {
  color: var(--notes-muted);
  font-weight: 400;
}

/* What the item is (src/frise/about.ts), then its dating remark, under each point of a note's chronology. */
.timeline-about {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
}

.timeline-note {
  margin: 0.1rem 0 0;
  color: var(--notes-muted);
  font-size: 0.85rem;
}

.note {
  --note-pad: 1rem;
  margin: 1rem 0 0;
  padding: var(--note-pad);
  background: var(--notes-paper);
  border: 1px solid var(--notes-line);
}

.note:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel) {
  background: var(--tone-bg);
  border-color: var(--tone-line);
}

.note:is(.tone-first, .tone-psalm, .tone-second, .tone-gospel) .note-type {
  color: var(--tone-ink);
}

.note-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.75rem;
  margin-top: 0.5rem;
}

/* Like a reading's, the name of a note's reading is a band that stays at the top of the drawer while the note scrolls
   by: one line, the name, then chips that lead to parts of the note (its chronology, its places on the map, its oral
   explanation), the « Lecture » button at the right. On phones the name is abridged and the chips closer, so that the
   longest name, its three chips and the button fit. */
.note-type {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: var(--band-height);
  margin: calc(-1 * var(--note-pad)) calc(-1 * var(--note-pad)) 0;
  padding: 0 var(--note-pad);
  background: var(--tone-bg, var(--notes-paper));
  border-bottom: 1px solid var(--tone-line, var(--notes-line));
  color: var(--notes-muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The chips are buttons like « Lecture » (same border, same height), against it at the right, the gap between
   them and before it the same; the name keeps them at a distance. */
.note-kind {
  margin-right: 0.6rem;
  /* The name as a reading's (.reading-type), the chips keeping the band's size. */
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* The name of a reading, in its band and in its note's (views/labels.ts kindName): « Première lecture » in full on
   tablets and wider, « 1re lecture » on phones (where the drawer of the notes goes over the readings), the full name
   staying for the ear only. The ordinal's letters are a styled <sup>, which every font renders, not the Unicode
   superscript letters, which many fonts lack. */
.kind-short {
  display: none;
}

.kind-short sup {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: 0.4em;
}

@media (max-width: 47.99rem) {
  .kind-long {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .kind-short {
    display: inline;
  }
}

.note-jumps {
  display: flex;
  flex: none;
  gap: 0.3rem;
  margin: 0 0.3rem 0 auto;
}

.note-type .note-reading {
  margin-left: 0;
}

.note .note-jump {
  display: inline-grid;
  place-items: center;
  width: var(--band-button);
  height: var(--band-button);
  border: 1px solid var(--tone-ink, var(--accent));
  border-radius: 999px;
  color: var(--tone-ink, var(--accent));
}

.note .note-jump .icon {
  width: 0.9rem;
  height: 0.9rem;
}

/* Under the mouse and under the finger, the icon alone swells a little and comes back (the chip keeps its size,
   nothing stays big), as in the icon buttons of the parts (.frise-point): a sign of life, no colour. */
@keyframes icon-swell {
  50% {
    transform: scale(1.2);
  }
}

.note .note-jump .icon,
.frise-point .icon {
  transition: transform 0.15s ease;
}

.note .note-jump:hover .icon,
.frise-point:hover .icon {
  animation: icon-swell 0.4s ease;
}

.note .note-jump:active .icon,
.frise-point:active .icon {
  transform: scale(1.3);
}

@media (prefers-reduced-motion: reduce) {
  .note .note-jump .icon,
  .frise-point .icon {
    transition: none;
    animation: none;
  }
}

.note .note-jump:focus-visible {
  outline: 2px solid var(--tone-ink, var(--accent));
  outline-offset: 2px;
}

@media (max-width: 47.99rem) {
  .note-jumps {
    gap: 0.2rem;
    margin-right: 0.2rem;
  }
}

.note-status {
  margin: 0;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--notes-line);
  color: var(--notes-muted);
}

.status-reviewed {
  color: var(--fait);
  border-color: currentColor;
}

.status-demo {
  color: var(--hypothese);
  border-style: dashed;
  border-color: currentColor;
}

.note-passage {
  margin: 0.4rem 0 0;
  color: var(--notes-muted);
  font-size: 0.82rem;
}

.note-passage > * {
  display: block;
}

.note-passage a,
.part-ref a,
.echo-ref a {
  color: var(--notes-accent);
}

/* ---- The oral explanation of a note (src/oral, src/views/notes.ts, public/app.js): a part of the note like the
   others, at its foot before its sources (a titled card for the children, public/enfants.css), with a player of
   one height in every state (to ask for, being prepared, played), and under it what it is. While it is prepared, a
   small line takes the place of its bar: nothing below it moves. The part heard stands out from the part to come.
   Hidden without script: nothing could play it. */
.oral {
  --oral-rest: color-mix(in srgb, var(--notes-ink) 17%, var(--notes-paper));
  margin: 0;
}

.oral-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  height: 3rem;
  padding: 0 0.9rem 0 0.35rem;
  border: 1px solid color-mix(in srgb, var(--notes-accent) 30%, var(--notes-paper));
  border-radius: 999px;
  background: color-mix(in srgb, var(--notes-accent) 9%, var(--notes-paper));
  cursor: pointer;
}

.oral-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--notes-accent);
  color: var(--notes-paper);
  cursor: pointer;
}

.oral-toggle:hover {
  filter: brightness(1.08);
}

.oral-toggle:focus-visible {
  outline: 3px solid var(--notes-ink);
  outline-offset: 2px;
}

.oral-icon,
.oral-wheel {
  grid-area: 1 / 1;
}

/* The triangle, a little to the right: it looks centred so. */
.oral-icon-play {
  margin-left: 2px;
}

.oral-icon-pause,
.oral-wheel,
.oral[data-oral-state='playing'] .oral-icon-play,
.oral[data-oral-state='pending'] .oral-icon-play {
  display: none;
}

.oral[data-oral-state='playing'] .oral-icon-pause {
  display: block;
}

/* While it is prepared, a wheel in place of the triangle, and a light that passes along the player. */
.oral[data-oral-state='pending'] .oral-wheel {
  display: block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: oral-wheel 0.8s linear infinite;
}

.oral[data-oral-state='pending'] .oral-player {
  background-image: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--notes-accent) 14%, transparent) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: oral-light 2.4s ease-in-out infinite;
}

.oral[data-oral-state='pending'] :is(.oral-player, .oral-toggle) {
  cursor: progress;
}

@keyframes oral-wheel {
  to {
    transform: rotate(360deg);
  }
}

@keyframes oral-light {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -50% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oral[data-oral-state='pending'] .oral-wheel {
    animation-duration: 2.4s;
  }

  .oral[data-oral-state='pending'] .oral-player {
    animation: none;
  }
}

/* Where the bar will be: what to tap, then, in small, that it is prepared, or why it could not be. Two lines at most. */
.oral-message {
  display: -webkit-box;
  grid-column: 2 / -1;
  margin: 0;
  overflow: hidden;
  color: var(--notes-ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.oral:is([data-oral-state='pending'], [data-oral-state='error'], [data-oral-state='quota']) .oral-message {
  color: var(--notes-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.oral-seek,
.oral-time,
.oral:is([data-oral-state='ready'], [data-oral-state='playing']) .oral-message {
  display: none;
}

.oral:is([data-oral-state='ready'], [data-oral-state='playing']) :is(.oral-seek, .oral-time) {
  display: block;
}

/* The bar: the part heard in the colour of the notes, the part to come in grey; its knob to move along it. */
.oral-seek {
  --played: 0%;
  width: 100%;
  height: 1.5rem;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.oral-seek::-webkit-slider-runnable-track {
  height: 0.4rem;
  border-radius: 999px;
  background: linear-gradient(to right, var(--notes-accent) var(--played), var(--oral-rest) var(--played));
}

.oral-seek::-webkit-slider-thumb {
  width: 1rem;
  height: 1rem;
  margin-top: -0.3rem;
  border: 2px solid var(--notes-paper);
  border-radius: 50%;
  background: var(--notes-accent);
  box-shadow: 0 0 0 1px var(--notes-accent);
  appearance: none;
}

.oral-seek::-moz-range-track {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--oral-rest);
}

.oral-seek::-moz-range-progress {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--notes-accent);
}

.oral-seek::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--notes-paper);
  border-radius: 50%;
  background: var(--notes-accent);
  box-shadow: 0 0 0 1px var(--notes-accent);
}

.oral-seek:focus-visible {
  border-radius: 999px;
  outline: 2px solid var(--notes-ink);
  outline-offset: 2px;
}

.oral-time {
  color: var(--notes-muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* What the explanation is: a precision, as the secondary texts of the notes (.timeline-note). */
.oral-about {
  margin: 0.5rem 0 0;
  color: var(--notes-muted);
  font-size: 0.85rem;
}

/* The pictures of what is heard (src/oral/pictures.ts): one large picture above the player, fading from one to the
   next and moving slowly towards its subject (public/app.js); under the player, the pictures in small, as chapters. */
/* Seen whole: as wide as the card, 24rem at most, and never taller than what the screen leaves under the drawer's
   header and the note's band, above the line of the switches, with the title and the player around it (a low screen,
   a phone turned), 15 % of it kept as a margin; in the middle of the card. */
.oral-stage {
  --oral-room: calc(var(--notes-head, 7rem) + var(--band-height, 3rem) + var(--switches-bar, 0px) + 8rem);
  position: relative;
  width: min(100%, 24rem, max(6rem, calc((100vh - var(--oral-room)) * 0.85)));
  width: min(100%, 24rem, max(6rem, calc((100dvh - var(--oral-room)) * 0.85)));
  aspect-ratio: 1;
  margin: 0 auto 0.65rem;
  overflow: hidden;
  background: var(--notes-line);
  border-radius: 16px;
}

.oral-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.oral-shot.is-shown {
  opacity: 1;
}

.oral-chapters {
  display: flex;
  justify-content: safe center;
  gap: 0.4rem;
  margin: 0.55rem -0.15rem 0;
  padding: 0.15rem 0.15rem 0.35rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  list-style: none;
}

.oral-chapter {
  display: block;
  flex: none;
  width: 3rem;
  height: 3rem;
  padding: 0;
  overflow: hidden;
  background: var(--notes-line);
  border: 2px solid transparent;
  border-radius: 10px;
  opacity: 0.7;
  cursor: pointer;
}

.oral-chapter img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oral-chapter.is-current {
  border-color: var(--notes-accent);
  opacity: 1;
}

/* The grown-ups' pictures, sober next to their notes: no large picture, but one strip above the player, the picture
   of the moment large in its middle (the first before the listening), on a mat; the others small, faded into the
   paper towards the edges. All of them in softened colours, the others more. The strip keeps its height: nothing
   below it moves. */
:root[data-mode='adulte'] .oral-stage {
  display: none;
}

:root[data-mode='adulte'] .oral-chapters {
  --oral-big: min(12rem, 55vw);
  align-items: center;
  justify-content: flex-start;
  height: calc(var(--oral-big) + 0.5rem);
  margin: 0 0 0.75rem;
  padding: 0 calc(50% - var(--oral-big) / 2);
  scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
}

:root[data-mode='adulte'] .oral-chapter {
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid var(--notes-line);
  border-radius: 4px;
  opacity: 0.55;
  filter: saturate(0.45) sepia(0.25);
  transition:
    width 0.5s ease,
    height 0.5s ease,
    opacity 0.5s ease,
    filter 0.5s ease;
}

:root[data-mode='adulte'] .oral-chapter:hover {
  opacity: 0.85;
}

:root[data-mode='adulte'] :is(.oral-chapter.is-current, .oral-chapters:not(:has(.is-current)) li:first-child .oral-chapter) {
  width: var(--oral-big);
  height: var(--oral-big);
  padding: 4px;
  background: var(--notes-paper);
  border-color: color-mix(in srgb, var(--notes-ink) 22%, var(--notes-paper));
  border-radius: 6px;
  opacity: 1;
  filter: saturate(0.8) sepia(0.1);
}

:root[data-mode='adulte'] .oral-chapter img {
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .oral-shot,
  .oral-chapter {
    transition: none !important;
  }
}

/* Over the children's layout of the box too (public/enfants.css). */
@media (scripting: none) {
  .oral {
    display: none !important;
  }
}

/* L’essentiel: the few plain sentences that open a note, set apart from what follows. */
.note-essential {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.85rem 0.7rem;
  background: var(--notes-paper);
  border: 1px solid var(--tone-line, var(--notes-line));
  border-left: 4px solid var(--notes-accent);
  border-radius: var(--radius);
}

.note-essential p {
  margin: 0;
  font-size: 1.05rem;
}

.note-essential h4,
.note-part h4,
.note-sources h4,
.oral h4 {
  margin: 1rem 0 0.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--notes-accent);
}

.note-essential h4 {
  margin-top: 0;
}

.claims {
  margin: 0;
  padding-left: 1.1rem;
}

.claims li {
  margin: 0 0 0.45rem;
}

.part-ref {
  margin-left: 0.35rem;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.part-text {
  margin: 0;
}

.echoes,
.church {
  margin: 0;
  padding-left: 1.1rem;
}

.echoes li,
.church li {
  margin: 0 0 0.55rem;
}

.echo-ref,
.church-ref {
  font-weight: 650;
}

.church-ref {
  margin: 0;
}

.church-ref a {
  color: var(--notes-accent);
}

.church-host {
  margin-left: 0.3rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--notes-muted);
}

/* Who an author is, folded under their name (the note's words, or the site's catalog): a small line with its chevron;
   open, a sentence or two in the colour of the remarks. */
.church-who {
  margin: 0.1rem 0 0.3rem;
  font-size: 0.85rem;
}

.church-who summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--notes-accent);
  list-style: none;
  cursor: pointer;
}

.church-who summary::-webkit-details-marker {
  display: none;
}

.church-who summary::before {
  content: '';
  width: 0.38rem;
  height: 0.38rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.church-who[open] summary::before {
  transform: rotate(45deg);
}

.church-who p {
  margin: 0.25rem 0 0;
  color: var(--notes-muted);
}

@media (prefers-reduced-motion: reduce) {
  .church-who summary::before {
    transition: none;
  }
}

.church-text {
  margin: 0.15rem 0 0;
}

/* What the saints and the Church say: their texts, numbered as the answers to the hard questions cite them, each with
   its quotation. */
.church-quote {
  margin: 0.3rem 0 0.25rem;
  padding: 0.05rem 0 0.05rem 0.75rem;
  border-left: 3px solid var(--tone-line, var(--notes-line));
  font-family: var(--serif);
  font-style: italic;
}

.church-quote p {
  margin: 0;
}

/* A question the passage raises, asked first, then the answer of the saints and the Church. */
.hard-question {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.8rem;
  border-left: 3px solid var(--notes-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--notes-paper);
}

.hard-question-ask {
  margin: 0 0 0.3rem;
  font-style: italic;
  font-weight: 650;
}

.hard-question-answer {
  margin: 0;
}

/* « Pour aujourd’hui »: a text of the Church or of a saint turning the passage to life, its quotation first, then who
   says it and what they invite to live; their question set apart, to carry through the day. */
.meditation-text {
  margin: 0.35rem 0 0;
}

.meditation-question {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.8rem;
  border-left: 3px solid var(--notes-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--notes-paper);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
}

/* The quiz of a note: its answers as buttons; once one is picked, without script (:has()), the right one turns green,
   the one picked red if wrong, and the sentence that says why appears. public/enfants.css makes it a game. */
.quiz-hint {
  margin: 0 0 0.5rem;
  color: var(--notes-muted);
  font-size: 0.85rem;
}

.quiz {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quiz fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.quiz legend {
  margin-bottom: 0.4rem;
  padding: 0;
  font-weight: 650;
}

.quiz-choices {
  display: grid;
  gap: 0.35rem;
}

.quiz-choice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--notes-line);
  border-radius: var(--radius);
  background: var(--notes-paper);
  cursor: pointer;
}

.quiz-choice:hover {
  border-color: var(--notes-accent);
}

.quiz-choice input {
  flex: none;
  margin: 0;
  accent-color: var(--notes-accent);
}

.quiz-choice:has(input:focus-visible) {
  outline: 3px solid var(--notes-accent);
  outline-offset: 2px;
}

.quiz-question:has(input:checked) .quiz-choice.is-right {
  border-color: var(--ok);
  background: var(--fait-bg);
}

.quiz-choice:not(.is-right):has(input:checked) {
  border-color: var(--wrong);
  background: var(--wrong-bg);
}

.quiz-feedback {
  display: none;
  margin: 0.45rem 0 0;
}

.quiz-question:has(input:checked) .quiz-feedback {
  display: block;
}

.quiz-right {
  color: var(--ok);
}

.quiz-wrong {
  color: var(--wrong);
}

.quiz-question:has(.is-right input:checked) .quiz-wrong,
.quiz-question:has(.quiz-choice:not(.is-right) input:checked) .quiz-right {
  display: none;
}

.entities {
  margin: 0;
}

.entities div {
  margin: 0 0 0.45rem;
}

.entities dt {
  display: inline;
  font-weight: 650;
}

.entities dt::after {
  content: ' — ';
  font-weight: 400;
  color: var(--notes-muted);
}

.entities dd {
  display: inline;
  margin: 0;
}

/* Sources as chips (as in quizzer-llm-2): the number of the superscripts, the site or the kind of source,
   then the citation, flowing as text so that a long one wraps inside its chip. One per line, as wide as its text. */
.source-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-chips li {
  display: flex;
  min-width: 0;
  max-width: 100%;
  border-radius: 10px;
}

.source-chips li:target {
  outline: 2px solid var(--hypothese);
  outline-offset: 1px;
}

.source-chip {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: 5px 10px;
  overflow-wrap: anywhere;
  border: 1px solid var(--notes-line);
  border-radius: 10px;
  background: var(--notes-bg);
  color: var(--notes-ink);
  font-size: 0.82rem;
  line-height: 1.35;
  text-decoration: none;
}

.notes a.source-chip {
  color: var(--notes-ink);
}

a.source-chip:hover {
  border-color: var(--notes-accent);
}

.source-number {
  display: inline-block;
  min-width: 1.2rem;
  margin-right: 6px;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--notes-paper);
  color: var(--notes-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.source-host {
  margin-right: 6px;
  font-weight: 700;
  color: var(--notes-accent);
}

.source-title {
  color: var(--notes-muted);
}

.note-missing {
  margin: 0.75rem 0 0;
  color: var(--notes-muted);
}

.spinner {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.3rem;
  border: 2px solid var(--notes-line);
  border-top-color: var(--notes-accent);
  border-radius: 50%;
  vertical-align: -0.1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

.note-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--notes-line);
}

.note-error {
  flex-basis: 100%;
  margin: 0;
  color: var(--hypothese);
  font-size: 0.82rem;
}

/* ---- What an artificial intelligence wrote */

.ai-tag {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  background: var(--notes-accent);
  color: var(--notes-paper);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-decoration: none;
  text-transform: none;
  vertical-align: 0.1em;
  cursor: help;
}

/* ---- The cross that closes the drawer on phones (the « Note » buttons of the readings open it): at the top right of
   the drawer, whatever its scroll, on the line of the title of the notes at the top, then of their header once it
   sticks there. Fixed inside the drawer, it comes and goes with it (the drawer, transformed open or closed, is where
   it is placed). A link back to the readings: the script closes the drawer with it (public/app.js); without script,
   following it closes the drawer opened on :target. Two bars draw the cross. */

.notes-close {
  position: fixed;
  top: max(var(--toggle-top), env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  /* A round button as tall as the others (over the 24px minimum of WCAG 2.5.8): the less room it takes, the more
     often « Notes » and its chip keep to its line. */
  width: var(--toggle-height);
  height: var(--toggle-height);
  padding: 0;
  border: 1px solid var(--notes-line);
  border-radius: 999px;
  background: var(--notes-bg);
  color: var(--notes-ink);
  text-decoration: none;
  cursor: pointer;
}

.notes-close::before,
.notes-close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.9rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.notes-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.notes-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.notes-close:hover {
  border-color: var(--notes-accent);
}

/* Inside the drawer, it shows and hides with it. */
@media (max-width: 47.99rem) {
  .notes-close {
    display: inline-flex;
  }
}

.notes,
.note {
  scroll-margin-top: 1rem;
}

/* ---- Drawer: the notes over the readings, opened by the button (public/app.js) */

html.drawer-open {
  overflow: hidden;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgb(0 0 0 / 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Five sixths of the screen; on wide screens no wider than a comfortable reading measure. */
/* While the notes of the other mode come (public/app.js), these fade a little. */
.notes-drawer.is-switching .notes {
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

.notes-drawer {
  position: fixed;
  top: 0;
  right: 0;
  /* Above the line of the switches. */
  bottom: var(--switches-bar, 0px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 90vw;
  background: var(--notes-bg);
  color: var(--notes-ink);
  border-left: 1px solid var(--notes-line);
  box-shadow: -8px 0 24px rgb(0 0 0 / 0.2);
  font-family: var(--sans);
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.25s ease,
    visibility 0s linear 0.25s;
}

/* Open, still transformed (by nothing): the cross, fixed inside it, stays placed on it, under the line of the switches
   where it starts, rather than on the screen. */
.notes-drawer.is-open,
html:not(.js) .notes-drawer:target,
html:not(.js) .notes-drawer:has(:target) {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.25s ease;
}

/* Like the readings' header: at the top of the drawer, which opens on it, from one edge to the other, it stays there, and the band of the note being read sticks just under it. Its height, measured by public/app.js,
   places the bands. */
.drawer-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
  margin-inline: -0.75rem;
  padding: max(var(--toggle-top), env(safe-area-inset-top)) 1rem 0.4rem;
  background: var(--notes-paper);
  border-bottom: 1px solid var(--notes-line);
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--toggle-height);
  margin: 0;
  /* As the readings' title, across the page, on a line of the same height: both headers alike, the bands of the notes
     stick as high as those of the readings. */
  font-size: 1.2rem;
  font-weight: 700;
  line-height: var(--toggle-height);
}

/* Beside the title, as the readings' « Texte liturgique officiel · AELF »: how the notes were written, a link back to
   the top of the notes, where it is told. */
.drawer-header .flag {
  margin: 0;
}

/* On phones, the line of the title leaves room for the cross, at its right; short of room, the chip goes under. Both
   headers keep their title and chip closer. At the top of the drawer, the title of the notes is on the line of the
   cross too. */
@media (max-width: 47.99rem) {
  .readings-header,
  .drawer-header {
    column-gap: 0.5rem;
  }

  .drawer-header .flag {
    margin-right: calc(var(--toggle-height) + 0.5rem);
  }
}

/* The smallest phones (320px): the drawer leaves less of the page at its left, and its header is a little tighter, so
   that the title of the notes, the children's included, keeps its badge on its line, at the left of the cross. */
@media (max-width: 22.5rem) {
  .notes-drawer {
    width: calc(100vw - 1.25rem);
  }

  /* Its title at the left edge of the notes' text. */
  .drawer-header {
    column-gap: 0.35rem;
    padding-left: 0.75rem;
  }

  .drawer-header .flag {
    padding-inline: 0.45rem;
    letter-spacing: 0.01em;
  }

  /* Both titles a little smaller, alike: the children’s « Comprendre » keeps its badge on its line. */
  .readings-header h2,
  .drawer-title {
    font-size: 1.1rem;
  }
}

.flag-ai {
  color: var(--notes-accent);
  background: var(--notes-paper);
  border: 1px solid var(--notes-line);
  text-decoration: none;
}

.flag-ai:hover {
  border-color: var(--notes-accent);
}

.drawer-toc {
  flex-basis: 100%;
  margin-top: 0.15rem;
}

/* Table of contents: one plain line per reading, under the title. */
.drawer-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawer-toc a {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.1rem 0;
  line-height: 1.35;
  color: var(--notes-ink);
  text-decoration: none;
}

.drawer-toc a:hover .jump-type,
.drawer-toc a:focus-visible .jump-type {
  color: var(--notes-accent);
  text-decoration: underline;
}

.drawer-toc .jump-type {
  display: inline;
  color: var(--notes-ink);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

.drawer-toc .jump-ref {
  color: var(--notes-muted);
  font-size: 0.8rem;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* What a link or the keyboard brings into view is never left under the header or the band of a note. */
  scroll-padding-top: calc(var(--notes-head, 7rem) + 3.5rem);
  padding: 0 0.75rem max(2rem, env(safe-area-inset-bottom));
}

/* In the drawer, the notes lose their own frame: the drawer is one, and the header already gives their title. */
.drawer-body .notes {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: none;
}

/* In the drawer, each note from one edge to the other, on the tone of its reading: no grey margin, no side border. As
   the readings, the first one right under the header and each one right after the other: their tones and a line part
   them. */
.drawer-body .note {
  --note-pad: 0.85rem;
  margin: 0 -0.75rem;
  border-inline: 0;
  border-top: 0;
}

.drawer-body .note-type {
  top: var(--notes-head, 7rem);
}

.drawer-body .notes > :not(.note),
.drawer-body .note > :not(.note-type) {
  max-width: 46rem;
}

/* ---- Shadows at the edges of the screen where more is to read, as the scrollbar hides on phones: at the top while
   something is above (over the headers, which stay there), at the bottom of the drawer while more follows. Rounded
   scroll shadows (radial gradients, darker in the middle), drawn over the headers and the text without catching a
   click, and only a hint: nothing is read out. public/app.js sets the classes from the scroll: `scroll-state()`
   queries and scroll-driven animations would do it in CSS, but Safari and Firefox lack one or the other. */
.readings-header::before,
.notes-drawer::before,
.notes-drawer::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 0.9rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* The readings' header is at the top of the screen once it sticks: the top of the page shows there. */
.readings-header::before,
.notes-drawer::before {
  top: 0;
  background: radial-gradient(farthest-side at 50% 0, var(--scroll-shadow), transparent);
}

/* Over the notes' header and its cross (z-index 3), over the bands of the notes (2). */
.notes-drawer::before {
  z-index: 4;
}

.notes-drawer::after {
  bottom: 0;
  z-index: 2;
  background: radial-gradient(farthest-side at 50% 100%, var(--scroll-shadow), transparent);
}

.readings-header.is-stuck::before,
.notes-drawer.more-above::before,
.notes-drawer.more-below::after {
  opacity: 1;
}

/* Under the band of the reading or note being read, once part of it has scrolled under the band: a light shadow of the
   band's own hue (more of it is above). Its deep colour, faint, on a light page; a dark shade with a touch of the hue
   on a dark one, where a light colour would glow rather than shade. */
.reading-header,
.note-type {
  --band-shadow: color-mix(in srgb, var(--tone-ink, var(--ink)) var(--band-shade-share), var(--band-shade-base));
}

.reading-header::after,
.note-type::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.6rem;
  background: radial-gradient(farthest-side at 50% 0, var(--band-shadow), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.reading-header.is-stuck::after,
.note-type.is-stuck::after {
  opacity: 1;
}

/* High contrast (forced colours): no shading; the borders already part the headers from the text. */
@media (forced-colors: active) {
  .readings-header::before,
  .notes-drawer::before,
  .notes-drawer::after,
  .reading-header::after,
  .note-type::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-drawer,
  .notes-drawer.is-open,
  .drawer-backdrop,
  .readings-header::before,
  .notes-drawer::before,
  .notes-drawer::after,
  .reading-header::after,
  .note-type::after {
    transition: none;
  }
}

/* ---- Buttons and forms */

.button {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button-quiet {
  background: transparent;
  color: var(--accent-ink);
}

.button-small {
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.notes .button {
  border-color: var(--notes-accent);
  background: var(--notes-accent);
  color: var(--notes-paper);
}

.notes .button-quiet {
  background: transparent;
  color: var(--notes-accent);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.inline-form {
  display: inline;
  margin: 0;
}

/* A version to choose and its button side by side (the administration: a note, its explanation, the late ones). */
.version-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin: 0.4rem 0;
}

.version-form select {
  width: auto;
}

/* A note, or its explanation, being written again: a wheel before the words of its button. */
.button.is-busy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: progress;
}

.button.is-busy::before {
  content: '';
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: oral-wheel 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .button.is-busy::before {
    animation-duration: 2.4s;
  }
}

/* In the table of the notes, the button above its selector, both as wide. */
.version-form-stacked {
  display: inline-grid;
  gap: 0.3rem;
  margin: 0;
}

/* A selector drawn in the site's colours: rounded, its own arrow (the colour of the text, light or dark). */
.pretty-select {
  position: relative;
  display: inline-block;
}

.pretty-select select {
  width: 100%;
  min-width: 6.5rem;
  padding: 0.3rem 1.9rem 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  appearance: none;
  cursor: pointer;
}

.pretty-select select:hover {
  border-color: var(--accent);
}

.pretty-select select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.pretty-select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0.8rem;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* Whether a version is the latest: a word in a pill, green or amber. */
.fresh {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.fresh-oui {
  background: color-mix(in srgb, #2e8b57 16%, var(--paper));
  color: color-mix(in srgb, #2e8b57 80%, var(--ink));
}

.fresh-non {
  background: color-mix(in srgb, #d08a1a 18%, var(--paper));
  color: color-mix(in srgb, #b06f0a 85%, var(--ink));
}

.stack {
  display: grid;
  gap: 0.5rem;
  max-width: 100%;
}

.stack input,
.stack select,
.stack textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.stack textarea {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.stack .button {
  justify-self: start;
}

/* A help text under its field, tied to it by aria-describedby. */
.field-hint {
  margin: -0.2rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* A checkbox with its label beside it: the label is part of the target. */
.field-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 0.4rem;
}

.stack .field-check input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  padding: 0;
  accent-color: var(--accent);
}

.settings-form {
  max-width: 34rem;
}

/* A group of choices: the legend reads like the labels of the other fields. */
.field-group {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group legend {
  margin-bottom: 0.25rem;
  padding: 0;
}

/* The device code of the ChatGPT login: big, spaced, easy to copy by hand. */
.device-code {
  margin: 0.5rem 0;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.settings-action {
  margin: 0.75rem 0 1.5rem;
}

/* ---- Other pages */

.unavailable,
.admin {
  margin-top: 1.5rem;
  padding: 1.25rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* The pages of the administration: the current one in bold, not a link to follow. */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: -0.25rem 0 1rem;
}

.admin-nav [aria-current='page'] {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.admin-narrow {
  max-width: 28rem;
}

.admin h1,
.unavailable h1,
.unavailable h2 {
  margin-top: 0;
  font-family: var(--serif);
}

/* A table wider than the screen scrolls in its box; what is placed in it (a title read by screen readers only) stays in
   it too, rather than pushing the page sideways. */
.table-scroll {
  position: relative;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

/* The table of the notes (src/views/admin.ts, public/admin.js): above it, a search, filters and a range of days, which
   wrap; the table keeps its columns whole and scrolls sideways. Hidden without script, the tools: nothing would run them. */
.table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 0.8rem;
  margin: 0.75rem 0;
}

.table-tools label,
.table-dates {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-tools input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
}

.table-search input {
  width: min(22rem, 80vw);
}

/* The range of days: its name above, as the other filters', then its fields, which go under one another when the
   screen is narrow (a fieldset is as wide as its content unless told otherwise: it would push the page sideways). */
.table-dates {
  min-inline-size: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

.table-dates legend {
  margin-bottom: 0.2rem;
  padding: 0;
}

.table-dates-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}

.table-dates label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* On a phone, « du » and « au » each on its line, under the choice of the days, their fields aligned. */
@media (max-width: 30rem) {
  .table-dates label {
    flex-basis: 100%;
  }

  .table-dates label input {
    margin-left: auto;
    width: calc(100% - 2rem);
  }
}

.table-count {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* The page of the table of the notes takes the whole width of the screen, not the column of the readings: the table shows
   its columns, scrolling only when the screen is narrower. */
main:has(.notes-table) {
  max-width: none;
}

/* One row in two a little darker, to follow a row along; counted on the rows shown (public/admin.js), on all without script. */
.notes-table tbody tr.is-alt td {
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
}

@media (scripting: none) {
  .notes-table tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--ink) 5%, var(--paper));
  }
}

.notes-table td,
.notes-table th {
  white-space: nowrap;
}

/* A column's title is a button that sorts the table; an arrow says which way. */
.sort-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.sort-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[aria-sort='ascending'] .sort-button::after {
  content: ' ▲';
}

[aria-sort='descending'] .sort-button::after {
  content: ' ▼';
}

@media (scripting: none) {
  .sort-button {
    cursor: default;
  }
}

.admin-table th,
.admin-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.revisions li {
  margin-bottom: 0.3rem;
}

/* The versions of each tab, on the dashboard and the configuration. */
.tab-versions {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
}

/* A prompt as it was sent: its lines kept, wrapped to the page. */
.prompt-text {
  overflow-x: auto;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
}

/* ---- Tablets and wider: the page of the phones, in two columns. On the left, the page itself (the day, the readings),
   in the body; on the right, the notes, in the drawer, always open. Each column scrolls on its own over all it holds,
   its scrollbar at its own edge, as the page and the drawer do on phones; the cross, the backdrop and the drawer's
   slide go. On screens only: printed, the page stays one column (the drawer is not printed). */
@media screen and (min-width: 48rem) {
  html:has(.notes-drawer) {
    --readings-share: 52%;
    overflow: hidden;
    scrollbar-gutter: auto;
  }

  body:has(.notes-drawer) {
    width: var(--readings-share);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* What a link or the keyboard brings into view is never left under the readings' header. */
    scroll-padding-top: calc(var(--readings-head, 7rem) + 0.5rem);
  }

  /* Above the line of the switches, as the drawer of the notes: the line is under the column, not in it. */
  body:has(.notes-drawer) {
    padding-bottom: 0;
    height: calc(100dvh - var(--switches-bar, 0px));
  }

  html.frise-drawer-open body:has(.notes-drawer) {
    padding-bottom: var(--frise-h, 0px);
    scroll-padding-bottom: var(--frise-h, 0px);
  }

  /* On wide screens, the readings keep their width, against the notes. */
  body:has(.notes-drawer) :is(.site-header, main, .site-footer) {
    max-width: 48rem;
    margin-inline: auto 0;
  }

  .notes-drawer {
    left: var(--readings-share);
    z-index: 1;
    width: auto;
    transform: none;
    visibility: visible;
    transition: none;
    box-shadow: none;
  }

  .drawer-backdrop {
    display: none;
  }
}

/* ---- Wider screens */

@media (min-width: 48rem) {
  .notes {
    padding: 1.75rem 2rem 1.25rem;
  }

  .note {
    --note-pad: 1.25rem;
  }

  .entities div {
    margin-bottom: 0.35rem;
  }
}

@media print {
  .site-header,
  .site-footer,
  .readings-toc,
  .notes-toc,
  .notes-drawer,
  .drawer-backdrop,
  .note-admin {
    display: none;
  }

  .readings,
  .notes,
  .note {
    border: 0;
    background: none;
  }
}

/* ---- The drawer of the timeline (public/frise.js, public/frise.css): the button of a note's chronology opens it;
   without script it would do nothing, and does not show. While it is open, the page and the notes keep room under
   their content for it, so that nothing stays under it. */
html:not(.has-frise) .frise-open {
  display: none;
}

/* Right after the dating of a point of the chronology: a dating too long for its line wraps beside it, and the button
   stays at the top, by its first line. */
.timeline .when {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.when-text {
  min-width: 0;
}

/* A round button with an icon (src/views/icons.ts, drawerIcon): a clock for the timeline, a map for the maps. Its
   middle on the middle of the line beside it (0.9rem, line-height 1.55), and over 24px, the WCAG 2.5.8 minimum. */
.frise-point {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: calc((0.9rem * 1.55 - 1.6rem) / 2);
  padding: 0;
  border: 1px solid var(--notes-line);
  border-radius: 999px;
  background: var(--notes-paper);
  color: var(--notes-accent);
  cursor: pointer;
}

.frise-point .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.frise-point:hover {
  border-color: var(--notes-accent);
}

/* The drawer of the maps (public/carte.js, public/carte.css), built as the timeline's: the button of a place of a note
   opens it, right after its name, as the button of a point of the chronology; what the note says of the place below. */
html:not(.has-carte) .carte-open {
  display: none;
}

.entities.places dt,
.place-era {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Under a scene on the way: where its zone comes from, as the frise says where its date comes from. */
.place-zone {
  display: block;
  margin-top: 0.1rem;
  color: var(--notes-muted);
  font-size: 0.85rem;
}

/* Without a place the maps have: the line that opens the map of the passage's time. */
.place-era {
  margin: 0;
  font-weight: 650;
}

.entities.places dt::after {
  content: none;
}

.entities.places dd {
  display: block;
}

.place-name {
  min-width: 0;
}

/* The drawer of the timeline or of the maps, above the line of the switches: the page keeps room for both. */
html.frise-drawer-open {
  scroll-padding-bottom: calc(var(--frise-h, 0px) + var(--switches-bar, 0px));
}

html.frise-drawer-open body {
  padding-bottom: calc(var(--frise-h, 0px) + var(--switches-bar, 0px));
  scroll-padding-bottom: calc(var(--frise-h, 0px) + var(--switches-bar, 0px));
}

html.frise-drawer-open .drawer-body {
  padding-bottom: calc(var(--frise-h, 0px) + 2rem);
  scroll-padding-bottom: var(--frise-h, 0px);
}

/* The page of the installed application without connection (src/views/offline.ts). */
.offline {
  max-width: 36rem;
  margin: 3rem auto;
  text-align: center;
}

/* ---- The legal pages (src/views/legal.ts): a column of text, a table of the cookies. */
.legal {
  max-width: var(--measure);
  margin: 1.5rem auto 0;
}

.legal h2 {
  margin-top: 1.75rem;
  font-size: 1.15rem;
}

.legal-updated {
  color: var(--muted);
  font-size: 0.9rem;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.legal-table th,
.legal-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  color: var(--muted);
  font-weight: 600;
}
