/* ============================================================
   MADAG — Thème Bludit "madag-psy"
   Variables identiques au site statique pour cohérence visuelle
   ============================================================ */

:root {
  --emerald-50:  #eef5ff;
  --emerald-100: #d4e8fb;
  --emerald-200: #aed1f6;
  --emerald-400: #5da8e8;
  --emerald-500: #3d95e2;
  --emerald-600: #2f89de;
  --emerald-700: #2776d7;
  --emerald-800: #1c5aa3;
  --emerald-900: #154278;

  --stone-50:  #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;

  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  --radius-md:  1rem;
  --radius-lg:  1.5rem;
  --radius-xl:  2rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.10);

  --transition: 200ms ease;
  --max-w: 75rem;
}

/* --- Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--stone-50);
  color: var(--stone-800);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* --- Layout ----------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0 1.5rem;
}

/* --- Typography ------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.25; color: var(--stone-800); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p  { color: var(--stone-600); }

/* --- Navbar ----------------------------------------------- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding-block: 1.5rem;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}
#navbar.scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  padding-block: 1rem;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.nav-logo span:first-child {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--emerald-800);
  font-weight: 700;
}
.nav-logo span:last-child {
  font-size: 0.8rem;
  color: var(--stone-500);
}
.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--emerald-700); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--emerald-700);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--emerald-800); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-pill { border-radius: var(--radius-full); }

/* Hamburger */
.nav-hamburger {
  display: flex;
  align-items: center;
  padding: 0.4rem;
  color: var(--stone-600);
}
@media (min-width: 768px) { .nav-hamburger { display: none; } }

/* Mobile menu */
#mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem 1.5rem;
  background: #fff;
  border-top: 1px solid var(--stone-100);
  box-shadow: var(--shadow-md);
}
#mobile-menu.open { display: flex; }
#mobile-menu a {
  padding: 0.75rem 0;
  font-size: 1.05rem;
  color: var(--stone-700);
  border-bottom: 1px solid var(--stone-100);
  font-weight: 500;
}
#mobile-menu a:last-child { border-bottom: none; }
#mobile-menu a:hover { color: var(--emerald-700); }

/* --- Page header ------------------------------------------ */
.page-header {
  background: var(--stone-50);
  padding-top: 8rem;
  padding-bottom: 3rem;
  text-align: center;
}
.page-header h1 { font-size: clamp(2rem,4vw,3rem); margin-bottom: .75rem; }
.page-header p { color: var(--stone-600); font-size: 1.1rem; max-width: 36rem; margin-inline: auto; margin-top: 1rem; }

/* --- Blog grid -------------------------------------------- */
.blog-grid {
  display: grid;
  gap: 1.75rem;
  padding-block: 3.5rem;
  margin-inline: auto;
}
@media (min-width: 768px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Blog card */
.blog-card {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--stone-100);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 200ms ease;
  display: flex;
  flex-direction: column;
}
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.blog-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-cover { width: 100%; height: 200px; object-fit: cover; display: block; }
.post-cover { width: 100%; max-height: 420px; object-fit: cover; display: block; border-radius: var(--radius-xl); margin-bottom: 2rem; }
.blog-date { font-size: .8rem; color: var(--stone-400); margin-bottom: .4rem; }
.blog-card h3 { margin-bottom: .5rem; font-size: 1.05rem; line-height: 1.4; }
.blog-card p { font-size: .9rem; flex: 1; }
.blog-category {
  display: inline-block;
  align-self: flex-start;
  background: var(--emerald-50);
  color: var(--emerald-800);
  border-radius: var(--radius-full);
  padding: .18rem .65rem;
  font-size: 0.85rem;
  margin-bottom: .65rem;
}
.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--emerald-700);
  font-weight: 600;
  font-size: .88rem;
  margin-top: 1rem;
  transition: gap 200ms ease;
}
.blog-read-more:hover { gap: .55rem; }

/* --- Single post ------------------------------------------ */
.post-wrapper {
  max-width: 46rem;
  margin-inline: auto;
  padding-block: 3.5rem;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .25rem;
  align-items: center;
  margin-bottom: 1.75rem;
  font-size: .85rem;
  color: var(--stone-500);
}
.post-meta span + span::before { content: '·'; margin-right: .25rem; }
.post-content {
  line-height: 1.8;
  color: var(--stone-700);
}
.post-content h2,
.post-content h3 { margin-top: 2rem; margin-bottom: .75rem; }
.post-content p { margin-bottom: 1.1rem; }
.post-content ul, .post-content ol { margin: 1rem 0 1rem 1.5rem; }
.post-content li { margin-bottom: .4rem; }
.post-content strong { color: var(--stone-800); }
.post-content a { color: var(--emerald-700); text-decoration: underline; }
.post-content blockquote {
  border-left: 3px solid var(--emerald-400);
  padding-left: 1.25rem;
  color: var(--stone-600);
  font-style: italic;
  margin: 1.5rem 0;
}

/* Post CTA — style identique à .cta-section */
.post-cta {
  padding-block: 5rem;
  background: var(--emerald-900);
  text-align: center;
  color: #fff;
}
.post-cta h3 { color: #fff; font-size: clamp(1.5rem,3vw,2rem); font-family: var(--font-serif); font-weight: 700; margin-bottom: 1rem; }
.post-cta p { color: var(--emerald-100); max-width: 36rem; margin-inline: auto; margin-bottom: 2rem; font-size: 1.05rem; }
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.5);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  transition: background 200ms ease, border-color 200ms ease;
}
.btn-cta:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.85); }

/* Back link */
.back-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--stone-500);
  font-size: .88rem;
  transition: color 200ms ease;
}
.back-link:hover { color: var(--emerald-700); }

/* --- Pagination ------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  padding-bottom: 3rem;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  border: 1.5px solid var(--stone-200);
  color: var(--stone-600);
  transition: all 200ms ease;
}
.pagination a:hover, .pagination .current {
  background: var(--emerald-700);
  color: #fff;
  border-color: var(--emerald-700);
}

/* --- Footer ----------------------------------------------- */
footer {
  background: var(--stone-900);
  color: var(--stone-400);
  padding-block: 3rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-brand { font-family: var(--font-serif); font-size: 1.3rem; color: #fff; margin-bottom: .4rem; }
footer p, footer a { font-size: .88rem; line-height: 1.8; }
footer a { color: var(--stone-400); transition: color 200ms ease; }
footer a:hover { color: #fff; }
.footer-nav { display: flex; flex-direction: column; gap: .2rem; }
.footer-copy { color: var(--stone-600); margin-top: 2rem; font-size: .82rem; text-align: center; }
