/* ============================================================
   The Ten Commandments — torahtech.co/10
   Program theme. Loads AFTER shared.css and tt-brand.css,
   which supply the Torah Tech tokens, chrome and primitives.
   This file owns the luchot, the reader and the source notes.
   ============================================================ */

:root {
  --tn-scale: 1;

  /* Semantic aliases onto the Torah Tech brand tokens */
  --ink:          var(--tt-ink);
  --ink-soft:     var(--tt-ink-soft);
  --muted:        var(--tt-ink-muted);
  --line:         var(--tt-line);
  --line-soft:    #f1f5fa;
  --surface:      var(--tt-surface);
  --surface-2:    var(--tt-surface-2);
  --accent:       var(--tt-blue);
  --accent-deep:  var(--tt-navy);
  --accent-soft:  #cfdcf0;
  --font-display: var(--tt-font-display);
  --font-body:    var(--tt-font-body);
  --font-serif:   var(--tt-font-serif);
  --font-hebrew:  var(--tt-font-hebrew);
  --radius:       var(--tt-radius);
  --radius-sm:    var(--tt-radius-sm);
  --shadow:       var(--tt-shadow-card);
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }

/* ── Utility bar (sits under the shared header) ──────────────── */
.tn-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 10px clamp(12px, 4vw, 28px);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tn-home { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none; }
.tn-home .tn-kicker { font: 700 .62rem/1 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.tn-home > span:last-child { font: 600 .95rem/1.2 var(--font-display); color: var(--accent-deep); }
.tn-spacer { flex: 1; }
.tn-btn {
  appearance: none; cursor: pointer; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--accent-deep); font: 600 .78rem/1 var(--font-body);
  padding: 8px 11px; transition: background .15s, transform .1s, border-color .15s;
}
.tn-btn:hover { background: var(--surface-2); transform: translateY(-1px); border-color: var(--accent-soft); }
.tn-btn:active { transform: translateY(0); }
.tn-btn.on { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.tn-btn:focus-visible, .tn-seg button:focus-visible, .tn-dib:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Page ────────────────────────────────────────────────────── */
.tn-wrap { max-width: 860px; margin: 0 auto; padding: 34px clamp(16px, 5vw, 28px) 20px; }
.tn-prose .tn-he-inline,
.tn-he-inline { font-family: var(--font-hebrew); font-size: 1.15em; direction: rtl; unicode-bidi: isolate; }

/* ── Controls ────────────────────────────────────────────────── */
.tn-controls {
  display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center; align-items: center;
  padding: 16px; margin: 0 0 30px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow);
}
.tn-ctl { display: flex; align-items: center; gap: 8px; }
.tn-ctl-label { font: 700 .6rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tn-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.tn-seg button {
  appearance: none; cursor: pointer; border: 0; background: transparent; color: var(--ink-soft);
  font: 600 .76rem/1 var(--font-body); padding: 9px 14px; transition: background .15s, color .15s;
}
.tn-seg button:hover { background: rgba(94,144,227,.14); }
.tn-seg button[aria-pressed="true"] { background: var(--accent-deep); color: #fff; }

/* ── The luchot ──────────────────────────────────────────────── */
.tn-luchot { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 3vw, 22px); margin-bottom: 12px; }
.tn-tablet {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 130px 130px var(--radius) var(--radius);
  padding: 30px clamp(10px, 2.4vw, 20px) 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s;
}
.tn-tablet:hover { box-shadow: var(--tt-shadow-lift); border-color: var(--accent-soft); }
.tn-tablet-head { text-align: center; margin-bottom: 14px; }
.tn-tablet-he { font-family: var(--font-hebrew); direction: rtl; font-size: 1.15rem; color: var(--accent-deep); font-weight: 600; }
.tn-tablet-en { font: 700 .56rem/1.5 var(--font-body); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.tn-dib {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: right;
  appearance: none; cursor: pointer; background: transparent; color: inherit;
  border: 0; border-top: 1px solid var(--line-soft); padding: 11px 6px;
  transition: background .15s;
  border-radius: 8px;
}
.tn-tablet .tn-dib:first-of-type { border-top: 0; }
.tn-dib:hover { background: var(--surface-2); }
.tn-dib.on { background: rgba(94,144,227,.13); }
.tn-num {
  flex: none; width: 25px; height: 25px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 .7rem/1 var(--font-display); color: var(--accent-deep);
  border: 1px solid var(--accent-soft); background: var(--surface-2);
}
.tn-dib.on .tn-num { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.tn-dib-text { flex: 1; min-width: 0; }
.tn-dib-he { display: block; font-family: var(--font-hebrew); direction: rtl; text-align: right; font-size: 1.18rem; color: var(--ink); line-height: 1.5; }
.tn-dib-en { display: block; font-size: .72rem; color: var(--muted); text-align: right; direction: ltr; line-height: 1.4; margin-top: 1px; }
@media (max-width: 620px) {
  .tn-luchot { grid-template-columns: 1fr; }
  .tn-tablet { border-radius: 90px 90px var(--radius) var(--radius); }
  .tn-dib-he { font-size: 1.05rem; }
}

/* ── Reader ──────────────────────────────────────────────────── */
.tn-reader { margin: 26px 0 10px; scroll-margin-top: 70px; }
.tn-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 30px);
}
.tn-card-head { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); margin-bottom: 18px; }
.tn-card-num {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font: 700 1.15rem/1 var(--font-display); color: #fff;
  background: var(--tt-grad-header);
  box-shadow: 0 6px 16px rgba(28,71,165,.24);
}
.tn-card-title { flex: 1; min-width: 0; }
.tn-card-title h2 { font: 700 clamp(1.15rem, 3.6vw, 1.4rem)/1.25 var(--font-display); color: var(--accent-deep); letter-spacing: -.3px; margin: 0 0 3px; }
.tn-card-ref { font-size: .78rem; color: var(--muted); }
.tn-side-tag { font: 700 .56rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 5px; }

.tn-verse { margin: 0 0 18px; }
.tn-he {
  font-family: var(--font-hebrew); direction: rtl; text-align: right;
  font-size: calc(1.62rem * var(--tn-scale)); line-height: 1.95; color: var(--ink);
}
.tn-en { font-size: calc(.9rem * var(--tn-scale)); line-height: 1.6; color: var(--ink-soft); margin-top: 5px; }
body.tn-no-en .tn-en { display: none; }
body.tn-no-en .tn-he { line-height: 2.15; }
.tn-translit {
  font-size: .84rem; color: var(--muted); font-style: italic; letter-spacing: .01em;
  padding: 9px 12px; background: var(--surface-2); border-radius: var(--radius-sm); margin: 0 0 16px;
}
body.tn-no-translit .tn-translit { display: none; }
.tn-note {
  font-size: .89rem; line-height: 1.7; color: var(--ink-soft);
  border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin-top: 18px;
}
.tn-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }

/* diff highlight */
.tn-diff { background: rgba(0,200,220,.30); border-radius: 4px; padding: 0 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.tn-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tn-compare > div { min-width: 0; }
.tn-compare-head { font: 700 .58rem/1 var(--font-body); letter-spacing: .13em; text-transform: uppercase; color: var(--accent); padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 620px) { .tn-compare { grid-template-columns: 1fr; gap: 24px; } }

/* ── Prose sections ──────────────────────────────────────────── */
.tn-section { margin: 56px 0 0; }
.tn-section > h2 {
  font: 700 clamp(1.35rem, 4vw, 1.75rem)/1.22 var(--font-display); color: var(--accent-deep);
  letter-spacing: -.5px; margin: 0 0 12px; text-align: center;
}
.tn-section > h2::after {
  content: ''; display: block; width: 60px; height: 2px;
  background: var(--accent); margin: 14px auto 0;
}
.tn-section > .tn-section-sub { text-align: center; color: var(--muted); font-size: .92rem; max-width: 54ch; margin: 14px auto 24px; line-height: 1.6; }
.tn-prose { font-size: .96rem; line-height: 1.8; color: var(--ink-soft); }
.tn-prose p { margin: 0 0 14px; }
.tn-prose strong { color: var(--accent-deep); font-weight: 700; }
.tn-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: clamp(16px, 3.5vw, 26px); }

/* Talmud quotation block */
.tn-quote {
  border-radius: var(--radius);
  background: var(--tt-grad-deep);
  padding: clamp(20px, 4vw, 30px);
  text-align: center;
  box-shadow: 0 14px 36px rgba(12,35,80,.22);
}
.tn-quote-he { font-family: var(--font-hebrew); direction: rtl; font-size: 1.4rem; line-height: 1.9; color: #fff; }
.tn-quote-en { font-size: .92rem; line-height: 1.7; color: rgba(255,255,255,.82); margin-top: 14px; }
.tn-quote-ref {
  font: 700 .58rem/1 var(--font-body); letter-spacing: .13em; text-transform: uppercase;
  color: var(--tt-ice); margin-top: 16px;
}

/* accents demo */
.tn-accents { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0 6px; }
.tn-accent-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 18px 16px; text-align: center; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tn-accent-card:hover { transform: translateY(-6px); box-shadow: var(--tt-shadow-lift); border-color: var(--accent-soft); }
.tn-accent-card .tn-accent-name { font: 700 .58rem/1 var(--font-body); letter-spacing: .13em; text-transform: uppercase; color: var(--accent); }
.tn-accent-card .tn-accent-he { font-family: var(--font-hebrew); direction: rtl; font-size: 2rem; color: var(--ink); margin: 12px 0 6px; }
.tn-accent-card .tn-accent-note { font-size: .78rem; color: var(--muted); line-height: 1.55; }
@media (max-width: 520px) { .tn-accents { grid-template-columns: 1fr; } }

/* FAQ */
.tn-faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  padding: 0; margin-bottom: 10px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.tn-faq details[open] { border-color: var(--accent-soft); box-shadow: var(--shadow); }
.tn-faq summary {
  cursor: pointer; list-style: none; padding: 15px 17px;
  font: 600 .95rem/1.45 var(--font-body); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: background .15s;
}
.tn-faq summary::-webkit-details-marker { display: none; }
.tn-faq summary:hover { background: var(--surface-2); }
.tn-faq summary::after { content: '+'; flex: none; color: var(--accent); font-size: 1.3rem; line-height: 1; font-weight: 400; }
.tn-faq details[open] summary::after { content: '\2013'; }
.tn-faq details[open] summary { background: var(--surface-2); }
.tn-faq .tn-faq-body { padding: 14px 17px 16px; font-size: .92rem; line-height: 1.75; color: var(--ink-soft); }
.tn-faq .tn-faq-body p { margin: 0 0 10px; }
.tn-faq .tn-faq-body p:last-child { margin: 0; }

/* related */
.tn-related { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tn-related a {
  display: block; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 20px 22px; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tn-related a:hover { transform: translateY(-6px); box-shadow: var(--tt-shadow-lift); border-color: var(--accent-soft); }
.tn-related .tn-rel-he { font-family: var(--font-hebrew); direction: rtl; font-size: 1.35rem; color: var(--accent-deep); }
.tn-related .tn-rel-en { font: 700 .58rem/1.5 var(--font-body); letter-spacing: .13em; text-transform: uppercase; color: var(--accent); margin-top: 4px; }
.tn-related .tn-rel-note { font-size: .82rem; color: var(--muted); margin-top: 6px; line-height: 1.55; }
@media (max-width: 520px) { .tn-related { grid-template-columns: 1fr; } }

/* credits strip, above the shared footer */
.tn-credits {
  max-width: 860px; margin: 0 auto; padding: 26px clamp(16px, 5vw, 28px) 40px;
  border-top: 1px solid var(--line); text-align: center;
  color: var(--muted); font-size: .8rem; line-height: 1.75;
}
.tn-credits a { color: var(--accent); }
.tn-credits p { margin: 0 0 6px; }

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

@media (prefers-reduced-motion: reduce) {
  .tn-tablet, .tn-accent-card, .tn-related a, .tn-btn { transition: none; }
  .tn-tablet:hover, .tn-accent-card:hover, .tn-related a:hover, .tn-btn:hover { transform: none; }
}
