:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #efe9dc;
  --text: #1d2230;
  --muted: #5a6172;
  --accent: #1f3b63;
  --accent-soft: #e3e9f2;
  --on-accent: #ffffff;
  --gold: #8a6a1c;
  --border: #e0d9c8;
  --mark: #f4e3a6;
  --shadow: 0 1px 2px rgba(20, 25, 40, .05), 0 6px 20px rgba(20, 25, 40, .06);
  --radius: 10px;
  --maxw: 1100px;
  --font-body: "Assistant", "Segoe UI", Arial, sans-serif;
  --font-head: "Frank Ruhl Libre", "David", "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141b;
    --surface: #191d27;
    --surface-2: #222836;
    --text: #e8e4da;
    --muted: #a2a8b5;
    --accent: #9dbbe3;
    --accent-soft: #233149;
    --on-accent: #0e1420;
    --gold: #d6b464;
    --border: #2d3443;
    --mark: #5b4a17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

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

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

main { flex: 1; padding-block: 2.5rem 4rem; }

/* ---------- Header ---------- */
#site-header {
  background: var(--surface);
  border-block-end: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
#site-header .bar {
  max-width: var(--maxw); margin-inline: auto; padding: .75rem 20px;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); margin-inline-end: auto; }
.brand-mark { color: var(--gold); font-size: 1.5rem; line-height: 1; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }

.site-nav { display: flex; align-items: center; gap: 1rem; }
.site-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  display: block; padding: .4rem .7rem; border-radius: 6px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .98rem;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
/* Donate stands out quietly: gold text on a soft gold tint. */
.site-nav a.nav-donate {
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent);
}
.site-nav a.nav-donate:hover,
.site-nav a.nav-donate[aria-current="page"] { color: var(--gold); background: color-mix(in srgb, var(--gold) 22%, transparent); }

.lang-toggle, .nav-toggle {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  border-radius: 999px; padding: .35rem .9rem;
}
.lang-toggle:hover, .nav-toggle:hover { border-color: var(--accent); }
.nav-toggle { display: none; font-size: 1.1rem; padding: .3rem .75rem; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-block: .5rem; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .lang-toggle { align-self: flex-start; }
}

/* ---------- Footer ---------- */
#site-footer { background: var(--surface); border-block-start: 1px solid var(--border); padding: 2rem 20px 1.25rem; }
.footer-inner { max-width: var(--maxw); margin-inline: auto; display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-name { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; margin-block-end: .25rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-copy { max-width: var(--maxw); margin: 1.5rem auto 0; font-size: .875rem; }
.footer-a11y { color: var(--muted); }
.footer-a11y:hover { color: var(--accent); }

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -3rem; z-index: 50;
  background: var(--accent); color: var(--on-accent); padding: .5rem 1rem; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: .5rem; }
main:focus { outline: none; }

.statement { max-width: 720px; }
.statement h2 { font-size: 1.2rem; margin-block-start: 2rem; }
.statement-contact { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1.5rem; }
.statement-contact dt { font-weight: 700; }
.statement-contact dd { margin: 0; }
p:empty { display: none; }

/* ---------- Page heading ---------- */
.page-head { margin-block-end: 2rem; max-width: 720px; }
.page-head .lead { color: var(--muted); font-size: 1.1rem; }
.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .04em; font-size: .85rem; text-transform: uppercase; margin-block-end: .4rem; }

/* ---------- Controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-block-end: 1.25rem; }
.search {
  flex: 1 1 280px; min-width: 0;
  font: inherit; padding: .7rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select, .field input, .field textarea, .field select {
  font: inherit; padding: .6rem .8rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.count { color: var(--muted); font-size: .95rem; margin-block-end: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-block-end: 1.25rem; }
.chip {
  font: inherit; font-size: .92rem; cursor: pointer;
  padding: .3rem .85rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.badge {
  display: inline-block; font-size: .78rem; font-weight: 700;
  padding: .1rem .55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.tag { display: inline-block; font-size: .85rem; padding: .1rem .6rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin: 0 0 .3rem .3rem; }
[dir="ltr"] .tag { margin: 0 .3rem .3rem 0; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: .55rem 1.1rem; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-small { padding: .3rem .75rem; font-size: .88rem; }

.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- Home ---------- */
.hero { padding-block: 1.5rem 2.5rem; border-block-end: 1px solid var(--border); margin-block-end: 2.5rem; }
.hero h1 { max-width: 760px; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 680px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { color: var(--accent); }
.card p { color: var(--muted); font-size: .98rem; flex: 1; }
.card .card-meta { font-size: .85rem; color: var(--gold); font-weight: 700; }

.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; margin-block-start: 3rem; }
.home-grid.single { grid-template-columns: minmax(0, 480px); }
@media (max-width: 800px) { .home-grid { grid-template-columns: 1fr; } }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-block-end: 1rem; }
.section-title a { font-size: .95rem; }

/* ---------- Bibliography ---------- */
.bib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.bib-open {
  width: 100%; text-align: start; cursor: pointer; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; display: grid; gap: .4rem;
  transition: border-color .15s, box-shadow .15s;
}
.bib-open:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.bib-head { display: flex; gap: .85rem; align-items: flex-start; }
.bib-num {
  flex: none; min-width: 2.2rem; text-align: center; padding: .1rem .4rem; border-radius: 6px;
  background: var(--surface-2); color: var(--gold); font-weight: 700; font-size: .9rem;
}
.bib-titles { display: grid; gap: .1rem; min-width: 0; }
.bib-title { font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; line-height: 1.35; }
.bib-title-2 { color: var(--muted); font-size: .95rem; }
.bib-sub { font-size: .93rem; color: var(--text); padding-inline-start: 3.05rem; }
.bib-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.bib-open > .bib-meta { padding-inline-start: 3.05rem; }
.bib-more { margin-inline-start: auto; color: var(--accent); font-weight: 600; }
.link-list { padding-inline-start: 1.2rem; margin: 0; }
.link-list li { overflow-wrap: anywhere; margin-block-end: .3rem; }

.archives { margin-block-start: 3.5rem; scroll-margin-top: 90px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 640px; }
.data-table th, .data-table td { padding: .65rem .85rem; text-align: start; vertical-align: top; border-block-end: 1px solid var(--border); }
.data-table thead th { background: var(--surface-2); font-weight: 700; color: var(--muted); }
.data-table tbody tr:last-child td { border-block-end: none; }
.data-table td a { overflow-wrap: anywhere; }
.link-btn {
  font: inherit; font-weight: 700; cursor: pointer; color: var(--accent);
  background: var(--accent-soft); border: none; border-radius: 999px; padding: .1rem .7rem;
}
.link-btn:hover { text-decoration: underline; }

dialog {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(10, 14, 22, .55); }
.dialog-inner { padding: 1.75rem; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.dialog-close {
  font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer;
  background: none; border: none; color: var(--muted); padding: .25rem .5rem; border-radius: 6px;
}
.dialog-close:hover { background: var(--surface-2); color: var(--text); }
.dialog-sub { color: var(--muted); font-size: 1.05rem; margin-block-start: -.25rem; }
.dialog-section { margin-block-start: 1.5rem; }
.dialog-section h3 { font-size: 1rem; color: var(--gold); font-family: var(--font-body); text-transform: uppercase; letter-spacing: .04em; }

.details-table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.details-table th, .details-table td { padding: .45rem .5rem; border-block-end: 1px solid var(--border); text-align: start; vertical-align: top; }
.details-table th { color: var(--muted); font-weight: 600; width: 32%; }
.details-table td { overflow-wrap: anywhere; }

.cite-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-block-end: .6rem; }
.cite-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: .85rem 1rem; font-size: .95rem; overflow-x: auto; margin-block-end: .6rem;
}
.cite-box pre { margin: 0; font-size: .85rem; direction: ltr; text-align: left; }
.cite-actions { display: flex; align-items: center; gap: .75rem; }
.copied { color: var(--gold); font-weight: 600; font-size: .9rem; }
.ltr-text { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .ltr-block { direction: ltr; text-align: left; }

/* ---------- Glossary ---------- */
.letters { display: flex; flex-wrap: wrap; gap: .25rem; margin-block-end: 1rem; }
.letter {
  font: inherit; font-weight: 700; min-width: 2.1rem; padding: .25rem .4rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px;
}
.letter:hover:not(:disabled) { border-color: var(--accent); }
.letter:disabled { opacity: .35; cursor: default; }
.letter[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
@media (max-width: 420px) { .terms { grid-template-columns: 1fr; } }
.term {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; scroll-margin-top: 90px; transition: box-shadow .3s, border-color .3s;
}
.term.flash { border-color: var(--gold); box-shadow: 0 0 0 3px var(--mark); }
.term-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.term h3 { margin-block-end: .1rem; }
.term-secondary { display: block; font-family: var(--font-body); font-weight: 600; color: var(--muted); font-size: 1rem; }
.term-original { font-style: italic; color: var(--gold); font-size: .93rem; margin-block: .3rem .6rem; }
.term-alt { font-size: .9rem; color: var(--muted); margin-block-end: .5rem; }
.term-def { margin-block-end: .6rem; }
.term-links { font-size: .9rem; margin: .2rem 0 0; }
.term-links a { margin-inline-end: .6rem; }

.page-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.page-section { margin-block-start: 3.5rem; scroll-margin-top: 90px; }
.chip-count { font-size: .8em; opacity: .7; margin-inline-start: .15rem; }

.lexicon { min-width: 0; }
.lexicon td { padding-block: .55rem; }
.lex-he { font-family: var(--font-head); font-size: 1.12rem; font-weight: 500; }
.lex-source { font-size: .93rem; color: var(--muted); }
.lexicon tbody tr:hover td { background: var(--surface-2); }
.lex-row { cursor: pointer; }
.lex-pic { display: inline-flex; vertical-align: middle; margin-inline-start: .4rem; color: var(--gold); }

/* Glossary illustrations. The light backing keeps drawn diagrams readable in dark mode. */
.term-figure { margin: .75rem 0 0; }
.term-figure + .term-figure { margin-block-start: 1.5rem; }
.term-figure img {
  display: block; max-width: 100%; height: auto; max-height: 60vh; margin-inline: auto;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.term-figure a { display: block; cursor: zoom-in; }
.term-figure figcaption { margin-block-start: .5rem; font-size: .95rem; color: var(--muted); text-align: center; }
.term-credit { display: block; font-size: .85rem; opacity: .85; }
.lex-open {
  font: inherit; color: inherit; background: none; border: none; padding: 0;
  text-align: start; cursor: pointer;
}
.lex-row:hover .lex-open, .lex-open:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.name-list { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin: 0; }
.name-list dt { color: var(--muted); font-weight: 600; }
.name-list dd { margin: 0; font-size: 1.08rem; }
.other-renderings { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.other-renderings li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.other-renderings .link-btn { font-family: var(--font-head); font-size: 1.05rem; }
.empty-cell { text-align: center !important; color: var(--muted); padding: 2rem !important; }

/* Glossary concept cards: one card per concept, one line per source (author) in time order. */
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 1rem; align-items: start; }
.concepts > .empty-cell { grid-column: 1 / -1; }
.concept {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem .6rem; cursor: pointer; transition: border-color .2s;
}
.concept:hover { border-color: var(--accent); }
.concept-head { display: flex; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; flex-wrap: wrap; }
.concept-head h3 { margin: 0; font-size: 1.3rem; }
.concept:hover .lex-open { color: var(--accent); }
.concept-sub { color: var(--muted); font-size: .95rem; }
.concept-names { display: flex; flex-wrap: wrap; gap: .15rem 1rem; margin: .35rem 0 .5rem; font-size: .88rem; color: var(--muted); }
.concept-names-label { font-weight: 600; opacity: .8; }
.concept-lines { list-style: none; margin: 0; padding: 0; }
.concept-line {
  display: grid; grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr); gap: .75rem;
  padding: .5rem 0; border-top: 1px solid var(--border); align-items: start;
}
.concept-line.is-current { background: var(--accent-soft); margin-inline: -.6rem; padding-inline: .6rem; border-radius: 6px; }
.line-who { font-size: .92rem; line-height: 1.35; }
.line-who a { color: inherit; }
.line-meta { display: block; font-size: .8rem; color: var(--muted); }
.line-words { display: flex; flex-wrap: wrap; gap: .35rem; }
.word {
  font-family: var(--font-head); font-size: 1.02rem; line-height: 1.5;
  padding: .05rem .55rem; border-radius: 6px; background: var(--surface-2);
}
.word-main { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.dialog-section .concept-line { grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); }
@media (max-width: 480px) {
  .concept-line, .dialog-section .concept-line { grid-template-columns: 1fr; gap: .3rem; }
}

.radio-group { border: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.radio-group legend { font-weight: 600; font-size: .95rem; margin-block-end: .4rem; padding: 0; width: 100%; }
.radio-group label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.radio-group input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }

/* ---------- Articles ---------- */
.article-list { display: grid; gap: 1.25rem; }
.article-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.article-card h2 { font-size: 1.35rem; margin-block-end: .3rem; }
.article-card h2 a { color: var(--text); text-decoration: none; }
.article-card h2 a:hover { color: var(--accent); }
.byline { color: var(--muted); font-size: .95rem; margin-block-end: .75rem; }

.article { max-width: 740px; margin-inline: auto; }
.article-header { border-block-end: 1px solid var(--border); padding-block-end: 1.5rem; margin-block-end: 2rem; }
.abstract { background: var(--surface); border-inline-start: 4px solid var(--gold); padding: 1rem 1.25rem; border-radius: 0 8px 8px 0; margin-block: 1.25rem; }
[dir="rtl"] .abstract { border-radius: 8px 0 0 8px; }
.abstract h2 { font-size: 1rem; font-family: var(--font-body); color: var(--gold); text-transform: uppercase; letter-spacing: .04em; margin-block-end: .3rem; }
.article-body { font-size: 1.12rem; line-height: 1.8; }
.article-body h2 { margin-block-start: 2rem; }
.article-body blockquote {
  margin: 1.5rem 0; padding: .5rem 1.25rem; border-inline-start: 3px solid var(--accent);
  font-family: var(--font-head); font-size: 1.2rem; color: var(--muted);
}
.references { margin-block-start: 3rem; border-block-start: 1px solid var(--border); padding-block-start: 1.5rem; }
.references ol { padding-inline-start: 1.25rem; }
.references li { margin-block-end: .6rem; }
.back-link { display: inline-block; margin-block-end: 1.5rem; }

/* ---------- Timeline ---------- */
.era-heading { font-size: 1.3rem; color: var(--gold); margin-block: 2.25rem 1rem; display: flex; align-items: center; gap: .75rem; }
.era-heading::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.era-heading:first-child { margin-block-start: 0; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; inset-block: .5rem; inset-inline-start: 7px;
  width: 2px; background: var(--border);
}
.tl-event { position: relative; padding-inline-start: 2.25rem; margin-block-end: 1.25rem; }
.tl-event::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 1.3rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--gold);
}
.tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.tl-date { color: var(--gold); font-weight: 700; font-size: .95rem; }
.tl-card h3 { margin-block: .15rem .4rem; }
.tl-card p { margin-block-end: .4rem; }
.tl-sources { font-size: .9rem; color: var(--muted); margin: 0; }
.tl-sources + .tl-sources { margin-block-start: .3rem; }
.tl-place { color: var(--muted); font-size: .93rem; margin-block: -.25rem .5rem; }
.tl-author::before { background: var(--gold); }
.tl-author .tl-card { border-inline-start: 3px solid var(--gold); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; align-items: start; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: .3rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field textarea, .field select { width: 100%; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { min-height: 160px; resize: vertical; }
.field-error { color: #b3261e; font-size: .85rem; min-height: 1em; }
@media (prefers-color-scheme: dark) { .field-error { color: #f2b8b5; } }
.field.invalid input, .field.invalid textarea { border-color: #b3261e; }
.form-status { padding: .8rem 1rem; border-radius: 8px; background: var(--accent-soft); color: var(--text); }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.info-card dt { font-weight: 700; color: var(--muted); font-size: .9rem; }
.info-card dd { margin: 0 0 1rem; }

/* Planetary hours calculator */
.ph-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .ph-grid { grid-template-columns: minmax(0, 1fr); } }
.field-label { font-weight: 600; font-size: .95rem; }
.ph-place { display: grid; padding: .6rem .8rem; background: var(--surface-2); border-radius: 8px; }
.ph-results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ph-results li + li { border-block-start: 1px solid var(--border); }
.ph-result-btn { width: 100%; text-align: start; font: inherit; color: var(--text); background: var(--surface); border: 0; padding: .55rem .8rem; cursor: pointer; }
.ph-result-btn:hover, .ph-result-btn:focus-visible { background: var(--accent-soft); outline: none; }
.ph-status:empty { display: none; }
.ph-small { font-size: .88rem; margin: 0; }
.ph-mode { border: 0; margin: 0; padding: 0; min-width: 0; }
.ph-mode legend { padding: 0; margin-block-end: .3rem; }
.ph-radio { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.ph-radio input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; margin: 0; }
.ph-how { margin-block-start: 1.5rem; max-width: 70ch; }
.ph-rulers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-block-end: 1rem; }
@media (max-width: 480px) { .ph-rulers { grid-template-columns: 1fr; } }
.ph-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.ph-box-hour { border-color: var(--gold); }
.ph-label { color: var(--gold); font-weight: 700; font-size: .95rem; }
.ph-planet { font-family: var(--font-head); font-size: 2rem; font-weight: 700; line-height: 1.3; }
.ph-glyph { display: inline-block; min-width: 1.3em; color: var(--accent); }
.ph-tz { margin: -.25rem 0 1rem; color: var(--muted); font-size: .92rem; }
.ph-box bdi, .ph-table bdi, .ph-facts bdi, .ph-tz bdi { white-space: nowrap; }
.ph-note { padding: .7rem 1rem; border-radius: 8px; background: var(--accent-soft); }
.ph-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem 1rem; margin: 0 0 1.5rem; }
.ph-facts dt { color: var(--muted); font-size: .88rem; }
.ph-facts dd { margin: 0; font-weight: 700; }
.ph-table-title { font-size: 1.2rem; }
.data-table.ph-table { min-width: 0; }
.ph-table .ph-part th { background: var(--surface-2); color: var(--gold); text-align: start; }
.ph-table .ph-current td { background: var(--mark); font-weight: 700; }

/* Birth chart calculator */
.bc-name { font-size: 1.4rem; margin: 0 0 .75rem; }
.bc-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-block-end: 1rem; }
@media (max-width: 480px) { .bc-summary { gap: .5rem; } .bc-summary .ph-box { padding: .7rem .6rem; } }
.bc-sign-big { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
@media (max-width: 480px) { .bc-sign-big { font-size: 1.15rem; } }
.bc-sect { font-weight: 600; margin: 0 0 .75rem; }
.ph-note p { margin: 0 0 .5rem; }
.bc-figure { margin: 0 0 1.5rem; }
.bc-wheel { direction: ltr; display: block; width: 100%; max-width: 600px; height: auto; margin-inline: auto; }
.bc-wheel text { text-anchor: middle; dominant-baseline: central; fill: var(--text); font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", "DejaVu Sans", var(--font-body); }
.bc-ring { fill: var(--surface); stroke: var(--border); }
.bc-sign { stroke: var(--border); }
.bc-el0 { fill: #f7e1d7; } .bc-el1 { fill: #ece6cf; } .bc-el2 { fill: #e1e9f2; } .bc-el3 { fill: #dcebe4; }
@media (prefers-color-scheme: dark) { .bc-el0 { fill: #3a2a26; } .bc-el1 { fill: #34311f; } .bc-el2 { fill: #24303f; } .bc-el3 { fill: #22352d; } }
.bc-sign-glyph { font-size: 26px; }
.bc-line { fill: none; stroke: var(--border); }
.bc-core { fill: var(--surface); stroke: var(--border); }
.bc-tick, .bc-cusp { stroke: var(--muted); stroke-width: 1; }
.bc-axis { stroke: var(--text); stroke-width: 2.2; }
.bc-axis-mc { stroke-dasharray: 6 4; }
.bc-wheel .bc-house-num { font-size: 16px; fill: var(--muted); }
.bc-asp { stroke-width: 1.3; }
.bc-asp-soft { stroke: #2f6fb3; }
.bc-asp-hard { stroke: #c4453c; }
@media (prefers-color-scheme: dark) { .bc-asp-soft { stroke: #7fb0e6; } .bc-asp-hard { stroke: #ef8a80; } }
.bc-mark { stroke: var(--text); stroke-width: 2; }
.bc-lead { stroke: var(--muted); stroke-width: .8; }
.bc-planet { font-size: 28px; }
.bc-planet, .bc-wheel .bc-deg { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.bc-wheel .bc-angle-label { font-size: 18px; font-weight: 700; font-family: var(--font-body); }
.bc-wheel .bc-deg { font-size: 15px; fill: var(--muted); font-family: var(--font-body); }
.bc-retro { color: var(--gold); font-size: .85rem; font-weight: 600; }
.bc-asp-name { color: var(--gold); font-weight: 600; }
.ph-table td bdi { white-space: nowrap; }

/* Tekufot calculator */
.ph-mode[hidden] { display: none; }
.tq-when { font-weight: 600; margin: 0 0 .5rem; }

/* ---------- Transcriptions ---------- */
.tr-card h3 { font-size: 1.35rem; }
.tr-card-sub { color: var(--muted); font-weight: 600; margin: -.35rem 0 .5rem; flex: 0 !important; }

/* List of works: one full-width row per work */
.tr-rows { display: flex; flex-direction: column; gap: 1.25rem; }
.tr-row { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem 1.6rem; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.tr-row:hover { border-color: var(--accent); box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.tr-row-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; }
.tr-row-top h3 { font-size: 1.6rem; margin: 0; }
.tr-row-top h3 a { color: inherit; text-decoration: none; }
.tr-row-top h3 a:hover { color: var(--accent); }
.tr-row-by { color: var(--gold); font-family: var(--font-head); font-size: 1.1rem; }
.tr-row-meta { color: var(--muted); font-size: .92rem; margin: .3rem 0 0; }
.tr-row-desc { margin: .7rem 0 1.1rem; max-width: 75ch; }
.tr-row-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem; border-block-start: 1px solid var(--border); padding-block-start: 1rem; }
.tr-row-cols h4 { font-family: var(--font-body); font-size: .85rem; font-weight: 700; letter-spacing: .03em; color: var(--muted); margin: 0 0 .5rem; }
.tr-bib { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .9rem; margin: 0; font-size: .95rem; }
.tr-bib dt { color: var(--muted); font-weight: 600; }
.tr-bib dd { margin: 0; overflow-wrap: anywhere; }
.tr-topics { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.tr-topics li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: .2rem .7rem; font-size: .88rem; font-weight: 600; }
.tr-row-go { margin-block-start: 1.1rem; }
@media (max-width: 720px) {
  .tr-row { padding: 1.1rem 1rem; }
  .tr-row-top { flex-direction: column; align-items: flex-start; gap: .15rem; }
  .tr-row-top h3 { font-size: 1.4rem; }
  .tr-row-cols { grid-template-columns: 1fr; gap: 1.1rem; }
  .tr-bib { grid-template-columns: 1fr; gap: 0; }
  .tr-bib dt { margin-block-start: .45rem; font-size: .85rem; }
  .tr-row-go { display: block; text-align: center; }
}

/* Reading page */
.tr-reader { max-width: 820px; padding-block-end: 6rem; }
.tr-crumbs { font-size: .95rem; margin-block-end: 1.25rem; }
.tr-crumbs a { text-decoration: none; font-weight: 600; }
.tr-crumbs a:hover { text-decoration: underline; }
.tr-crumb-arrow::before { content: "→ "; }
[dir="ltr"] .tr-crumb-arrow::before { content: "← "; }
.tr-head { max-width: none; text-align: center; padding-block-end: 1.5rem; border-block-end: 1px solid var(--border); margin-block-end: 1.5rem; }
.tr-head h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); margin-block-end: .25rem; }
.tr-head .lead { font-family: var(--font-head); font-size: 1.2rem; color: var(--gold); margin-block-end: .75rem; }
.tr-front p { margin: 0 0 .3rem; color: var(--muted); font-size: .95rem; }
.tr-front .muted { color: var(--muted); }
.tr-note { font-size: .95rem; text-align: center; }

/* Contents */
.tr-toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.25rem .75rem; margin-block-end: 3rem; scroll-margin-top: 80px;
}
.tr-toc > h2 { margin-block-end: .9rem; }
.tr-toc-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-block-end: .75rem; }
.tr-toc-tools .search { flex: 1 1 240px; padding-block: .55rem; }
.tr-toc-buttons { display: flex; gap: .4rem; }
.tr-gates { list-style: none; margin: 0; padding: 0; font-family: var(--font-head); }
.tr-gate { border-block-start: 1px solid var(--border); }
.tr-gate:first-child { border-block-start: none; }
.tr-gate[hidden], .tr-simanim li[hidden] { display: none; }
.tr-solo { padding: .55rem .25rem; font-size: 1.1rem; }
.tr-gate a { text-decoration: none; }
.tr-gate a:hover { text-decoration: underline; }
.tr-gate summary {
  display: flex; align-items: center; gap: .6rem; cursor: pointer; list-style: none;
  padding: .6rem .25rem; min-height: 44px; font-size: 1.12rem;
}
.tr-gate summary::-webkit-details-marker { display: none; }
.tr-gate summary::before { content: "◂"; color: var(--gold); font-size: .8rem; transition: transform .15s; }
.tr-gate details[open] > summary::before { transform: rotate(-90deg); }
.tr-gate summary:hover { background: var(--surface-2); border-radius: 6px; }
.tr-gate-title { font-weight: 700; }
.tr-count { margin-inline-start: auto; font-family: var(--font-body); font-size: .85rem; color: var(--muted); white-space: nowrap; }
.tr-simanim {
  list-style: none; margin: 0 0 .9rem; padding: 0 1.4rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 0 .75rem;
}
.tr-simanim a { display: block; padding: .3rem .35rem; border-radius: 6px; font-size: 1.02rem; }
.tr-simanim a:hover { background: var(--accent-soft); text-decoration: none; }
.tr-simanim a.tr-sub { font-size: .88rem; color: var(--muted); padding-block: 0 .3rem; padding-inline-start: .9rem; }
.tr-toc .empty { margin: .5rem 0; padding: 1rem; }

/* The text */
.tr-book { font-family: var(--font-head); font-size: 1.16rem; line-height: 1.9; }
.tr-book p { text-align: justify; margin-block-end: .9em; }
.tr-book p.center { text-align: center; }
.tr-book h2, .tr-book h3, .tr-book h4 { scroll-margin-top: 80px; }
.tr-book h2 { font-size: 1.75rem; color: var(--text); margin: 3rem 0 1.25rem; padding-block-end: .4rem; border-block-end: 2px solid var(--gold); }
.tr-book h3 { font-size: 1.3rem; color: var(--accent); margin: 2.2rem 0 .6rem; }
.tr-book h4 { font-size: 1.08rem; color: var(--gold); margin: 1.6rem 0 .5rem; font-weight: 700; }
.tr-book :is(h2, h3, h4):target { background: var(--accent-soft); border-radius: 4px; box-shadow: 0 0 0 .3rem var(--accent-soft); }
.tr-book .b { font-weight: 700; }
.tr-book .i { font-style: italic; }
.tr-book .muted { color: var(--muted); }
.tr-book .small { font-size: .85em; }
.tr-book .sup { vertical-align: super; font-size: .75em; }
.tr-page {
  display: flex; align-items: center; gap: .75rem; margin: 1.75rem 0 1rem;
  font-family: var(--font-body); font-size: .8rem; color: var(--muted);
}
.tr-page::before, .tr-page::after { content: ""; flex: 1; border-block-start: 1px dashed var(--border); }
.tr-book figure { margin: 1.5rem 0; text-align: center; }
.tr-book img {
  max-width: 100%; height: auto; background: #fff; padding: .4rem;
  border: 1px solid var(--border); border-radius: 6px;
}
.tr-table { overflow-x: auto; margin: 1.25rem 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
.tr-table table { border-collapse: collapse; width: 100%; font-family: var(--font-body); font-size: .95rem; line-height: 1.5; }
.tr-table th, .tr-table td { padding: .45rem .75rem; border: 1px solid var(--border); text-align: start; vertical-align: top; white-space: nowrap; }
.tr-table th { background: var(--surface-2); font-weight: 700; }
.tr-table tr > :first-child { border-inline-start: none; }
.tr-table tr > :last-child { border-inline-end: none; }

/* Floating "Contents" button with the current gate and section */
.tr-float {
  position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 15;
  display: flex; align-items: center; gap: .6rem; max-width: calc(100vw - 32px);
  padding: .55rem 1rem .55rem .8rem; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); text-decoration: none; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.tr-float.show { opacity: 1; transform: none; pointer-events: auto; }
.tr-float:hover { filter: brightness(1.1); }
.tr-float-icon { font-size: 1.1rem; line-height: 1; }
.tr-float-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tr-float-label { font-weight: 700; font-size: .9rem; }
.tr-where { font-family: var(--font-head); font-size: .85rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-where:empty { display: none; }

@media (max-width: 600px) {
  .tr-toc { padding: 1rem .85rem .5rem; margin-inline: -8px; }
  .tr-toc-buttons { width: 100%; }
  .tr-toc-buttons .btn { flex: 1; justify-content: center; }
  .tr-simanim { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); padding-inline-start: 0; padding-inline-end: .4rem; }
  .tr-simanim a { padding-block: .45rem; }
  .tr-book { font-size: 1.08rem; line-height: 1.85; }
  /* Justified Hebrew leaves wide gaps on a narrow screen. */
  .tr-book p { text-align: start; }
  .tr-book h2 { font-size: 1.5rem; }
  .tr-float { inset-inline: 12px; bottom: 12px; justify-content: center; max-width: none; }
  .tr-where { max-width: 70vw; }
}
@media (prefers-reduced-motion: reduce) { .tr-float, .tr-gate summary::before { transition: none; } }
@media print {
  #site-header, #site-footer, .tr-float, .tr-toc-tools, .tr-crumbs { display: none; }
  .tr-toc { box-shadow: none; }
}

/* ---------- Donate ---------- */
.donate-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.donate-text { max-width: 640px; }
.donate-text h2 { font-size: 1.2rem; margin-block-start: 1.75rem; }
.donate-text h2:first-child { margin-block-start: 0; }
.donate-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; position: sticky; top: 90px;
}
.donate-box h2 { font-size: 1.2rem; }
.donate-button { min-height: 1px; margin-block: 1rem .5rem; }
.donate-status { margin: .5rem 0; }
.donate-status[hidden] { display: none; }
.donate-secure { font-size: .88rem; margin: .75rem 0 0; }
@media (max-width: 800px) {
  .donate-grid { grid-template-columns: 1fr; }
  .donate-box { position: static; order: -1; }
}
