/*
 * www.carefreeway.com. One stylesheet, no script, no web fonts.
 *
 * The look is a chalkboard: the name written in chalk across the board at the
 * top, a chalk line drawn freehand under it and over the footer, warm paper
 * by day and asphalt by night. The yellow is what is left of the road.
 */

:root {
  color-scheme: light dark;

  --paper: #f7f4ec;
  --raised: #fffdf8;
  --ink: #1f2328;
  --muted: #5d6167;
  --rule: #dcd6c7;
  --link: #005a46;
  --focus: #005a46;

  --sign: #00664f;
  --sign-ink: #ffffff;
  --yellow: #f5c518;
  --asphalt: #2b2d30;
  /* The board is the colour of the name's picture, so the two run together. */
  --board: #212524;
  --chalk: #edebe4;

  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1c1e;
    --raised: #222527;
    --ink: #e9e6df;
    --muted: #a2a49f;
    --rule: #383b3e;
    --link: #74d3b6;
    --focus: #f5c518;
    --asphalt: #0f1011;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

img,
video,
iframe {
  max-width: 100%;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  padding: 0.4rem 0.8rem;
  background: var(--sign);
  color: var(--sign-ink);
  font: 600 0.9rem/1.4 var(--sans);
  border-radius: 4px;
}
.skip:focus {
  top: 0.75rem;
}

/* ── Masthead: the chalkboard ─────────────────────────────────────────── */

.masthead {
  background:
    url(board.svg?v=1) center top / 900px 300px,
    var(--board);
}
.masthead-in {
  max-width: 50rem;
  margin: 0 auto;
  padding-top: 0.5rem;
}

/* The name, in chalk. The picture's edges fade into the board around it. */
.board-name {
  display: block;
  text-decoration: none;
}
.board-name img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image:
    linear-gradient(90deg, transparent, #000 3%, #000 97.5%, transparent),
    linear-gradient(transparent, #000 8%, #000 97%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent, #000 3%, #000 97.5%, transparent),
    linear-gradient(transparent, #000 8%, #000 97%, transparent);
  mask-composite: intersect;
  /* Only what is lighter than the board shows, so no edge of the picture does. */
  mix-blend-mode: lighten;
}

.masthead nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
  font: 600 0.9rem/1.4 var(--sans);
  letter-spacing: 0.02em;
}
.masthead nav a,
.footer-links a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.masthead nav a:hover,
.footer-links a:hover {
  border-bottom-color: var(--yellow);
}
.masthead nav {
  justify-content: center;
  gap: 0.25rem 2rem;
  padding: 0 1.25rem 0.35rem;
  letter-spacing: 0.06em;
}
.masthead nav a {
  color: var(--chalk);
}
.masthead nav a:hover {
  border-bottom-color: var(--chalk);
}
.masthead :focus-visible {
  outline-color: var(--yellow);
}

/* A chalk line drawn freehand across the board: not quite straight. The line
   is a mask, so the same drawing can be any colour. */
.lane {
  padding: 0.3rem 0 0.55rem;
  background:
    url(board.svg?v=1) center top / 900px 300px,
    var(--board);
}
.masthead .lane {
  background: none;
}
.lane::before {
  content: "";
  display: block;
  height: 1.25rem;
  background: var(--chalk);
  -webkit-mask: url(chalk-line.svg?v=1) center / auto 100% repeat-x;
  mask: url(chalk-line.svg?v=1) center / auto 100% repeat-x;
}

main.wrap {
  padding-top: 2.75rem;
  padding-bottom: 3.5rem;
}

/* ── Small type: dates, topics, labels ────────────────────────────────── */

.meta,
.eyebrow,
.updated,
.pager,
.comments-note,
.comment-by,
.footer-fine {
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

.meta {
  margin: 0 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.9rem;
  align-items: baseline;
}
.meta time {
  font-variant-numeric: tabular-nums;
}
.tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.7rem;
}
.tags a {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
  text-decoration: none;
}
.tags a:hover {
  color: var(--link);
  text-decoration: underline;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--link);
}
.eyebrow a {
  text-decoration: none;
}

/* ── Headings ─────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  font-family: var(--sans);
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

.page-title,
.post-head h1,
.lead h1 {
  font-size: clamp(1.9rem, 1.2rem + 3vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.12;
}
.page-title {
  margin-bottom: 1.75rem;
}

/* A section's label, with a short yellow stripe over it. */
.section,
.marker {
  margin: 3rem 0 0.5rem;
  padding-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: linear-gradient(var(--yellow), var(--yellow)) left top / 2.5rem 0.1875rem no-repeat;
}

/* ── The front page's first post ──────────────────────────────────────── */

.lead h1 a,
.row h2 a {
  color: inherit;
  text-decoration: none;
}
.lead h1 a:hover,
.row h2 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--yellow);
}
.lead-picture {
  display: block;
  margin-bottom: 1.5rem;
}
.lead-picture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 30rem;
  object-fit: cover;
  border-radius: 6px;
  background: var(--rule);
}
.lead h1 {
  margin-bottom: 0.6rem;
}
.lead-summary {
  margin: 0.6rem 0 0.9rem;
  font-size: 1.25rem;
  line-height: 1.55;
}
.lead p:last-child {
  margin: 0;
}
.more {
  font: 700 0.9rem/1.4 var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
}
.more:hover {
  text-decoration: underline;
}

/* ── Lists of posts ───────────────────────────────────────────────────── */

.row {
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
}
.rows .row:first-child {
  border-top: 0;
}
.row.has-thumb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem;
  gap: 1.25rem;
  align-items: start;
}
.row h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.row-summary {
  margin: 0.4rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.thumb {
  display: block;
  margin-top: 0.3rem;
}
.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: var(--rule);
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.pager a {
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}
.pager a:hover {
  text-decoration: underline;
}
.pager > :last-child {
  text-align: right;
}

/* ── A post ───────────────────────────────────────────────────────────── */

.post-head {
  margin-bottom: 2rem;
}
.post-head .meta {
  margin-bottom: 0.6rem;
}
.updated {
  margin: 0.75rem 0 0;
}
.cover {
  margin: 0 0 2rem;
}
.cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.prose > :first-child {
  margin-top: 0;
}
.prose > :last-child {
  margin-bottom: 0;
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
  margin: 0 0 1.3em;
}
.prose h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.prose h3 {
  margin: 1.9em 0 0.5em;
  font-size: 1.2rem;
  font-weight: 700;
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li {
  margin: 0.3em 0;
}
.prose li > p {
  margin: 0;
}
.prose li > p + p,
.prose li > ul,
.prose li > ol {
  margin-top: 0.4em;
}
.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 0.1em 0 0.1em 1.1em;
  border-left: 0.1875rem solid var(--yellow);
  color: var(--muted);
  font-style: italic;
}
.prose blockquote > :last-child {
  margin-bottom: 0;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.1em 0.3em;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.prose pre {
  padding: 1rem 1.1rem;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.5;
}
.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}
/* A break in the post: a short stroke of the chalk line. */
.prose hr {
  height: 1.25rem;
  width: 11rem;
  margin: 2em auto;
  border: 0;
  background: var(--muted);
  /* The stroke starts and stops softly, as a lifted piece of chalk does. */
  -webkit-mask:
    linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent),
    url(chalk-line.svg?v=1) 22% center / auto 100% repeat-x;
  -webkit-mask-composite: source-in;
  mask:
    linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent),
    url(chalk-line.svg?v=1) 22% center / auto 100% repeat-x;
  mask-composite: intersect;
}
.prose sup,
.prose sub {
  line-height: 0;
}

/* Photos and videos. A small picture stays its own size: many of the old
   posts' are a few hundred pixels wide. */
.prose figure {
  margin: 2em 0;
}
.prose figure img {
  display: block;
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 85vh;
  border-radius: 4px;
}
.prose figure video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 85vh;
  background: #000;
  border-radius: 4px;
}
.prose figure iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 4px;
  background: #000;
}
.prose figcaption {
  margin-top: 0.6rem;
  font: 0.875rem/1.45 var(--sans);
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}
.group-link {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

/* ── The old site's comments ──────────────────────────────────────────── */

.comments {
  margin-top: 3.5rem;
}
.comments h2 {
  padding-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: linear-gradient(var(--yellow), var(--yellow)) left top / 2.5rem 0.1875rem no-repeat;
}
.comments-note {
  margin: 0.25rem 0 1.25rem;
}
.comments ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment {
  padding: 1rem 0 1rem 1rem;
  border-left: 0.1875rem solid var(--rule);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.comment + .comment {
  margin-top: 0.9rem;
}
.comment.by-owner {
  border-left-color: var(--sign);
}
.comment-by {
  margin: 0 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  align-items: baseline;
}
.comment-by strong {
  color: var(--ink);
  font-size: 0.9rem;
}
.comment .prose p {
  margin-bottom: 0.8em;
}

.neighbors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}
.neighbors a {
  color: var(--ink);
  text-decoration: none;
}
.neighbors a:hover {
  color: var(--link);
}
.neighbors a span {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.neighbors .next {
  text-align: right;
}

/* ── Archive and topics ───────────────────────────────────────────────── */

.year-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin: -0.75rem 0 0;
  font: 600 0.9rem/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
}
.year-jump a {
  text-decoration: none;
}
.year-jump a:hover {
  text-decoration: underline;
}

.marker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 1.5rem;
  letter-spacing: 0;
  color: var(--ink);
}
.marker a {
  color: inherit;
  text-decoration: none;
}
.marker a:hover {
  color: var(--link);
}
.marker span {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.month h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.month h3 a {
  color: var(--muted);
  text-decoration: none;
}
.month h3 a:hover {
  color: var(--link);
}
.month ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.month li {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.3rem 0;
  font-size: 1.0625rem;
  line-height: 1.4;
}
.month time {
  font: 0.8125rem/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.month li a {
  color: var(--ink);
  text-decoration-color: var(--rule);
}
.month li a:hover {
  color: var(--link);
  text-decoration-color: currentColor;
}

.topics {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 2.5rem;
  font-family: var(--sans);
  font-size: 1.0625rem;
}
.topics li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  break-inside: avoid;
}
.topics a {
  font-weight: 600;
  text-decoration: none;
}
.topics a:hover {
  text-decoration: underline;
}
.topics span {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer-in {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}
.footer-bio {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
}
.footer-bio strong {
  color: var(--ink);
  font-family: var(--sans);
}
.footer-links {
  margin: 0 0 1rem;
}
.footer-fine {
  margin: 0;
}

/* ── Narrow screens, and paper ────────────────────────────────────────── */

@media (max-width: 34rem) {
  body {
    font-size: 1.0625rem;
  }
  .masthead-in {
    padding-top: 0.25rem;
  }
  main.wrap {
    padding-top: 1.75rem;
  }
  .row.has-thumb {
    grid-template-columns: minmax(0, 1fr) 5.5rem;
    gap: 0.9rem;
  }
  .thumb img {
    aspect-ratio: 1;
  }
  .row h2 {
    font-size: 1.15rem;
  }
  .row-summary {
    font-size: 1rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .lead-summary {
    font-size: 1.125rem;
  }
  .topics {
    columns: 1;
  }
  .neighbors {
    grid-template-columns: 1fr;
  }
  .neighbors .next {
    text-align: left;
  }
  /* Photos run to the edges of a phone. */
  .prose figure img,
  .prose figure video,
  .prose figure iframe,
  .lead-picture img {
    border-radius: 0;
  }
  .post .prose > figure,
  .lead-picture {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
  }
  .prose figcaption {
    padding: 0 1.25rem;
  }
}

@media print {
  .masthead {
    background: none;
  }
  .board-name img {
    display: none;
  }
  .board-name::after {
    content: "The Carefree Way";
    font: 700 18pt/1.2 var(--sans);
    color: #000;
  }
  .masthead nav,
  .lane,
  .skip,
  .pager,
  .neighbors,
  .footer-links {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .prose figure {
    break-inside: avoid;
  }
}
