/* Academic — serif, justified body text, classical typography (think LaTeX article class) */

.preview[data-theme="academic"] {
  font-family: "New York", "Iowan Old Style", "Palatino", "Georgia", "Charter", serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  text-align: justify;
  hyphens: auto;
}

.preview[data-theme="academic"] h1,
.preview[data-theme="academic"] h2,
.preview[data-theme="academic"] h3,
.preview[data-theme="academic"] h4 {
  font-family: "New York", "Iowan Old Style", "Palatino", "Georgia", serif;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.6em;
  text-align: left;
}

.preview[data-theme="academic"] h1 {
  font-size: 2.2em;
  text-align: center;
  margin-top: 0;
  margin-bottom: 1.2em;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.preview[data-theme="academic"] h2 {
  font-size: 1.5em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25em;
}

.preview[data-theme="academic"] h3 { font-size: 1.2em; font-style: italic; }
.preview[data-theme="academic"] h4 { font-size: 1em; font-style: italic; font-weight: 600; }

.preview[data-theme="academic"] p {
  margin: 0;
  text-indent: 1.5em;
}
.preview[data-theme="academic"] p:first-of-type,
.preview[data-theme="academic"] h1 + p,
.preview[data-theme="academic"] h2 + p,
.preview[data-theme="academic"] h3 + p,
.preview[data-theme="academic"] h4 + p,
.preview[data-theme="academic"] blockquote + p,
.preview[data-theme="academic"] pre + p,
.preview[data-theme="academic"] ul + p,
.preview[data-theme="academic"] ol + p,
.preview[data-theme="academic"] hr + p {
  text-indent: 0;
}

.preview[data-theme="academic"] a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.preview[data-theme="academic"] code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-subtle);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.preview[data-theme="academic"] pre {
  background: var(--bg-subtle);
  border-left: 3px solid var(--border-strong);
  padding: 14px 18px;
  margin: 1.4em 0;
  font-size: 0.85em;
  line-height: 1.5;
  overflow-x: auto;
  text-align: left;
}

.preview[data-theme="academic"] pre code {
  background: transparent;
  padding: 0;
}

.preview[data-theme="academic"] blockquote {
  border: 0;
  margin: 1.5em 2em;
  font-style: italic;
  color: var(--text-muted);
}

.preview[data-theme="academic"] ul,
.preview[data-theme="academic"] ol {
  padding-left: 2em;
  margin: 1em 0;
  text-align: left;
}

.preview[data-theme="academic"] li {
  text-indent: 0;
  margin-bottom: 0.3em;
}

.preview[data-theme="academic"] hr {
  border: 0;
  text-align: center;
  margin: 2em 0;
}
.preview[data-theme="academic"] hr::after {
  content: "* * *";
  letter-spacing: 0.5em;
  color: var(--text-muted);
}

.preview[data-theme="academic"] table {
  border-collapse: collapse;
  margin: 1.4em auto;
  font-size: 0.95em;
}

.preview[data-theme="academic"] th,
.preview[data-theme="academic"] td {
  padding: 8px 16px;
  text-align: left;
}

.preview[data-theme="academic"] th {
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--text);
  font-weight: 600;
}

.preview[data-theme="academic"] tbody tr:last-child td {
  border-bottom: 2px solid var(--text);
}

.preview[data-theme="academic"] img { max-width: 100%; display: block; margin: 1.4em auto; }
