/* RamblingRoux — cream page and slate-blue banner, both taken from the original site. */
:root {
  --bg: #fff6d8;
  --surface: #f5e9c3;
  --line: #e4d4a6;
  --text: #241c17;
  --muted: #6e604f;
  --accent: #b83a2a;
  --lime: #c6d63a;
  --banner: #587487;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 40rem;
  --page: 68rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.125rem/1.7 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--lime); color: var(--text); }

/* Header / footer */
/* Top banner: a slate-blue strip (the original site's blue) with the logo on the left. */
.site-header {
  background: var(--banner);
}
.site-header-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}
.brand { display: inline-block; vertical-align: middle; }
.brand img { width: min(100%, 15rem); }

main { max-width: var(--page); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

.site-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font: 400 0.875rem/1.5 var(--sans);
  color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer a { text-decoration-color: var(--line); }

/* Tiles */
time {
  display: block;
  font: 500 0.75rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile h2 {
  margin: 0.6rem 0 0.5rem;
  font: 600 1.35rem/1.25 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.tile h2 a { text-decoration: none; }
.tile h2 a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent); }
.tile p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.tile-img { display: block; overflow: hidden; border-radius: 4px; background: var(--surface); }
.tile-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.4s ease; }
.tile:hover .tile-img img { transform: scale(1.02); }
.tile-text { padding-top: 1rem; }
.post, .tile-text { overflow-wrap: anywhere; }

.tile--featured { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.tile--featured h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
.tile--featured p { font-size: 1.1rem; }

/* A post without a picture gets a thin accent rule instead of an empty box. */
.tile--noimg .tile-text { border-top: 3px solid var(--accent); padding-top: 1rem; }

.grid { display: grid; gap: 2.75rem 2rem; grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .site-header-inner { padding: 1.1rem 1.25rem; }
  .brand img { width: 19rem; }
  .tile--featured { display: grid; grid-template-columns: 7fr 5fr; gap: 2.5rem; align-items: center; }
  .tile--featured .tile-text { padding-top: 0; }
  .tile--featured.tile--noimg { display: block; }
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* Post page */
.post { max-width: var(--measure); margin: 0 auto; }
.post-head { margin-bottom: 2rem; }
.back {
  display: inline-block;
  margin-bottom: 2rem;
  font: 500 0.875rem/1 var(--sans);
  color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--text); }
.post h1 {
  margin: 0.75rem 0 1rem;
  font: 700 clamp(2rem, 7vw, 3rem)/1.1 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.standfirst { margin: 0; font-size: 1.25rem; line-height: 1.5; color: var(--muted); font-style: italic; }
.post-img { margin: 0 0 2.5rem; }
.post-img img { width: 100%; border-radius: 4px; }

.prose { font-size: 1.1875rem; }
.prose p { margin: 0 0 1.4em; }
.prose h2 { font: 600 1.6rem/1.25 var(--serif); margin: 2.2em 0 0.6em; }
.prose h3 { font: 600 1.25rem/1.3 var(--serif); margin: 2em 0 0.5em; }
.prose blockquote {
  margin: 2em 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--text);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1.4em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--accent); }
.post-end { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.post-end .back { margin: 0; }

/* Empty / 404 */
.empty { max-width: var(--measure); margin: 3rem auto; text-align: center; color: var(--muted); }
.empty h1 { color: var(--text); font: 700 2rem/1.2 var(--serif); }

@media (prefers-reduced-motion: reduce) {
  .tile-img img { transition: none; }
  .tile:hover .tile-img img { transform: none; }
}
