/* Blog: the article list (blog, category, tag and author pages) and the article page.
   Loads after pages.css. The one bold move is the stela-topped picture on the newest
   article and on the article page; everything else stays quiet for reading. */

/* ---------- Shared pieces ---------- */
.post-cat { margin-bottom: 12px; font-size: 14.5px; font-weight: 600; color: var(--blue); }
.post-cat a { position: relative; z-index: 1; }
.post-cat a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14.5px; color: var(--ink-soft); }
.post-card-link::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.post-card-link:focus-visible { outline: none; }
.post-card-link:focus-visible::after { outline: 3px solid var(--blue); outline-offset: 4px; }
.author-photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.author-photo.is-large { width: clamp(88px, 8vw, 120px); height: clamp(88px, 8vw, 120px); }

/* ---------- List pages ---------- */
.blog-intro-head { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.blog-intro .part-lead { margin-top: clamp(16px, 2vw, 28px); color: var(--ink-soft); }
.author-profile { margin-top: 14px; }
.author-profile a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--blue); }
.author-profile .i { width: 14px; height: 14px; }
.blog-cats .chips { margin-bottom: 0; }
.blog-cats a[aria-current] { background: var(--blue); color: #fff; }

.post-lead { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 88px); align-items: center; margin-bottom: clamp(56px, 6vw, 96px); }
.post-lead-media { aspect-ratio: 960 / 760; border-radius: 50% 50% 18px 18px / 24% 24% 18px 18px; overflow: hidden; background: var(--paper); }
.post-lead-media img { width: 100%; height: 100%; object-fit: cover; transition: scale .8s var(--ease); }
.post-lead-title { font: 300 clamp(34px, 3.8vw, 60px)/1.02 var(--display); letter-spacing: var(--track-tight); text-wrap: balance; }
.post-lead-excerpt { margin-block: clamp(16px, 2vw, 24px); max-width: 52ch; font-size: clamp(17px, 1.25vw, 19px); color: var(--ink-soft); }

.post-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(40px, 4vw, 64px) clamp(20px, 2.4vw, 36px); }
.post-card { position: relative; height: 100%; display: flex; flex-direction: column; gap: 20px; }
.post-card-media { aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--paper); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: scale .8s var(--ease); }
.post-card-title { font: 400 clamp(22px, 1.75vw, 27px)/1.14 var(--display); letter-spacing: var(--track-tight); text-wrap: balance; }
.post-card-excerpt { margin-block: 10px 14px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-body { display: flex; flex-direction: column; flex: 1; }
.post-card-body .post-meta { margin-top: auto; }
@media (hover: hover) {
  .post-card:hover .post-card-media img, .post-lead:hover .post-lead-media img { scale: 1.04; }
  .post-card:hover .post-card-title a, .post-lead:hover .post-lead-title a { color: var(--blue); }
}
.post-card-title a, .post-lead-title a { transition: color .25s; }

.blog-empty { display: grid; justify-items: start; gap: 8px; }

/* ---------- Article page ---------- */
.post-measure { max-width: 720px; margin-inline: auto; }
.post-head { padding-bottom: clamp(32px, 3.6vw, 56px); }
.post-head .crumbs { max-width: 720px; margin-inline: auto; }
/* The title is the h1 just below, so its crumb stays on one line rather than wrapping under a lone slash. */
.post-head .crumbs li:last-child { display: flex; flex: 1 1 0; min-width: 0; }
.post-head .crumbs li:last-child span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.post-title { font: 300 clamp(40px, 5.2vw, 78px)/1 var(--display); letter-spacing: var(--track-tight); text-wrap: balance; }
.post-lede { margin-top: clamp(18px, 2vw, 28px); font: 300 clamp(20px, 1.75vw, 25px)/1.4 var(--display); color: var(--ink-soft); text-wrap: pretty; }
.post-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: clamp(24px, 3vw, 40px); padding-top: 20px; border-top: 1px solid var(--line); }
.post-author { font-weight: 500; }
.post-author a { color: var(--blue); }
.post-author a:hover, .author-card-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-byline .post-meta { flex-basis: 100%; }
.post-byline:has(.post-author) .post-meta { flex-basis: auto; margin-left: auto; }

/* The hero picture and its caption; the credit stays small and quiet but readable. */
.post-hero-figure { margin-block: 0; }
.post-hero-caption { max-width: 1080px; margin: 12px auto 0; font-size: 14.5px; color: var(--ink-soft); text-align: center; }
.credit { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-soft); }
.credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.post-hero picture, .post-lead-media picture, .post-card-media picture { display: contents; }

.post-hero { max-width: 1080px; margin-inline: auto; aspect-ratio: 3 / 2; border-radius: 50% 50% 20px 20px / 22% 22% 20px 20px; overflow: hidden; background: var(--paper); }
.post-hero img { width: 100%; height: 100%; object-fit: cover; }

/* Contents beside the article on wide screens, above it on smaller ones. pages.js marks the section in view. */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr); column-gap: clamp(32px, 4vw, 72px); align-items: start; }
.post-layout > .post-measure { grid-column: 2; max-width: none; margin-inline: 0; }
.post-toc { grid-column: 1; justify-self: end; width: 100%; max-width: 250px; position: sticky; top: calc(var(--head-h) + 24px); margin-top: clamp(40px, 5vw, 72px); }
.post-toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 1.5px solid var(--line); }
.post-toc a { display: block; margin-inline-start: -1.5px; padding: 7px 0; padding-inline-start: 16px; border-inline-start: 1.5px solid transparent; font-size: 15px; line-height: 1.35; color: var(--ink-soft); transition: color .25s, border-color .25s; }
.post-toc a:hover { color: var(--ink); }
.post-toc a[aria-current] { border-color: var(--blue); color: var(--blue); font-weight: 500; }
.post-body :is(h2, h3)[id] { scroll-margin-top: calc(var(--head-h) + 16px); }

/* Stored rich text from the admin editor: style plain elements, not classes. */
.post-body { margin-top: clamp(40px, 5vw, 72px); font-size: clamp(17.5px, 1.2vw, 19px); line-height: 1.75; overflow-wrap: break-word; }
.post-body > * + * { margin-top: 1.15em; }
.post-body :is(h1, h2) { margin-top: 1.9em; font: 400 clamp(28px, 2.5vw, 38px)/1.12 var(--display); letter-spacing: var(--track-tight); text-wrap: balance; }
.post-body h3 { margin-top: 1.6em; font: 500 clamp(21px, 1.6vw, 25px)/1.25 var(--display); }
.post-body h4 { margin-top: 1.4em; font-weight: 600; }
.post-body :is(h1, h2, h3, h4) + * { margin-top: .6em; }
.post-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body :is(ul, ol) { padding-left: 1.3em; }
.post-body li + li { margin-top: .45em; }
.post-body li::marker { color: var(--blue); }
.post-body blockquote { margin-inline: 0; padding-left: 22px; border-left: 3px solid var(--blue); font: 300 clamp(20px, 1.6vw, 24px)/1.45 var(--display); }
.post-body :is(img, video, iframe) { max-width: 100%; height: auto; border-radius: 14px; }
.post-body figure { margin-inline: 0; }
.post-body figcaption { margin-top: 10px; font-size: 14.5px; color: var(--ink-soft); }
.post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .92em; }
.post-body :is(th, td) { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.post-body th { font-weight: 600; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }

.post-foot { display: grid; gap: 32px; margin-block: clamp(48px, 5vw, 80px) clamp(56px, 6vw, 96px); padding-top: 32px; border-top: 1px solid var(--line); }
.post-foot-title { margin-bottom: 12px; font: 600 14.5px/1.3 var(--text); color: var(--ink-soft); }
.post-tags .chips { margin: 0; }
.post-checked { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-soft); }
.post-checked strong { display: block; font-weight: 600; color: var(--ink); }
.post-checked .i { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--blue); }
.post-body picture { display: block; }
.post-body figure img { width: 100%; }

/* List pagination and the trips an article links to. */
.blog-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 28px; margin-top: clamp(48px, 5vw, 80px); }
.blog-pages p { color: var(--ink-soft); }
.post-trips .part-title { margin-bottom: clamp(24px, 3vw, 40px); }
.share { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.share a { display: grid; place-items: center; width: 46px; height: 46px; border: 1.5px solid var(--line); border-radius: 50%; transition: border-color .25s, color .25s, background-color .25s; }
.share a:hover { border-color: var(--blue); background: var(--blue); color: #fff; }
.share .i { width: 18px; height: 18px; }
.author-card { display: flex; align-items: flex-start; gap: clamp(18px, 2.4vw, 28px); padding: clamp(22px, 2.6vw, 32px); border-radius: 18px; background: #fff; }
.author-card .post-foot-title { margin-bottom: 4px; }
.author-card-name { margin-bottom: 8px; font: 400 clamp(22px, 1.8vw, 27px)/1.15 var(--display); }
.author-card p:last-child { color: var(--ink-soft); }

@media (max-width: 1200px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-layout > .post-measure { grid-column: 1; max-width: 720px; margin-inline: auto; width: 100%; }
  .post-toc { grid-column: 1; position: static; justify-self: stretch; max-width: 720px; margin-inline: auto; padding: 20px 22px; border-radius: 16px; background: #fff; }
  .post-toc a { padding-block: 6px; }
}
@media (max-width: 1000px) {
  .post-lead { grid-template-columns: minmax(0, 1fr); }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .blog-intro-head { flex-direction: column; align-items: flex-start; }
  .post-hero { aspect-ratio: 4 / 3; border-radius: 50% 50% 14px 14px / 18% 18% 14px 14px; }
  .post-byline:has(.post-author) .post-meta { flex-basis: 100%; margin-left: 0; }
  .author-card { flex-direction: column; }
}
