/* ══════════════════════════════════════════════════════════════════
   Template « Défaut Magazine » — design moderne responsive.
   Variables surchargées par les réglages du blog (base.njk) :
   --accent, --bg, --font, --fs-*-scale, html{font-size} (zoom).
   ══════════════════════════════════════════════════════════════════ */
:root {
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --text: #16181d;
  --muted: #5c6470;
  --subtle: #8b93a1;
  --bg: #f4f5f8;
  --card: #ffffff;
  --border: #e4e7ec;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-hover: 0 12px 28px -8px rgba(16, 24, 40, .16);

  /* Échelles de taille détaillées (réglages du blog) — 1 = taille normale */
  --fs-h1-scale: 1; --fs-h2-scale: 1; --fs-h3-scale: 1;
  --fs-body-scale: 1; --fs-quote-scale: 1; --fs-italic-scale: 1;
  --fs-button-scale: 1; --fs-link-scale: 1; --fs-logo-scale: 1;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: calc(1rem * var(--fs-body-scale));
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); font-size: calc(1em * var(--fs-link-scale)); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
em, i { font-size: calc(1em * var(--fs-italic-scale)); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.container--article { max-width: 860px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ─────────────────────────── Header ─────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 22px; min-height: 62px; }
.site-title {
  font-size: calc(1.32rem * var(--fs-logo-scale));
  font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.site-title:hover .brand-name { color: var(--accent); }

/* Logo auto-généré : tuile monogramme dégradée + nom */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: calc(2.1em * var(--fs-logo-scale) / 1.32); height: calc(2.1em * var(--fs-logo-scale) / 1.32);
  border-radius: 30%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #10131c));
  color: #fff; font-weight: 900; font-size: .92em; line-height: 1;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 35%, transparent);
}
.brand-name { transition: color .12s; }
.site-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.site-nav::-webkit-scrollbar { display: none; }
.nav-item {
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: calc(.92rem * var(--fs-link-scale));
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--border); color: var(--text); }
.nav-item.is-active { background: var(--accent); color: var(--accent-ink); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); text-decoration: none; font-size: calc(.9rem * var(--fs-button-scale));
  background: var(--card); transition: border-color .12s, color .12s;
}
.search-btn:hover { border-color: var(--accent); color: var(--accent); }

.burger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; }
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .18s, opacity .18s; }
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { display: none; }

@media (max-width: 820px) {
  .site-nav, .search-btn-label { display: none; }
  .search-btn { border: 0; padding: 10px; }
  .burger { display: flex; }
  .mobile-menu { display: flex; flex-direction: column; border-top: 1px solid var(--border); background: var(--card); padding: 8px 0; }
  .mobile-menu[hidden] { display: none; }
  .mobile-menu a { padding: 13px 22px; text-decoration: none; color: var(--text); font-weight: 500; }
  .mobile-menu a:active { background: var(--bg); }
}

/* ─────────────────────────── Composants ─────────────────────────── */
.pill {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}
.pill-lg { font-size: .8rem; padding: 5px 14px; }
.pill-on-image { background: var(--accent); color: var(--accent-ink); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 44px 0 18px; }
.section-title {
  font-size: calc(1.45rem * var(--fs-h2-scale)); font-weight: 800; letter-spacing: -0.02em; margin: 0;
  padding-left: 14px; border-left: 4px solid var(--accent);
}
.section-more { font-weight: 600; text-decoration: none; font-size: .92rem; white-space: nowrap; }
.section-more:hover { text-decoration: underline; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ─────────────────────────── Hero (accueil) ─────────────────────────── */
.hero-zone { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 22px; padding-top: 26px; }
.hero-card { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.hero-link { position: relative; display: block; min-height: 420px; height: 100%; text-decoration: none; }
.hero-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-cover--placeholder { background: linear-gradient(135deg, var(--accent), #17123a); }
.hero-overlay {
  position: absolute; inset: auto 0 0 0; padding: 88px 28px 26px;
  background: linear-gradient(to top, rgba(8, 10, 16, .88) 30%, rgba(8, 10, 16, .35) 75%, transparent);
}
.hero-title { color: #fff; font-size: calc(1.85rem * var(--fs-h1-scale)); line-height: 1.18; letter-spacing: -0.02em; margin: 12px 0 8px; }
.hero-summary { color: rgba(255, 255, 255, .82); margin: 0 0 10px; font-size: .98rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { color: rgba(255, 255, 255, .6); font-size: .82rem; margin: 0; }

.featured-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 22px; }
.featured-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s; }
.featured-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.featured-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--text); }
.featured-cover { width: 100%; height: 110px; object-fit: cover; }
.featured-body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 7px; }
.featured-title { margin: 0; font-size: calc(1.02rem * var(--fs-h3-scale)); line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; }
.featured-meta { margin: 0; color: var(--subtle); font-size: .8rem; }

@media (max-width: 980px) {
  .hero-zone { grid-template-columns: 1fr; }
  .hero-link { min-height: 340px; }
  .featured-stack { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .hero-zone { padding-top: 16px; gap: 16px; }
  .hero-link { min-height: 300px; }
  .hero-overlay { padding: 70px 18px 18px; }
  .hero-title { font-size: calc(1.42rem * var(--fs-h1-scale)); }
  .featured-stack { grid-template-columns: 1fr; gap: 16px; }
  .featured-cover { height: 150px; }
}

/* ─────────────────────────── Grille de cartes ─────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; gap: 16px; } }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--text); }
.card-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.card-cover--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 82%, #000), var(--accent));
  color: rgba(255,255,255,.5); font-size: 2.6rem; font-weight: 800;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-date { color: var(--subtle); font-size: .78rem; white-space: nowrap; }
.card-title { margin: 0; font-size: calc(1.08rem * var(--fs-h3-scale)); line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; }
.card-summary { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin: auto 0 0; padding-top: 6px; color: var(--subtle); font-size: .78rem; }

/* ─────────────────────────── Pages rubrique / recherche ─────────────────────────── */
.page-hero { padding: 34px 0 8px; margin-bottom: 18px; }
.page-hero-title { font-size: calc(2rem * var(--fs-h1-scale)); font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 4px; }
.page-hero-sub { color: var(--muted); margin: 0; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .84rem; color: var(--subtle); padding: 18px 0 0; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-current { color: var(--subtle); }

.search-form {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 4px 18px; margin-bottom: 20px; color: var(--subtle);
  box-shadow: var(--shadow);
}
.search-form:focus-within { border-color: var(--accent); }
.search-form input {
  flex: 1; min-width: 0; /* enfant flex : sans ça, la largeur intrinsèque de l'input fait déborder la page sur mobile */
  border: 0; background: none; padding: 14px 0; font: inherit; color: var(--text); outline: none;
  font-size: max(16px, 1rem); /* ≥16px : évite le zoom auto iOS */
}
.search-count { color: var(--muted); font-size: .88rem; margin: 0 0 16px; min-height: 1.2em; }

/* ─────────────────────────── Article ─────────────────────────── */
.article-full { padding-bottom: 10px; }
.article-head { padding: 26px 0 4px; }
.article-title { font-size: calc(2.1rem * var(--fs-h1-scale)); line-height: 1.16; letter-spacing: -0.025em; margin: 14px 0 12px; }
.article-standfirst { font-size: calc(1.13rem * var(--fs-quote-scale)); color: var(--muted); line-height: 1.55; margin: 0 0 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--subtle); font-size: .88rem; margin-bottom: 20px; }
.article-meta span:first-child { color: var(--text); font-weight: 600; }

.article-cover-wrap { margin: 0 0 26px; }
.article-cover { width: 100%; border-radius: var(--r-lg); aspect-ratio: 16 / 9; object-fit: cover; box-shadow: var(--shadow); }
.article-credit { color: var(--subtle); font-size: .76rem; margin-top: 8px; text-align: right; }

.llm-answer {
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: var(--r-lg); padding: 18px 22px; margin: 0 0 22px;
}
.llm-answer-q { margin: 0 0 8px; font-weight: 700; color: var(--accent); font-size: .98rem; }
.llm-answer-a { margin: 0; font-size: calc(1.02rem * var(--fs-body-scale)); }

.key-points { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--r); padding: 16px 22px; margin: 0 0 26px; }
.key-points-title { margin: 0 0 8px; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.key-points ul { margin: 0; padding-left: 20px; }
.key-points li { margin: 5px 0; }

.media-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 20px; margin: 0 0 24px; }
.media-block audio, .media-block video { width: 100%; border-radius: 8px; }
.media-label { margin: 0 0 10px; font-weight: 700; font-size: .92rem; }

.article-content { font-size: calc(1.05rem * var(--fs-body-scale)); line-height: 1.78; }
.article-content h2 { font-size: calc(1.5rem * var(--fs-h2-scale)); letter-spacing: -0.015em; margin: 40px 0 14px; }
.article-content h3 { font-size: calc(1.2rem * var(--fs-h3-scale)); margin: 30px 0 10px; }
.article-content p { margin: 0 0 18px; }
.article-content img { border-radius: var(--r); }
.article-content blockquote {
  margin: 26px 0; padding: 14px 22px; font-size: calc(1.05rem * var(--fs-quote-scale));
  border-left: 4px solid var(--accent); background: var(--card); border-radius: 0 var(--r) var(--r) 0;
  color: var(--muted); font-style: italic;
}
.article-content a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.article-content ul, .article-content ol { padding-left: 24px; margin: 0 0 18px; }
.article-content li { margin: 6px 0; }
.article-content code { background: var(--border); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.article-content pre { background: #14161c; color: #e5e7eb; padding: 18px; border-radius: var(--r); overflow-x: auto; }
.article-content pre code { background: none; padding: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 0 0 18px; display: block; overflow-x: auto; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.article-content th { background: var(--card); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }
.tag { background: var(--card); border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: .8rem; }

/* Partage */
.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 28px 0 6px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share-label { font-weight: 700; font-size: .88rem; color: var(--muted); margin-right: 4px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  font-size: calc(1rem * var(--fs-button-scale)); font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}
.share-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.share-copy.copied { background: #16a34a; border-color: #16a34a; color: #fff; }

/* FAQ */
.faq { margin: 34px 0 0; }
.faq h2 { font-size: calc(1.5rem * var(--fs-h2-scale)); letter-spacing: -0.015em; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.faq-item summary {
  cursor: pointer; padding: 15px 20px; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); flex-shrink: 0; transition: transform .15s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0; padding: 0 20px 16px; color: var(--muted); }

.related { margin-top: 8px; padding-bottom: 30px; }

/* 404 */
.notfound { text-align: center; padding: 90px 0 110px; }
.notfound-code { font-size: 5.4rem; font-weight: 900; letter-spacing: -0.04em; color: var(--accent); margin: 0; line-height: 1; opacity: .25; }
.notfound h1 { font-size: calc(1.8rem * var(--fs-h1-scale)); margin: 12px 0; }
.notfound-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.btn-accent, .btn-ghost {
  display: inline-block; padding: 12px 22px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: calc(.95rem * var(--fs-button-scale));
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--card); }

/* ─────────────────────────── Footer ─────────────────────────── */
.site-footer { margin-top: 64px; background: #14161c; color: #b6bcc8; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; padding: 44px 20px 30px; }
.footer-title { color: #fff; font-weight: 800; font-size: calc(1.15rem * var(--fs-logo-scale)); margin: 0 0 8px; }
.footer-title.brand { gap: 9px; }
.footer-desc { margin: 0; font-size: .9rem; line-height: 1.6; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-title { color: #fff; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 4px; }
.footer-col a { color: #b6bcc8; text-decoration: none; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.09); padding: 16px 20px; font-size: .8rem; color: #7d8492; }
.footer-bottom p { margin: 0; }
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding: 34px 20px 22px; }
}
