/* =========================================================
   Shared styles for every page.
   Change colors and fonts here and the whole site updates.
   The font itself is loaded by the <link> tags in each page's <head>.
   ========================================================= */
:root {
  --font: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ink: #1f2a24;        /* main text */
  --muted: #6b7770;      /* captions, dates, nav */
  --accent: #2c5f2d;     /* links, hover color */
  --paper: #fdfdfb;      /* page background */
  --rule: #e4e8e2;       /* thin divider lines */
  --max: 780px;          /* content width */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: color .15s, text-decoration-color .15s;
}
a:hover { text-decoration-color: currentColor; }

/* ---- Top navigation ---- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem 2rem;
  max-width: var(--max); margin: 0 auto; padding: 2.5rem 1.25rem 1.5rem;
}
.site-name {
  font-size: 1.1rem; font-weight: 600;
  color: var(--ink); text-decoration: none;
}
.site-header nav { display: flex; gap: 1.75rem; }
.site-header nav a {
  font-size: 1rem; color: var(--muted); text-decoration: none;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--ink); }
.site-header nav a[aria-current="page"] {
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 6px;
}

/* ---- Page body ---- */
main { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem 4rem; }
h1, h2 { font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; margin: 2rem 0 2.25rem; }
h2 { font-size: 1.25rem; margin: 0 0 .3rem; }

/* Home page: portrait photo beside the intro text */
.intro {
  display: grid; grid-template-columns: 280px 1fr; gap: 3rem;
  align-items: start; margin-top: 2rem;
}
.portrait { margin: 0; }
.portrait img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.portrait figcaption {
  font-size: .8rem; font-style: italic; line-height: 1.45;
  color: var(--muted); margin-top: .6rem;
}
.intro .lead { margin-top: 0; }
@media (max-width: 700px) {
  .intro { grid-template-columns: 1fr; gap: 1.75rem; }
  .portrait { max-width: 300px; }
}

/* ---- Writing list ---- */
.post {
  display: grid; grid-template-columns: 180px 1fr; gap: 1.75rem;
  align-items: start;
  padding: 2rem 0; border-top: 1px solid var(--rule);
}
.post:first-of-type { border-top: 0; padding-top: 0; }
.post img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px;
  transition: opacity .15s;
}
.post > a:hover img { opacity: .85; }
.post h2 a { color: var(--ink); text-decoration: none; }
.post h2 a:hover { color: var(--accent); }
.meta { font-size: .85rem; color: var(--muted); margin: 0 0 .6rem; }
.post p { margin-top: 0; }
.post p:last-child { margin-bottom: 0; }
.more { margin-top: 1rem; padding-top: 2rem; border-top: 1px solid var(--rule); }

@media (max-width: 600px) {
  body { font-size: 17px; }
  h1 { font-size: 1.8rem; }
  .post { grid-template-columns: 1fr; gap: 1rem; }
  .post img { aspect-ratio: 16 / 9; }
}

/* ---- Footer ---- */
.site-footer {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  /* same width as the content above, so the divider lines up with the text */
  width: min(calc(var(--max) - 2.5rem), calc(100% - 2.5rem));
  margin: 0 auto; padding: 1.75rem 0 3.5rem;
  border-top: 1px solid var(--rule);
  font-size: .9rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
