/* ════════════════════════════════════════
   BLOG — archive, article, sidebar, cards
   Optimisé pour l'expérience de lecture
   ════════════════════════════════════════ */

.blog-archive { padding: 60px 32px; background: var(--white); }

.blog-archive-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

/* Archive head */
.archive-head { margin-bottom: 44px; }

/* ── ARCHIVE GRID & CARDS ── */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

/* Style de base des cartes d'articles */
.archive-grid .post {
  display: flex;
  flex-direction: column;
  background: var(--card, #ffffff);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  border: 1.5px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  height: 100%; /* Permet d'avoir des cartes de même hauteur */
}

.archive-grid .post:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(30, 77, 123, 0.08);
  border-color: var(--blue-mid);
}

/* Zone d'image uniforme sur les cartes */
.post-visual {
  height: 220px;
  width: 100%;
  overflow: hidden;
  position: relative;
  background: var(--sky);
  flex-shrink: 0;
}

.post-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Recadrage parfait sans déformation */
  display: block;
  transition: transform 0.4s ease;
}

.archive-grid .post:hover .post-visual img {
  transform: scale(1.03); /* Léger effet de zoom au survol */
}

/* Fallback emoji si pas d'image */
.post-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
}

/* Corps de texte de la carte */
.post-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Pousse le footer vers le bas */
}

/* Catégories Capsules */
.post-cat {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  width: fit-content;
  align-self: flex-start;
  flex: none;
}

.cat-infos-du-cabinet,
.cat-cabinet {
  background-color: #faf3e8;
  color: #c8924a;
}

.cat-en-pratique {
  background-color: #e0f2fe;
  color: #0369a1;
}

.cat-prevention {
  background-color: #ecfdf5;
  color: #047857;
}

/* Titre d'article dans la grille */
.post-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
  color: var(--text);
  transition: color 0.2s ease;
}

.archive-grid .post:hover h2 {
  color: var(--blue-mid);
}

/* Extrait d'article */
.post-body p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 20px;
  flex-grow: 1; /* Permet d'aligner le bas des cartes si extraits différents */
}

/* Pied de carte (Date + CTA de lecture) */
.post-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1.5px solid var(--line);
  font-size: 0.8rem;
}

.post-date {
  color: var(--muted);
  font-weight: 500;
}

.post-link {
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.archive-grid .post:hover .post-link {
  color: var(--blue-mid);
}

.no-posts { color: var(--muted); font-size: 0.95rem; }


/* ── FEATURED POST (Premier article mis en avant) ── */
.archive-grid .post.post-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: var(--sky);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  border: 1.5px solid var(--line);
  align-items: stretch; /* Aligne la hauteur de l'image et du texte */
}

.archive-grid .post.post-featured .post-visual {
  height: 100%;
  min-height: 340px;
  border-radius: 0;
}

.archive-grid .post.post-featured .post-body {
  padding: 40px;
  justify-content: center;
}

.archive-grid .post.post-featured h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
}

.archive-grid .post.post-featured .post-excerpt {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 24px;
}

.archive-grid .post.post-featured .post-foot {
  border-top: 1.5px solid rgba(30, 77, 123, 0.1);
}


/* ── PAGINATION ── */
.archive-pagination { margin-top: 40px; }
.archive-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.archive-pagination .page-numbers {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .2s, color .2s;
}
.archive-pagination .page-numbers.current,
.archive-pagination .page-numbers:hover { background: var(--blue); color: #fff; border-color: var(--blue); }


/* ── SIDEBAR ── */
.blog-sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar-search h3,
.sidebar-cats h3,
.sidebar-widget-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
  margin-top: 0;
}

/* Formulaire recherche */
.search-form { width: 100%; display: block; }
.search-input-wrapper {
  position: relative;
  width: 100%;
}
.search-form .search-field {
  width: 100%;
  padding: 12px 46px 12px 20px;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  background-color: #f8fafc;
  font-family: 'Outfit', sans-serif;
  font-size: 0.87rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.search-form .search-field:focus {
  border-color: var(--blue);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
.search-form .search-submit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s;
}
.search-form .search-submit:hover {
  color: var(--blue);
  background: none;
}
.search-form .search-icon {
  display: block;
}

/* Unified Contact block in Sidebar */
.sidebar-contact-unified {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 8px;
}

.phone-card {
  background: var(--blue);
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}
.phone-card small {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, .9);
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.phone-card a {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease;
}
.phone-card a:hover {
  transform: scale(1.03);
}
.phone-card p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, .92);
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
}

.info-chips {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--stone);
  border-radius: 10px;
  font-size: 0.87rem;
  text-align: left;
}
.chip-icon {
  font-size: 1.1rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.chip strong {
  color: var(--text);
  display: block;
  font-weight: 600;
}
.chip span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Catégories */
.sidebar-cats ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-cats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.2s, padding-left 0.2s;
  position: relative;
}
.sidebar-cats li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 4px;
  height: 16px;
  background-color: var(--blue);
  border-radius: 0 4px 4px 0;
  transition: transform 0.2s ease;
}
.sidebar-cats li:hover {
  background-color: #f8fafc;
  padding-left: 18px;
}
.sidebar-cats li:hover::before {
  transform: translateY(-50%) scaleY(1);
}
.sidebar-cats li a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color .2s;
  flex-grow: 1;
}
.sidebar-cats li:hover a {
  color: var(--blue);
}
.sidebar-cats .cat-count {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 2px 10px;
  border-radius: 12px;
  transition: background-color 0.2s, color 0.2s;
}
.sidebar-cats li:hover .cat-count {
  background-color: var(--blue);
  color: #fff;
}

/* Articles Récents Sidebar */
.sidebar-recent-posts {
  display: flex;
  flex-direction: column;
}
.recent-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.recent-post-item {
  width: 100%;
}
.recent-post-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  width: 100%;
  transition: transform 0.2s ease;
}
.recent-post-link:hover {
  transform: translateX(4px);
}
.recent-post-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.recent-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-post-emoji {
  font-size: 1.5rem;
}
.recent-post-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recent-post-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}
.recent-post-link:hover .recent-post-title {
  color: var(--blue);
}
.recent-post-date {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── ARTICLE SINGLE (Distraction-Free Reading Mode) ── */
.single-article { padding: 60px 32px; background: var(--white); position: relative; }

/* Barre de progression de lecture */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--gold);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* Grille CSS à deux colonnes pour l'article et la barre latérale */
.single-article-inner {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  max-width: var(--max-w);
  margin: 0 auto;
  align-items: start;
}
.article-wrap {
  width: 100%;
}

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 36px; }
.breadcrumb a { color: var(--blue); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

/* En-tête article */
.article-header { margin-bottom: 36px; text-align: center; }
.article-header .post-cat { margin: 0 auto 16px auto; }
.article-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 18px;
  margin-top: 12px;
  font-weight: 700;
}
.article-meta { font-size: 0.88rem; color: var(--muted); display: flex; gap: 8px; justify-content: center; align-items: center; }

/* Image mise en avant (Hero de l'article) — Constrainte en hauteur ! */
.article-thumbnail {
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 44px;
  box-shadow: 0 6px 24px rgba(30,77,123,0.06);
  height: 360px; /* Hauteur maximale contrôlée */
  width: 100%;
}
.article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Recadrage parfait, évite l'effet géant */
  display: block;
}

/* Contenu de l'article */
.article-content {
  font-size: 1.06rem;
  color: #2c3e50; /* Gris foncé, plus doux que le noir pur */
  line-height: 1.85;
  letter-spacing: -0.01em;
}
.article-content h2 { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--text); margin: 44px 0 16px; font-weight: 700; }
.article-content h3 { font-family: 'Playfair Display', serif; font-size: 1.25rem; color: var(--text); margin: 32px 0 14px; font-weight: 600; }
.article-content p { margin-bottom: 24px; }
.article-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; font-weight: 500; }
.article-content a:hover { color: var(--blue-mid); }
.article-content ul, .article-content ol { padding-left: 28px; margin-bottom: 24px; }
.article-content li { margin-bottom: 10px; }
.article-content blockquote {
  border-left: 4px solid var(--gold);
  padding: 20px 28px;
  background: var(--gold-pale);
  border-radius: 0 16px 16px 0;
  margin: 36px 0;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--muted);
  line-height: 1.7;
}
.article-content strong { color: var(--text); font-weight: 600; }
.article-content table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 0.9rem; }
.article-content th { background: var(--blue); color: #fff; padding: 10px 14px; text-align: left; }
.article-content td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.article-content tr:nth-child(even) td { background: var(--sky); }

/* Encadré d'appel à l'action / conversion en fin d'article */
.article-cta-box {
  background: linear-gradient(135deg, var(--blue) 0%, #173b5e 100%);
  border-radius: 20px;
  padding: 36px;
  color: #fff;
  display: flex;
  gap: 28px;
  align-items: center;
  margin: 56px 0 48px 0;
  box-shadow: 0 8px 30px rgba(30, 77, 123, 0.12);
}
.article-cta-box .cta-box-icon {
  font-size: 2.8rem;
  background: #fff;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.article-cta-box .cta-box-content {
  flex: 1;
}
.article-cta-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 8px;
  font-weight: 600;
}
.article-cta-box p {
  font-size: 0.92rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 20px;
}
.article-cta-box .cta-box-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.article-cta-box .btn-gold {
  background: var(--gold);
  color: #fff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-cta-box .btn-gold:hover {
  background: #d8a25a;
  transform: translateY(-2px);
}
.article-cta-box .btn-line-blue {
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.article-cta-box .btn-line-blue:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  transform: translateY(-2px);
}

/* Navigation articles modernisée (Cartes Côte à Côte) */
.article-nav {
  display: flex;
  gap: 20px;
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1.5px solid var(--line);
}
.article-nav-link {
  flex: 1;
  padding: 20px 24px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .25s ease, background-color .25s ease, transform .25s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
.article-nav-link:hover {
  border-color: var(--blue-mid);
  background: var(--sky);
  transform: translateY(-2px);
}
.article-nav-link.next {
  flex-direction: row-reverse;
  text-align: right;
}
.article-nav-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.article-nav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-nav-emoji {
  font-size: 1.5rem;
}
.article-nav-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  min-width: 0;
}
.article-nav-link.next .article-nav-text {
  align-items: flex-end;
}
.article-nav-link span { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.article-nav-link strong { font-size: 0.95rem; line-height: 1.4; color: var(--text); font-weight: 600; }

/* Page générique */
.page-content { background: var(--white); }
.page-body { font-size: 1.05rem; color: var(--text); line-height: 1.8; margin-top: 24px; max-width: 760px; }
.page-body h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin: 28px 0 12px; }
.page-body p { margin-bottom: 16px; }
.page-body a { color: var(--blue); }

/* Sticky Sidebar for Desktop */
@media (min-width: 961px) {
  .blog-sidebar {
    position: -webkit-sticky; /* Support Safari */
    position: sticky;
    top: 110px; /* Décale pour dégager le header sticky */
    align-self: start; /* Évite l'étirement en hauteur */
  }
}


/* ── RESPONSIVE BLOG & CARDS ── */
@media (max-width: 960px) {
  .blog-archive-inner { grid-template-columns: 1fr; }
  .single-article-inner { grid-template-columns: 1fr; }
  .blog-sidebar { order: 1; } /* Sidebar en bas sur tablette */
  .archive-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  
  /* Featured Post responsive */
  .archive-grid .post.post-featured {
    grid-template-columns: 1fr;
  }
  .archive-grid .post.post-featured .post-visual {
    height: 240px;
    min-height: auto;
  }
  .archive-grid .post.post-featured .post-body {
    padding: 24px;
  }
}

@media (max-width: 600px) {
  .archive-grid { grid-template-columns: 1fr; gap: 32px; }
  .blog-archive, .single-article { padding: 40px 20px; }
  
  /* Keep Card Styles on Mobile instead of resetting them */
  .archive-grid .post {
    border: 1.5px solid var(--line) !important;
    background: var(--card, #ffffff) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 12px rgba(30, 77, 123, 0.04) !important;
    transform: none !important;
    height: auto;
    overflow: hidden;
  }
  
  /* Clear Featured Card styles on Mobile too but keep as card */
  .archive-grid .post.post-featured {
    border: 1.5px solid var(--line) !important;
    background: var(--card, #ffffff) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 12px rgba(30, 77, 123, 0.04) !important;
    grid-template-columns: 1fr;
  }
  
  .post-visual {
    height: 200px;
    border-radius: 0 !important;
    overflow: hidden;
  }
  
  .archive-grid .post.post-featured .post-visual {
    height: 200px;
    border-radius: 0 !important;
  }
  
  .post-body {
    padding: 20px !important;
  }
  
  .archive-grid .post.post-featured .post-body {
    padding: 20px !important;
  }
  
  .post-foot {
    border-top: 1.5px solid var(--line) !important;
    padding-top: 12px !important;
    margin-top: 16px !important;
  }
  
  .post-body h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }
  
  .archive-grid .post.post-featured h2 {
    font-size: 1.35rem;
  }
  
  .article-header h1 { font-size: 1.8rem; }
  .article-content { font-size: 1.02rem; }
  .article-thumbnail { height: 220px; margin-bottom: 24px; border-radius: 12px; }
  
  .article-cta-box {
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    text-align: center;
    margin: 36px 0;
  }
  .article-cta-box .cta-box-icon {
    width: 64px;
    height: 64px;
    font-size: 2.2rem;
  }
  .article-cta-box .cta-box-actions {
    justify-content: center;
    width: 100%;
  }
  .article-cta-box .btn-gold, .article-cta-box .btn-line-blue {
    width: 100%;
    justify-content: center;
  }
  .article-nav { flex-direction: column; gap: 14px; }
}
