/* Published site — Northnitch-derived minimal theme */

:root {
  --green-50:  #EEF4F1;
  --green-100: #D7E4DD;
  --green-500: #1E7A5A;
  --green-700: #134A37;
  --green-800: #0F3B2E;
  --blue-600:  #224870;
  --grey-0:    #FFFFFF;
  --grey-50:   #F7F8F9;
  --grey-100:  #EEF0F2;
  --grey-150:  #E3E6EA;
  --grey-300:  #B8BEC6;
  --grey-500:  #6B7280;
  --grey-700:  #374151;
  --grey-900:  #111827;

  --font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--grey-900);
  background: var(--grey-0);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}

.site {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px 96px;
}

.site-header {
  border-bottom: 1px solid var(--grey-150);
  padding-bottom: 14px;
  margin-bottom: 32px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.site-header a.site-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--green-700);
  text-decoration: none;
}
.site-header a.site-title:hover { color: var(--green-800); }
.site-header .feed {
  margin-left: auto;
  font-size: 12px;
  color: var(--grey-500);
}
.site-header .feed a { color: var(--grey-500); text-decoration: none; margin-left: 8px; }
.site-header .feed a:hover { color: var(--green-700); text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--grey-900);
  margin: 0;
}
h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 22px; line-height: 1.3; margin-top: 32px; }
h3 { font-size: 17px; line-height: 1.35; margin-top: 24px; }

a {
  color: var(--blue-600);
  text-decoration: none;
  text-underline-offset: 2px;
}
a:hover { text-decoration: underline; }

time.num, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}

.post-meta {
  color: var(--grey-500);
  font-size: 13px;
  margin-top: 6px;
}

.post-body {
  margin-top: 28px;
  font-size: 17px;
  line-height: 1.6;
}
.post-body p { margin: 0 0 16px; }
.post-body img { max-width: 100%; height: auto; border-radius: 6px; display: block; }
.post-body figure { margin: 20px 0; }
.post-body figcaption { color: var(--grey-500); font-size: 13px; margin-top: 6px; }
.post-body pre {
  background: var(--grey-100);
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}
.post-body code {
  background: var(--grey-100);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.post-body pre code { background: none; padding: 0; }
.post-body blockquote {
  border-left: 3px solid var(--green-500);
  margin: 16px 0;
  padding-left: 16px;
  color: var(--grey-700);
}
.post-body hr { border: 0; border-top: 1px solid var(--grey-150); margin: 28px 0; }
.post-body ul, .post-body ol { padding-left: 24px; }

.post-body ul.task-list,
.post-body ul:has(.task-list-item) { list-style: none; padding-left: 2px; }
.post-body .task-list-item {
  position: relative;
  padding-left: 24px;
  margin: 6px 0;
}
.post-body .task-list-item > input[type=checkbox] {
  position: absolute; left: 0; top: 4px;
  width: 16px; height: 16px; margin: 0;
  accent-color: var(--green-700);
  cursor: default;
}
.post-body .task-list-item:has(input:checked) {
  color: var(--grey-500);
  text-decoration: line-through;
  text-decoration-color: var(--grey-300);
}

.wiki-ref {
  background: var(--green-50);
  color: var(--green-800);
  padding: 0 4px;
  border-radius: 2px;
  text-decoration: none;
}
.wiki-ref:hover { background: var(--green-100); text-decoration: none; }

/* A reference to a memex note that isn't published on this site. Rendered
   as a citation (italic title, dotted underline) with no link — the
   reader sees what it refers to without us leaking a private URL or
   sending them back to the legacy WordPress version. */
.wiki-ref-unpublished {
  font-style: italic;
  color: var(--grey-700);
  border-bottom: 1px dotted var(--grey-300);
  padding-bottom: 0;
}

.memex-block { margin: 20px 0; }
.memex-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.memex-table th, .memex-table td { border: 1px solid var(--grey-150); padding: 6px 10px; text-align: left; }
.memex-table th { background: var(--grey-50); font-weight: 600; }
.memex-kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  background: var(--grey-50);
  border: 1px solid var(--grey-150);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
}
.memex-kv dt { font-weight: 600; color: var(--grey-700); }
.memex-kv dd { margin: 0; }
.memex-url {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 4px 10px;
  background: var(--grey-50);
  border: 1px solid var(--grey-150);
  border-radius: 6px;
  padding: 10px 14px;
}

.memex-gallery {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  padding: 0;
}
.memex-gallery-cols-1 { grid-template-columns: 1fr; }
.memex-gallery-cols-2 { grid-template-columns: repeat(2, 1fr); }
.memex-gallery-cols-3 { grid-template-columns: repeat(3, 1fr); }
.memex-gallery-cols-4 { grid-template-columns: repeat(4, 1fr); }
.memex-gallery-item {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: var(--grey-100);
}
.memex-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 4 / 3;
}
.memex-gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(17, 24, 39, 0.75), rgba(17, 24, 39, 0));
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}
@media (max-width: 520px) {
  .memex-gallery-cols-2,
  .memex-gallery-cols-3,
  .memex-gallery-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* ── Banner (homepage hero) ── */
.banner {
  margin: 0 0 32px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--grey-150);
}
.banner-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 0 16px;
}
.banner-subtitle {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  color: var(--grey-700);
  margin: 0 0 12px;
}
.banner-tagline {
  color: var(--grey-500);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
  max-width: 640px;
}

/* ── Homepage grid (main feed + popular sidebar) ── */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 48px;
}
@media (max-width: 720px) {
  .home-grid { grid-template-columns: 1fr; gap: 32px; }
}
.home-main { min-width: 0; }
.home-sidebar {
  font-size: 14px;
}
.sidebar-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-500);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grey-150);
}
.popular-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.popular-list li {
  padding: 6px 0;
  border-bottom: 1px dotted var(--grey-150);
}
.popular-list li:last-child { border-bottom: 0; }
.popular-list a {
  color: var(--grey-900);
  text-decoration: none;
  line-height: 1.35;
  display: block;
}
.popular-list a:hover { color: var(--green-700); }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 14px 0; border-bottom: 1px solid var(--grey-150); }
.post-list li:last-child { border-bottom: 0; }
.post-list a.post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--grey-900);
  letter-spacing: -0.01em;
  display: block;
}
.post-list a.post-title:hover { color: var(--green-700); text-decoration: none; }
.post-list time {
  color: var(--grey-500);
  font-size: 12px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

footer.site-footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--grey-150);
  color: var(--grey-500);
  font-size: 13px;
}

/* Pagefind UI — override its defaults to match the Northnitch theme.
   Pagefind ships its own pagefind-ui.css first; these rules come after
   because they're in the later-loaded /style.css. */
#site-search {
  margin: 20px 0 32px;
}
.pagefind-ui {
  font-family: var(--font-sans);
}
.pagefind-ui__form {
  position: relative;
}
.pagefind-ui__search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--grey-150);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--grey-0);
  color: var(--grey-900);
}
.pagefind-ui__search-input:focus {
  outline: 0;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(30, 122, 90, 0.18);
}
.pagefind-ui__search-clear {
  color: var(--grey-500);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 14px;
}
.pagefind-ui__result {
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-150);
}
.pagefind-ui__result:last-child { border-bottom: 0; }
.pagefind-ui__result-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
}
.pagefind-ui__result-title a {
  color: var(--grey-900);
  text-decoration: none;
}
.pagefind-ui__result-title a:hover {
  color: var(--green-700);
}
.pagefind-ui__result-excerpt {
  margin-top: 6px;
  color: var(--grey-700);
  font-size: 14px;
  line-height: 1.5;
}
.pagefind-ui__result-excerpt mark {
  background: var(--green-100);
  color: var(--green-900);
  padding: 0 2px;
  border-radius: 2px;
}
.pagefind-ui__message {
  color: var(--grey-500);
  font-size: 13px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .site { padding: 24px 16px 64px; }
  h1 { font-size: 28px; }
  .post-body { font-size: 16px; }
}
