/*
  Base styling — minimal and lightweight by design: system font
  stacks only (no web font downloads), no JS, no build step beyond
  Eleventy itself. Light/dark palettes are both defined as custom
  properties so prefers-color-scheme just swaps values, no separate
  dark-mode rules to maintain.

  Changes from the original version: added an --accent-color used
  deliberately (header rule, hover states) instead of relying on
  link-blue for everything; more typographic contrast between the
  homepage bio, post titles, and body copy; transitions on
  interactive states; focus-visible outlines for keyboard nav;
  blockquote/code styles that were previously undefined; and a
  narrow-viewport tweak so post thumbnails stack above the text
  instead of squeezing it.
*/

:root {
  --bg-color: #fdfdfc;
  --text-color: #1a1a1a;
  --muted-color: #666;
  --link-color: #1a56db;
  --accent-color: #b5502e;
  --border-color: #e5e5e5;
  --max-width: 42rem;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #17181a;
    --text-color: #e8e6e3;
    --muted-color: #999;
    --link-color: #7aa2f7;
    --accent-color: #e08e6d;
    --border-color: #333;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.7;
}

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.2;
  font-weight: 700;
}

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

/* Underline-on-hover instead of an instant color swap, everywhere. */
a {
  transition: color 0.15s ease;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.site-header,
main,
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
}

/* Thin accent rule instead of a flat border — small, deliberate
   use of --accent-color so the header reads as "designed" rather
   than default. */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent-color);
}

.site-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text-color);
}

.site-header nav a {
  margin-left: 1.25rem;
  color: var(--muted-color);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-header nav a:hover {
  color: var(--accent-color);
}

main {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

/* Homepage intro: bigger and lighter-weight than body copy, and in
   the text color rather than muted, so it reads as a lede rather
   than another paragraph in the flow. */
.bio {
  color: var(--text-color);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 2.5rem;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-thumb {
  width: 6rem;
  height: 6rem;
  object-fit: cover;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.post-list h2 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
}

.post-list h2 a {
  color: var(--text-color);
  text-decoration: none;
}

.post-list h2 a:hover {
  color: var(--accent-color);
}

.post-list time {
  display: block;
  color: var(--muted-color);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.post-excerpt {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.95rem;
}

/* Below ~420px, stack the thumbnail above the text instead of
   squeezing both into a narrow row — matters if you're checking
   the blog from a phone. */
@media (max-width: 420px) {
  .post-list li {
    flex-direction: column;
  }

  .post-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

.post-hero {
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
}

.post-meta {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin-top: -0.75rem;
}

article h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

article img {
  max-width: 100%;
  border-radius: 0.375rem;
}

/* These two were previously undefined — a post with a quote or a
   code snippet would have rendered with raw browser defaults. */
article blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent-color);
  color: var(--muted-color);
  font-style: italic;
}

article code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--border-color);
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
}

article pre {
  background: var(--border-color);
  padding: 1rem;
  border-radius: 0.375rem;
  overflow-x: auto;
}

article pre code {
  background: none;
  padding: 0;
}

.site-footer {
  border-top: 1px solid var(--border-color);
  color: var(--muted-color);
  font-size: 0.9rem;
}

.social-links a {
  margin-right: 1rem;
  color: var(--muted-color);
}

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