/* sermon.css - the Sermon and lesson helper (/sermon-helper/, prefix sh-). Uses christian.css tokens; dark mode follows them. */

/* ---------------------------------------------------------------- the passage box */
.sh-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 10px; }
.sh-form label { font-weight: 600; }
.sh-form input[type=text] { flex: 1 1 240px; min-width: 0; max-width: 520px; padding: 9px 12px; font-size: 1rem; border: 1px solid var(--cx-line); border-radius: 999px; background: var(--cx-card); color: var(--cx-ink); }
.sh-form input[type=text]:focus { outline: 2px solid var(--cx-accent); outline-offset: 1px; }
.sh-examples { margin: 4px 0 18px; }
.sh-recent { margin: 0 0 18px; }
.sh-recent-h { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cx-muted); margin: 0 0 6px; }
.sh-error { border: 1px solid var(--cx-line); border-left: 4px solid var(--cx-accent); background: var(--cx-soft); border-radius: var(--cx-radius); padding: 10px 14px; margin: 10px 0 14px; }
.sh-error p { margin: 6px 0; }

/* ---------------------------------------------------------------- Sunday's readings */
.sh-suns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.sh-sun { border: 1px solid var(--cx-line); border-radius: var(--cx-radius); background: var(--cx-card); padding: 10px 14px; }
.sh-sun h3 { font-family: var(--cx-serif); margin: 2px 0 2px; }
.sh-sun .cx-muted { margin: 0 0 8px; font-size: .9rem; }
.sh-readings { list-style: none; margin: 0; padding: 0; }
.sh-readings li { padding: 5px 0; border-top: 1px solid var(--cx-line); }
.sh-readings li:first-child { border-top: 0; }
.sh-rl { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cx-muted); }
.sh-howto li { margin: 0 0 8px; }

/* ---------------------------------------------------------------- layout and contents */
.sh-layout { display: block; }
.sh-toc { position: sticky; top: 0; z-index: 5; margin: 0 -16px 8px; padding: 6px 16px; background: var(--cx-soft); border-bottom: 1px solid var(--cx-line); }
.sh-toc-h { display: none; }
.sh-toc ol { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.sh-toc ol::-webkit-scrollbar { display: none; }
.sh-toc li a { display: block; white-space: nowrap; padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--cx-ink); font-size: .88rem; }
.sh-toc li a:hover, .sh-toc li a.on { background: var(--cx-card); color: var(--cx-accent-ink); }
.sh-toc { display: flex; align-items: center; gap: 6px; }
.sh-toc ol { flex: 1 1 auto; min-width: 0; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
.sh-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; position: relative; }
.sh-tools .cx-btn { padding: 4px 10px; font-size: .82rem; }
.sh-tools[hidden] { display: none; }
.sh-status { position: absolute; right: 0; top: 100%; white-space: nowrap; font-size: .8rem; color: var(--cx-muted); background: var(--cx-soft); padding: 0 4px; }
.sh-status:empty { display: none; }
.sh-body { min-width: 0; }
.sh-part { scroll-margin-top: 56px; }
@media (min-width: 960px) {
  .sh-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
  .sh-toc { top: 12px; margin: 26px 0 0; padding: 12px 0 12px 14px; background: none; border: 0; border-left: 2px solid var(--cx-line); max-height: calc(100vh - 24px); overflow-y: auto; }
  .sh-toc-h { display: block; margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cx-muted); }
  .sh-toc ol { flex-direction: column; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .sh-toc li a { padding: 4px 8px; border-radius: 6px; white-space: normal; }
  .sh-toc { display: block; }
  .sh-tools { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 14px; }
  .sh-tools .cx-btn { padding: 7px 14px; font-size: .92rem; }
  .sh-status { position: static; white-space: normal; background: none; padding: 0; }
  .sh-part { scroll-margin-top: 12px; }
}
.sh-cut { margin-top: 0; }

/* ---------------------------------------------------------------- the passage */
.sh-trform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.sh-trform select { max-width: 100%; padding: 6px 8px; border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-card); color: var(--cx-ink); }
.sh-trform.js button { display: none; }
.sh-text { font-family: var(--cx-serif); font-size: 1.12rem; line-height: 1.65; background: var(--cx-soft); border-radius: var(--cx-radius); padding: 10px 16px; }
.sh-v { margin: 0 0 6px; }
.sh-v sup { font-family: system-ui, sans-serif; font-size: .7rem; color: var(--cx-accent-ink); font-weight: 700; margin-right: 2px; }
.sh-ch { font-family: system-ui, sans-serif; font-size: .78rem !important; text-transform: uppercase; letter-spacing: .06em; color: var(--cx-muted); margin: 14px 0 6px !important; }
.sh-ch:first-child { margin-top: 4px !important; }
.sh-trline { font-size: .85rem; margin: 6px 0 8px; }
.sh-onward { margin: 8px 0 0; }

/* ---------------------------------------------------------------- key words */
.sh-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sh-words { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sh-words th, .sh-words td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--cx-line); }
.sh-words th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cx-muted); }
.sh-words .lx-orig { font-size: 1.25rem; line-height: 1.3; }
@media (max-width: 600px) {
  .sh-words thead { display: none; }
  .sh-words, .sh-words tbody, .sh-words tr, .sh-words td { display: block; width: auto; }
  .sh-words tr { border-bottom: 1px solid var(--cx-line); padding: 6px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
  .sh-words td { border: 0; padding: 2px 0; }
}

/* ---------------------------------------------------------------- commentary, cross-references */
.sh-worknav { margin: 0 0 12px; }
.sh-work { border-top: 2px solid var(--cx-line); padding-top: 8px; margin: 18px 0; }
.sh-work > h3 { font-family: var(--cx-serif); font-size: 1.15rem; margin: 4px 0 2px; }
.sh-trad { margin: 0 0 8px; font-size: .88rem; color: var(--cx-muted); }
.sh-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--cx-soft); border: 1px solid var(--cx-line); color: var(--cx-ink); font-size: .8rem; margin-right: 4px; }
.sh-note, .sh-xref { position: relative; border: 1px solid var(--cx-line); border-radius: var(--cx-radius); background: var(--cx-card); padding: 8px 12px; margin: 8px 0; }
.sh-note.on, .sh-xref.on { border-color: var(--cx-accent); box-shadow: inset 3px 0 0 var(--cx-accent); }
.sh-range { font-size: .95rem; margin: 2px 0 6px; padding-right: 120px; }
.sh-pick { float: right; font-size: .8rem; color: var(--cx-muted); cursor: pointer; margin: 0 0 4px 8px; user-select: none; }
.sh-pick input { vertical-align: -2px; margin-right: 3px; }
.sh-ex, .sh-full { font-size: .95rem; line-height: 1.55; }
.sh-full h4 { font-size: .95rem; margin: 6px 0; }
.sh-full p { margin: 0 0 8px; }
.sh-more summary { cursor: pointer; color: var(--cx-accent-ink); font-size: .9rem; margin: 2px 0 6px; }
.sh-readfull { margin: 4px 0 0; font-size: .85rem; }
.sh-xh { margin: 0 0 4px; padding-right: 120px; }
.sh-open { font-size: .8rem; margin-left: 4px; }
.sh-xt { margin: 0; font-family: var(--cx-serif); line-height: 1.55; }
.sh-xt sup { font-family: system-ui, sans-serif; font-size: .68rem; color: var(--cx-muted); }
@media (max-width: 520px) {
  .sh-range, .sh-xh { padding-right: 0; }
  .sh-pick { float: none; display: block; margin: 0 0 4px; }
}

/* ---------------------------------------------------------------- creeds, hymns, dictionary */
.sh-creed { margin: 12px 0; }
.sh-creed h3 { font-family: var(--cx-serif); }
.sh-creedlist, .sh-hymns { margin: 6px 0; padding-left: 20px; }
.sh-creedlist li, .sh-hymns li { margin: 0 0 8px; }
.sh-snip { font-size: .9rem; color: var(--cx-muted); }
.sh-dict { margin: 10px 0; }
.sh-dict h3 { margin: 0 0 2px; font-family: var(--cx-serif); }
.sh-dict p { margin: 0; font-size: .95rem; }
.sh-again { margin-top: 28px; border-top: 1px solid var(--cx-line); }

/* ---------------------------------------------------------------- print: the text and the notes only */
@media print {
  .sh-toc, .sh-tools, .sh-part:not(.sh-print), .sh-noprint, .sh-trform, .sh-onward, .sh-worknav, .sh-pick, .sh-readfull, .sh-more summary, .cx-crumbs, .cx-note, .sh-cut, .cx-lede { display: none !important; }
  .sh-layout { display: block; }
  .sh-text { background: none; padding: 0; font-size: 12pt; }
  .sh-note { border: 0; border-bottom: 1px solid #ccc; border-radius: 0; padding: 4px 0; break-inside: avoid; box-shadow: none; }
  .sh-range, .sh-xh { padding-right: 0; }
  .sh-range a { color: inherit; text-decoration: none; }
  html.sh-picked .sh-note:not(.on), html.sh-picked .sh-work:not(.has-on) { display: none !important; }
  a { color: inherit; }
}
