:root {
  --ink: #111820;
  --muted: #36434d;
  --blue: #174f86;
  --blue-deep: #0c3155;
  --green: #216b4b;
  --green-deep: #12472f;
  --line: #d7e0e5;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 16px/1.65 var(--sans);
}

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

header, footer { padding: 22px 0; border-bottom: 1px solid var(--line); }
footer { border: 0; border-top: 1px solid var(--line); margin-top: 72px; }

.wrap { width: min(760px, calc(100% - 40px)); margin: auto; }

header .wrap, footer .wrap {
  display: flex;
  width: min(1120px, calc(100% - 40px));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

header .brand { font: bold 1.45rem var(--serif); color: var(--ink); text-decoration: none; }
header .brand:hover { color: var(--blue); text-decoration: underline; }
header nav a { margin-left: 18px; font-size: 0.95rem; font-weight: 600; }

footer p { margin: 0; color: var(--muted); font-size: 0.9rem; }

main { padding: clamp(28px, 4vw, 48px) 0 0; }

/* The writing section borrows the homepage's colour so it reads as part of the
   site rather than as a plain document. Body copy stays on white. */
.masthead {
  padding: clamp(44px, 8vw, 82px) 0 clamp(38px, 6vw, 64px);
  background: linear-gradient(115deg, var(--blue-deep) 0%, var(--blue) 52%, var(--green-deep) 100%);
  color: #fff;
}
.masthead .mast-wrap { width: min(1120px, calc(100% - 40px)); margin: auto; }
.masthead .kicker {
  margin: 0 0 12px;
  color: #a9d6bd;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.masthead h1 {
  margin: 0;
  max-width: 20ch;
  color: #fff;
  font-size: clamp(2.3rem, 6vw, 3.5rem);
  letter-spacing: -0.025em;
}
.masthead .lede {
  margin: 18px 0 0;
  max-width: 60ch;
  color: #d9e8e1;
  font-size: clamp(1rem, 2vw, 1.1rem);
}
.masthead .meta {
  margin: 16px 0 0;
  color: #c6dbd1;
  font-size: 0.92rem;
}
.masthead .meta a { color: #fff; text-decoration: underline; text-underline-offset: 0.18em; }
.masthead .lede a { color: #fff; text-decoration: underline; text-underline-offset: 0.18em; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.14; }
h1 { margin: 0 0 14px; font-size: clamp(2.1rem, 5vw, 3.2rem); letter-spacing: -0.02em; }
h2 { margin: 44px 0 12px; font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { margin: 32px 0 10px; font-size: 1.25rem; }

p, li { color: #1d2730; }
p { margin: 0 0 18px; }

.byline {
  margin: 0 0 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.lede { font-size: 1.15rem; color: var(--muted); }

blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--green);
  font-family: var(--serif);
  font-size: 1.2rem;
}

.note {
  margin: 40px 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fafb;
}

.note p:last-child { margin-bottom: 0; }

.cta {
  margin: 48px 0 0;
  padding: 28px;
  border-radius: 18px;
  background: var(--green-deep);
  color: #fff;
}

.cta h2 { margin: 0 0 8px; color: #fff; font-size: 1.5rem; }
.cta p { margin: 0 0 18px; color: #eaf3ee; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button:hover { background: var(--green-deep); text-decoration: none; }
.cta .button { background: #fff; color: var(--green-deep); }
.cta .button:hover { background: var(--green); color: #fff; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 22px 0; border-top: 1px solid var(--line); }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list a.title { font: 1.35rem var(--serif); color: var(--ink); text-decoration: none; display: block; }
.post-list a.title:hover { color: var(--blue); text-decoration: underline; }
.post-list .meta { display: block; margin-top: 6px; color: var(--muted); font-size: 0.88rem; }
.post-list .summary { margin: 8px 0 0; color: var(--muted); font-size: 0.98rem; }

@media (max-width: 620px) {
  header .wrap, footer .wrap { flex-direction: column; align-items: flex-start; }
  header nav a { margin: 0 18px 0 0; }
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- layout */

.blog-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: clamp(28px, 4vw, 54px);
  width: min(1040px, calc(100% - 40px));
  margin: auto;
  padding-top: clamp(6px, 1vw, 12px);
  align-items: start;
}

.blog-main { min-width: 0; }

.sidebar {
  display: grid;
  gap: 26px;
  position: sticky;
  top: 24px;
}

/* ---------------------------------------------------------------- search */

.search { display: grid; gap: 8px; }
.search label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #8998a2;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
.search button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font: 600 0.95rem var(--sans);
  cursor: pointer;
}
.search button:hover { background: var(--green-deep); }

/* ------------------------------------------------------------ categories */

.catbox h2, .sidebook h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-family: var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.catbox ul { margin: 0; padding: 0; list-style: none; }
.catbox li + li { border-top: 1px solid var(--line); }
.catbox a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  color: var(--ink);
  font-size: 0.96rem;
}
.catbox a span { color: var(--muted); font-variant-numeric: tabular-nums; }
.catbox a:hover { color: var(--blue); }
.catbox a.active { color: var(--blue); font-weight: 700; }

.sidebook {
  padding: 20px;
  border-radius: 16px;
  background: #f4f8f6;
  border: 1px solid var(--line);
}
.sidebook h2 {
  margin: 0 0 8px;
  font: 1.15rem var(--serif);
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}
.sidebook p { margin: 0 0 14px; color: var(--muted); font-size: 0.93rem; }
.sidebook .button { min-height: 42px; padding: 8px 16px; font-size: 0.92rem; }
.sidebook .small { margin: 12px 0 0; font-size: 0.85rem; }

/* -------------------------------------------------------------- post list */

.post-list .meta a.cat::before,
.byline a.cat::before {
  content: "\00b7\00a0";
  color: var(--muted);
}
.post-list .meta a.cat, .byline a.cat { white-space: nowrap; }

.post-list .more {
  display: inline-block;
  margin-top: 8px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 600;
}
.post-list .more:hover { color: var(--green-deep); text-decoration: underline; }

.empty {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fafb;
}
.empty p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ pagination */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.pager .pages { display: flex; gap: 6px; }
.pager .pages a, .pager .pages .current {
  display: inline-flex;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 8px;
}
.pager .pages .current { background: var(--green-deep); color: #fff; font-weight: 700; }
.pager .off { color: #96a4ae; }

/* ------------------------------------------------------------ more posts */

.more-posts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.more-posts a { display: block; }
.more-posts a.right { text-align: right; }
.more-posts .label {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.more-posts .title { display: block; margin-top: 4px; font-family: var(--serif); font-size: 1.05rem; }
.more-posts a:hover .title { color: var(--blue); }

.backlink { margin: 26px 0 0; font-size: 0.93rem; }
.cta .small { margin: 14px 0 0; font-size: 0.9rem; }
.cta .small a { color: #fff; }

/* --------------------------------------------------------------- figures */

/* The picture at the top of a post. One shape for every image, whatever the
   file's own proportions, so a page of writing keeps the same rhythm. The
   crop favours the upper part of the frame, where faces sit. */
.post-figure { margin: 0 0 26px; }
.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 38%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #eef2f4;
}
.post-figure figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

@media (max-width: 860px) {
  .blog-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .more-posts { grid-template-columns: 1fr; }
  .more-posts a.right { text-align: left; }
}
