/* Site-specific overrides on top of the hello_friend theme.
   Look and feel modelled on thinkingmachines.ai: serif body, small grey sans for
   navigation and metadata, a narrow 660px column, light mode only. */

:root {
  /* Trying Libertinus Serif (Google Fonts). Previous: "Iowan Old Style", "Iowan Old Style BT", "Source Serif 4", Georgia, serif
     (Source Serif 4 would also need re-adding to the Google Fonts link in layouts/partials/extra-head.html). */
  --serif: "Libertinus Serif", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --text: #282828;
  --muted: #676767;
  --rule: #eaeaea;
  --column: 660px;
}

/* ---------- Base ---------- */

html { letter-spacing: normal; }

body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  font-feature-settings: normal;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--text);
}
h1 { font-size: 1.75rem; line-height: 1.35; }
h2 { font-size: 1.375rem; line-height: 1.4; margin: 2em 0 0.6em; }
h3 { font-size: 1.15rem;  line-height: 1.4; margin: 1.6em 0 0.5em; }
h4 { font-size: 1rem; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(40, 40, 40, 0.3);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: currentColor; }

hr {
  background: var(--rule);
  margin: 2.5em 0;
}

blockquote {
  position: static;
  margin: 1.5em 0;
  padding: 0 0 0 1.2em;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}
blockquote:before { content: none; }

code {
  background: #f4f4f4;
  font-size: 0.85em;
  border-radius: 3px;
  padding: 1px 4px;
}

figure figcaption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  opacity: 1;
}

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

.header {
  background: #fff;
  padding: 18px 24px;
}
.header__inner { width: 100%; }
/* No logo: keep the nav on the right, without the divider that sat before the theme toggle. */
.header__right { margin-left: auto; }

.menu {
  background: #fff;
  border-right: none;
  margin-right: 0;
}
.menu__inner {
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 0;
}
.menu__inner li { margin: 0 0 0 22px; }
.menu a {
  color: #3c3836;
  margin-right: 0;
  text-decoration: none;
}
.menu a:hover { text-decoration: underline; text-decoration-color: rgba(40, 40, 40, 0.3); }

@media (max-width: 684px) {
  .menu { top: 56px; padding: 10px 24px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }
  .menu__inner li { margin: 0; }
}

/* ---------- Page column ---------- */

.post,
.posts {
  max-width: calc(var(--column) + 48px);
  padding: 24px;
  margin: 32px auto;
}
.posts:not(:last-of-type) { border-bottom: none; }

/* ---------- Single pages ---------- */

.post-title {
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 12px;
  display: block;
}
.post-title a { text-decoration: none; }

.post-meta {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.post-meta .sep { margin: 0 0.4em; }

/* Optional front matter on project pages: `byline` and `links` (list of {name, url}). */
.post-authors {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 2px;
}
.post-links {
  font-family: var(--sans);
  font-size: 15px;
  margin: 14px 0 0;
}
.post-links a { margin-right: 18px; }

.post-content { margin-top: 32px; }
.post-content p { margin: 0 0 1.1em; }

.post-cover {
  width: 100%;
  max-width: 100%;
  margin: 32px 0 0;
  border-radius: 0;
}

#toc {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
  margin: 32px 0 0;
}
#toc .toc-title { color: var(--text); font-weight: 500; margin-bottom: 4px; }
#toc ul { margin-left: 1.2em; }
#toc a { text-decoration: none; }
#toc a:hover { text-decoration: underline; }

/* ---------- List pages (posts, talks, projects) ---------- */

.list-title {
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 8px;
}
.list-intro {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
}
.list-intro p { margin: 0; }

.entries {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
}
.entry { border-bottom: 1px solid var(--rule); }
.entry:last-child { border-bottom: none; }
.entry a {
  display: grid;
  grid-template-columns: 110px 1fr;
  column-gap: 24px;
  padding: 22px 0;
  text-decoration: none;
}
.entry-date {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 2px;
  white-space: nowrap;
}
.entry-title { font-size: 17px; line-height: 1.4; }
.entry a:hover .entry-title {
  text-decoration: underline;
  text-decoration-color: rgba(40, 40, 40, 0.3);
  text-underline-offset: 0.18em;
}
.entry-sub {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 684px) {
  .entry a { grid-template-columns: 1fr; row-gap: 2px; }
}

/* Pagination on list pages */
.pagination__buttons a { font-family: var(--sans); font-weight: 500; font-size: 15px; }
.button { background: #f4f4f4; border-radius: 4px; }

/* Home page photo: portrait image, kept small so the bio is visible without scrolling. */
figure.portrait {
  max-width: 320px;
  margin: 0 0 28px;
}
figure.portrait img { width: 100%; }

/* ---------- Code blocks and BibTeX citations ---------- */
/* Light, quiet blocks instead of the theme's black monokai ones. Chroma writes inline
   colours, so the background and base colour need !important to override them. */

:root {
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --code-bg: #f7f7f5;
}

.post-content pre,
.post-content pre[style] {
  background: var(--code-bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px;
  margin: 1.2em 0 1.6em;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}
.post-content pre code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
  margin: 0;
}
.post-content .highlight { margin: 0; }

/* Inline code */
.post-content :not(pre) > code {
  font-family: var(--mono);
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 0.85em;
}

/* Copy button (added by /js/copy-code.js) */
.code-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.code-wrap:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: #cfcfcf; }
@media (hover: none) { .copy-btn { opacity: 1; } }
