/* Fontes: the primers (js/primer.js). A lesson is set as a page of a book: one
   column of prose at a measure the eye can keep, in the serif of the
   translations, with its examples in the type of the texts. The colours and
   the fonts of each script are those of css/app.css. */

/* ---- the ways in ---------------------------------------------------------- */
.shelf h2 .pr-in {
  float: right; margin-left: 16px; letter-spacing: 0; text-transform: none; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
.shelf h2 .pr-in::before { content: "❦"; margin-right: 6px; font-weight: 400; }
.shelf h2 .pr-in small { margin-left: 8px; }
.shelf h2 .pr-in:hover { text-decoration: underline; text-decoration-color: var(--rule); }
#primerLink { margin-left: 8px; white-space: nowrap; }

/* ---- the page: the lessons down the side, the lesson beside them ------------ */
.primer { max-width: 1180px; margin: 0 auto; }
.pr { display: grid; grid-template-columns: 230px minmax(0, 39em); gap: 0 58px; align-items: start; justify-content: center; }
.pr-side { position: sticky; top: 0; padding-top: 4px; }
.pr-side h2 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); font-size: 13px; letter-spacing: .09em; text-transform: uppercase; }
.pr-side h2 a { color: var(--accent); text-decoration: none; }
.pr-toc { list-style: none; margin: 0; padding: 0; }
.pr-toc a {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 14px; gap: 0 6px; align-items: baseline;
  padding: 4px 8px 4px 4px; border-radius: 5px; color: inherit; text-decoration: none;
}
.pr-toc a:hover { background: var(--accent-soft); }
.pr-toc .no { color: var(--accent); font-variant-numeric: tabular-nums; text-align: right; }
.pr-toc .on a { background: var(--accent-soft); font-weight: 600; }
.pr-toc .read .tk::after { content: "✓"; color: var(--accent); font-size: 12px; }
.pr-side .pr-toc .read:not(.on) .tt { color: var(--muted); }
/* on the front page of a primer the same list is set large, with a line on each lesson */
.pr-toc.full { margin: 6px 0 22px; font-family: var(--ui); font-size: 15px; line-height: 1.45; border-top: 1px solid var(--rule); }
.pr-toc.full li { border-bottom: 1px solid var(--rule); }
.pr-toc.full a { grid-template-columns: 26px minmax(0, 1fr) 16px; padding: 8px 6px 9px 0; border-radius: 0; }
.pr-toc.full .tt { font-weight: 600; }
.pr-toc.full .ts { display: block; margin-top: 1px; font: 15px/1.5 Georgia, "Iowan Old Style", serif; color: var(--muted); }

/* ---- the lesson ------------------------------------------------------------- */
.pr-body { font: 17px/1.68 Georgia, "Iowan Old Style", "Palatino Linotype", serif; padding-bottom: 40px; }
.pr-crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; margin: 0 0 20px; font: 13px/1.45 var(--ui); color: var(--muted); }
.pr-crumb i { margin: 0 8px; color: var(--faint); font-style: normal; }
.pr-crumb .pr-speak { margin-left: auto; }
.pr-body h1 { margin: 0 0 8px; font: 600 31px/1.2 Georgia, "Iowan Old Style", serif; }
.pr-lead { margin: 0 0 26px; font-size: 19px; line-height: 1.5; font-style: italic; color: var(--muted); }
.pr-lead .cop { font-style: normal; }
.pr-body h2 { margin: 36px 0 8px; font: 600 21px/1.3 Georgia, "Iowan Old Style", serif; }
.pr-body h3 { margin: 28px 0 6px; font: 600 12px/1.4 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.pr-body p { margin: 0 0 15px; }
.pr-body p > .cop, .pr-body li .cop, .pr-lit .cop, .pr-body h2 .cop, .pr-lead .cop { font-size: 1.1em; line-height: 1; }
.pr-body .po.una, .pr-body .tr.una { text-decoration: underline dotted var(--faint); text-underline-offset: 4px; }
/* a word in transliteration (Ugaritic): italic, in the serif of the prose, as the grammars print it */
.pr-body { --tr: "STIX Two Text", Cambria, "Times New Roman", serif; }      /* fonts that set ʿ and ʾ close to their letters */
.pr-body .tr { font-family: var(--tr); font-style: italic; }
.pr-lead .tr { font-style: normal; }
.pr-body .pr-n { font-variant-numeric: tabular-nums; }
.pr-body strong { font-weight: 600; }
.pr-note { margin: -8px 0 20px; font: 13px/1.5 var(--ui); color: var(--muted); }

/* a table: an alphabet, a set of pronouns, a frequency list */
.pr-tw { margin: 18px 0 22px; overflow-x: auto; }
.pr-t { border-collapse: collapse; font: 14px/1.45 var(--ui); }
.pr-t th { padding: 3px 22px 6px 0; border-bottom: 1px solid var(--rule); text-align: start; font-weight: 400; font-size: 12px; color: var(--faint); white-space: nowrap; }
.pr-t td { padding: 6px 22px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.pr-t .cop { font-size: 19px; line-height: 1.2; }
.pr-t .tr { font-size: 16px; line-height: 1.2; }
.pr-body[data-script="Ugar"] .pr-t .cop { font-size: 24px; }    /* the wedges are small at the size of a Coptic letter */
.pr-t td:last-child, .pr-t th:last-child { padding-right: 4px; }
.pr-freq { width: 100%; }
.pr-fk { width: 1%; padding-right: 12px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.pr-ff { white-space: nowrap; }
.pr-ff .po + .po { margin-left: 9px; color: var(--muted); }
.pr-fg { color: var(--gloss); }
.pr-fc { color: var(--muted); font-size: 13px; }
.pr-fc small { margin-left: 6px; color: var(--faint); white-space: nowrap; }
.pr-fc small .cop { font-size: 15px; }
.pr-t .pr-fn { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- a passage of a text: an example, or something to read --------------------
   The words are set as in the day's reading (.dtext, .dw, .dm in css/app.css). */
.pr-ex {
  margin: 20px 0 22px; padding: 10px 16px 9px; font: 14px/1.45 var(--ui);
  background: var(--panel); border: 1px solid var(--rule); border-radius: 8px;
}
.pr-ex figcaption { margin-bottom: 9px; font-size: 12px; }
.pr-ex figcaption a { color: var(--accent); text-decoration: none; }
.pr-ex figcaption a:hover { text-decoration: underline; text-decoration-color: var(--rule); }
.pr-ex .dtext { font-size: 21px; }
.pr-ex .dm[data-w] { cursor: pointer; }
.pr-ex .dm.hit { background: var(--hit); border-radius: 3px; }
.pr-ex .dm.on { background: var(--sel); }
/* the transliteration under a piece written in a script of its own */
.pr-ex .dm .t { display: block; margin-top: 2px; font: italic 15px/1.25 var(--tr); color: var(--ink); white-space: nowrap; }
.pr-ex .dm.punct .t { color: var(--faint); }
.pr-ex .pr-info .tr { font-size: 15px; }
.pr-v { align-self: flex-start; margin: .5em .35em 0 0; font: 600 10px var(--ui); color: var(--accent); user-select: none; }
.pr-ex .pr-lit, .pr-en p { margin: 10px 0 0; max-width: 62em; font: 15px/1.55 Georgia, "Iowan Old Style", serif; color: var(--muted); }
.pr-ex .pr-lit em { color: var(--ink); font-style: normal; }
.pr-en { margin-top: 9px; }
.pr-en summary { width: max-content; font-size: 12.5px; color: var(--accent); cursor: pointer; }
.pr-en p { margin-top: 4px; }
.pr-info {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; min-height: 26px;
  margin: 9px 0 0; padding-top: 6px; border-top: 1px solid var(--rule); font: 13px/1.45 var(--ui); color: var(--muted);
}
.pr-ex .pr-info { margin-bottom: 0; }
.pr-ex .pr-info .cop { font-size: 17px; line-height: inherit; color: var(--ink); }
.pr-ex .pr-info .cop.nm { color: var(--muted); }
.pr-info .ig { color: var(--gloss); font-weight: 600; }
.pr-info .idle { color: var(--faint); }
.pr-rd { border-inline-start: 3px solid var(--accent-soft); }

/* ---- the foot of a lesson: read or not, and the lessons on either side --------- */
.pr-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--rule); font: 14px/1.45 var(--ui);
}
.pr-turn { display: inline-flex; flex-wrap: wrap; gap: 8px 10px; margin-left: auto; }
.pr-prev, .pr-next {
  padding: 5px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel);
  color: inherit; text-decoration: none;
}
.pr-prev:hover, .pr-next:hover { border-color: var(--faint); }
.pr-next { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pr-go { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; font: 14px/1.45 var(--ui); }
.pr-sum { color: var(--muted); }

@media (max-width: 900px) {
  .pr { grid-template-columns: minmax(0, 39em); }
  .pr-side { display: none; }
}
@media (max-width: 720px) {
  .library:has(> .primer:not([hidden])) { padding: 18px 18px 60px; }
  .pr-body { font-size: 16.5px; }
  .pr-body h1 { font-size: 27px; }
  .pr-ex { margin-inline: -6px; padding-inline: 12px; }
  .shelf h2 .pr-in { float: none; display: block; margin: 4px 0 0; }
}
