/* ===========================================================
   Design tokens — direction: éditorial/magazine (référence:
   Agorapulse, Kota, Nova Benefits). Cartes bien définies, tags
   de catégorie colorés, sans-serif affirmé, beaucoup d'air blanc.
   =========================================================== */
:root {
  --ink: #14181c;
  --paper: #ffffff;
  --canvas: #f5f6f8;
  --line: #e3e5e9;
  --muted: #6b7280;

  --navy: #1c2b4a;
  --navy-dark: #131f38;
  --coral: #e8613f;
  --coral-soft: #fdece7;
  --sage: #3f6b52;
  --sage-soft: #e9f2ec;
  --gold: #a5730f;
  --gold-soft: #faf1de;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 16px;
  --max-w: 1160px;

  /* Ombres superposées — pour une profondeur douce plutôt que plate */
  --shadow-sm: 0 1px 2px rgba(20,24,28,0.05), 0 1px 1px rgba(20,24,28,0.03);
  --shadow-md: 0 2px 4px rgba(20,24,28,0.04), 0 8px 20px -4px rgba(20,24,28,0.10);
  --shadow-lg: 0 4px 8px rgba(20,24,28,0.05), 0 20px 40px -12px rgba(20,24,28,0.18);
}

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.logo span { color: var(--coral); }

.main-nav {
  display: flex;
  gap: 30px;
  font-size: 0.92rem;
  font-weight: 500;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--coral);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 1rem;
}

/* Menu déroulant mobile — activé en JS via la classe .open */
.main-nav.open {
  display: flex !important;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--paper);
  padding: 18px 24px 22px;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  gap: 16px;
}

/* ---------- Page hero (blog index) ---------- */
.blog-hero {
  background: var(--navy);
  color: #fff;
}

.blog-hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 64px;
}

.blog-hero__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cfd8e8;
  margin-bottom: 14px;
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 14px;
  max-width: 20ch;
}

.blog-hero p {
  color: #c3ccdc;
  font-size: 1.05rem;
  margin: 0;
  max-width: 46ch;
}

/* ---------- Layout: page with sidebar ---------- */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}

.sidebar__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__list a {
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  display: block;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar__list a:hover { background: var(--canvas); }

.sidebar__list a.active {
  background: var(--navy);
  color: #fff;
}

/* ---------- Sidebar ---------- */
.sidebar__select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(20,24,28,0.1);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.search-box {
  position: relative;
  margin-bottom: 32px;
}

.search-box input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px 12px 42px;
  border: 1px solid rgba(20,24,28,0.1);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.search-box input:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: var(--shadow-sm), 0 0 0 3px var(--coral-soft);
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.no-results {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 40px 0;
}

/* ---------- Featured (article en vedette, généré automatiquement) ---------- */
.featured-section {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  margin-bottom: 48px;
}

.featured-card {
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s ease;
}

.featured-card:hover { box-shadow: var(--shadow-lg); }

.featured-card__photo {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.featured-card__photo img { width: 100%; height: 100%; object-fit: cover; }

.featured-card__body { padding: 26px 28px 30px; }

.featured-card__title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 10px;
}

.featured-card__desc {
  font-size: 0.98rem;
  color: var(--muted);
  margin: 0;
}

.featured-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-item {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  gap: 14px;
  background: var(--paper);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease;
}

.rail-item:hover { box-shadow: var(--shadow-md); }

.rail-item__photo {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}

.rail-item__photo img { width: 100%; height: 100%; object-fit: cover; }

.rail-item__title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  line-height: 1.25;
  margin: 2px 0 4px;
}

.rail-item__desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Article grid (blog index) ---------- */
.section-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 24px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.article-card {
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(20,24,28,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.article-card__photo {
  aspect-ratio: 4 / 3;
  background: var(--line);
  overflow: hidden;
  position: relative;
}

.article-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__body { padding: 18px 20px 22px; }

/* Tags de catégorie colorés — une couleur par catégorie */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(20,24,28,0.06);
}


.article-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0 0 8px;
}

.article-card__desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

/* ---------- Article page ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 24px;
}

.back-link:hover { text-decoration: underline; }

.article-header h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 10px 0 14px;
}

.article-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.article-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 32px;
  border-radius: var(--radius);
}

.article-body { max-width: 66ch; font-size: 1.04rem; }

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-top: 2.2em;
}

.article-body p { margin: 0 0 1.2em; }

/* ---------- Partage social ---------- */
.share-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.share-row__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.share-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(20,24,28,0.12);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.share-btn:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ---------- Pop-up infolettre (image + formulaire) ---------- */
.newsletter-overlay {
  position: fixed; inset: 0; background: rgba(20,24,28,0.55);
  display: none; align-items: center; justify-content: center;
  padding: 20px; z-index: 200;
}
.newsletter-overlay.visible { display: flex; }

.newsletter-popup {
  background: var(--paper); border-radius: var(--radius);
  max-width: 720px; width: 100%; overflow: hidden;
  box-shadow: var(--shadow-lg); position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
}

.newsletter-popup__photo { display: block; }
.newsletter-popup__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.newsletter-popup__content { padding: 34px 32px; display: flex; flex-direction: column; }

.newsletter-popup__close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.9); border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 1.05rem; color: var(--ink);
  cursor: pointer; line-height: 1; z-index: 2;
}

.newsletter-popup__eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--coral); margin-bottom: 10px;
}

.newsletter-popup h3 {
  font-family: var(--font-display); font-size: 1.5rem;
  margin: 0 0 10px; line-height: 1.25;
}

.newsletter-popup p.sub {
  color: var(--muted); font-size: 0.92rem; margin: 0 0 22px; line-height: 1.5;
}

.newsletter-popup input[type="email"] {
  width: 100%; font-family: var(--font-body); font-size: 0.95rem;
  padding: 12px 14px; border: 1px solid rgba(20,24,28,0.12);
  border-radius: 10px; background: var(--canvas); margin-bottom: 14px;
}
.newsletter-popup input:focus {
  outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft);
}

.newsletter-popup__consent {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.76rem; color: var(--muted); line-height: 1.5; margin-bottom: 16px;
}
.newsletter-popup__consent input { margin-top: 3px; flex-shrink: 0; }

.newsletter-popup button[type="submit"] {
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  background: var(--navy); color: #fff; border: none;
  padding: 12px 20px; border-radius: 10px; cursor: pointer;
  box-shadow: var(--shadow-sm); margin-bottom: 12px;
}

.newsletter-popup__dismiss {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--muted); margin-top: auto; padding-top: 8px;
}

.newsletter-popup__status { font-size: 0.85rem; margin-top: 6px; }
.newsletter-popup__status.success { color: #2c6e49; }
.newsletter-popup__status.error { color: #b8371f; }

@media (max-width: 640px) {
  .newsletter-popup { grid-template-columns: 1fr; }
  .newsletter-popup__photo { display: none; }
}

/* ---------- Carte "Une question ?" dans la sidebar ---------- */
.sidebar-cta {
  margin-top: 32px;
  padding: 22px 20px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.sidebar-cta__eyebrow {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #f0a58f; margin-bottom: 8px;
}
.sidebar-cta h4 {
  font-family: var(--font-display); font-size: 1.1rem;
  margin: 0 0 10px; line-height: 1.3;
}
.sidebar-cta p {
  font-size: 0.85rem; color: #c3ccdc; margin: 0 0 16px; line-height: 1.5;
}
.sidebar-cta a {
  display: inline-block; background: #fff; color: var(--navy);
  font-weight: 600; font-size: 0.85rem; text-decoration: none;
  padding: 9px 16px; border-radius: 8px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-dark);
  color: #aab3c5;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer__logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
}

.site-footer a { color: #aab3c5; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-block; }

  .blog-hero__inner { padding: 40px 20px 44px; }
  .blog-hero h1 { font-size: 1.9rem; }

  .page {
    grid-template-columns: 1fr;
    padding: 24px 18px 60px;
  }

  .sidebar__list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .sidebar__label { display: none; }

  /* Le module vedette et son rail s'empilent en une colonne sur mobile */
  .featured-section {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 36px;
  }

  .featured-card__title { font-size: 1.35rem; }
  .featured-card__body { padding: 20px 20px 24px; }

  .rail-item__photo { width: 72px; height: 72px; }

  .article-header h1 { font-size: 1.7rem; }
  .article-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
