/* ============================================================
   Blog — the catalog (blog.html) and the article template
   (blog-<slug>.html). Shared rather than page-local, because every
   article reuses it; tokens come from colors_and_type.css.
   ============================================================ */

/* ---------- catalog ---------------------------------------- */
.blog-list { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

.blog-card {
  display: grid; grid-template-columns: minmax(0, 360px) 1fr;
  background: var(--orca-white); border: 1px solid var(--app-line);
  border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: inherit;
  transition: box-shadow var(--dur-base) var(--ease-serene),
              transform var(--dur-base) var(--ease-serene),
              border-color var(--dur-base) var(--ease-serene);
}
/* The card lifts from the wrapper, so the copy button rides along with it. */
.blog-item { position: relative; transition: transform var(--dur-base) var(--ease-serene); }
.blog-item:hover { transform: translateY(-2px); }
.blog-item:hover .blog-card { box-shadow: var(--shadow-float); border-color: var(--app-line-strong); }

/* Copy link. A sibling of the card, never nested: a button cannot legally
   live inside an anchor. Opaque, because on a narrow screen it sits over the
   thumbnail rather than the white body. */
.blog-copy {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 32px; height: 32px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--orca-white); border: 1px solid var(--app-line);
  color: var(--app-ink-3); cursor: pointer; padding: 0;
  transition: color var(--dur-base) var(--ease-serene),
              border-color var(--dur-base) var(--ease-serene);
}
.blog-copy:hover { color: var(--app-ink); border-color: var(--app-line-strong); }
.blog-copy.is-copied { color: var(--accent-cyan); border-color: var(--accent-cyan); }
.blog-card__shot { position: relative; min-height: 210px; background: var(--orca-depth); overflow: hidden; }
.blog-card__shot img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s var(--ease-serene); }
.blog-item:hover .blog-card__shot img { transform: scale(1.04); }
.blog-card__body { padding: 24px 26px; display: flex; flex-direction: column; gap: 9px; }
.blog-card__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  color: var(--app-slate-icon); letter-spacing: .04em; text-transform: uppercase; }
.blog-card__meta .dot { width: 3px; height: 3px; border-radius: 999px; background: var(--app-line-strong); }
.blog-card__title { font-family: var(--font-display); font-size: clamp(18px,2vw,21px);
  font-weight: 700; line-height: 1.25; color: var(--app-ink); }
/* Clamped so every card in a row is the same height. The thumbnail is a grid
   cell, so a taller body stretches it, and object-fit then crops the artwork
   harder on that one card than on its neighbours. */
.blog-card__excerpt { font-size: 14px; color: var(--app-ink-2); line-height: 1.55; margin: 2px 0 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; }
.blog-card--lead .blog-card__excerpt { -webkit-line-clamp: 3; line-clamp: 3; }
.blog-card__go { margin-top: 6px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--accent-cyan); }
.blog-item:hover .blog-card__go svg { transform: translateX(4px); }
.blog-card__go svg { transition: transform var(--dur-base) var(--ease-serene); }

/* the featured card leads with a wider image */
.blog-card--lead { grid-template-columns: minmax(0, 520px) 1fr; }
.blog-card--lead .blog-card__shot { min-height: 300px; }
.blog-card--lead .blog-card__title { font-size: clamp(22px,2.6vw,28px); }

/* most popular — three across */
.blog-pop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1000px; margin: 0 auto; }
.blog-pop .blog-card { grid-template-columns: 1fr; }
.blog-pop .blog-card__shot { min-height: 168px; }
.blog-pop .blog-card__body { padding: 20px 22px; }
.blog-pop .blog-card__title { font-size: 17px; }

@media (max-width: 900px) {
  .blog-card, .blog-card--lead { grid-template-columns: 1fr; }
  .blog-pop { grid-template-columns: 1fr; }
  /* Stacked, the thumbnail is a row of its own, so it can hold its true 16:9
     and crop nothing. Left on min-height the lead card lost 19% of each side. */
  .blog-card__shot, .blog-card--lead .blog-card__shot { min-height: 0; aspect-ratio: 16 / 9; }
}

/* ---------- article ---------------------------------------- */
.post__wrap { max-width: 1140px; padding-top: 30px; padding-bottom: 80px; }

.post__crumbs { display: flex; align-items: center; gap: 9px; font-size: 12.5px;
  color: var(--app-ink-3); margin-bottom: 22px; }
.post__crumbs a { color: var(--app-ink-2); text-decoration: none; font-weight: 600; }
.post__crumbs a:hover { color: var(--accent-cyan); }
.post__crumb-sep { color: var(--app-line-strong); }

.post__layout { display: grid; grid-template-columns: 282px minmax(0, 1fr); gap: 52px; align-items: start; }

/* left rail sticks under the nav; --announce-h keeps it clear of the
   announcement bar when one is running (see chrome.js). */
.post__rail { position: sticky; top: calc(84px + var(--announce-h)); display: flex;
  flex-direction: column; gap: 22px; }

.post__cta { padding: 22px; border: 1px solid var(--app-line); border-radius: var(--radius-lg);
  background: var(--app-surface-sunken); }
.post__cta-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--app-ink); }
.post__cta-list { list-style: none; margin: 14px 0 18px; padding: 0; display: flex;
  flex-direction: column; gap: 9px; }
.post__cta-list li { position: relative; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--app-ink-2); }
.post__cta-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px;
  border-radius: 999px; background: var(--accent-cyan); }

.post__toc-cap { font-size: 11.5px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: #546c93; margin-bottom: 12px; }
.post__toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--app-line); }
.post__toc a { display: block; padding: 7px 0 7px 14px; margin-left: -1px;
  border-left: 2px solid transparent; font-size: 13px; line-height: 1.45;
  color: var(--app-ink-2); text-decoration: none;
  transition: color var(--dur-base) var(--ease-serene), border-color var(--dur-base) var(--ease-serene); }
.post__toc a:hover { color: var(--app-ink); }
.post__toc a.is-active { color: var(--app-ink); font-weight: 600; border-left-color: var(--accent-cyan); }

/* ---------- article body ----------------------------------- */
.post__series { font-size: 11.5px; font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--accent-cyan); margin-bottom: 12px; }

.post__meta { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600;
  color: var(--app-slate-icon); letter-spacing: .04em; text-transform: uppercase; }
.post__meta .dot { width: 3px; height: 3px; border-radius: 999px; background: var(--app-line-strong); }
.post__title { font-family: var(--font-display); font-weight: var(--weight-bold);
  font-size: clamp(28px,3.4vw,42px); line-height: 1.15; color: var(--app-ink); margin: 14px 0 0; }
.post__standfirst { font-size: 17px; line-height: 1.6; color: var(--app-ink-2); margin: 16px 0 0; max-width: 62ch; }

.post__hero { margin: 30px 0 0; }
.post__hero img { width: 100%; height: auto; display: block; border-radius: var(--radius-lg);
  border: 1px solid var(--app-line); }

/* Prose: the only place on the site where bare tags are styled, since an
   article body is written as plain HTML by whoever is authoring it. */
.post__body { margin-top: 34px; max-width: 68ch; }
.post__body p { font-size: 16px; line-height: 1.72; color: var(--app-ink); margin: 0 0 20px; }
.post__body h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(20px,2.2vw,26px);
  line-height: 1.25; color: var(--app-ink); margin: 40px 0 14px;
  scroll-margin-top: calc(96px + var(--announce-h)); }
.post__body h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: var(--app-ink); margin: 28px 0 10px; scroll-margin-top: calc(96px + var(--announce-h)); }
.post__body ul, .post__body ol { margin: 0 0 20px; padding-left: 22px; }
.post__body li { font-size: 16px; line-height: 1.7; color: var(--app-ink); margin-bottom: 8px; }
.post__body a, .post__standfirst a { color: var(--accent-cyan); }
.post__body em { font-style: italic; }
.post__body strong { font-weight: var(--weight-bold); }
.post__body figure { margin: 30px 0; }
.post__body img { width: 100%; height: auto; display: block; border-radius: var(--radius-md);
  border: 1px solid var(--app-line); }
.post__body figcaption { margin-top: 10px; font-size: 13px; color: var(--app-ink-3); }
.post__body blockquote { margin: 30px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent-cyan); }
.post__body blockquote p { font-size: 18px; line-height: 1.6; color: var(--app-ink); margin: 0; }

.post__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--app-line); }
.post__back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--app-ink-2); text-decoration: none; }
.post__back svg { transform: rotate(180deg); }
.post__back:hover { color: var(--accent-cyan); }

/* Closing line and source note: the sign-off of an article, set apart from the
   argument above it. */
.post__kicker { margin-top: 34px; padding: 18px 20px; border-radius: var(--radius-md);
  background: var(--app-surface-sunken); border: 1px solid var(--app-line); }
.post__kicker strong { font-weight: var(--weight-semibold); }
.post__body .post__sources { margin-top: 22px; font-size: 12.5px; line-height: 1.6; color: var(--app-ink-3); }

/* Keep reading: suggestions under the article, built by blog.js. Rows with
   a small thumbnail by default, since beside the rail the column is narrow;
   three across once it is wide enough for cards to breathe. */
.post-next { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--app-line); }
.post-next__cap { font-family: var(--font-display); font-weight: 700; font-size: 20px;
  color: var(--app-ink); margin: 0 0 16px; }
.post-next__grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.post-next .blog-item { height: 100%; }
.post-next .blog-card { grid-template-columns: 184px minmax(0, 1fr); height: 100%; }
/* The thumbnails carry their title as artwork, so they are shown whole at
   16:9, inset, rather than cropped to fill the row's height. */
.post-next .blog-card__shot { min-height: 0; aspect-ratio: 16 / 9; align-self: center;
  margin: 12px 0 12px 12px; border-radius: var(--radius-md); }
.post-next .blog-card__body { padding: 14px 52px 14px 18px; gap: 6px; }
.post-next .blog-card__meta { font-size: 11px; }
.post-next .blog-card__title { font-size: 15.5px; }
.post-next .blog-card__excerpt { font-size: 13px; }
.post-next .blog-card__go { margin-top: auto; padding-top: 4px; }
.post-next .blog-copy { width: 28px; height: 28px; top: 10px; right: 10px; }
@media (min-width: 1240px) {
  .post-next__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .post-next .blog-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .post-next .blog-card__shot { margin: 0; border-radius: 0; align-self: stretch; }
  .post-next .blog-card__body { padding: 16px 18px; }
}
@media (max-width: 560px) {
  .post-next .blog-card { grid-template-columns: 1fr; }
  .post-next .blog-card__shot { margin: 0; border-radius: 0; }
  .post-next .blog-card__body { padding: 16px 18px; }
}
/* The foot follows the suggestions, so it needs its own breathing room. */
.post-next + .post__foot { margin-top: 32px; }

/* Narrow: the rail stops sticking and the index collapses above the article,
   so the reader is not scrolling past a column of links to reach the text. */
@media (max-width: 900px) {
  .post__layout { grid-template-columns: 1fr; gap: 28px; }
  .post__rail { position: static; }
  .post__toc { display: none; }
  .post__body, .post__standfirst { max-width: none; }
}
