/* =======================================================
   academic.css (v2) — clean academic blog theme
   - Reduced bullet indent
   - Light rounded code/citation blocks
   - MathJax support + dark-mode overrides
   ======================================================= */

/* ---------- Base & typography ---------- */
:root{
  --maxw: 750px;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666666;
  --border: #e8e8e8;
  --accent: #0066cc;

  --code-bg: #f8f9fa;  /* subtle light gray background */
  --inline-code-bg: #f4f4f4;

  --radius: 6px;
  --lh: 1.8;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0f1115;
    --fg: #e6e6e6;
    --muted: #b7b7b7;
    --border: #2a2f3a;
    --accent: #7ab7ff;

    --code-bg: #151923;
    --inline-code-bg: #1a1f2a;
  }
}

*{box-sizing:border-box;}
html{font-size:16px; -webkit-text-size-adjust:100%;}
body{
  margin:0 auto;
  padding:80px 20px;
  max-width:var(--maxw);
  background:var(--bg); color:var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height:var(--lh);
}
main,.content{max-width:var(--maxw); margin:0 auto;}

h1,h2,h3,h4,h5,h6{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight:700; line-height:1.3; color:inherit;
  margin:2em 0 .8em;
}
h1{font-size:2.2rem; margin-top:.5em; margin-bottom:0.3em; font-weight:800; text-align:center;}
h2{font-size:1.7rem; margin-top:1.8em;}
h3{font-size:1.35rem;}
p{margin:1.2em 0;}

/* Author/date metadata styling */
h1 + p{
  text-align:center;
  color:var(--muted);
  font-size:1.05rem;
  margin-top:0.5em;
  margin-bottom:2em;
}

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

/* ---------- Lists (reduced indent) ---------- */
ul,ol{
  margin:1em 0 1em 1.5em;
  padding-left:1.2em;
}
li{margin:.5em 0; line-height:1.6;}

/* ---------- Blockquotes ---------- */
blockquote{
  margin:1.5em 0; padding:1em 1.5em;
  border-left:4px solid var(--accent);
  color:var(--fg);
  font-style:italic;
  background:rgba(0,0,0,.02);
  border-radius:0 var(--radius) var(--radius) 0;
}

/* ---------- Code (inline & blocks) ---------- */
code,kbd,pre{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

/* inline code */
code{
  background:var(--inline-code-bg);
  color:inherit;
  padding:.15em .35em;
  border-radius:6px;
}

/* fenced/indented code blocks — matches your preferred light box */
pre{
  background:var(--code-bg);
  color:inherit;
  padding:1.2em 1.4em;
  border-radius:var(--radius);
  border:1px solid var(--border);
  overflow-x:auto;
  font-size:.92em;
  line-height:1.6;
  margin:1.5em 0;
}
pre code{
  background:transparent; /* avoid double background */
  color:inherit;
  display:block;
  padding:0;
}

/* ---------- Tables ---------- */
table{
  width:100%; border-collapse:collapse; margin:1.8em 0;
  font-variant-numeric:tabular-nums;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
}
thead th{
  text-align:left; padding:.8em 1em;
  border-bottom:2px solid var(--border);
  background:rgba(0,0,0,.02);
  font-weight:600;
}
td,th{padding:.75em 1em; border-bottom:1px solid var(--border);}
tbody tr:nth-child(odd){background:rgba(0,0,0,.02);}
tbody tr:last-child td{border-bottom:none;}

/* ---------- Images / figures ---------- */
img{max-width:100%; height:auto; display:block;}
figure{margin:2em 0; text-align:center;}
figcaption{font-size:.88rem; color:var(--muted); margin-top:.6em; font-style:italic;}

/* ---------- Horizontal rule ---------- */
hr{border:0; height:1px; background:var(--border); margin:2em 0;}

/* ---------- Details / summary ---------- */
details{
  border:1px solid var(--border);
  border-radius:8px; padding:.6em .9em; margin:1.2em 0;
}
summary{cursor:pointer; font-weight:600;}

/* ---------- Footnotes ---------- */
.footnotes{
  border-top:1px solid var(--border);
  margin-top:2em; padding-top:1em; font-size:.9rem; color:var(--muted);
}
a.footnote-ref, a.footnote-backref{
  text-decoration:none; border-bottom:1px dotted var(--accent);
}

/* ---------- TOC (if any) ---------- */
.toc{
  border:1px solid var(--border); border-radius:8px;
  padding:.8em 1em; margin:1.2em 0 1.6em;
}
.toc ul{margin:.6em 0 0 1.2em;}

/* ---------- MathJax tweaks ---------- */
mjx-container[jax="CHTML"]{font-size:1em;}
.mjx-container{overflow-x:auto; overflow-y:hidden; padding-bottom:.1rem;}
.mjx-display{margin:1em 0 !important; text-align:center !important;}
.math-display{display:block; margin:1em 0;} /* for some generators */

/* ---------- Callout helper (optional) ---------- */
.callout{
  border-left:4px solid var(--accent);
  background:rgba(26,115,232,.06);
  padding:.8em 1em; border-radius:8px; margin:1em 0;
}
@media (prefers-color-scheme: dark){
  .callout{background:rgba(122,183,255,.10);}
}

/* ---------- Header / footer containers (optional) ---------- */
header,footer{max-width:var(--maxw); margin:28px auto; padding:0 20px;}
footer{margin:48px auto 60px; color:var(--muted); font-size:.9rem;}

/* ---------- Print ---------- */
@media print{
  :root{--bg:#fff; --fg:#000; --muted:#444; --border:#ddd; --inline-code-bg:#f3f3f3; --code-bg:#f8f8f8;}
  body{background:#fff; color:#000;}
  a{color:#000; text-decoration:underline;}
  pre{page-break-inside:avoid;}
  img,table,blockquote,figure{page-break-inside:avoid;}
  header,footer{display:none;}
}