/* =====================================================================
   Our Money — styling for the LAW SECTION's own pages: index.html (main)
   and laws.html (the list). votes/ and court/ keep their own styles.
   Shared tokens, .subnav and components live in style.css.
   ===================================================================== */

/* ---------- a highlight: two rows, then "show all" ----------
   A row = the name + ONE quiet line. ▸ opens details in place; the link to
   the full record sits inside, never on the name (Mercy: no blue names). */
/* a block's title: a coloured bar at its start (Mercy chose option ב), a
   different colour per block, and the card a stronger border. The colours
   are the dataviz categorical slots in page order — never green/red (the
   site's for/against), checked by the palette validator in both modes; the
   title text stays ink (the bar is identity, the words are the label). */
.card:has(> h2.hh) { border: 1.5px solid var(--baseline); }
.card > h2.hh { font-size: 20px; font-weight: 700; margin: 0 0 12px;
  border-inline-start: 4px solid var(--acc, var(--series-1)); padding-inline-start: 10px; }
.acc1 { --acc: #2a78d6; } .acc2 { --acc: #eb6834; } .acc3 { --acc: #4a3aa7; }
.acc4 { --acc: #eda100; } .acc5 { --acc: #e87ba4; }
@media (prefers-color-scheme: dark) {
  .acc1 { --acc: #3987e5; } .acc2 { --acc: #d95926; } .acc3 { --acc: #9085e9; }
  .acc4 { --acc: #c98500; } .acc5 { --acc: #d55181; }
}
.hl { list-style: none; margin: 0; padding: 0; }
.hl > li { border-bottom: 1px solid var(--grid); }
.hl > li:last-child { border-bottom: 0; }
/* ראשי: a line above the first law and below the last too — every law sits
   in its own box of lines (Mercy) */
.hl:not(.plain) > li:first-child { border-top: 1px solid var(--grid); }
.hl:not(.plain) > li:last-child { border-bottom: 1px solid var(--grid); }
.it > button.head { all: unset; box-sizing: border-box; display: block; width: 100%;
  cursor: pointer; padding: 12px 2px; }
.it > button.head:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.it .nm { display: block; font-size: 15.5px; font-weight: 400; color: var(--ink-1); }   /* regular: the title leads */
.it > button.head:hover .nm { color: var(--accent-ink); }
.it .chev { display: inline-block; width: 16px; color: var(--ink-2); font-size: 13px; }
.it .nm .lbadge { margin-inline-end: 6px; vertical-align: 1px; }
.it .line { display: block; font-size: 13px; color: var(--ink-2); margin-top: 3px;
  padding-inline-start: 16px; }
.it .det { padding: 0 18px 14px; font-size: 13.5px; color: var(--ink-2); }
.it .det p { margin: 4px 0; }
.it .det ul { margin: 4px 0; padding-inline-start: 18px; }
.morebtn { border: 0; background: none; color: var(--accent-ink); cursor: pointer;
  font-size: 13.5px; padding: 8px 0 0; }
.morebtn:hover { text-decoration: underline; }
.srcnote { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; }
.srcnote a { color: var(--accent-ink); }

/* a name in two voices (law.data.js splitName): what it is about, bold;
   the amendment number / brackets / Hebrew year in the same ink, regular,
   one step smaller (Mercy's option ב) — never cut */
.it .chev { font-size: 16px; width: 20px; }
.it .line { padding-inline-start: 20px; }
/* the laws list opens in place too: the same ▸ */

/* an opened row: "label: value" lines — the label bold, the value regular */

/* ---------- badges: words first; colour never carries an opinion ---------- */
.lbadge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px;
  font-weight: 600; white-space: nowrap; border: 1px solid var(--border); color: var(--ink-2);
  background: var(--page); }
.lbadge.court { border-color: var(--ink-2); color: var(--ink-1); }
.lbadge.soft { font-weight: 500; }
.lbadge.stop { border-color: var(--against); color: var(--against-ink); }   /* the court stopped the whole law — red on purpose (Mercy) */
.doclink { color: var(--accent-ink); font-size: 13px; text-decoration: none; white-space: nowrap; }
.doclink:hover { text-decoration: underline; }

/* ---------- the laws list ---------- */
.lawctl { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.lawctl select, details.adv select { background: var(--page); color: var(--ink-1); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 14px; max-width: 100%; }
details.adv { margin: 4px 0 10px; font-size: 13.5px; color: var(--ink-2); }
details.adv summary { cursor: pointer; color: var(--accent-ink); }
details.adv .advin { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 8px 2px 2px; }
details.adv label { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
/* סדר / סוג / נושאים: one column of labels, three boxes of one width — a long
   choice is cut (Mercy) */
.lawctl label, details.adv label:has(select) { display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.lawctl label > span, details.adv label:has(select) > span { min-width: 3.9em; font-weight: 700; }   /* bold labels (Mercy) */
.lawctl select, details.adv select { width: 10.8em; text-overflow: ellipsis; }   /* "חוקים שחלים היום" in full (Mercy) */
.lawctl { padding-inline: 2px; }   /* level with .advin's 2px */
.statline { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.statline .hid { color: var(--ink-3); }

.lawrow { border-bottom: 1px solid var(--grid); position: relative; padding: 11px 2px; }
.lawrow:first-child, .loosenote + .lawrow { border-top: 1px solid var(--grid); }   /* each law in its own box (Mercy) */
/* "! nothing matches with your settings…" — its own block, a line above (Mercy) */
.loosenote { margin: 14px 0 10px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 14px; }
.loosenote b { color: var(--ink-1); margin-inline-end: 2px; }
/* a row = a link to the law's page: the name's link stretches over the row */
.lawrow .nm { font-size: 15px; color: var(--ink-1); }
.lawrow a.go { color: inherit; text-decoration: none; }
.lawrow a.go::after { content: ""; position: absolute; inset: 0; }
.lawrow:hover a.go { color: var(--accent-ink); }
.lawrow a.go:focus-visible { outline: none; }
.lawrow:has(a.go:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.lawrow .facts { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.lawrow .facts b { color: var(--ink-1); font-weight: 600; }
.lawrow a.replink { position: relative; z-index: 1; color: var(--accent-ink); }
.lawrow .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center;
  font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.det h3 { font-size: 13.5px; color: var(--ink-2); margin: 12px 0 4px; font-weight: 600; }
.det p { margin: 3px 0; }
.det ul { margin: 3px 0; padding-inline-start: 18px; }
.det .srcs a { display: inline-block; margin-inline-end: 14px; }
.notadvice { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }

@media (max-width: 640px) {
  .it .nm, .lawrow .nm { font-size: 15px; }
  .card > h2.hh { font-size: 19px; margin-bottom: 10px; }
  .lawctl select, details.adv select { font-size: 16px; }   /* no iPhone zoom */
}

/* the "?" button lives in style.css; .info boxes are its hidden sources */
.info[hidden] { display: none; }

/* ---------- one law's page (law/page.html, filled by worker/pages.js) ---------- */
.lawhead .crumbs { margin: 0 0 6px; font-size: 13px; }
.lawhead .crumbs a { color: var(--accent-ink); text-decoration: none; }
.lawhead .crumbs a::before { content: "→ "; }
h1.lawname { font-size: clamp(21px, 3vw, 27px); line-height: 1.3; margin: 0 0 10px; letter-spacing: -0.01em; }
.lawhead .chips { margin: 0 0 8px; }
.lawhead .facts, .card .facts { font-size: 13.5px; color: var(--ink-2); margin: 4px 0; }
.lawhead .facts.knesset { color: var(--ink-3); font-size: 12.5px; }
.card .note { color: var(--ink-2); font-size: 14px; white-space: pre-line; }
.hl.plain > li { padding: 10px 2px; }
.hl.plain .nm { font-size: 15px; font-weight: 500; }
.hl.plain .line { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
details.more { margin-top: 8px; }
details.more > summary, details.sum > summary { cursor: pointer; color: var(--accent-ink); font-size: 13.5px; }
details.sum { margin-top: 4px; }
details.sum p { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 0; }
.srcs a { display: inline-block; margin-inline-end: 14px; }
/* a law's links (what it replaced, what replaced it) wrap like words — a
   list of 17 old ordinances must not push the page sideways on a phone */
.lawhead .facts .doclink, .hl.plain .doclink { white-space: normal; }

/* the AI summary on a law's page (worker pages.js aiBox) */
.aisum .aione { font-size: 17px; font-weight: 700; line-height: 1.5; margin: 4px 0 10px; }
.aisum .aikv { margin: 10px 0; font-size: 15px; line-height: 1.6; }
.aisum .aikv > b { display: block; font-size: 13.5px; color: var(--ink-2); margin-bottom: 2px; }
.aisum .aikv ul { margin: 2px 0 0; padding-inline-start: 20px; }
.aisum .aikv li { margin: 3px 0; }
.aistatus { background: var(--grid); border-inline-start: 4px solid var(--ink-3); border-radius: 6px; padding: 7px 12px; margin: 0 0 10px; font-size: 14.5px; }
.aistatus p { margin: 2px 0; }
.aistatus.stop { border-color: var(--against); background: color-mix(in srgb, var(--against) 10%, transparent); }
.aisum .aistale { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; }
.aisum .aifoot { border-top: 1px solid var(--grid); margin: 12px 0 0; padding-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.card .ksum { white-space: pre-line; font-size: 15px; line-height: 1.6; }
