:root {
  --bg: #1a1a1a;
  --panel: #1f2937;
  --text: #e6e6e6;
  --muted: #b6beca;
  --accent: #9fb8ff;
  --link: #8fe3ff;
  --linkHover: #d7b7ff;
  --codeBg: #2d3748;
  --border: #4a5568;
}

body {
  font-family: Palatino, 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  margin: 0;
}

.container {
  max-width: 900px;
  margin: 28px auto;
  padding: 28px;
  background: var(--panel);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  border-radius: 14px;
}

img {
  display: block;
  margin: 18px auto;
  max-width: 100%;
  height: auto;
  max-height: 520px;
  border-radius: 12px;
}

h1, h2, h3 {
  color: var(--accent);
  margin: 1.2em 0 .35em;
  line-height: 1.25;
}

h1 {
  font-size: 1.85rem;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: .7em 0;
}

.chapter-number {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-top: 0.25em;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--linkHover);
  text-decoration: underline;
}

code {
  background: var(--codeBg);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace,  SFMono-Regular,  Menlo,  Monaco,  Consolas,  "Liberation Mono",  "Courier New",  monospace;
  font-size: .95em;
}

pre {
  background: var(--codeBg);
  padding: 14px 16px;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

blockquote {
  border-left: 4px solid var(--border);
  margin: 1em 0;
  padding: .25em 1em;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.page-number {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .02em;
}

.page-number::before,
.page-number::after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
  opacity: .7;
}

/* Page number spans positioned in right margin */
span[id^="page"] {
  position: absolute;
  right: -4rem;
  color: var(--muted);
  opacity: 0.88;
  font-size: 1.25rem;    /* Increased for legibility */
  font-weight: 700;      /* Increased for clarity */
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.05);
}


/* Ensure parent elements have relative positioning for absolute page numbers */
p,
aside {
  position: relative;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
  opacity: .85;
}

.footnotes {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.footnotes h2 {
  margin-top: 0;
}

.footnotes ol {
  padding-left: 22px;
}

.footnotes li {
  margin: 10px 0;
  color: var(--muted);
}

sup.footnote-ref {
  font-size: .82em;
  margin-left: 2px;
}


/* Citation Styles */
h4 {
  color: var(--accent);
  margin: 1em 0 0.5em;
  line-height: 1.3;
  font-size: 1.1rem;
  font-weight: 600;
}

h4 i {
  font-style: italic;
}

h5 {
  color: var(--muted);
  margin: 0.3em 0;
  line-height: 1.4;
  font-size: 0.95rem;
  font-weight: normal;
}

aside.citation {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  background: rgba(255, 255, 255, 0.02);
  border-left: none;
  border-radius: 6px;
  text-align: center;
}

aside.citation.case {
  border-left: none;
}

aside.citation.article {
  border-left: none;
}

aside.citation h4 {
  margin-top: 0;
}

aside.citation h5:last-child {
  margin-bottom: 0;
}

/* Opinion blocks (full case text) */
aside.opinion {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  background: rgba(0, 0, 0, 0.14);
  border-left: 3px solid var(--border);
  border-radius: 6px;
}

aside.opinion.case {
  border-left-color: rgba(159, 184, 255, 0.55);
}

aside.opinion.article {
  border-left-color: rgba(143, 227, 255, 0.55);
}
