/* ============================================================
   Minimal reading stylesheet for md-server
   Light theme · serif body · clean nav
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:          #fffefb;
  --surface:     #f5f4ef;
  --border:      #dedad3;
  --text:        #1c1b18;
  --muted:       #6b6760;
  --accent:      #1a56db;
  --accent-dark: #1041b0;
  --code-bg:     #f0efe8;
  --code-text:   #c0392b;

  --font-serif:  Georgia, "Times New Roman", serif;
  --font-sans:   system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:   "JetBrains Mono", "Fira Mono", Menlo, Consolas, monospace;

  --measure:     68ch;
  --indent:      1.5rem;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ────────────────────────────────────────────────── */
html {
  font-size: 18px;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-serif);
  line-height: 1.75;
  padding: 0 1rem;
}

/* ── Layout shell ────────────────────────────────────────── */
nav[aria-label="breadcrumb"],
main {
  max-width: var(--measure);
  margin-inline: auto;
}

nav[aria-label="breadcrumb"] { padding-top: 1.5rem; }
main { padding-block: 2.5rem 5rem; }

/* ── Breadcrumb ──────────────────────────────────────────── */
nav[aria-label="breadcrumb"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  padding-left: 0;
}

nav[aria-label="breadcrumb"] ol li {
	text-transform: capitalize;
}

nav[aria-label="breadcrumb"] ol li + li::before {
  content: "›";
  margin-inline: 0.4rem;
  color: var(--border);
}

nav[aria-label="breadcrumb"] a {
  color: var(--muted);
  text-decoration: none;
}

nav[aria-label="breadcrumb"] a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

nav[aria-label="breadcrumb"] span[aria-current="page"] {
  color: var(--text);
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: 2.1rem;  margin-block: 0 1.2rem; }
h2 { font-size: 1.5rem;  margin-block: 2.2rem 0.7rem; }
h3 { font-size: 1.2rem;  margin-block: 1.8rem 0.5rem; }
h4 { font-size: 1rem;    margin-block: 1.4rem 0.4rem; }
h5 { font-size: 0.95rem; margin-block: 1.2rem 0.3rem; }
h6 { font-size: 0.9rem;  margin-block: 1rem 0.2rem;   color: var(--muted); }

p { margin-block: 1rem; }

a, a:visited {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

strong, b { font-weight: 700; }
em, i     { font-style: italic; }

small, .meta { font-size: 0.82rem; color: var(--muted); }

/* ── Code ────────────────────────────────────────────────── */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  margin-block: 1.5rem;
  font-size: 0.82rem;
  line-height: 1.6;
}

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

/* ── Blockquote ──────────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--border);
  margin-inline: 0;
  padding: 0.3rem 1.2rem;
  color: var(--muted);
  font-style: italic;
  margin-block: 1.5rem;
}

/* ── Lists ───────────────────────────────────────────────── */
ul, ol {
  padding-left: var(--indent);
  margin-block: 1rem;
}

li { margin-block: 0.3rem; }

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

/* ── Images ──────────────────────────────────────────────── */
img, video {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-block: 1.5rem;
}

figure { margin-block: 1.5rem; }
figcaption { font-size: 0.82rem; color: var(--muted); text-align: center; margin-top: 0.5rem; }

/* ── Tables ──────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-block: 1.5rem;
  font-family: var(--font-sans);
}

th, td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  background: var(--surface);
  border-bottom-color: #c8c5be;
}

tr:last-child td { border-bottom: none; }

/* ── Directory index ─────────────────────────────────────── */
main > h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: var(--font-sans);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Top-level index page — reset the small-caps style */
main > h1:first-child { margin-top: 0; }

main > ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0 0;
}

main > ul > li {
  border-bottom: 1px solid var(--border);
  padding-block: 1.1rem;
  margin: 0;
}

main > ul > li:first-child { padding-top: 0; }
main > ul > li:last-child  { border-bottom: none; }

/* Entry title link */
main > ul > li > a {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  line-height: 1.3;
}

main > ul > li > a:hover { color: var(--accent); }

/* Date / author inline text that follows the link */
main > ul > li {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--muted);
}

/* Summary paragraph inside a listing entry */
main > ul > li > p {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--muted);
  margin-block: 0.3rem 0;
  line-height: 1.6;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  html  { font-size: 16px; }
  h1    { font-size: 1.7rem; }
  h2    { font-size: 1.3rem; }
  pre   { font-size: 0.78rem; }
}
