/* CASA-1: the house inline layer (CEO, 06/10). One vocabulary for marks, one source block.
   Colour is a legend: blue = what was decided, orange = the limit, ink = everything else.
   Intensity is a reader/CEO dial (body[data-int]); the shipped default is "proposto". */

:root { --casa-hl: color-mix(in srgb, var(--conc) 26%, transparent); --casa-hl-dif: color-mix(in srgb, var(--dif) 24%, transparent); }
:root[data-theme="dark"] { --casa-hl: color-mix(in srgb, var(--conc) 34%, transparent); --casa-hl-dif: color-mix(in srgb, var(--dif) 34%, transparent); }

/* ── marks ─────────────────────────────────────────── */
.held, .limit { font-weight: 650; }
.held { color: var(--dif); }
.limit { color: var(--conc); }
.mark { background: linear-gradient(var(--casa-hl), var(--casa-hl)) 0 57% / 100% .74em no-repeat; padding: 0 .08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.term { text-decoration: underline dotted var(--ink-2) 1.5px; text-underline-offset: .22em; cursor: help; position: relative; }
.term:hover::after, .term:focus-visible::after {
  content: attr(data-def); position: absolute; left: 0; top: calc(100% + 8px); z-index: 5; width: max-content; max-width: 30ch;
  padding: 8px 11px; background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--grid-major);
  font: 400 14px/1.4 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink); font-style: normal; white-space: normal;
}
.art { font: 500 .8em/1 var(--mono); letter-spacing: .01em; padding: .12em .32em .16em; background: var(--paper-2); border-bottom: 1px solid var(--ink-2); white-space: nowrap; }
.org { font-variant-caps: all-small-caps; letter-spacing: .06em; font-weight: 500; }
.tab { font-variant-numeric: tabular-nums; }

/* intensity: discreto (ink + coloured rule), proposto (coloured bold), forte (coloured bold on wash) */
body[data-int="discreto"] .held, body[data-int="discreto"] .limit { color: inherit; text-decoration: underline 2px; text-underline-offset: .2em; font-weight: 600; }
body[data-int="discreto"] .held { text-decoration-color: var(--dif); }
body[data-int="discreto"] .limit { text-decoration-color: var(--conc); }
body[data-int="discreto"] .mark { background: none; text-decoration: underline wavy var(--conc) 1px; text-underline-offset: .22em; }
body[data-int="forte"] .held { background: var(--dif-wash); padding: 0 .22em; }
body[data-int="forte"] .limit { background: var(--conc-wash); padding: 0 .22em; }
body[data-int="forte"] .mark { background: linear-gradient(var(--casa-hl), var(--casa-hl)) 0 63% / 100% .95em no-repeat; }
:root[data-theme="dark"] body[data-int="forte"] .held { background: var(--dif-wash); }
:root[data-theme="dark"] body[data-int="forte"] .limit { background: var(--conc-wash); }
body[data-int="forte"] .held, body[data-int="forte"] .limit { -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ── the source block: the one way a source speaks ───────────────────
   Replaces .lex, blockquote.law, .julgado and the Codex .source-block.
   Bar colour = what the source IS to the argument: blue a decision or statute's operative words,
   orange a limit (the passage that caps the holding), ink a book or doctrine. */
.fonte { --bar: var(--ink-2); margin: 30px 0 34px; padding: 18px clamp(18px, 2.6vw, 34px) 16px; background: var(--paper-2); border-left: 3px solid var(--bar); }
.fonte.dec { --bar: var(--dif); }
.fonte.lim { --bar: var(--conc); }
.fonte > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 12px; font: 500 11px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bar); }
.fonte > header .loc { color: var(--muted); }
.fonte blockquote { margin: 0; padding: 0; border: 0; max-width: none; font: 400 18px/1.62 var(--serif); font-style: normal; color: var(--ink); }
.fonte blockquote p { margin: 0 0 .9em; max-width: none; width: auto; }
.fonte blockquote p:last-child { margin-bottom: 0; }
.fonte .key { background: linear-gradient(var(--casa-hl-dif), var(--casa-hl-dif)) 0 57% / 100% .74em no-repeat; padding: 0 .06em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.fonte.lim .key { background: linear-gradient(var(--casa-hl), var(--casa-hl)) 0 57% / 100% .74em no-repeat; }
.fonte blockquote[lang]:not([lang="pt"]):not([lang="pt-BR"]) { font-size: 17.5px; }
.fonte .tr { margin: 14px 0 0; padding-top: 12px; border-top: 1px dotted var(--grid-major); color: var(--ink-2); font: 400 17px/1.58 var(--serif); }
.fonte .tr[hidden] { display: none; }
.fonte .tr > b { display: block; margin-bottom: 6px; font: 500 10px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fonte footer { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; }
.fonte footer button { border: 0; border-bottom: 1px solid currentColor; padding: 2px 0; background: none; color: var(--bar); cursor: pointer; font: 500 11px/1.5 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.fonte footer button:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* run-in head: a short bold label that opens a paragraph in a parallel run (Peru, 1823. / Brasil, 1824.). Structure, not emphasis. */
.runin { font-weight: 650; }
/* .fonte.resumo: our summary of a decision, not its words (no blockquote, no quote face) */
.fonte .corpo { font: 400 17.5px/1.6 var(--serif); color: var(--ink-2); }
.fonte .corpo p { margin: 0 0 .9em; max-width: none; width: auto; }
.fonte .corpo p:last-child { margin-bottom: 0; }
.fonte.resumo > header::after { content: "resumo"; margin-left: auto; color: var(--muted); }
.fonte .tese { margin: 14px 0 0; padding-top: 12px; border-top: 1px dotted var(--grid-major); font: 500 17.5px/1.55 var(--serif); color: var(--ink); }
.fonte .tese::before { content: "resultado"; display: block; margin-bottom: 6px; font: 500 10px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bar); }
