/* lexicon-mode — the rules that only ever match inside this engine, moved out of
   core/styles.css so other pages don't download them. Loaded by core/app.js after
   core/styles.css (the ENGINES table's css). */

body.lexicon-mode #lexiconRoot {
  display: block; min-height: 100vh; background: var(--bg-1); color: var(--ink);
  /* Every lexicon rule reads these two tokens, so rebinding them here swaps
     the whole page's type without touching the rest of the site. */
  --font: "Lex Text", Georgia, serif;
  --font-display: "Lex Display", "Palatino Linotype", Palatino, Georgia, serif;
  font-family: var(--font); font-size: 17px; line-height: 1.7; font-variant-numeric: lining-nums;
  padding: 0 16px 88px;
}
/* Light parchment's --text-dim (#6f6151) is 4.41:1 on the recessed cards (--bg-0);
   this slightly deeper sepia clears 4.5:1 on every lexicon surface. Light mode only:
   on dark parchment the same ink was 2.7:1 (the palette's own dim reads there). */
:root[data-mode="light"] body.lexicon-mode #lexiconRoot { --text-dim: #66584a; }

#lexDraft { max-width: 1100px; margin: 0 auto; padding: 8px 12px; text-align: center;
  font-weight: 700; color: var(--ink); background: var(--soft-fill-2); border-bottom: 1px dashed var(--line); }

#lexHeader, #lexStrip, #lexBody, #lexWide { max-width: 1100px; margin: 0 auto; }

#lexHeader { padding: 56px 0 18px; border-bottom: 1px solid var(--line); }

.lex-kicker { margin: 0; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-dim); }

.lex-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(44px, 7.6vw, 80px); line-height: 1; margin: 6px 0 10px; overflow-wrap: anywhere; }

.lex-phrase { font-style: italic; font-weight: 500; }

.lex-orig { margin: 0 0 8px; font-size: 20px; }

.lex-sep-group { margin: 0 .6em; }

.lex-grc { font-family: "Lex Greek", var(--font-display); font-size: 1.35em; }

.lex-he  { font-family: "Lex Hebrew", serif; font-size: 1.45em; unicode-bidi: isolate; }

.lex-translit { font-family: var(--font); font-style: italic; color: var(--text-dim); font-size: .85em; }

.lex-strongs { font-family: var(--font); color: var(--text-dim); font-size: .75em; letter-spacing: .04em; }

.lex-source { font-style: normal; font-family: var(--font-display); font-weight: 600; font-size: 1.1em; }

.lex-essence { font-family: var(--font-display); font-weight: 600; font-size: 25px; margin: 4px 0 0; }

#lexStrip { padding: 10px 0; font-size: 15px; color: var(--text-dim); border-bottom: 1px solid var(--line); }

#lexStrip a { color: var(--ink); }

#lexStrip [aria-current] { font-weight: 700; color: var(--ink); }

#lexBody { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 40px; padding: 28px 0; }

@media (max-width: 759px) {
  #lexBody { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  
  /* Start below the ⌂ Library and light/dark pills (both sit at the top left), not beside them. */
  #lexDraft { padding: 56px 16px 10px; text-align: left; }
}

.lex-sec h2 { font-family: var(--font-display); font-weight: 600; font-size: 29px; margin: 22px 0 8px; }

.lex-prose p { margin: 0 0 12px; }

#lexiconRoot .lex-prose a { color: var(--ink); text-decoration: underline; }

.lex-dry .lex-dict { font-size: 16px; }

.lex-cite { color: var(--text-dim); font-size: 14px; margin: 0; }

.lex-accent { border-left: 4px solid var(--lex-accent); background: rgba(var(--lex-accent-rgb), .07);
  padding: 2px 18px 6px; border-radius: 0 8px 8px 0; }

.lex-cards { display: grid; gap: 12px; }

#lexWide { padding: 0 0 28px; }

#lexWide .lex-sec h2 { margin-top: 0; }

#lexWide .lex-cards { grid-template-columns: repeat(var(--lex-cols, 3), minmax(0, 1fr)); gap: 16px; }

@media (max-width: 899px) {
  #lexWide .lex-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  #lexWide .lex-cards { grid-template-columns: minmax(0, 1fr); }
}

.lex-card { background: var(--bg-0); border-radius: 8px; padding: 12px 14px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12); }

.lex-quote { margin: 0; font-family: var(--font); font-style: italic; color: var(--ink); }

.lex-quote p { margin: 0 0 6px; }

.lex-quote cite { display: block; font-style: normal; font-family: var(--font); font-size: 14px; color: var(--text-dim); }

.lex-note { font-size: 15px; margin: 6px 0 0; color: var(--text); }

.lex-count strong { font-family: var(--font-display); font-weight: 600; font-size: 32px; }

.lex-more { margin-top: 10px; font: inherit; font-size: 15px; cursor: pointer; padding: 6px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); }

.lex-terms dt { font-weight: 700; }

.lex-terms dd { margin: 0 0 10px; }

#lexCredit { text-align: center; margin-top: 32px; }

body.lexicon-mode a:focus-visible, body.lexicon-mode button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---- Phone -----------------------------------------------------------------
   The fixed ⌂ Library / Dark pills rode over the prose all the way down the
   page; here they scroll away with the header (core/app.js places the Dark
   pill beside an absolute link the same way). The series strip's links get
   40px tap heights. */
@media (max-width: 639px) {
  body.lexicon-mode #lexiconRoot { position: relative; }
  #lexBack { position: absolute; }
  #lexStrip { padding: 4px 0; line-height: 1.4; }
  #lexStrip a, #lexStrip [aria-current] { display: inline-block; min-width: 40px; padding: 10px 1px; text-align: center; }
  .lex-more { min-height: 44px; }
}
