/* The one stylesheet of the site. Every page links this file and no other.

   The look is the Visit Record soul page, https://visit-record-soul.pages.dev/. The values
   below that have a counterpart there are that page's own: the ground and paper colours,
   the sheet (720px of text, 2.2rem 2rem 3rem of padding, a 1px border, a 14px radius, no
   shadow), the two font stacks, 18px text on a 1.65 line, the heading sizes and margins,
   clay links, the small plain link line above the title, the hairline lists, and the small
   muted notes under a hairline. At 600px and under the sheet fills the screen and the text
   is 17px, as it is there.

   Three things differ from that page on purpose. Small text is 15px or more on a phone,
   where that page keeps it at 13.6px. Links that stand alone are padded to a 44px tap
   target. The sheet keeps clear of the iPhone safe areas.

   The words on a page come from the markup alone. Nothing here hides text or adds any. */

@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-roman.bd38db4cf0.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-italic.f14773cc79.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/noto-sans-roman.3c8cabad1c.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+02C0, U+1D49, U+1D53, U+1D9C, U+1E07, U+1E35;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/noto-sans-italic.6576ec72e2.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+02C0, U+1D49, U+1D53, U+1D9C, U+1E07, U+1E35;
}

@font-face {
  font-family: "Noto Serif Hebrew";
  src: url("/assets/fonts/noto-serif-hebrew.114052355e.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0591-05F4;
}

/* Syriac has its own family name. Served as one more face of "Literata", Chrome picks the
   Latin face for a Syriac letter, finds no glyph, and falls back to whatever the device has. */

@font-face {
  font-family: "Noto Sans Syriac";
  src: url("/assets/fonts/noto-sans-syriac.7c2847ec7c.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0700-074F;
}

:root {
  color-scheme: light;
  --bg: #ebe4d8;
  --paper: #fbf7f0;
  --ink: #1b1714;
  --muted: #6a6258;
  --line: #e0d6c8;
  --clay: #9a4f1e;
  /* The reference stacks, then the site's own files for any letter the device lacks. */
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif, "Literata", "Noto Serif Hebrew", "Noto Sans Syriac";
  --serif: "Iowan Old Style", Palatino, Georgia, serif, "Literata", "Noto Serif Hebrew", "Noto Sans Syriac";
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* The link line, the footer, and labels. */
  --small: 0.85rem;
  /* Notes under a hairline. */
  --note: 0.9rem;
  /* Padding that brings a one-line link to a 44px tap height. */
  --tap: 0.7rem;
  --word-column: 11.5rem;
  --column-gap: 1.5rem;
  /* One line height for every headword, so Hebrew, Greek, and Syriac sit on the same baseline. */
  --word-line: 2.6rem;
}

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

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

/* The page declares viewport-fit=cover, so the ground runs to the edges of the screen and
   the padding keeps the sheet out from under the notch and the home indicator. */

body {
  margin: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.65 var(--sans);
  overflow-wrap: break-word;
}

/* The text column is 720px wide. The sheet adds its padding and its border around that. */

.sheet {
  max-width: calc(720px + 4rem + 2px);
  margin: 2rem auto;
  padding: 2.2rem 2rem 3rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--serif);
  font-weight: 600;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
}

h2 {
  margin: 2.2rem 0 0.6rem;
  color: var(--clay);
  font-size: 1.35rem;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.15rem;
}

h2 + h3 {
  margin-top: 1rem;
}

em {
  font-style: italic;
}

a {
  color: var(--clay);
}

a:focus-visible,
button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

code {
  font-family: var(--mono);
  font-size: 1em;
  overflow-wrap: anywhere;
}

/* Hebrew, Greek, and Syriac. Each <bdi> isolates its own direction, so a right-to-left word
   keeps its letter order inside a left-to-right line. The typefaces are the files this site
   serves, named first so the pointing and the breathings look the same on every device.
   The Hebrew and Syriac files hold one weight, so those words are not drawn in false bold.
   The line height keeps a larger word from pushing its line apart from the others. */

bdi[lang="he"],
bdi[lang="grc"],
bdi[lang="syr"] {
  font-style: normal;
}

bdi[lang="he"] {
  font-family: "Noto Serif Hebrew", var(--serif);
  font-size: 1.12em;
  font-weight: 400;
  line-height: 1;
}

bdi[lang="grc"] {
  font-family: "Literata", var(--serif);
}

bdi[lang="syr"] {
  font-family: "Noto Sans Syriac", var(--sans);
  font-size: 1.12em;
  font-weight: 400;
  line-height: 1;
}

/* A whole verse in its own language stands on lines of its own, under its label and over
   its transliteration. Hebrew and Syriac start at the right. The box is an inline block a
   full line wide, so the paragraph still reads as one line of text, which is what
   scripts/check-browser.mjs compares with the source. */

bdi.verse {
  display: inline-block;
  width: 100%;
  margin: 0.2rem 0;
  line-height: 1.65;
}

bdi[lang="he"].verse,
bdi[lang="syr"].verse {
  direction: rtl;
  line-height: 1.8;
}

.skip-link {
  position: absolute;
  left: -100vw;
  top: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  left: 1.2rem;
}

/* The link line above the title: small, plain, and clay. Each link carries the tap padding
   on every side. The negative margins take it back, so the line sits where a plain line of
   text would and its first word starts at the edge of the text. */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  margin: calc(0rem - var(--tap)) calc(0rem - var(--tap)) calc(1.2rem - var(--tap));
  font-size: var(--small);
}

.trail a,
.site-header .jump {
  display: inline-block;
  min-width: 2.75rem;
  padding: var(--tap);
  text-align: center;
  text-decoration: none;
}

.trail a:hover,
.site-header .jump:hover {
  text-decoration: underline;
}

.trail .sep {
  color: var(--muted);
}

.site-header .jump {
  flex: none;
  margin-left: auto;
}

.site-header .jump::after {
  content: " \2193";
}

/* The line under the page: small and muted, over a hairline. */

.site-footer {
  margin: 2.5rem 0 calc(1em - var(--tap));
  padding: calc(1rem - var(--tap)) 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--small);
}

.site-footer a {
  display: inline-block;
  min-width: 2.75rem;
  padding: var(--tap) var(--tap) var(--tap) 0;
}

/* Running text */

blockquote {
  margin: 1em 0;
  padding: 0 0 0 1.1rem;
  border-left: 2px solid var(--clay);
}

blockquote p {
  margin: 0;
}

/* A rule between parts: a full-width hairline with the heading close under it. */

hr {
  height: 1px;
  margin: 2.5rem 0 0;
  border: 0;
  background: var(--line);
}

hr + h2 {
  margin-top: 1rem;
}

/* Lists of notes: entries divided by hairlines, with no bullets. */

.reading ul,
.sources ul {
  margin: 1em 0;
  padding: 0;
  list-style: none;
}

.reading ul li,
.sources ul li {
  margin: 0;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.reading ul li:first-child,
.sources ul li:first-child {
  padding-top: 0;
  border-top: 0;
}

.reading ul li:last-child,
.sources ul li:last-child {
  padding-bottom: 0;
}

ol {
  margin: 1em 0;
  padding-left: 1.4em;
}

/* Small muted notes: the note that closes a chapter, a note under a table, and whatever
   follows the last rule of a reading, which is its list of sources. */

.reading .note,
.reading table + p,
.reading table + p + p,
.reading hr:last-of-type ~ * {
  color: var(--muted);
  font-size: var(--note);
}

.reading .note {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.reading hr:last-of-type ~ h2 {
  color: var(--clay);
  font-size: 1.15rem;
}

/* The label over a chapter title that opens a new book. */

.reading .part {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: var(--small);
}

/* Word tables. Each row is one entry: the word and its transliteration, then the lexicon
   number, the gloss, the count, and the key verse. The header row is the key to that order
   and wears the same styles as the fields it names. Six columns never have to fit side by
   side, so nothing scrolls sideways on a phone. */

.reading table {
  display: block;
  margin: 1.2rem 0 0;
}

.reading thead,
.reading tbody {
  display: block;
}

.reading tr {
  display: flow-root;
}

.reading thead tr {
  padding: 0 0 0.9rem;
}

.reading tbody tr {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.reading thead th,
.reading tbody td {
  display: block;
  padding: 0;
  text-align: start;
}

.reading thead th {
  font-size: var(--note);
  font-weight: 400;
}

.reading thead th:nth-child(1) {
  font-family: var(--serif);
  font-weight: 600;
}

.reading tbody td:nth-child(1) {
  color: var(--muted);
  font-family: var(--serif);
  font-size: var(--note);
  line-height: var(--word-line);
}

.reading tbody td:nth-child(1) bdi {
  color: var(--ink);
  font-size: 1.75rem;
}

.reading tbody td:nth-child(1) bdi[lang="syr"] {
  font-size: 1.5rem;
}

.reading tbody td:nth-child(1) bdi[lang="grc"] {
  font-size: 1.3rem;
  font-weight: 600;
}

.reading thead th:nth-child(2),
.reading tbody td:nth-child(2) {
  font-style: italic;
}

.reading thead th:nth-child(3),
.reading thead th:nth-child(5),
.reading tbody td:nth-child(3),
.reading tbody td:nth-child(5) {
  color: var(--muted);
}

.reading tbody td:nth-child(3),
.reading tbody td:nth-child(5) {
  font-size: var(--note);
}

.reading tbody td:nth-child(4) {
  margin-top: 0.2rem;
}

.reading tbody td:nth-child(5),
.reading tbody td:nth-child(6) {
  margin-top: 0.5rem;
}

.reading table + p {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.reading table + p + p {
  margin: 0.8em 0 0;
}

/* Wide screens: the word and its transliteration stand in a column on the left, and the
   rest of the entry runs beside them. */

@media (min-width: 601px) {
  .reading thead th:nth-child(-n + 2),
  .reading tbody td:nth-child(-n + 2) {
    float: left;
    clear: left;
    width: var(--word-column);
  }

  .reading thead th:nth-child(n + 3),
  .reading tbody td:nth-child(n + 3) {
    margin-left: calc(var(--word-column) + var(--column-gap));
  }

  .reading tbody td:nth-child(3) {
    padding-top: 0.7rem;
  }
}

/* The audio player on a chapter page */

.listen {
  margin: 0 0 1.6rem;
}

.listen figcaption {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: var(--small);
}

.listen audio {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  accent-color: var(--clay);
}

.listen a {
  display: inline-block;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin-top: 0.3rem;
  font-size: var(--small);
  line-height: 2.75rem;
  text-decoration: none;
}

.listen a:hover {
  text-decoration: underline;
}

/* The reader's note that opens Psalms and Proverbs */

.opening {
  margin: 0 0 1.6rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--note);
}

.opening > :first-child {
  margin-top: 0;
}

/* The list of chapters */

.chapter-index {
  margin-top: 2.5rem;
  padding-top: calc(1rem - var(--tap));
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.begin {
  margin: 0;
}

.begin a {
  display: inline-block;
  padding: var(--tap) var(--tap) var(--tap) 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}

.begin a:hover {
  text-decoration: underline;
}

.chapter-index h2 {
  margin-top: 1.4rem;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-grid a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.chapter-grid a:visited {
  color: var(--muted);
}

.chapter-grid a:hover {
  text-decoration: underline;
}

/* Previous and next, under a hairline */

.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.chapter-nav > a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.2rem;
  line-height: 1.4;
  text-decoration: none;
}

.chapter-nav .next {
  grid-column: 2;
  text-align: right;
}

.chapter-nav .dir {
  color: var(--muted);
  font-size: var(--small);
}

.chapter-nav .prev .dir::before {
  content: "\2190\00a0";
}

.chapter-nav .next .dir::after {
  content: "\00a0\2192";
}

.chapter-nav .name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.chapter-nav > a:hover .name {
  text-decoration: underline;
}

.all-chapters {
  grid-column: 1 / -1;
  margin: 0.6rem 0 0;
  font-size: var(--small);
  text-align: center;
}

.all-chapters a {
  display: inline-block;
  padding: var(--tap) 1rem;
  text-decoration: none;
}

.all-chapters a:hover {
  text-decoration: underline;
}

/* Home: the sections, as entries divided by hairlines */

.section-list {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.section-list li {
  border-top: 1px solid var(--line);
}

.section-list a,
.section-list .soon {
  display: block;
  padding: 1.1rem 0;
  color: inherit;
  text-decoration: none;
}

.section-list li:last-child > * {
  padding-bottom: 0;
}

.section-list h2 {
  margin: 0 0 0.35rem;
  color: inherit;
  font-size: 1.15rem;
}

.section-list a h2 {
  color: var(--clay);
}

.section-list a:hover h2 {
  text-decoration: underline;
}

.section-list p {
  margin: 0;
  color: var(--muted);
  font-size: var(--note);
}

.badge {
  display: inline-block;
  color: var(--muted);
  font-size: var(--small);
}

/* Sources: each row of a license table as an entry, a small muted label over each value */

.source-card {
  margin: 0;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.source-card dt {
  margin: 0 0 0.1rem;
  color: var(--muted);
  font-size: var(--small);
}

.source-card dd {
  margin: 0 0 0.7rem;
  overflow-wrap: anywhere;
}

.source-card dd:last-child {
  margin-bottom: 0;
}

.sources li,
.sources p {
  overflow-wrap: anywhere;
}

/* Ask */

.ask-turn {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.ask-turn:first-child {
  padding-top: 0;
  border-top: 0;
}

.ask-turn .who {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: var(--small);
}

.ask-status {
  min-height: 1.65em;
  color: var(--muted);
  font-size: var(--note);
}

.ask-form label {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: var(--small);
}

.ask-form input,
.ask-form textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.ask-passkey button,
.ask-form button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin-top: 0.9rem;
  padding: 0.55rem 1.2rem;
  border: 0;
  border-radius: 10px;
  background: var(--clay);
  color: var(--paper);
  font: inherit;
}

.ask-passkey button:disabled,
.ask-form button:disabled {
  opacity: 0.6;
}

[popover] {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}

/* Phones: the sheet fills the screen, as the reference does at this width, and takes the
   safe areas into its own padding. Small text comes up to 15px. */

@media (max-width: 600px) {
  :root {
    --small: 0.94rem;
    --note: 0.94rem;
  }

  body {
    padding: 0;
    font-size: 17px;
  }

  .sheet {
    margin: 0;
    padding: 1.4rem 1.2rem 2.5rem;
    padding: calc(1.4rem + env(safe-area-inset-top, 0px)) calc(1.2rem + env(safe-area-inset-right, 0px)) calc(2.5rem + env(safe-area-inset-bottom, 0px)) calc(1.2rem + env(safe-area-inset-left, 0px));
    border: 0;
    border-radius: 0;
    /* A short page still fills the screen, so the ground never shows under an
       edge-to-edge sheet. The reference page is long and never meets this. */
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Each table entry is one stack. The cells are inline blocks a full line wide. They
     stack, and a row still reads as one line of text, which is what
     scripts/check-browser.mjs compares with the source. */

  .reading tr {
    line-height: 1;
  }

  .reading thead th,
  .reading tbody td {
    display: inline-block;
    width: 100%;
    line-height: 1.65;
  }

  .reading tbody td:nth-child(1) {
    line-height: var(--word-line);
  }

  .reading tbody td:nth-child(3) {
    margin-top: 0.55rem;
  }
}

@media print {
  .site-header,
  .site-footer,
  .listen,
  .chapter-nav,
  .chapter-index,
  .skip-link {
    display: none;
  }

  body {
    background: white;
    font-size: 11pt;
  }

  .sheet {
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .reading tbody tr,
  .reading ul li {
    break-inside: avoid;
  }
}
