/* BienVu, le blog.
 *
 * Linked from the head of /blog and /blog/<slug>, after the tokens and base rules of
 * styles.css have been defined but BEFORE styles.css itself in the page: the head slot
 * of Base.astro comes first. Every rule therefore starts from `.blog`, so it outweighs
 * the site rule of the same kind whatever the order. Accessibility helpers such as
 * .sr-only live in styles.css and are not redefined here.
 */

.blog { padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 104px); }

/* ── The list ──────────────────────────────────────────────────────────── */
.blog .blog-head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 48px); }
.blog .blog-head h1 { font-size: var(--step-3); margin-bottom: 14px; }

.blog .blog-empty {
  max-width: 62ch; margin: 0; padding: 24px 26px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--muted); font-size: var(--step-1);
}

.blog .blog-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(20px, 3vw, 30px); }
@media (min-width: 700px) { .blog .blog-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .blog .blog-cards { grid-template-columns: repeat(3, 1fr); } }

.blog .blog-card { display: flex; }
.blog .blog-card-link {
  display: flex; flex-direction: column; width: 100%; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--ink); text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.blog .blog-card-link:hover {
  color: var(--ink); border-color: var(--brand);
  box-shadow: 0 18px 40px -28px rgba(31, 27, 22, 0.45);
}
.blog .blog-card-link:focus-visible { border-radius: var(--radius-lg); }

.blog .blog-card-media { display: block; aspect-ratio: 16 / 10; background: var(--card); }
.blog .blog-card-media img { width: 100%; height: 100%; object-fit: cover; }
.blog .blog-card-placeholder {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-family: var(--serif); font-size: 30px; color: var(--brand); opacity: 0.5;
}

.blog .blog-card-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 24px; }
.blog .blog-card-date { font-size: 13px; color: var(--faint); }
.blog .blog-card-title { margin: 0; font-size: var(--step-2); line-height: 1.15; }
.blog .blog-card-excerpt { color: var(--muted); font-size: 15px; line-height: 1.55; }
.blog .blog-card-more { margin-top: auto; padding-top: 6px; font-size: 14.5px; font-weight: 600; color: var(--brand-dark); }

.blog .blog-pager { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(32px, 5vw, 48px); }
.blog .blog-pager .blog-pager-next { margin-left: auto; }

/* ── The article ───────────────────────────────────────────────────────── */
.blog.blog-article { max-width: calc(76ch + 2 * var(--gutter)); }

.blog .blog-preview-note {
  margin: 0 0 24px; padding: 12px 16px;
  border: 1.5px dashed var(--brand); border-radius: var(--radius);
  background: var(--brand-soft); color: var(--brand-dark); font-size: 14.5px;
}

.blog .blog-back { margin: 0 0 28px; font-size: 14.5px; }
.blog .blog-back a { font-weight: 500; text-decoration: none; }
.blog .blog-back a:hover { text-decoration: underline; }

.blog .blog-article-head { margin-bottom: clamp(24px, 4vw, 36px); }
.blog .blog-article-date { margin: 0 0 14px; font-size: 13.5px; color: var(--faint); }
.blog .blog-article-head h1 { font-size: var(--step-3); line-height: 1.12; }
.blog .blog-article-excerpt { margin: 18px 0 0; }

.blog .blog-article-figure { margin: 0 0 clamp(28px, 4vw, 40px); }
.blog .blog-article-figure img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
}

/* The body: HTML cleaned by the server (paragraphs, h2 to h4, lists, quotations,
   links, rules). */
.blog .blog-prose { font-size: 17px; line-height: 1.75; color: var(--ink); }
.blog .blog-prose > :first-child { margin-top: 0; }
.blog .blog-prose p { margin: 0 0 1.15em; }
.blog .blog-prose h2 { margin: 1.8em 0 0.6em; font-family: var(--serif); font-size: var(--step-2); line-height: 1.2; }
.blog .blog-prose h3 { margin: 1.6em 0 0.5em; font-family: var(--sans); font-size: var(--step-1); font-weight: 600; line-height: 1.35; }
.blog .blog-prose h4 { margin: 1.4em 0 0.4em; font-family: var(--sans); font-size: 17px; font-weight: 600; line-height: 1.4; }
.blog .blog-prose ul, .blog .blog-prose ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.blog .blog-prose li { margin-bottom: 0.45em; }
.blog .blog-prose li::marker { color: var(--brand-dark); }
.blog .blog-prose li > p { margin-bottom: 0.45em; }
.blog .blog-prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--brand);
  font-family: var(--serif); font-size: var(--step-1); line-height: 1.5;
}
.blog .blog-prose blockquote p:last-child { margin-bottom: 0; }
.blog .blog-prose a { color: var(--brand-dark); text-decoration: underline; }
.blog .blog-prose a:hover { color: var(--brand); }
.blog .blog-prose strong, .blog .blog-prose b { font-weight: 600; }
.blog .blog-prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }

/* ── The closing block of an article ──────────────────────────────────── */
.blog .blog-cta {
  margin-top: clamp(40px, 6vw, 64px); padding: clamp(24px, 4vw, 36px);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.blog .blog-cta h2 { margin-bottom: 10px; font-size: var(--step-2); }
.blog .blog-cta p { max-width: 56ch; margin: 0 0 20px; color: var(--muted); }
