:root {
  --sidebar-w: 320px;
  --ink: #1a1a1a;
  --muted: #666;
  --rule: #e2e2e2;
  --accent: #7a1f2b;       /* legal maroon */
  --bg: #fbfaf7;
  --max-measure: 44rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  border-right: 1px solid var(--rule);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-head { padding: 1rem; border-bottom: 1px solid var(--rule); }
.home-link {
  display: block;
  font-weight: bold;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: .6rem;
}
#case-search {
  width: 100%;
  padding: .5rem .6rem;
  font: inherit;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.sidebar nav { flex: 1; overflow-y: auto; }
#case-nav { list-style: none; margin: 0; padding: 0; }
#case-nav li { border-bottom: 1px solid var(--rule); }
#case-nav a {
  display: block;
  padding: .6rem 1rem;
  text-decoration: none;
  color: var(--ink);
}
#case-nav a:hover { background: #f3efe8; }
.nav-title { display: block; font-size: .92rem; }
.nav-meta { display: block; font-size: .75rem; color: var(--muted); }
#search-empty { padding: 1rem; color: var(--muted); font-style: italic; }
.sidebar-foot { padding: .8rem 1rem; border-top: 1px solid var(--rule); font-size: .85rem; }

/* ---------- Main content ---------- */
.content {
  margin-left: var(--sidebar-w);
  padding: 2.5rem 3rem;
  max-width: calc(var(--max-measure) + 6rem);
}
.page-head h1 { color: var(--accent); }
.lede { color: var(--muted); }

/* index cards */
.case-cards { list-style: none; margin: 0; padding: 0; }
.case-card { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.case-card a { text-decoration: none; color: var(--ink); }
.case-card h2 { margin: 0 0 .3rem; font-size: 1.15rem; }
.case-card a:hover h2 { color: var(--accent); }
.card-meta { margin: 0; font-size: .85rem; color: var(--muted); }
.card-meta span + span::before { content: " · "; }
.card-cites { margin: .2rem 0 0; font-size: .85rem; font-style: italic; color: var(--muted); }

/* case page */
.case-header h1 { color: var(--accent); margin-bottom: .2rem; }
.full-name { font-style: italic; color: var(--muted); margin-top: 0; }
dl.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .2rem 1rem;
  margin: 1.2rem 0;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: .9rem;
}
dl.meta dt { font-weight: bold; color: var(--muted); }
dl.meta dd { margin: 0; }
.parties ul { list-style: none; padding: 0; margin: .5rem 0; }
.parties li { padding: .35rem 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.party-name { font-weight: bold; }
.party-type { color: var(--muted); font-style: italic; }
.counsel { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.syllabus { border-left: 3px solid var(--accent); padding-left: 1rem; }
.source a { color: var(--accent); }

.opinion { margin-top: 2.5rem; }
.opinion-type {
  border-bottom: 2px solid var(--accent);
  padding-bottom: .3rem;
  font-size: 1.1rem;
}
.opinion-type .author { float: right; font-weight: normal; font-style: italic; color: var(--muted); }
.render-note { font-size: .8rem; color: var(--muted); font-style: italic; }
.opinion-body { max-width: var(--max-measure); }
.opinion-body .page-number { color: #aaa; font-size: .75em; vertical-align: super; }
.opinion-body .footnote { font-size: .85rem; color: #444; border-top: 1px solid var(--rule); margin-top: 1rem; padding-top: .5rem; }
pre.opinion-text { white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.unavailable { color: var(--muted); font-style: italic; }

.pdf-embed iframe { width: 100%; height: 85vh; border: 1px solid var(--rule); }
.pdf-fallback { font-size: .85rem; }

.case-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .9rem; }
.case-pager a { color: var(--accent); text-decoration: none; max-width: 45%; }

/* ---------- Print ---------- */
@media print {
  .sidebar, .case-pager, .source { display: none; }
  .content { margin-left: 0; max-width: none; padding: 0; }
  .print-cover { page-break-after: always; text-align: center; padding-top: 30vh; }
  .case { page-break-before: always; }
  .print-view .case:first-of-type { page-break-before: avoid; }
  .pdf-embed iframe { height: auto; min-height: 60vh; }
  body { background: #fff; }
}
