/* Simon Blampied — site styles */

:root {
  --bg:      #fdfdfc;
  --text:    #2e2e2e;
  --muted:   #767676;
  --link:    #a33b3d;
  --rule:    #e4e2de;
  --mark:    #fcffc0;
  --code-bg: #f4f3f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #17181a;
    --text:    #ddd9d3;
    --muted:   #9a9691;
    --link:    #e8908f;
    --rule:    #33353a;
    --mark:    #5c5424;
    --code-bg: #212327;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.wrapper {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ---- header nav ---- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.site-header .name {
  font-weight: 600;
  font-size: 1rem;
}

.site-header a {
  color: var(--text);
  text-decoration: none;
}

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

.site-header nav {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

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

/* ---- typography ---- */

h1, h2, h3 {
  line-height: 1.25;
  margin: 2.25rem 0 0.75rem;
  font-weight: 600;
}

h1 { font-size: 1.6rem; margin-top: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1.1rem; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { text-decoration-thickness: 2px; }

strong, b { font-weight: 600; }

/* Article date line, sits under the h1 */
.date {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -0.4rem 0 2rem;
}

hr {
  height: 1px;
  border: 0;
  background: var(--rule);
  margin: 2rem 0;
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

mark {
  background: var(--mark);
  color: inherit;
  padding: 0 0.2em;
}

code {
  background: var(--code-bg);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- lists ---- */

ul, ol {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
}

li { margin-bottom: 0.35rem; }

li > ul, li > ol { margin-top: 0.35rem; margin-bottom: 0; }

/* ---- post index ---- */

.posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.posts li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: baseline;
}

/* Long titles wrap within their own column instead of pushing the
   date onto a new line, so dates stay right-aligned at every width. */
.posts li > a {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.posts li > .date {
  flex: 0 0 auto;
}

.posts li:last-child { border-bottom: 0; }

.posts a { text-decoration: none; }
.posts a:hover { text-decoration: underline; }

.posts .date {
  margin: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---- elsewhere links ---- */

.elsewhere {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem;
  display: flex;
  gap: 1rem;
}
