/* kintoandar blog theme: Minimal Mistakes layout, www.kintoandar.com colours and type.
   The reading area stays pure white because many post images have white backgrounds. */

:root {
  --bg: #fff;
  --bg-alt: #f6f3ec;
  --ink: #141a26;
  --text: #2a303b;
  --muted: #5d6370;
  --border: #e5e3dd;
  --link: #c94a26;
  --link-hover: #ff8a65;
  --accent: #c94a26;
  --mark: #f6c9b8;
  --code-bg: #f6f8fa;
  --info-bg: #f6f3ec;
  --info: #141c2e;
  --danger-bg: #fdeeee;
  --danger: #d9534f;
  --shadow: 0 1px 2px rgb(20 26 38 / 6%), 0 4px 14px rgb(20 26 38 / 8%);

  /* masthead and footer band */
  --band: #141c2e;
  --band-ink: #f3efe6;
  --band-muted: #aab1c2;
  --band-accent: #ff8a65;

  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 6px;
  --measure: 46rem;

  color-scheme: light;
}


/* ---- base ---- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}

@media (min-width: 1024px) { body { font-size: 18px; } }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--link-hover); }

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

::selection { background: var(--mark); color: var(--ink); }

/* <picture> wrappers added for WebP must not affect layout */
picture { display: contents; }
picture > source { display: none; }

.icon { width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }

.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--bg); padding: 0.5rem 1rem; z-index: 10; }
.skip-link:focus { left: 0.5rem; }

/* ---- masthead ---- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--band);
}

.masthead__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--band-ink);
  font: 700 1.2rem/1 var(--serif);
  text-decoration: none;
}
/* the logo is a dark glyph on transparent; invert it for the dark band */
.site-brand img { filter: invert(1); }
.site-brand:hover { color: var(--band-accent); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-left: auto; }
.site-nav a {
  color: var(--band-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--band-ink); border-bottom-color: var(--band-accent); }

/* ---- hero ---- */

.hero img {
  display: block;
  width: 100%;
  height: clamp(9rem, 28vw, 22rem);
  object-fit: cover;
}

/* ---- layout ---- */

.container {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  display: grid;
  gap: 2rem;
}

main { min-width: 0; }

@media (min-width: 900px) {
  .container { grid-template-columns: 14rem minmax(0, 1fr); gap: 3rem; padding-top: 3rem; }
  .container--full { grid-template-columns: minmax(0, 1fr); }
}

/* ---- author sidebar ---- */

.author { display: flex; gap: 1rem; align-items: center; font-size: 0.85rem; }
.author__avatar { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.author__name { margin: 0; font-size: 1.05rem; }
.author__bio { margin: 0.2rem 0 0.5rem; color: var(--muted); }
.author__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; }
.author__links a { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); text-decoration: none; }
.author__links a:hover { color: var(--link); }

@media (max-width: 899px) {
  .author { padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
  .author__links span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .author__links .icon { width: 1.2em; height: 1.2em; }
}

@media (min-width: 900px) {
  .author { flex-direction: column; align-items: flex-start; position: sticky; top: 5rem; align-self: start; }
  .author__avatar { width: 7rem; height: 7rem; }
  .author__links { flex-direction: column; margin-top: 0.5rem; }
}

/* ---- headings & section titles ---- */

h1, h2, h3, h4, h5, h6 { font-family: var(--serif); color: var(--ink); line-height: 1.2; margin: 2em 0 0.5em; }
.author__name, .entry__title, .card__title, .post__title { font-family: var(--serif); color: var(--ink); }

.section-title { margin-top: 0; font-size: 1.6rem; }

.post__header { margin-bottom: 1.5rem; }
.post__title { margin: 0 0 0.4rem; font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -0.01em; }

.meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin: 0; color: var(--muted); font-size: 0.85rem; }
.meta span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ---- post with table of contents ---- */

.toc {
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-alt);
}
.toc__title { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.4rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.2rem 0; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--link); }
.toc__l3 { padding-left: 1rem; }

@media (min-width: 1200px) {
  .post--toc { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; column-gap: 2.5rem; }
  .post--toc > * { grid-column: 1; }
  .post--toc > .toc {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: start;
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
  }
}

/* ---- prose ---- */

.prose { max-width: var(--measure); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.2rem; }
.prose h4 { font-size: 1.05rem; }
.prose li + li { margin-top: 0.25rem; }

.prose blockquote {
  margin: 1.5em 0;
  padding: 0.2em 1.2em;
  border-left: 4px solid var(--mark);
  color: var(--muted);
  font-style: italic;
}

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.9rem; margin: 1.5em 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.4em 0.8em; text-align: left; }
.prose th { background: var(--bg-alt); }

code, pre { font-family: var(--mono); font-size: 0.85em; }
:not(pre) > code { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 4px; padding: 0.1em 0.35em; color: var(--ink); }

/* code blocks: dark panels in the masthead navy, with a language bar and copy button */
pre {
  margin: 0;
  padding: 1rem 1.25rem 1.1rem;
  overflow-x: auto;
  line-height: 1.6;
  background: var(--band);
  color: #e6e1d6;
  border-radius: var(--radius);
  scrollbar-color: #2c3650 transparent;
  tab-size: 2;
}
pre code { font-size: inherit; }

.code {
  margin: 1.5em 0;
  border-radius: 10px;
  background: var(--band);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.code figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.2rem;
  padding: 0 0.5rem 0 1.25rem;
  background: #0f1624;
  border-bottom: 1px solid #2c3650;
  color: var(--band-muted);
  font: 600 0.7rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.code pre { border-radius: 0; }
.code__copy {
  margin-left: auto;
  padding: 0.3rem 0.6rem;
  border: 1px solid #2c3650;
  border-radius: 4px;
  background: transparent;
  color: var(--band-muted);
  font: 600 0.7rem/1 var(--sans);
  cursor: pointer;
}
.code__copy:hover { color: var(--band-accent); border-color: var(--band-accent); }

/* images & alignment (kept from Minimal Mistakes so post markup stays valid) */
.align-center, .center img { display: block; margin: 1.5em auto; }
.center { text-align: center; }
.align-left { float: left; margin: 0.3em 1.5em 1em 0; max-width: 45%; }
.align-right { float: right; margin: 0.3em 0 1em 1.5em; max-width: 45%; }
.prose::after { content: ""; display: table; clear: both; }

.gallery { display: grid; gap: 0.5rem; margin: 1.5em 0; }
.gallery--2 { grid-template-columns: repeat(2, 1fr); }
.gallery--3 { grid-template-columns: repeat(3, 1fr); }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.gallery figcaption { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* notices */
.notice--info, .notice--danger, .notice {
  padding: 0.8em 1em;
  border-radius: var(--radius);
  border-left: 4px solid var(--info);
  background: var(--info-bg);
  font-size: 0.95rem;
}
.notice--danger { border-left-color: var(--danger); background: var(--danger-bg); }

/* buttons */
.btn {
  display: inline-block;
  padding: 0.45em 1em;
  border-radius: var(--radius);
  border: 1px solid var(--link);
  color: var(--link);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--link-hover); border-color: var(--link-hover); color: var(--bg); }
.btn--info { background: var(--link); color: var(--bg); }
.btn--info:hover { background: var(--link-hover); border-color: var(--link-hover); color: var(--bg); }
.btn--large { font-size: 0.95rem; padding: 0.6em 1.3em; }

/* archived tweets, kept as static quotes */
.prose blockquote.tweet {
  max-width: 34rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  font-style: normal;
}
.tweet p { margin: 0 0 0.6rem; }
.tweet img { display: block; border-radius: 4px; margin-bottom: 0.6rem; }
.tweet footer { color: var(--muted); font-size: 0.85rem; }

.age-notice {
  max-width: var(--measure);
  margin: 0 0 1.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- post footer ---- */

.post__footer { max-width: var(--measure); margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.9rem; }

.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: 0 0 1rem; color: var(--muted); }

.tag, .chips a {
  display: inline-block;
  padding: 0.1em 0.65em;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  text-decoration: none;
}
.tag:hover, .chips a:hover { border-color: var(--link-hover); color: var(--link-hover); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.pager a {
  display: block;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  line-height: 1.35;
}
.pager a:hover { border-color: var(--link-hover); }
.pager small { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.pager__next { text-align: right; }


/* ---- lists of posts ---- */

.entry { padding: 1.4rem 0; border-bottom: 1px solid var(--border); }
.entry:first-of-type { padding-top: 0; }
.entry__title { margin: 0 0 0.3rem; font-size: 1.3rem; }
.entry__title a { color: var(--text); text-decoration: none; }
.entry__title a:hover { color: var(--link); }
.entry__excerpt { margin: 0.5rem 0 0; }

.pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 2rem; }
.pagination a, .pagination span {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9rem;
}
.pagination a { color: var(--text); }
.pagination a:hover { border-color: var(--link-hover); color: var(--link-hover); }
.pagination span { background: var(--band); border-color: var(--band); color: var(--band-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2rem; }
.chips span { color: var(--muted); font-size: 0.75em; }

.year__title, .tag-group h2 { font-size: 1.3rem; margin: 2.5rem 0 1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.2rem; }
.related .cards { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  background: var(--bg);
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.card__img { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; border-bottom: 1px solid var(--border); }
.card__img img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; padding: 0.6rem; }
.card__title { padding: 0.7rem 0.9rem 0.2rem; font-weight: 600; line-height: 1.3; }
.card__excerpt { padding: 0 0.9rem 0.9rem; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }

.related { max-width: var(--measure); margin-top: 3.5rem; }
.related h2 { font-size: 1.2rem; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px dashed var(--border); }
.post-list time { color: var(--muted); font-size: 0.8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- publications ---- */

.pub {
  max-width: var(--measure);
  margin: 0 0 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}
.pub__head {
  display: grid;
  gap: 1.25rem 2rem;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-alt);
}
.pub__cover { display: block; width: 100%; max-width: 13rem; margin: 0 auto; }
.pub__kind { margin: 0 0 0.3rem; color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pub h2 { margin: 0 0 0.6rem; padding: 0; border: 0; font-size: 1.45rem; }
.pub__head p { margin: 0 0 1rem; }
.pub__head > div > :last-child { margin-bottom: 0; }
.pub__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pub audio { width: 100%; }
.pub__details { padding: 0.25rem 1.5rem 1.5rem; border-top: 1px solid var(--border); }
.pub__details h3 { margin-top: 1.5rem; }
.pub__details > :last-child { margin-bottom: 0; }
@media (min-width: 640px) {
  .pub__head { grid-template-columns: 11rem minmax(0, 1fr); }
}

.pub__chapters { margin: 1.5rem 0 0; padding: 0.6rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); }
.pub__chapters summary { cursor: pointer; font: 700 1.05rem var(--serif); color: var(--ink); }
.pub__chapters ol { margin: 0.8rem 0 0.4rem; columns: 2 16rem; column-gap: 2rem; }

/* ---- footer ---- */

.site-footer { background: var(--band); color: var(--band-muted); font-size: 0.85rem; }
.site-footer__inner { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.site-footer__inner p { margin: 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.site-footer__links strong { color: var(--band-ink); }
.site-footer__links a { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--band-muted); text-decoration: none; }
.site-footer__links a:hover { color: var(--band-accent); }

/* ---- syntax highlighting (highlight.js classes, tuned for the navy panels) ---- */

.hljs-comment, .hljs-quote { color: #7d8799; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag { color: #ff8a65; }
.hljs-built_in, .hljs-type { color: #7fd1c7; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute { color: #b5d99c; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #f6c177; }
.hljs-variable, .hljs-template-variable, .hljs-attr, .hljs-params, .hljs-subst { color: #8fbcff; }
.hljs-title, .hljs-section, .hljs-name, .hljs-function { color: #d4b8ff; }
.hljs-meta { color: #f6c177; }
.hljs-deletion { color: #ff8f8f; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

@media print {
  .masthead, .hero, .author, .toc, .pager, .related, .site-footer, .code__copy { display: none; }
  .container { display: block; }
}
