/* ═══════════════════════════════════════════════════════════════
   JANAA — BLOG
   Layout : listing + article page
   ═══════════════════════════════════════════════════════════════ */

/* ── BLOG HERO ───────────────────────────────────────────────── */
.blog-hero {
  padding: clamp(6rem, 10vw, 8rem) 0 clamp(2rem, 4vw, 3rem);
  background: var(--color-ink-50);
  border-bottom: 1px solid var(--line);
}

.blog-hero .breadcrumb {
  display: flex;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  margin-bottom: var(--s-4);
}
.blog-hero .breadcrumb a {
  color: var(--fg-muted);
  text-decoration: none;
}
.blog-hero .breadcrumb a:hover { color: var(--fg); }

.blog-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tighter);
  color: var(--fg);
  margin: var(--s-4) 0 var(--s-6);
  max-width: 18ch;
}

.blog-hero__lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg-muted);
  max-width: 60ch;
  margin-bottom: var(--s-6);
}

.blog-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}

/* ── FILTRES ─────────────────────────────────────────────────── */
.blog-filters {
  padding: var(--s-6) 0 var(--s-4);
  background: var(--color-ink-50);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  background-color: color-mix(in srgb, var(--color-ink-50) 92%, transparent);
}

.blog-filters__inner {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: var(--s-2);
}
.blog-filters__inner::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--dur-quick) var(--ease-out-soft);
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--fg);
  color: var(--fg);
}
.filter-chip.is-active {
  background: var(--fg);
  color: var(--fg-on-deep);
  border-color: var(--fg);
}

/* ── GRID ARTICLES ───────────────────────────────────────────── */
.blog-grid-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--color-ink-50);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.blog-card {
  background: var(--bg-elevated);
  border-radius: var(--r-6);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform var(--dur-base) var(--ease-out-soft),
              box-shadow var(--dur-base) var(--ease-out-soft);
  cursor: pointer;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.blog-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-ink-100);
}
.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out-soft);
}
.blog-card:hover .blog-card__media img {
  transform: scale(1.04);
}

.blog-card__cat {
  position: absolute;
  bottom: var(--s-4);
  left: var(--s-4);
  padding: 0.375rem 0.75rem;
  background: color-mix(in srgb, var(--color-ink-900) 88%, transparent);
  color: var(--fg-on-deep);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.blog-card__body {
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.blog-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  color: var(--fg);
  margin: 0;
}

.blog-card__excerpt {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--fg-muted);
  margin: 0;
}

.blog-card__meta {
  display: flex;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--fg-subtle);
  margin-top: var(--s-2);
}

/* ── CTA NEWSLETTER ──────────────────────────────────────────── */
.blog-cta {
  padding: clamp(4rem, 7vw, 6rem) 0;
  background: var(--bg-elevated);
}

.blog-cta__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 4vw, 3rem);
  background: var(--color-ink-900);
  color: var(--fg-on-deep);
  border-radius: var(--r-8);
}
.blog-cta__inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--s-3);
}
.blog-cta__inner p {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: color-mix(in srgb, var(--fg-on-deep) 70%, transparent);
  margin: 0;
}

.blog-cta__form {
  display: flex;
  gap: var(--s-2);
}
.blog-cta__form input {
  flex: 1;
  padding: 0.875rem 1rem;
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, #fff 16%, transparent);
  background: color-mix(in srgb, #fff 8%, transparent);
  color: var(--fg-on-deep);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color var(--dur-quick);
}
.blog-cta__form input::placeholder {
  color: color-mix(in srgb, var(--fg-on-deep) 50%, transparent);
}
.blog-cta__form input:focus {
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .blog-cta__inner {
    grid-template-columns: 1fr;
  }
  .blog-cta__form {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ARTICLE PAGE
   ═══════════════════════════════════════════════════════════════ */

.article-hero {
  padding: clamp(6rem, 10vw, 8rem) 0 clamp(2rem, 4vw, 3rem);
  background: var(--color-ink-50);
  border-bottom: 1px solid var(--line);
}

.article-hero .breadcrumb {
  display: flex;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.article-hero .breadcrumb a { color: var(--fg-muted); text-decoration: none; }
.article-hero .breadcrumb a:hover { color: var(--fg); }

.article-cat {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: var(--fg);
  color: var(--fg-on-deep);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--s-4);
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4vw + 0.5rem, 3.75rem);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tighter);
  color: var(--fg);
  margin: 0 0 var(--s-6);
  max-width: 22ch;
}

.article-lead {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1.5vw + 0.5rem, 1.5rem);
  font-weight: 500;
  line-height: var(--lh-relaxed);
  color: var(--fg-muted);
  max-width: 65ch;
  margin-bottom: var(--s-6);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.article-meta__sep { color: var(--fg-subtle); }

.article-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-6);
  background: var(--color-ink-100);
  margin: clamp(2rem, 4vw, 3rem) 0;
}
.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(4rem, 7vw, 6rem);
  background: var(--bg-elevated);
}

.article-prose {
  max-width: 70ch;
  margin: 0 auto;
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg);
}
.article-prose > * + * { margin-top: var(--s-6); }
.article-prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.25rem);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  color: var(--fg);
  margin-top: var(--s-12);
  scroll-margin-top: 100px;
}
.article-prose h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--fg);
  margin-top: var(--s-8);
}
.article-prose p {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg);
}
.article-prose ul,
.article-prose ol {
  padding-left: 1.5rem;
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
}
.article-prose li { margin-bottom: var(--s-2); }
.article-prose li::marker { color: var(--accent); }
.article-prose strong { font-weight: 600; color: var(--fg); }
.article-prose a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.article-prose a:hover { color: var(--accent); }

.article-prose blockquote {
  padding: var(--s-6);
  background: var(--color-ink-100);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-4);
  font-style: normal;
  font-size: var(--fs-lg);
  color: var(--fg);
}
.article-prose blockquote p:first-child { margin-top: 0; }
.article-prose blockquote p:last-child { margin-bottom: 0; }

.article-callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4);
  padding: var(--s-6);
  background: var(--color-vert-50);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-4);
  margin: var(--s-8) 0;
}
.article-callout__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  border-radius: var(--r-pill);
}
.article-callout__title {
  font-weight: 700;
  font-size: var(--fs-base);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: var(--s-2);
}
.article-callout p { margin: 0; font-size: var(--fs-base); }

.article-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
  margin: var(--s-6) 0;
}
.article-prose table th,
.article-prose table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.article-prose table th {
  font-weight: 600;
  background: var(--color-ink-100);
  color: var(--fg);
}
.article-prose table tr:last-child td { border-bottom: none; }

/* ── ARTICLE PRODUCT CARD ────────────────────────────────────── */
.article-product {
  max-width: 70ch;
  margin: var(--s-12) auto 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-6);
  padding: var(--s-6);
  background: var(--color-ink-50);
  border-radius: var(--r-6);
  border: 1px solid var(--line-strong);
  align-items: center;
}
.article-product__img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--r-3);
  background: var(--color-ink-100);
}
.article-product__text h4 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin: 0 0 var(--s-1);
  color: var(--fg);
}
.article-product__text p {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  margin: 0;
}

@media (max-width: 640px) {
  .article-product {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .article-product__img { margin: 0 auto; }
}

/* ── ARTICLES SUIVANTS ───────────────────────────────────────── */
.article-related {
  padding: clamp(4rem, 7vw, 6rem) 0;
  background: var(--color-ink-50);
  border-top: 1px solid var(--line);
}
.article-related h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.25rem);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--s-8);
  color: var(--fg);
}
.article-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--s-6);
}

/* ── ANCHOR TOC ──────────────────────────────────────────────── */
.article-toc {
  background: var(--color-ink-100);
  border-radius: var(--r-4);
  padding: var(--s-6);
  margin: var(--s-8) 0;
}
.article-toc__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--s-3);
}
.article-toc ol {
  list-style: none;
  padding-left: 0;
  counter-reset: toc;
  font-size: var(--fs-base);
}
.article-toc li {
  counter-increment: toc;
  margin-bottom: var(--s-2);
}
.article-toc li::before {
  content: counter(toc, decimal-leading-zero) ".";
  display: inline-block;
  width: 2.5rem;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.article-toc a {
  color: var(--fg);
  text-decoration: none;
  transition: color var(--dur-quick);
}
.article-toc a:hover { color: var(--accent-deep); }

/* ── Colonne de contenu : même largeur que .article-prose ────────────
   `70ch` dépend de la taille de police de l'ÉLÉMENT. .article-prose est
   en --fs-lg (18 px) et fait donc ~795 px, alors qu'un bloc frère laissé
   à 16 px n'en fait que ~707 : 44 px de décalage visible sous le texte.
   On rétablit la même base, sans toucher aux tailles internes des blocs. */
.article-column {
  max-width: 70ch;
  font-size: var(--fs-lg);
  margin-left: auto;
  margin-right: auto;
  margin-top: var(--s-8);
}

/* ── Figure dans le corps de texte ───────────────────────────────────
   Placée en enfant direct de .article-prose : elle hérite donc de la
   largeur de colonne et de l'espacement du texte, sans règle en double. */
.prose-figure { margin-top: var(--s-10); }
.prose-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r-4);
}
.prose-figure figcaption {
  margin-top: var(--s-3);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--fg-muted);
}

/* Photo en orientation portrait : à pleine largeur de colonne elle dépasse
   la hauteur d'un écran (1059 px mesurés pour 795 px de large). On la borne
   en largeur, ce qui la ramène à une hauteur lisible sans la recadrer. */
.prose-figure--portrait img {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* Visuel technique sur fond noir (comparatif d'armature) : deux défauts à
   éviter. Le filet clair de .prose-figure dessine un cadre visible autour
   d'une image sombre, et à pleine largeur de colonne les barres qui sortent
   du cadre donnent l'impression d'une image mal recadrée. On le présente
   donc en encart : plus étroit, centré, sans filet. */
.prose-figure--encart img {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  border: 0;
}

/* Une légende plus large que son image flotte dans le vide : on la cale
   sur la largeur du visuel qu'elle décrit. */
.prose-figure--encart figcaption { max-width: 520px; margin-left: auto; margin-right: auto; }
.prose-figure--portrait figcaption { max-width: 460px; margin-left: auto; margin-right: auto; }

/* Format intermédiaire : un schéma n'a pas besoin de toute la colonne, et
   quatre visuels de même largeur d'affilée donnent un empilement monotone. */
.prose-figure--moyen img,
.prose-figure--moyen figcaption { max-width: 620px; margin-left: auto; margin-right: auto; }

/* ── Tableau : il défile, il n'élargit pas la page ────────────────────
   Un tableau plus large que l'écran fait grandir la fenêtre de mise en page
   du navigateur, et tout le reste part avec — y compris le burger, qui se
   retrouve hors écran et devient inatteignable. Mesuré à 320 px sur
   connecteurs-etanches : tableau 391 px, page élargie à 411 px, burger à x=344. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
}
.table-scroll table { min-width: 26rem; }
.table-scroll:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }
