/* ============================================================
   Kalexex — Blog (v2.5.0)
   Reutilise les variables de theme de css/style.css.
   ============================================================ */

/* ── Texture fond blog (v2.8.35, retour a structure 3 couches) ──
   v2.8.34 (blotches + fibres) jugee trop chargee. Retour a 3 couches sobres
   (= structure v2.8.33) mais grain bumpe (.085 -> .14) et halo bumpe (.07 -> .08)
   pour rester un cran au-dessus du subtil initial. Aucune blotches/fibres. */
body {
  background-color: #1a0d09;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212,165,116,0.035), transparent 58%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.65 0 0 0 0 0.42 0 0 0 0.14 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, #1f110b 0%, #18100a 50%, #130c08 100%);
  background-repeat: no-repeat, repeat, no-repeat;
  background-attachment: fixed;
  background-size: auto, 220px 220px, auto;
  min-height: 100vh;
}

.blog-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ── En-tete de liste ── */
.blog-header { margin-bottom: 20px; }
.blog-header h1 {
  font-size: 30px;
  color: var(--gold);
  margin: 0 0 8px;
}
.blog-intro {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}
.blog-intro:empty { display: none; }

/* ── Navigation par categorie (chips) ── */
.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.blog-cats a {
  padding: 5px 13px;
  border-radius: 14px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-dim);
  background: rgba(212,165,116, 0.08);
  border: 1px solid rgba(212,165,116, 0.2);
  transition: background .2s, color .2s, border-color .2s;
}
.blog-cats a:hover { color: var(--gold); border-color: rgba(212,165,116, 0.45); }
.blog-cats a.active {
  color: #fff;
  background: rgba(212,165,116, 0.28);
  border-color: rgba(212,165,116, 0.55);
}

/* ── Liste des articles ── */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.blog-loading, .blog-empty {
  grid-column: 1 / -1;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
  padding: 30px 0;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212,165,116, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.blog-card-link { text-decoration: none; color: inherit; display: block; }
.blog-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-card-hover);
}
.blog-card-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  opacity: 0.35;
}
.blog-card-body { padding: 14px 16px 18px; }
.blog-card-cat {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 6px;
}
.blog-card-title {
  font-size: 17px;
  line-height: 1.35;
  margin: 0 0 6px;
  color: var(--text);
}
.blog-card-excerpt {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-date { font-size: 12px; color: var(--text-muted); }

/* ── Pagination ── */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}
.blog-pagination a {
  color: var(--gold);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 14px;
  border: 1px solid rgba(212,165,116, 0.3);
  border-radius: 10px;
}
.blog-pagination a:hover { background: rgba(212,165,116, 0.12); }
.blog-page-info { font-size: 13px; color: var(--text-muted); }

/* ── Page article ── */
.blog-back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}
.blog-back:hover { color: var(--gold); }

.blog-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin-bottom: 20px;
}
.blog-cat {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  text-decoration: none;
  margin-bottom: 6px;
}
.blog-cat:hover { text-decoration: underline; }
.blog-article h1 {
  font-size: 32px;
  line-height: 1.25;
  color: var(--gold);
  margin: 4px 0 10px;
}
.blog-date { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.blog-lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dim);
  font-style: italic;
  border-left: 3px solid rgba(212,165,116, 0.4);
  padding-left: 14px;
  margin: 0 0 24px;
}

/* ── Corps de l'article (prose) ── */
.blog-body {
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
}
.blog-body h2 {
  font-size: 22px;
  color: var(--gold);
  margin: 30px 0 12px;
}
.blog-body h3 { font-size: 18px; color: var(--gold); margin: 24px 0 8px; }
.blog-body h4 { font-size: 15px; color: var(--gold-light); margin: 20px 0 6px; }
.blog-body p { margin: 14px 0; }
.blog-body ul, .blog-body ol { padding-left: 26px; margin: 14px 0; }
.blog-body li { margin-bottom: 6px; }
.blog-body a { color: var(--gold); }
.blog-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 16px 0;
}
.blog-body video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 16px 0;
  background: #000;
}
.blog-body blockquote {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 16px;
  margin: 18px 0;
  color: var(--text-muted);
  font-style: italic;
}
.blog-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 30px 0;
}
/* Encadre (bouton "Encadre" de l'editeur) */
.blog-body .blog-callout {
  background: rgba(212,165,116, 0.07);
  border: 1px solid rgba(212,165,116, 0.25);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0;
}
.blog-body .blog-callout p:first-child { margin-top: 0; }
.blog-body .blog-callout p:last-child { margin-bottom: 0; }
/* Texte mis en accent (bouton "Texte dore" de l'editeur) */
.blog-body .accent { color: var(--gold); font-weight: 600; }

/* Illustration de la carte tiree (articles auto du Journal d'Haroun) */
.blog-body .blog-card-illus {
  max-width: 300px;
  margin: 24px auto;
  text-align: center;
}
.blog-body .blog-card-illus img,
.blog-body .blog-card-illus video {
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.blog-body .blog-card-illus figcaption {
  margin-top: 10px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
}

/* Illustration dans le corps (automatisations, generations role=illustration) */
.blog-body .blog-illus {
  max-width: 440px;
  margin: 24px auto;
}
.blog-body .blog-illus img {
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

/* ── Articles recents ── */
.blog-recent { margin-top: 50px; border-top: 1px solid var(--border); padding-top: 24px; }
.blog-recent h2 { font-size: 18px; color: var(--gold); margin: 0 0 16px; }
.blog-recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.blog-recent-item {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s;
}
.blog-recent-item:hover { border-color: rgba(212,165,116, 0.45); }
.blog-recent-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.blog-recent-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  font-size: 28px;
  opacity: 0.3;
  background: var(--bg-card-hover);
}
.blog-recent-title {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

/* --- Fil d'Ariane --- */
.blog-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.blog-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--gold); }
.blog-breadcrumb span[aria-current] { color: var(--text); }
.blog-bc-sep { opacity: 0.5; }

/* --- FAQ par article --- */
.blog-faq {
  margin-top: 38px;
  border-top: 1px solid var(--border);
  padding-top: 26px;
}
.blog-faq h2 { font-size: 22px; color: var(--gold); margin: 0 0 16px; }
.blog-faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 0 16px;
  background: var(--bg-card);
}
.blog-faq-item summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  gap: 10px;
}
.blog-faq-item summary::-webkit-details-marker { display: none; }
.blog-faq-item summary::before {
  content: '+';
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}
.blog-faq-item[open] summary::before { content: '\2212'; }
.blog-faq-a {
  padding: 0 0 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- Bloc CTA fin d'article --- */
.blog-cta {
  margin-top: 38px;
  padding: 30px 26px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(90,20,35,0.28), rgba(212,165,116,0.12));
}
.blog-cta h2 { font-size: 21px; color: var(--gold); margin: 0 0 8px; }
.blog-cta p { margin: 0 0 20px; color: var(--text-muted); }
.blog-cta-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--bg-dark);
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
}
.blog-cta-btn:hover { background: var(--gold-light); }

/* --- Footer blog --- */
.blog-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 20px 34px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}
.blog-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-bottom: 12px;
}
.blog-footer a { color: var(--text-muted); text-decoration: none; }
.blog-footer a:hover { color: var(--gold); }
.blog-footer p { margin: 0; }

@media (max-width: 540px) {
  .blog-wrap { padding: 24px 16px 60px; }
  .blog-header h1 { font-size: 25px; }
  .blog-article h1 { font-size: 26px; }
  .blog-list { grid-template-columns: 1fr; }
  .blog-cta { padding: 24px 18px; }
}

/* Desktop : page liste (/blog) elargie a 1400px + fontes/cards bumpees, cohérent
   avec la home (v2.8.30). Articles (.blog-article) restent a 760px — meilleure
   lisibilite de lecture longue. Scope via :has(.blog-list) pour ne toucher
   que la page liste. */
@media (min-width: 769px) {
  .blog-wrap:has(.blog-list) { max-width: 1400px; padding: 48px 24px 100px; }
  .blog-wrap:has(.blog-list) .blog-header h1 { font-size: 44px; }
  .blog-wrap:has(.blog-list) .blog-intro { font-size: 18px; }
  .blog-wrap:has(.blog-list) .blog-cats { gap: 12px; margin-bottom: 32px; }
  .blog-wrap:has(.blog-list) .blog-cats a { font-size: 16px; padding: 9px 20px; border-radius: 18px; }
  .blog-list { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 28px; }
  .blog-card-body { padding: 20px 22px 24px; }
  .blog-card-cat { font-size: 13px; margin-bottom: 8px; }
  .blog-card-title { font-size: 22px; }
  .blog-card-excerpt { font-size: 16px; margin-bottom: 14px; }
  .blog-card-date { font-size: 14px; }
}
