/* Blog list and article pages (templates/site/blog.html, templates/site/post.html).
   Each article uses the icon and color of its test (from static/js/registry.js) instead of a photo.
   The article cards themselves (.post-card) are in site.css, the home page uses them too. */

/* ---------- blog list ---------- */
.bl-hero { padding-bottom: 130px; }
.bl-body { padding-top: 0; }
/* the newest article: a large card that sits over the bottom of the blue hero */
.bl-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  margin-top: -84px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.bl-feature .post-art { aspect-ratio: auto; min-height: 340px; }
.bl-feature .post-art .tile { width: 108px; height: 108px; border-radius: 30px; }
.bl-feature .post-art .tile .ic { width: 56px; height: 56px; }
.bl-feature:hover .post-art .tile { transform: scale(1.06) rotate(-3deg); }
.bl-feature-text { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; padding: 44px; }
.bl-title { color: var(--ink); font: 600 clamp(25px, 2.8vw, 34px)/1.2 var(--font-head); letter-spacing: -0.015em; }
.bl-feature:hover .bl-title { color: var(--blue); }
.bl-feature .post-desc { font-size: 17px; max-width: 46ch; }
.bl-feature .post-meta { margin-top: 0; padding-top: 0; }
.bl-read { margin-top: 8px; color: var(--blue); font: 600 15.5px/1.4 var(--font-head); }
.bl-read::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-start: 9px; border: solid currentColor; border-width: 2px 2px 0 0; transform: translateY(-2px) rotate(45deg); transition: transform 0.2s; }
.bl-feature:hover .bl-read::after { transform: translate(3px, -2px) rotate(45deg); }
/* the other articles: as many columns as fit, so two articles fill the row */
/* the other articles: 3 in a row (2 on tablets, 1 on phones). From page 2 they sit over the hero like the large card. */
.bl-body .wrap > .bl-list:first-child { margin-top: -84px; }
.bl-body .wrap > .bl-list:first-child .post-card { box-shadow: var(--shadow-card); }
/* page numbers under the articles */
.bl-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 44px; }
.bl-pages a, .bl-pages span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 12px; color: var(--ink); font: 500 15px/1 var(--font-head); text-decoration: none; }
.bl-pages a { border: 1px solid var(--line-2); background: var(--card); transition: border-color 0.2s, color 0.2s; }
.bl-pages a:hover { border-color: var(--blue-line); color: var(--blue); }
.bl-pages a[aria-current="page"] { border-color: transparent; background: var(--grad); color: #fff; }
.bl-pages span { color: var(--muted-2); }
/* the numbers (routes.py page_numbers): up to 9 on wide screens, up to 7 on phones (.is-wide / .is-narrow), always in one row */
.bl-nums { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bl-pages .is-narrow { display: none; }
.bl-list .post-art { aspect-ratio: auto; height: clamp(170px, 18vw, 230px); }
.bl-empty { padding: 40px; color: var(--text); font-size: 17px; text-align: center; }
/* a category with no articles yet: the message sits over the hero like the cards */
.bl-body .wrap > .bl-empty:first-child { position: relative; margin-top: -84px; box-shadow: var(--shadow-card); }

/* ---------- article page ---------- */
.ps-wrap { width: min(780px, 100% - var(--gutter) * 2); }
.ps-hero { padding-bottom: 76px; }
.ps-hero h1 { max-width: 24ch; font-size: clamp(31px, 4.4vw, 48px); }
.ps-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; color: rgba(255, 255, 255, 0.78); font-size: 14.5px; }
.ps-meta .tile { width: 38px; height: 38px; border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.14); }
.ps-meta .tile .ic { width: 20px; height: 20px; }
.ps-meta .post-tag { background: rgba(255, 255, 255, 0.14); color: #fff; }
.ps-meta a.post-tag { text-decoration: none; transition: background-color 0.15s; }
.ps-meta a.post-tag:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }
.ps-author { display: inline-flex; align-items: center; gap: 10px; margin-inline-end: 4px; color: #fff; }
.ps-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24); font: 700 14px/1 var(--font-head); letter-spacing: 0.03em; }
.ps-author b { display: block; font-weight: 650; line-height: 1.25; }
.ps-author small { display: block; color: rgba(255, 255, 255, 0.78); font-size: 12.5px; line-height: 1.35; }
.ps-body { padding: 64px 0 96px; background: var(--bg); }
/* the article's own cover picture sits over the bottom of the blue hero */
.ps-hero.has-cover { padding-bottom: 166px; }
.ps-cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; margin: -154px 0 48px; object-fit: cover; border-radius: var(--r-lg); background: var(--bg-alt); box-shadow: var(--shadow-card); }

.prose { color: var(--text); font-size: 18px; line-height: 1.8; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { position: relative; margin-top: 2.1em; padding-top: 18px; font-size: clamp(23px, 2.6vw, 28px); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.prose h2::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 40px; height: 4px; border-radius: 4px; background: var(--grad); }
.prose h3 { margin-top: 1.7em; font-size: 20px; font-weight: 600; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--blue); font-weight: 700; }
.prose a { text-underline-offset: 3px; }
.prose code { padding: 2px 6px; border-radius: 6px; background: var(--bg-alt); color: var(--ink); font-family: var(--mono); font-size: 0.86em; }
.prose kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font: 600 0.82em/1.5 var(--font-head);
  text-align: center;
}

/* "Try it now" box at the end, in the color of the article's test */
.ps-try {
  --tile: #47c6e8;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px 22px;
  margin-top: 52px;
  padding: 28px 30px;
  border-color: color-mix(in oklab, var(--tile) 30%, var(--line));
  background: linear-gradient(120deg, color-mix(in oklab, var(--tile) 12%, var(--card)), var(--card) 70%);
}
.ps-try .tile { width: 58px; height: 58px; border-radius: 17px; }
.ps-try .tile .ic { width: 30px; height: 30px; }
.ps-try h2 { font-size: 21px; font-weight: 600; }
.ps-try p { margin-top: 4px; color: var(--text); }

@media (max-width: 991px) {
  .bl-feature { grid-template-columns: 1fr; }
  .bl-feature .post-art { min-height: 0; aspect-ratio: 16 / 8; }
  .bl-feature-text { padding: 30px 28px 34px; }
}
@media (max-width: 767px) {
  /* the page numbers get their own row, Previous and Next go under them */
  .bl-nums { flex: 1 1 100%; }
  .bl-pages .bl-step { order: 2; }
}
@media (max-width: 575px) {
  .bl-hero { padding-bottom: 110px; }
  .bl-feature, .bl-body .wrap > .bl-list:first-child, .bl-body .wrap > .bl-empty:first-child { margin-top: -72px; }
  .bl-pages .bl-step { flex: 1 1 100%; order: 2; }
  .bl-nums { flex: 1 1 100%; flex-wrap: nowrap; gap: 6px; }
  .bl-pages .is-wide { display: none; }
  .bl-pages .is-narrow { display: grid; }
  .bl-pages .bl-nums a, .bl-pages .bl-nums span { flex: 0 1 44px; min-width: 0; padding: 0; }
  .bl-feature-text { padding: 24px 20px 28px; }
  .bl-list { grid-template-columns: 1fr; }
  .bl-list .post-art { height: 150px; }
  .ps-body { padding: 44px 0 64px; }
  .ps-hero.has-cover { padding-bottom: 124px; }
  .ps-cover { margin: -124px 0 32px; border-radius: var(--r-md); }
  .prose { font-size: 17px; }
  .ps-try { grid-template-columns: auto 1fr; padding: 22px 20px; }
  .ps-try .btn { grid-column: 1 / -1; }
}
