/* Country-flag emoji for Windows, whose emoji font has no flags and shows the two letters instead (added
   2026-09-29). "Twemoji Country Flags" 0.1.10 from npm country-flag-emoji-polyfill (MIT; the flag graphics are
   Twemoji, (c) Twitter, CC-BY 4.0), served from our own origin. unicode-range: only the regional-indicator
   letters that make up flags, so browsers download it only when a page contains a flag. */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("/fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF;
  font-display: swap;
}

:root {
  --bg: #fdfdfc;
  --fg: #1f2328;
  --muted: #5f6670;
  --line: #e3e5e8;
  --accent: #1d5fa8;
  --field: #ffffff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e6e8eb;
    --muted: #9aa1ab;
    --line: #2c3036;
    --accent: #7eb3ef;
    --field: #1d2024;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 "Twemoji Country Flags", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--fg); text-decoration: none; }
nav { display: flex; gap: 1.1rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--fg); }

main { padding-top: 2rem; padding-bottom: 3rem; min-height: 60vh; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.9rem; margin: 0 0 1rem; }
.prose { overflow-wrap: break-word; }
.prose pre { overflow-x: auto; padding: .75rem 1rem; background: var(--field); border: 1px solid var(--line); border-radius: 6px; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .35rem .6rem; }
.prose blockquote { margin-left: 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.meta, time { color: var(--muted); font-size: .9rem; }
/* Sizes come from the img width/height attributes (the CSP forbids inline styles); CSS only caps them. */
.portrait { float: right; max-width: 45%; height: auto; margin: .3rem 0 1rem 1.5rem; border-radius: 10px; }
.portrait-left { float: left; margin: .3rem 1.5rem 1rem 0; }
.prose::after, .clear { content: ""; display: table; clear: both; }

/* {{< img >}}: the figure is as wide as its image (fit-content; the caption's own width is excluded by
   contain: inline-size, so it wraps under the image instead of widening the figure). */
figure.img { width: fit-content; max-width: 100%; margin: 1rem 0; }
figure.img img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
figure.img figcaption { contain: inline-size; padding-top: .35rem; color: var(--muted); font-size: .9rem; }
figure.img-left { float: left; margin: .3rem 1.5rem 1rem 0; max-width: 50%; }
figure.img-right { float: right; margin: .3rem 0 1rem 1.5rem; max-width: 50%; }
figure.img-center { margin-left: auto; margin-right: auto; }

/* {{< big >}}: emoji/text at a multiple of the surrounding size; line-height 1 keeps lines from spreading. */
.big { line-height: 1; vertical-align: -0.1em; }
.big-2 { font-size: 2em; }
.big-3 { font-size: 3em; }
.big-4 { font-size: 4em; }
.big-5 { font-size: 5em; }
.big-6 { font-size: 6em; }

@media (max-width: 560px) {
  .portrait, .portrait-left { float: none; display: block; max-width: 70%; margin: 0 auto 1.25rem; }
  figure.img-left, figure.img-right { float: none; max-width: 100%; margin: 1rem auto; }
}

/* A Markdown "---" divider; kept tight (Scott wanted little space around it, 2026-09-29). */
.prose > :last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0 .5rem; }
.prose hr + h2 { margin-top: .75rem; }
.prose .cards-wrap { margin: .75rem 0 1rem; }
.site-footer p { margin: 0; }
.post-list { list-style: none; padding: 0; }
.post-list li { margin: 0 0 1.25rem; }
.post-list li > a { font-weight: 600; }
.post-list time { margin-left: .5rem; }
.post-list p { margin: .25rem 0 0; color: var(--muted); }

/* Post cards (partials/post-cards.html): a wrapping grid, or a carousel (one row, scroll-snap sideways). */
.cards-wrap { position: relative; margin: 1rem 0 1.5rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; background: var(--field);
  border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.card-img { width: calc(100% + 2rem); max-width: none; margin: -1rem -1rem .4rem; height: auto;
  aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px 10px 0 0; }
.card-title { font-weight: 700; line-height: 1.3; text-decoration: none; color: var(--fg); }
.card-title:hover { color: var(--accent); text-decoration: underline; }
.card time { font-size: .85rem; }
.card p { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.carousel .cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(220px, 31%);
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: thin;
  padding-bottom: .6rem; }
.carousel .card { scroll-snap-align: start; }
.carousel .cards:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.cards-nav { position: absolute; top: calc(50% - 1.3rem - .3rem); z-index: 1; width: 2.6rem; height: 2.6rem;
  border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font: 700 1.5rem/1 system-ui, sans-serif; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.cards-nav.prev { left: -1.1rem; }
.cards-nav.next { right: -1.1rem; }
.cards-nav:disabled { opacity: .3; cursor: default; }
.cards-nav[hidden] { display: none; }
@media (max-width: 560px) {
  .carousel .cards { grid-auto-columns: 80%; }
  .cards-nav { display: none; }
}

form.contact { display: grid; gap: 1rem; margin-top: 1.5rem; }
form.contact label { display: grid; gap: .3rem; font-weight: 600; }
form.contact input, form.contact textarea {
  font: inherit; font-weight: 400; color: var(--fg); background: var(--field);
  border: 1px solid var(--line); border-radius: 6px; padding: .55rem .7rem; width: 100%;
}
form.contact button {
  justify-self: start; font: inherit; font-weight: 600; color: #fff; background: var(--accent);
  border: 0; border-radius: 6px; padding: .6rem 1.4rem; cursor: pointer;
}
@media (prefers-color-scheme: dark) { form.contact button { color: #0d1117; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer .wrap { padding-top: 1.25rem; padding-bottom: 2rem; }
