/* ==========================================================================
   jasonmaclean.com
   Static HTML, no build step. One stylesheet for the whole site.

   Sans for headings and navigation, serif for reading. A narrow column,
   because it's a personal site and not a magazine. Colour is used sparingly
   and always means "this is a link or an action".
   ========================================================================== */

:root {
  --paper:   #f2f1ec;
  --raised:  #e9e7e0;
  --ink:     #23211e;
  --ink-2:   #57534c;
  --ink-3:   #8a8478;
  --rule:    #dcd8ce;
  --accent:  #14624a;
  --accent-2:#0d4634;

  --sans:  "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;

  --page:   38rem;   /* one column, sized to read at about 68 characters */
  --gutter: clamp(1.25rem, 5vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #1a1917;
    --raised:  #232220;
    --ink:     #e9e6df;
    --ink-2:   #a7a298;
    --ink-3:   #7b756b;
    --rule:    #33312c;
    --accent:  #62b995;
    --accent-2:#8ad3b4;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Type --------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
h2 { font-size: 1.3rem; margin-top: 2.4em; }
h3 { font-size: 1.05rem; margin-top: 1.8em; }

/* The margin above is for headings inside an article. A heading that opens a
   section already has the section's own space above it. */
section > h2:first-child,
section > h3:first-child,
.copy > h2:first-child,
.copy > h3:first-child { margin-top: 0; }

p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; }
strong { font-weight: 600; }

.lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.small { font-size: 0.9375rem; }
.muted { color: var(--ink-2); }

/* Small sans labels. Sentence case on purpose: no letterspaced all-caps. */
.label {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0;
  text-transform: none;
}

/* --- Layout ------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { padding-block: 2.5rem 1rem; }

section + section {
  margin-top: 2.75rem;
  padding-top: 2.75rem;
  border-top: 1px solid var(--rule);
}

/* Stop a floated portrait escaping its section and dragging the next rule up. */
section::after,
article::after { content: ""; display: block; clear: both; }

/* --- Header ------------------------------------------------------------- */

.site-header { padding-block: 1.5rem 0; }

.site-header__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.nav a {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }

/* --- Portrait ----------------------------------------------------------- */

/* Floated, so the heading and the paragraphs under it wrap around the photo as
   one continuous block. Sitting it in its own flex column instead left the
   text below starting at a different width to the text beside it. */
.portrait {
  float: right;
  width: 6rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  margin: 0.35rem 0 0.9rem 1.4rem;
  shape-outside: inset(0 round 3px);
}

@media (max-width: 24rem) {
  .portrait { width: 4.75rem; margin-left: 1.1rem; }
}

/* --- Links -------------------------------------------------------------- */

a.link,
.copy a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 0.15s ease;
}

a.link:hover,
.copy a:hover { color: var(--accent-2); }

/* .copy is now the full width of the page column; no extra constraint. */

/* --- Now list ----------------------------------------------------------- */

.now { margin: 0; }

.now > div {
  display: flex;
  gap: 0.9rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
}
.now > div:first-child { border-top: 1px solid var(--rule); }

.now dt {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
  flex: none;
  width: 4.5rem;
  padding-top: 0.28rem;
}

.now dd { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 1rem; }

@media (max-width: 26rem) {
  .now > div { flex-direction: column; gap: 0.15rem; }
  .now dt { width: auto; padding-top: 0; }
}

/* --- Facts (London) ----------------------------------------------------- */

.facts {
  margin: 1.75rem 0 0;
  font-size: 1rem;
}

.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--rule);
}
.facts > div:first-child { border-top: 1px solid var(--rule); }

.facts dt {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.facts dd { margin: 0; text-align: right; }

/* --- Posts -------------------------------------------------------------- */

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

.posts li + li { margin-top: 1.5rem; }

.posts a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.posts a:hover .posts__title { color: var(--accent); }

.posts__title {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 0.2rem;
  transition: color 0.15s ease;
}

.posts__date {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-bottom: 0.35rem;
}

.posts__blurb { color: var(--ink-2); font-size: 1rem; }

/* --- Article meta ------------------------------------------------------- */

.meta {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-3);
  margin-bottom: 2rem;
}

.back {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1.5rem;
}
.back:hover { color: var(--accent); }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn--plain {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--plain:hover { background: transparent; border-color: var(--ink-3); color: var(--ink); }

.btn--off {
  background: transparent;
  color: var(--ink-3);
  border-color: var(--rule);
  border-style: dashed;
  cursor: not-allowed;
}
.btn--off:hover { background: transparent; border-color: var(--rule); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1.5rem;
}

/* --- Aside -------------------------------------------------------------- */

.aside {
  background: var(--raised);
  border-radius: 3px;
  padding: 1.1rem 1.25rem;
  margin-top: 1.75rem;
  font-size: 0.9375rem;
}

/* --- Prose extras ------------------------------------------------------- */

.copy ul { padding-left: 1.15rem; margin: 0 0 1.2em; }
.copy li { margin-bottom: 0.4em; }

.copy hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.25rem 0;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  margin-top: 3.5rem;
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-3);
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
