:root {
  --bbw-green: #95c11f;
  --bbw-green-dark: #7aa018;
  --bbw-green-light: #f0f7dc;
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #ffffff;
  --bg-code: #f5f5f5;
  --border: #e0e0e0;
  --font: -apple-system, "SF Pro Display", "SF Pro Text", BlinkMacSystemFont,
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Code", "Fira Code", monospace;
}

body {
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Headings ── */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

h1 {
  font-size: 2rem;
  color: var(--bbw-green);
  margin-top: 0;
  margin-bottom: 0.3em;
}

h1::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  background: var(--bbw-green);
  margin-top: 0.5em;
  border-radius: 2px;
}

h2 {
  font-size: 1.4rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3em;
}

h3 {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Inline & block code ── */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--bbw-green-dark);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 3px solid var(--bbw-green);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* ── Blockquote ── */
blockquote {
  margin: 1rem 0;
  padding: 0.6em 1em;
  border-left: 3px solid var(--bbw-green);
  background: var(--bbw-green-light);
  border-radius: 0 6px 6px 0;
  color: var(--text);
}

blockquote p {
  margin: 0.3em 0;
}

/* ── Warning panel: <div class="warning"> in Markdown (also pandoc's > [!WARNING] output) ── */
.warning {
  margin: 1rem 0;
  padding: 0.6em 1em;
  border-left: 3px solid #e0a800;
  background: #fff8db;
  border-radius: 0 6px 6px 0;
  color: var(--text);
}

.warning p {
  margin: 0.3em 0;
}

.warning .title p {
  font-weight: 600;
}

/* ── Links ── */
a {
  color: var(--bbw-green-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

a:hover {
  border-bottom-color: var(--bbw-green-dark);
}

/* ── Lists ── */
ul, ol {
  margin: 0.8rem 0;
  padding-left: 1.6rem;
}

li {
  margin-bottom: 0.3rem;
}

li::marker {
  color: var(--bbw-green);
}

/* ── Tables ── */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}

th {
  background: var(--bbw-green);
  color: white;
  font-weight: 600;
  text-align: left;
  padding: 0.55em 0.9em;
}

td {
  padding: 0.5em 0.9em;
  border-bottom: 1px solid var(--border);
}

tr:nth-child(even) td {
  background: #fafafa;
}

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── BBW header (injected via pandoc -B, see shared/assignments/header.html) ── */
.bbw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.bbw-header a,
.bbw-header a:hover {
  border-bottom: 0;
}

.bbw-logo {
  display: block;
  height: 38px;
  width: auto;
  border: 0;
  border-radius: 0;
}

.bbw-header-meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bbw-header-link {
  color: var(--text-muted);
}

.bbw-header-link:hover {
  color: var(--bbw-green-dark);
}

@media (max-width: 480px) {
  .bbw-logo { height: 30px; }
  .bbw-header-subject { display: none; }
}
