/* HKU ALDW Workshop — editorial theme */

:root {
  --ink:      #1a1a1a;
  --ink-soft: #4a4a4a;
  --paper:    #fafaf7;
  --rule:     #d8d4c8;
  --accent:   #8a3324;
  --card-bg:  #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* pandoc emits a duplicate title in <header> — suppress it */
header#title-block-header { display: none; }

/* ── Main container ───────────────────────────────────────── */

section.level1 {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

/* ── Page title ───────────────────────────────────────────── */

section.level1 > h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.4rem;
}

/* Bold subtitle line below h1 (the "HKU PISA ALDW Project · …" line) */
section.level1 > p:first-of-type > strong:only-child {
  display: block;
  font-size: 0.82rem;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding-bottom: 2rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

/* ── Section headings (h2) ────────────────────────────────── */

section.level2 { margin-top: 2rem; }

h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 0.8rem;
}

/* ── Session cards (level-3 sections) ─────────────────────── */

section.level3 {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.5rem 1.5rem 1.25rem;
  margin: 1rem 0;
}

section.level3 > h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--ink);
  margin: 0 0 0.8rem;
}

/* ── Sub-headings inside cards (Morning / Afternoon) ─────── */

section.level4 { margin-top: 1rem; }

section.level4 > h4 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}

/* ── Body text ────────────────────────────────────────────── */

p { margin: 0 0 0.7rem; }

strong { color: var(--ink); }

/* ── Lists ────────────────────────────────────────────────── */

ul, ol {
  margin: 0.2rem 0 0.5rem 1.2rem;
  padding: 0;
}

li { margin: 0.2rem 0; }

/* ── Links ────────────────────────────────────────────────── */

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(138, 51, 36, 0.3);
  transition: border-color 0.15s;
}

a:hover { border-bottom-color: var(--accent); }

/* ── Tables (meeting links) ───────────────────────────────── */

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  margin: 0.4rem 0 0.6rem;
}

section.level3 table {
  background: var(--paper);
  border-radius: 3px;
}

/* suppress the empty header row pandoc emits for headerless tables */
thead:has(th:empty) { display: none; }

td {
  padding: 0.35rem 0.7rem;
  vertical-align: top;
}

td:first-child {
  color: var(--ink-soft);
  white-space: nowrap;
  width: 110px;
}

/* ── Horizontal rule ──────────────────────────────────────── */

hr { display: none; }

/* ── Footer note ──────────────────────────────────────────── */

section.level1 > p:last-of-type {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
  section.level1 { padding: 2.5rem 1.2rem 3rem; }
  section.level3 { padding: 1.1rem 1rem; }
}

/* ── Print ────────────────────────────────────────────────── */

@media print {
  body { font-size: 10pt; background: #fff; }
  section.level3 { border-color: #ccc; break-inside: avoid; }
  a { color: inherit; border-bottom: none; }
}
