/* NSPE BER Case Library. Tokens follow the NSPE Design System (nspe-blue leads, charcoal ink, Montserrat / Zilla Slab / Roboto Condensed). Light theme only: the blue logo is for light grounds. */
:root {
  --nspe-blue: #006CA3;
  --navy: #1F3567;
  --magenta: #E51376;
  --teal: #1EB2B0;
  --ink: #282829;
  --muted: #55565c;
  --gray: #D1D1D9;
  --surface: #FFFFFF;
  --tint: #F5F6FB;
  --mark: #FFE7A3;
  --warn-bg: #FFF4EA;
  --warn-line: #F57C21;
  --alert-bg: #FDEBF3;
  --shadow: 0 2px 8px rgba(0,0,0,.12);
  --sans: Montserrat, Arial, sans-serif;
  --slab: "Zilla Slab", Georgia, serif;
  --cond: "Roboto Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--surface); }
body { margin: 0; background: var(--surface); color: var(--ink); font: 500 16px/1.6 var(--sans); }
img { max-width: 100%; }
a { color: var(--nspe-blue); }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 20; }
.skip:focus { left: 16px; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.brandbar { border-bottom: 1px solid var(--gray); background: var(--surface); }
.brandbar .wrap { padding-block: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.brandbar .logo { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brandbar .logo img { height: 42px; width: auto; display: block; }
.brandbar .logo span { font: 700 14px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--navy); border-left: 1px solid var(--gray); padding-left: 16px; }
.brandbar nav { display: flex; gap: 8px 22px; flex-wrap: wrap; font-weight: 700; font-size: 14px; }
.brandbar nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.brandbar nav a[aria-current="page"] { border-bottom-color: var(--nspe-blue); }
@media (max-width: 560px) { .brandbar .logo span { display: none; } }
footer.site { background: linear-gradient(90deg, #006CA3, #E51376); color: #fff; margin-top: 56px; }
footer.site .wrap { padding-block: 24px; display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 13px; }
footer.site a { color: #fff; }

/* Type */
.label { font: 700 15px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--nspe-blue); margin: 0; }
h1.page { font: 700 clamp(30px, 5vw, 48px)/1.08 var(--sans); text-transform: uppercase; margin: 0; text-wrap: balance; }
.intro { font-weight: 400; font-size: clamp(17px, 2vw, 20px); max-width: 62ch; margin: 0; }
h2.section { font: 700 clamp(22px, 3vw, 28px)/1.2 var(--sans); margin: 32px 0 12px; }
h3, .h4 { font: 600 24px/1.3 var(--slab); margin: 0 0 8px; }

/* Hero and search */
.hero { background: var(--tint); }
.hero .wrap { padding-block: 40px 32px; display: grid; gap: 14px; }
.search { position: relative; max-width: 900px; }
.search input { width: 100%; height: 56px; border-radius: 999px; border: 1px solid var(--gray); padding: 0 56px 0 24px; font: 500 17px var(--sans); color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.search svg { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.tries { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.tries a { font: 600 13px var(--sans); border: 1px solid var(--nspe-blue); color: var(--nspe-blue); background: var(--surface); border-radius: 999px; padding: 5px 12px; text-decoration: none; }
.tries a:hover { background: var(--nspe-blue); color: #fff; }

/* Search layout */
main { display: block; }
.main-pad { padding-block: 28px 0; }
.layout { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0,1fr); } }
.filters { display: grid; gap: 22px; position: sticky; top: 16px; }
@media (max-width: 860px) { .filters { position: static; } .filters:not(.open) { display: none; } }
.btn.toggle-filters { display: none; }
@media (max-width: 860px) { .btn.toggle-filters { display: inline-flex; justify-self: start; min-height: 44px; } }
.fgroup { display: grid; gap: 8px; }
.flabel { font: 700 13px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
select { height: 48px; border-radius: 999px; border: 1px solid var(--gray); padding: 0 40px 0 18px; font: 500 15px var(--sans); color: var(--ink); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23006CA3' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 18px center; appearance: none; width: 100%; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { border: 1px solid var(--gray); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 600 13px var(--sans); cursor: pointer; font-variant-numeric: tabular-nums; }
.tabs button[aria-pressed="true"] { background: var(--nspe-blue); border-color: var(--nspe-blue); color: #fff; }
.tabs .ct { opacity: .75; font-weight: 500; margin-left: 4px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--nspe-blue); }
.linkbtn { justify-self: start; background: none; border: 0; color: var(--nspe-blue); font: 700 14px var(--sans); cursor: pointer; padding: 0; text-decoration: underline; }
.note { font-size: 13px; color: var(--muted); background: var(--tint); border-radius: 4px; padding: 12px 14px; margin: 0; }
.status { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.status p { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.status .sort { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.status .sort select { height: 40px; width: auto; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.card { background: var(--surface); border-radius: 4px; box-shadow: var(--shadow); padding: 18px 20px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 16px; }
.badge { grid-row: span 4; background: var(--navy); color: #fff; border-radius: 6px; font: 700 20px/1 var(--cond); padding: 10px 8px; min-width: 66px; text-align: center; align-self: start; font-variant-numeric: tabular-nums; }
.badge small { display: block; font-size: 12px; letter-spacing: .06em; opacity: .85; margin-bottom: 3px; }
.card h2 { margin: 0; font: 700 18px/1.3 var(--sans); text-wrap: balance; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.snip { margin: 4px 0 0; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--tint); border: 1px solid var(--gray); border-radius: 999px; padding: 2px 10px; font: 600 12px/1.6 var(--sans); color: var(--ink); text-decoration: none; }
a.chip:hover { border-color: var(--nspe-blue); color: var(--nspe-blue); }
.pill { font: 700 11px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; }
.pill.revoked { background: var(--magenta); color: #fff; }
.pill.dissent { background: var(--tint); color: var(--navy); border: 1px solid var(--gray); }
mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
.empty { background: var(--tint); border-radius: 4px; padding: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 6px; font: 700 13px var(--sans); letter-spacing: .2em; text-decoration: none; text-transform: uppercase; cursor: pointer; }
.btn.solid { background: var(--nspe-blue); color: #fff; border: 0; }
.btn.solid:hover { background: var(--navy); color: #fff; }
.btn.outline { border: 2px solid var(--nspe-blue); color: var(--nspe-blue); background: var(--surface); }
.more { margin-top: 18px; }
.loading { color: var(--muted); }

/* Case page */
.crumbs { font-size: 14px; margin: 0 0 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.case { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 40px; align-items: start; }
@media (max-width: 960px) { .case { grid-template-columns: minmax(0,1fr); } }
.case h1 { font: 700 clamp(26px, 3.6vw, 38px)/1.15 var(--sans); margin: 6px 0 20px; text-wrap: balance; }
.case section { margin-bottom: 30px; max-width: 70ch; }
.case section p { margin: 0 0 12px; }
.callout { border-left: 4px solid var(--warn-line); background: var(--warn-bg); padding: 12px 16px; border-radius: 4px; margin: 0 0 24px; font-size: 14px; max-width: 70ch; }
.callout.revoked { border-left-color: var(--magenta); background: var(--alert-bg); }
.callout p { margin: 0; }
.refs { display: grid; gap: 10px; }
.ref { background: var(--tint); border-radius: 4px; padding: 12px 14px; }
.ref a.code { color: var(--navy); font: 700 17px var(--cond); letter-spacing: .03em; margin-right: 6px; text-decoration: none; }
.ref .chips { margin-top: 8px; }
.opinion { border-top: 1px solid var(--gray); padding-top: 18px; }
details.pdftext summary { cursor: pointer; font-weight: 700; color: var(--nspe-blue); }
details.pdftext .body { white-space: pre-wrap; font-size: 15px; margin-top: 12px; }
aside.rail { display: grid; gap: 18px; position: sticky; top: 16px; }
@media (max-width: 960px) { aside.rail { position: static; } }
.box { background: var(--surface); border-radius: 4px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 10px; }
.box h2 { margin: 0; font: 700 13px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.box dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.box dt { color: var(--muted); }
.box dd { margin: 0; font-weight: 600; }
.box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.box li a { text-decoration: none; }
.box li a b { font-family: var(--cond); font-size: 15px; margin-right: 6px; }
.box .small, .small { font-size: 12px; color: var(--muted); margin: 0; }

/* Browse and Code index */
.decade { margin-top: 32px; }
.decade h2 { font: 700 22px var(--sans); margin: 0 0 12px; display: flex; gap: 10px; align-items: baseline; }
.decade h2 span { font: 600 14px var(--sans); color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; columns: 2 380px; column-gap: 32px; }
.list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--tint); display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 10px; font-size: 15px; }
.list li b { font: 700 15px var(--cond); color: var(--navy); font-variant-numeric: tabular-nums; }
.list li a { text-decoration: none; }
.list li a:hover { text-decoration: underline; }
.codes { display: grid; gap: 10px; }
.codes .row { display: grid; grid-template-columns: 90px minmax(0,1fr) auto; gap: 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--tint); }
.codes .row b { font: 700 17px var(--cond); color: var(--navy); }
.codes .row a.count { font-weight: 700; white-space: nowrap; font-size: 14px; }
@media (max-width: 560px) { .codes .row { grid-template-columns: 70px minmax(0,1fr); } .codes .row a.count { grid-column: 2; } }
.prose { max-width: 70ch; }
.prose p, .prose li { margin: 0 0 12px; }
@media (prefers-reduced-motion: no-preference) { .card { transition: box-shadow .15s; } .card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.16); } }
