/* Citizenship Bill 2026: before and after. Plain CSS, no JavaScript. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c2420;
  --muted: #5a655f;
  --line: #e2dfd7;
  --accent: #0d6a4e;
  --accent-ink: #ffffff;
  --legal-bg: #f5f3ec;
  --del-bg: #fbe1e1;
  --del-ink: #8f1919;
  --ins-bg: #daf1e1;
  --ins-ink: #0f5428;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111513; --surface: #181e1b; --ink: #e4e9e6; --muted: #9ba7a1; --line: #2b3430;
    --accent: #5cc39a; --accent-ink: #0b1a14; --legal-bg: #151a17;
    --del-bg: #3d1e1e; --del-ink: #ffb8b8; --ins-bg: #173321; --ins-ink: #a8e7bb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111513; --surface: #181e1b; --ink: #e4e9e6; --muted: #9ba7a1; --line: #2b3430;
  --accent: #5cc39a; --accent-ink: #0b1a14; --legal-bg: #151a17;
  --del-bg: #3d1e1e; --del-ink: #ffb8b8; --ins-bg: #173321; --ins-ink: #a8e7bb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; }
.top a { color: var(--ink); font-weight: 700; text-decoration: none; }

.layout { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; }
nav ol { list-style: none; margin: 0; padding: 0; }
nav a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 15px; }
nav a:hover { background: var(--legal-bg); }
nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.side { position: sticky; top: 0; align-self: start; padding: 24px 0; }
.menu { display: none; border-bottom: 1px solid var(--line); background: var(--surface); }
.menu summary { padding: 10px 16px; cursor: pointer; font-weight: 600; }
.menu nav { padding: 0 8px 10px; }
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .menu { display: block; }
}

main { padding: 24px 0 56px; min-width: 0; }
h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 36px 0 10px; }
p { margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 18px; max-width: 760px; }
.ref { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.small { font-size: 14px; color: var(--muted); }

/* summary tables */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin: 12px 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
tr:last-child > * { border-bottom: 0; }
thead th { background: var(--legal-bg); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tbody th { font-weight: 600; width: 30%; }
td.now { color: var(--muted); }
td.new { background: var(--ins-bg); color: var(--ins-ink); font-weight: 600; }
td.same { color: var(--muted); font-style: italic; }

/* legal text: before / after */
.law { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 12px 0 24px; background: var(--surface); font-family: var(--serif); font-size: 16px; line-height: 1.55; }
.law-cap { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 14px; background: var(--legal-bg); border-bottom: 1px solid var(--line); }
.law-head, .law-row { display: grid; grid-template-columns: 1fr 1fr; }
.law-head div { font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 14px; border-bottom: 1px solid var(--line); }
.law-row > div { padding: 8px 14px; border-bottom: 1px solid var(--line); }
.law-row > div:first-child, .law-head div:first-child { border-right: 1px solid var(--line); }
.law-row:last-child > div { border-bottom: 0; }
.law p { margin: 0 0 6px; }
.law p:last-child { margin-bottom: 0; }
.law .l1 { padding-left: 1.4em; }
.law .l2 { padding-left: 2.8em; }
.law .l3 { padding-left: 4.2em; }
.law .title { font-weight: 700; }
.law .rep { color: var(--muted); }
.law .none { font-family: var(--sans); font-style: italic; font-size: 14px; color: var(--muted); }
.law-row.same > div { color: var(--muted); }
.law-row.blk > .b { background: var(--del-bg); color: var(--del-ink); }
.law-row.blk > .a { background: var(--ins-bg); color: var(--ins-ink); }
.law-row.blk > .b .none, .law-row.blk > .a .none { color: inherit; }
.law del, .law ins { text-decoration: none; border-radius: 3px; padding: 0 3px; font-weight: 700; }
.law del { background: var(--del-bg); color: var(--del-ink); }
.law ins { background: var(--ins-bg); color: var(--ins-ink); }
.law-gap { font-family: var(--sans); font-size: 14px; font-style: italic; color: var(--muted); padding: 6px 14px; border-bottom: 1px solid var(--line); }
@media (max-width: 700px) {
  .law-head { display: none; }
  .law-row { grid-template-columns: minmax(0, 1fr); }
  .law-row > div:first-child { border-right: 0; }
  .law-row > div::before { content: attr(data-l); display: block; font-family: var(--sans); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
  .law-row.same > .a { display: none; }
  .law-row.same > .b::before { content: "Unchanged"; }
}

.key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.key span { padding: 1px 8px; border-radius: 4px; font-weight: 700; }
.key .k-del { background: var(--del-bg); color: var(--del-ink); }
.key .k-ins { background: var(--ins-bg); color: var(--ins-ink); }

details.v { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin: 10px 0; }
details.v summary { cursor: pointer; padding: 10px 14px; font-weight: 600; }
details.v > div { padding: 4px 16px 14px; font-family: var(--serif); font-size: 15.5px; }
details.v h4 { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
details.v p { margin: 0 0 6px; }
details.v .l1 { padding-left: 1.4em; }
details.v .l2 { padding-left: 2.8em; }
details.v .gap { font-style: italic; color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; flex-wrap: wrap; font-size: 15px; }
.pager .next { margin-left: auto; }
footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 13.5px; color: var(--muted); padding: 16px; }
footer p { max-width: 1168px; margin: 0 auto; }

@media print { .side, .menu, .pager { display: none; } .layout { display: block; } }
