/* ==========================================================================
   Caasi : le blog (caasi.app/blog/)
   Chargée après styles.css, dont elle reprend les tokens, l'en-tête, les
   boutons et le pied de page. Les pages sont générées par
   blog/build.mjs : changer CSS_VERSION là-bas à chaque
   modification de ce fichier.
   ========================================================================== */

.blog-main {
  padding: 32px 0 96px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--primary);
}

/* ------------------------------------------------------------- article -- */

.article {
  max-width: 780px;
}

.article h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
}

.article__meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* La réponse directe, en tête : c'est le passage que reprennent les moteurs
   de réponse, et ce que cherche le parent qui arrive de Google. */
.tldr {
  margin: 32px 0 0;
  padding: 22px 26px;
  background: var(--sleep-soft);
  border-radius: var(--radius-card);
}

.tldr__label,
.toc__label {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tldr p:last-child {
  font-size: 1.08rem;
  font-weight: 600;
}

.toc {
  margin: 20px 0 0;
  padding: 20px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.toc ol {
  margin: 0;
  padding-left: 1.3em;
}

.toc li + li {
  margin-top: 4px;
}

.toc a {
  text-decoration: none;
  font-weight: 600;
}

.toc a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------- texte courant -- */

.prose {
  margin-top: 8px;
}

.prose h2 {
  margin: 2.2em 0 0.2em;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  scroll-margin-top: 92px;
}

.prose h3 {
  margin: 1.8em 0 0;
  font-size: 1.2rem;
  scroll-margin-top: 92px;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0.9em 0 0;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose li::marker {
  color: var(--primary);
  font-weight: 700;
}

.prose strong {
  font-weight: 700;
}

.callout {
  margin: 1.4em 0 0;
  padding: 18px 22px;
  background: var(--milk-soft);
  border-radius: 18px;
}

.table-wrap {
  margin: 1.4em 0 0;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
}

.table-wrap th,
.table-wrap td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.table-wrap thead th {
  background: var(--surface);
  font-size: 0.85rem;
  white-space: nowrap;
}

.table-wrap tbody tr:last-child th,
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap tbody th {
  font-weight: 700;
}

/* La ligne mise en avant (nom en gras dans le Markdown) : celle de Caasi
   dans les comparatifs. */
.table-wrap tbody tr:has(th strong),
.table-wrap tbody tr:has(th strong) th:first-child {
  background: var(--sleep-soft);
}

/* Sur mobile, un comparatif large défile : la première colonne (le nom de
   l'application) reste en place pour qu'on sache quelle ligne on lit. */
@media (max-width: 620px) {
  .table-wrap th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 128px;
    box-shadow: 1px 0 0 var(--line);
  }

  .table-wrap tbody th:first-child {
    background: var(--card);
  }
}

.article__note {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* --------------------------------------------------------- encart Caasi -- */

.cta-card {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 48px 0 0;
  padding: 30px 34px;
  color: var(--sky-ink);
  background: var(--sky);
  border-radius: 28px;
}

.cta-card img {
  flex: none;
  width: 140px;
  height: 140px;
  filter: var(--shadow-sticker);
}

.cta-card p {
  margin: 0;
  color: var(--sky-text);
}

.cta-card .cta-card__title {
  margin-bottom: 6px;
  color: var(--sky-ink);
  font-size: 1.35rem;
  font-weight: 700;
}

.cta-card .btn-chunky {
  margin-top: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 0 #c9bff2, 0 22px 36px -16px rgba(8, 4, 30, 0.7);
}

.cta-card .btn-chunky:hover {
  box-shadow: 0 1px 0 #c9bff2, 0 14px 24px -16px rgba(8, 4, 30, 0.6);
}

.cta-card :focus-visible {
  outline-color: var(--gold);
}

@media (max-width: 620px) {
  .cta-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 26px 22px;
  }

  .cta-card img {
    width: 96px;
    height: 96px;
  }
}

/* ----------------------------------------------------------------- cartes -- */

.blog-head {
  max-width: 780px;
}

.blog-head h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
}

.related {
  margin-top: 80px;
}

.related h2 {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
}

.cards--list {
  margin-top: 44px;
}
