/* obsidian-vault-publisher — single-column, text-first academic theme. */

:root {
  --measure: 46rem;
  --bg: #fdfdfc;
  --surface: #f4f3f0;
  --text: #1b1b1b;
  --muted: #5f5f58;
  --rule: #e0dfd9;
  --accent: #8a2b1f;
  --accent-soft: #f6ece9;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14150f;
    --surface: #1e1f19;
    --text: #e9e8e1;
    --muted: #a6a59c;
    --rule: #33342c;
    --accent: #f0a08c;
    --accent-soft: #2a211e;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin-inline: auto;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  z-index: 10;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  padding-block: 2.5rem 1rem;
}

.identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--surface);
}

.identity-text {
  min-width: 0;
}

.site-title {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-tagline {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-nav a.current {
  color: var(--text);
  font-weight: 600;
}

/* Page furniture ---------------------------------------------------------- */

main {
  padding-top: 2rem;
}

h1 {
  font-size: 1.85rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2.25rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
}

.page-header,
.note-header {
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.eyebrow a {
  color: inherit;
  text-decoration: none;
}

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

.note-meta,
.lede {
  margin: 0;
  color: var(--muted);
}

.lede {
  font-size: 1.05rem;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

/* Listings ---------------------------------------------------------------- */

.note-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.note-card + .note-card {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.note-card-title {
  margin: 0;
  font-size: 1.15rem;
}

.note-card-title a {
  text-decoration: none;
}

.note-card-title a:hover {
  text-decoration: underline;
}

.note-card-meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.note-card-summary {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

/* Publication cards (note-list blocks) ------------------------------------ */

.publication-card {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.75rem;
  align-items: stretch;
}

.publication-card + .publication-card {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
/*
.publication-media {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--surface);
  overflow: hidden;
}
*/
.publication-card .publication-media img {
  display: block;
  width: 100%;
  /*height: 100%;*/
  object-fit: cover;
}

.publication-content {
  min-width: 0;
}

.publication-heading {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.publication-authors {
  color: var(--accent);
}

.publication-year {
  margin-left: 0.25em;
}

.publication-title {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  line-height: 1.25;
  font-weight: 600;
}

.publication-title a {
  text-decoration: none;
}

.publication-title a:hover {
  text-decoration: underline;
}

.publication-venue {
  margin: 0 0 0.75rem;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--muted);
}

.publication-card .note-card-summary {
  margin: 0 0 0.8rem;
  color: var(--text);
  line-height: 1.6;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem 1rem;
  font-size: 0.9rem;
}

.publication-links > a:not(:last-child)::after {
  color: var(--muted);
}

.publication-citation {
  display: inline-block;
}

.publication-citation summary {
  cursor: pointer;
  color: var(--muted);
}

.publication-citation pre {
  margin: 0.4rem 0 0;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.home-section {
  margin-top: 3rem;
}

.home-section h2 {
  margin-bottom: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.home-section h2 a {
  color: var(--text);
  text-decoration: none;
}

.home-section h2 a:hover {
  color: var(--accent);
}

.more {
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

/* Tags -------------------------------------------------------------------- */

.tag-list,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
}

.tag-cloud {
  gap: 0.6rem 0.75rem;
  margin-top: 1.5rem;
}

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
}

.tag:hover {
  text-decoration: underline;
}

.tag-count {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Prose ------------------------------------------------------------------- */

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  margin: 1rem 0;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

.heading-anchor {
  margin-left: 0.35rem;
  color: var(--rule);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
}

h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

/* Links that point at notes which were not published stay as plain text. */
.unresolved {
  color: var(--muted);
  border-bottom: 1px dotted var(--rule);
  cursor: help;
}

/* Callouts and embeds ----------------------------------------------------- */

.callout,
.embed {
  margin: 1.5rem 0;
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  border-left: 3px solid var(--rule);
  background: var(--surface);
}

.callout > :first-child,
.embed > :first-child {
  margin-top: 0;
}

.callout > :last-child,
.embed > :last-child {
  margin-bottom: 0;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 0.4rem !important;
}

.callout-tip,
.callout-success,
.callout-info,
.callout-note {
  border-left-color: #3b7ea1;
}

.callout-warning,
.callout-question {
  border-left-color: #b8862b;
}

.callout-danger,
.callout-failure,
.callout-bug {
  border-left-color: #a8382b;
}

.embed {
  border-left-style: dashed;
}

/* Code, tables, math ------------------------------------------------------ */

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

:not(pre) > code {
  padding: 0.12em 0.35em;
  border-radius: 3px;
  background: var(--surface);
}

pre {
  margin: 1.5rem 0;
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  font-size: 0.85rem;
}

/* Shiki renders both themes; swap to the dark one with the OS setting. */
@media (prefers-color-scheme: dark) {
  .shiki,
  .shiki span {
    color: var(--shiki-dark) !important;
    background-color: var(--shiki-dark-bg) !important;
  }
}

.table-wrap,
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.prose table {
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--rule);
  text-align: left;
}

.prose th {
  background: var(--surface);
}

.katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 0.25rem;
}

.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--muted);
}

/* Backlinks and footer ---------------------------------------------------- */

.backlinks {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.backlinks h2 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.backlinks ul {
  margin: 0;
  padding-left: 1.1rem;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.35rem 0;
}

/* Narrow screens ---------------------------------------------------------- */

@media (max-width: 40rem) {
  body {
    font-size: 1rem;
    padding-inline: 1rem;
  }

  .site-header {
    padding-block: 1.75rem 0.75rem;
  }

  .identity {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .avatar {
    width: 72px;
    height: 72px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .publication-card {
    grid-template-columns: 1fr;
  }

  .publication-media {
    width: 100%;
    max-width: 13rem;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .site-nav,
  .site-links,
  .skip-link,
  .backlinks,
  .heading-anchor {
    display: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }
}
