/* Simple academic style in neutral grays, with navigation and search in a left sidebar. */

/* To change the fonts, swap this import and --display / --body below. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Lora:ital,wght@0,400..700;1,400..700&display=swap');

:root {
  --page: #fafafa;
  --panel: #d6d6d6;
  --text: #111111;
  --muted: #4a4a4a;
  --accent: #111111;
  --visited: #444444;
  --rule: #c8c8c8;
  --side-muted: #3d3d3d;
  --side-link: #333333;
  --side-rule: #b3b3b3;
  --field: #7a7a7a;
  --code-bg: #efefef;
  --highlight: #ffffff;
  --display: 'Cormorant Garamond', Georgia, serif;
  --body: 'Lora', Georgia, serif;
  --mono: Menlo, Consolas, monospace;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
}

/* ─── LAYOUT ─── */
.sidebar {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  padding: 24px 16px;
}

main {
  max-width: 700px;
  padding: 32px 16px 80px;
}

@media (min-width: 860px) {
  body {
    display: grid;
    grid-template-columns: 340px minmax(0, 700px);
    column-gap: 72px;
    min-height: 100vh;
  }

  .sidebar {
    border-bottom: 0;
    border-right: 1px solid var(--rule);
    padding: 64px 32px;
  }

  /* Scrolls on its own when search results make it taller than the window. */
  .sidebar-inner {
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 3px;
    margin: -3px;
  }

  main {
    padding: 56px 16px 80px 0;
  }
}

/* ─── SIDEBAR ─── */
.name {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
}

.tagline {
  color: var(--side-muted);
  font-size: 16px;
  line-height: 1.5;
  margin: 8px 0 0;
}

nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  margin-top: 20px;
}

nav a, nav a:visited {
  color: var(--side-link);
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

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

@media (min-width: 860px) {
  nav {
    display: block;
    margin-top: 28px;
  }

  nav a {
    display: block;
    line-height: 1.35;
    padding: 6px 0;
  }
}

/* ─── TEXT ─── */
h1, h2 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 38px;
  margin: 0 0 16px;
}

h2 {
  font-size: 28px;
  margin: 40px 0 10px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
}

p, ul, ol, pre {
  margin: 0 0 16px;
}

ul, ol {
  padding-left: 28px;
}

li {
  margin-bottom: 6px;
}

strong {
  font-weight: 600;
}

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

a:visited {
  color: var(--visited);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 32px 0;
}

h1 + .date {
  margin-top: -12px;
}

h2 + .date {
  margin-top: -6px;
}

.date {
  color: var(--muted);
}

/* Clickable tag, such as wip. */
a.tag, a.tag:visited {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--field);
  border-radius: 4px;
  padding: 1px 7px;
}

a.tag:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Previous / next links at the bottom of each Flink series page. */
.series-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.series-nav span {
  color: var(--muted);
}

/* ─── CODE & IMAGES (article pages) ─── */
code, pre {
  font-family: var(--mono);
  font-size: 14px;
}

code {
  background: var(--code-bg);
  padding: 1px 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  padding: 12px 14px;
  overflow-x: auto;
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
  font-size: 13px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  margin: 8px 0 20px;
}

/* ─── ROWS (Public Appearances, Open Source Contributions) ─── */
/* Image or date on the left, details on the right. */
.entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}

.entry.dated {
  grid-template-columns: 150px 1fr;
}

.entry:last-child {
  border-bottom: 1px solid var(--rule);
}

.entry img {
  width: 100%;
  margin: 0;
}

.entry h2 {
  font-size: 24px;
  margin: 0 0 6px;
}

.entry p {
  margin-bottom: 0;
}

.entry .date + p {
  margin-top: 8px;
}

.entry ul {
  margin: 10px 0 0;
}

.entry .next-up {
  color: var(--muted);
  margin-top: 10px;
}

.entry-meta {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  padding-top: 4px;
}

@media (max-width: 600px) {
  .entry,
  .entry.dated {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .entry img {
    max-width: 320px;
  }
}

/* ─── SEARCH (bottom of the sidebar) ─── */
.site-search {
  border-top: 1px solid var(--side-rule);
  margin-top: 24px;
  padding-top: 20px;
}

.site-search label {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.search-row {
  display: flex;
  gap: 8px;
  max-width: 460px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 7px 10px;
  border: 1px solid var(--field);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.search-row button {
  font: inherit;
  font-size: 15px;
  padding: 7px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.search-row button:hover {
  background: var(--visited);
}

.search-summary {
  color: var(--side-muted);
  font-size: 15px;
  margin: 14px 0 10px;
}

#search-results ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

#search-results li {
  font-size: 16px;
  line-height: 1.45;
  margin-bottom: 14px;
}

#search-results li p {
  color: var(--side-muted);
  font-size: 14px;
  margin: 3px 0 0;
}

mark {
  background: var(--highlight);
  color: var(--text);
}

@media (min-width: 860px) {
  .site-search {
    margin-top: 32px;
  }
}
