/* ── blog.css — Styles du blog cardiologie ──────────────────────────────── */
/* Complète style.css (variables Poppins + couleurs du site partagées)       */

/* ── Variables blog ───────────────────────────────────────────────────────── */
:root {
  --blog-blue:    #0e73ab;
  --blog-blue-dk: #0b5c88;
  --blog-bg:      #f4f8fb;
  --blog-card-bg: #ffffff;
  --blog-border:  #d6e8f0;
  --blog-text:    #1a2e44;
  --blog-muted:   #4d6a78;
  --blog-cat-1:   #0e73ab;  /* prevention */
  --blog-cat-2:   #e74c3c;  /* symptomes  */
  --blog-cat-3:   #8e44ad;  /* examens    */
  --blog-cat-4:   #d35400;  /* maladies   */
  --blog-cat-5:   #27ae60;  /* traitements*/
  --blog-cat-6:   #16a085;  /* faq        */
  --blog-radius:  12px;
  --blog-shadow:  0 4px 20px rgba(26, 144, 208, .08);
}

/* ── Skip nav (réutilise le style de style.css) ─────────────────────────── */
/* Masquage par clip plutôt que par décalage : en RTL, un `left: -999px`
   crée un débordement horizontal de la page entière. */
.skip-nav {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-nav:focus {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  margin: 0;
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  padding: .5rem 1rem;
  background: var(--blog-blue);
  color: #fff;
  z-index: 9999;
  font-size: 1rem;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  color: var(--blog-muted);
  margin-bottom: 1rem;
}
.breadcrumb a {
  color: var(--blog-blue);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.article-breadcrumb-bar {
  background: #edf5fb;
  border-bottom: 1px solid var(--blog-border);
  padding: .6rem 0;
}
.article-breadcrumb-bar .breadcrumb { margin-bottom: 0; }

/* ── Compensation header fixe — valeur affinée dynamiquement par blog.js */
main {
  padding-top: 80px;
}
@media (max-width: 768px) {
  main { padding-top: 175px; }
}

/* Nav compacte : règles déplacées dans style.css, appliquées à tout le site. */

/* ── Hero du blog ─────────────────────────────────────────────────────────── */
.blog-hero {
  background: linear-gradient(135deg, #1272a8 0%, #1a90d0 60%, #30b8e8 100%);
  color: #fff;
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}
.blog-hero .breadcrumb { justify-content: center; color: rgba(255,255,255,.7); }
.blog-hero .breadcrumb a { color: rgba(255,255,255,.85); }
.blog-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: .7rem;
  line-height: 1.2;
}
.blog-hero p {
  font-size: clamp(.95rem, 1.5vw, 1.15rem);
  opacity: .88;
  max-width: 580px;
  margin: 0 auto;
}

/* ── Filtres catégories ──────────────────────────────────────────────────── */
.blog-filters {
  background: #fff;
  border-bottom: 1px solid var(--blog-border);
  padding: 1rem 0;
  position: sticky;
  top: 80px; /* se colle sous le header fixe */
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem .9rem;
  border-radius: 20px;
  border: 1.5px solid var(--blog-border);
  color: var(--blog-text);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s, border-color .18s, color .18s;
  white-space: nowrap;
}
.cat-tab:hover {
  background: #edf5fb;
  border-color: var(--blog-blue);
  color: var(--blog-blue);
}
.cat-tab--active {
  background: var(--blog-blue);
  border-color: var(--blog-blue);
  color: #fff;
}

/* ── Grille d'articles ───────────────────────────────────────────────────── */
.blog-grid-section {
  background: var(--blog-bg);
  padding: 2.5rem 0 3rem;
}
.blog-count {
  text-align: center;
  font-size: .88rem;
  color: var(--blog-muted);
  margin-bottom: 1.5rem;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 1024px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .blog-grid { grid-template-columns: 1fr; } }

.blog-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px)  { .blog-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .blog-grid--3 { grid-template-columns: 1fr; } }

/* ── Carte article ───────────────────────────────────────────────────────── */
.blog-card {
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  overflow: hidden;
  box-shadow: var(--blog-shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .22s, transform .22s;
}
.blog-card:hover {
  box-shadow: 0 8px 32px rgba(0, 119, 182, .16);
  transform: translateY(-3px);
}
.blog-card__img-link {
  display: block;
  overflow: hidden;
  height: 200px;
}
.blog-card__img-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.blog-card:hover .blog-card__img-link img { transform: scale(1.04); }

.blog-card__body {
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .6rem;
}
.blog-card__cat {
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--blog-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.blog-card__cat:hover { text-decoration: underline; }
.blog-card__time {
  font-size: .73rem;
  color: var(--blog-muted);
  display: flex;
  align-items: center;
  gap: .25rem;
}
.blog-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .5rem;
  flex: 1;
}
.blog-card__title a {
  color: var(--blog-text);
  text-decoration: none;
}
.blog-card__title a:hover { color: var(--blog-blue); }
.blog-card__excerpt {
  font-size: .85rem;
  color: var(--blog-muted);
  line-height: 1.55;
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border-top: 1px solid #eef3f6;
  padding-top: .7rem;
  margin-top: auto;
}
.blog-card__date {
  font-size: .75rem;
  color: var(--blog-muted);
  display: flex;
  align-items: center;
  gap: .25rem;
}
.blog-card__read-more {
  font-size: .78rem;
  font-weight: 700;
  color: var(--blog-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
}
.blog-card__read-more:hover { text-decoration: underline; }

/* ── État vide ───────────────────────────────────────────────────────────── */
.blog-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--blog-muted);
}
.blog-empty i { font-size: 3rem; margin-bottom: 1rem; opacity: .4; display: block; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 .55rem;
  border: 1.5px solid var(--blog-border);
  border-radius: 8px;
  color: var(--blog-text);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: background .18s, border-color .18s, color .18s;
}
.pag-btn:hover { background: #edf5fb; border-color: var(--blog-blue); }
.pag-btn--active {
  background: var(--blog-blue);
  border-color: var(--blog-blue);
  color: #fff;
  pointer-events: none;
}

/* ── CTA blog ────────────────────────────────────────────────────────────── */
.blog-cta {
  background: linear-gradient(135deg, #1272a8, #30b8e8);
  padding: 3rem 0;
}
.blog-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.blog-cta__inner h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: #fff;
  margin-bottom: .4rem;
}
.blog-cta__inner p { color: rgba(255,255,255,.85); font-size: .95rem; }
.blog-cta .btn.primary-btn {
  background: #fff;
  color: var(--blog-blue);
  border: none;
  white-space: nowrap;
  font-weight: 700;
}
.blog-cta .btn.primary-btn:hover { background: #e0f0f5; }

/* ── Layout de l'article ─────────────────────────────────────────────────── */
.article-layout {
  background: var(--blog-bg);
  padding: 2.5rem 0;
}
.article-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 960px) {
  .article-grid { grid-template-columns: 1fr; }
  .article-sidebar { order: -1; }
}

/* ── En-tête article ─────────────────────────────────────────────────────── */
/* Neutralise header{position:fixed} de style.css pour l'en-tête d'article */
.article-header {
  position: static;
  top: auto;
  left: auto;
  width: auto;
  background-color: transparent;
  z-index: auto;
  box-shadow: none;
  padding: 0;
}
.article-hero-img {
  margin: 1rem 0 1.5rem;
}

.article-main {
  background: #fff;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--blog-shadow);
}
@media (max-width: 600px) { .article-main { padding: 1.25rem; } }

.article-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .32rem .85rem;
  background: #edf5fb;
  border: 1.5px solid var(--blog-blue);
  border-radius: 20px;
  color: var(--blog-blue);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 1rem;
}
.article-cat-badge:hover { background: var(--blog-blue); color: #fff; }

.article-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--blog-text);
  line-height: 1.25;
  margin-bottom: .85rem;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .82rem;
  color: var(--blog-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--blog-border);
}
.article-meta span {
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* ── Corps de l'article ──────────────────────────────────────────────────── */
.article-excerpt {
  font-size: 1.05rem;
  color: var(--blog-muted);
  line-height: 1.7;
  margin-bottom: 1.75rem;
  padding: 1rem 1.25rem;
  background: #edf5fb;
  border-left: 4px solid var(--blog-blue);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--blog-text);
}
.article-body h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  color: var(--blog-blue);
  margin: 2rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid #d6e8f0;
}
.article-body h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  color: var(--blog-text);
  margin: 1.5rem 0 .6rem;
}
.article-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blog-text);
  margin: 1.25rem 0 .5rem;
}
.article-body p { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol {
  margin: 0 0 1.1rem 1.5rem;
}
.article-body li { margin-bottom: .4rem; }
.article-body blockquote {
  border-left: 4px solid var(--blog-blue);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  background: #f0f8ff;
  border-radius: 0 8px 8px 0;
  color: var(--blog-muted);
  font-style: italic;
}
.article-body strong { color: var(--blog-text); font-weight: 700; }
.article-body a { color: var(--blog-blue); }
.article-body a:hover { text-decoration: none; }
.article-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .9rem;
}
.article-body th {
  background: var(--blog-blue);
  color: #fff;
  padding: .55rem .8rem;
  text-align: left;
  font-weight: 700;
}
.article-body td {
  padding: .5rem .8rem;
  border-bottom: 1px solid var(--blog-border);
}
.article-body tr:nth-child(even) td { background: #f4f8fb; }

/* Encadrés info / alerte */
.article-body .info-box {
  background: #e8f4fa;
  border-left: 4px solid var(--blog-blue);
  padding: .85rem 1.1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
}
.article-body .warning-box {
  background: #fff3cd;
  border-left: 4px solid #f0ad00;
  padding: .85rem 1.1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
}
.article-body .info-box p,
.article-body .warning-box p { margin-bottom: 0; }

/* ── Tags ────────────────────────────────────────────────────────────────── */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--blog-border);
}
.tag {
  display: inline-block;
  padding: .25rem .65rem;
  background: #edf5fb;
  border: 1px solid var(--blog-border);
  border-radius: 4px;
  font-size: .75rem;
  color: var(--blog-muted);
}

/* ── Partage ─────────────────────────────────────────────────────────────── */
.article-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--blog-bg);
  border-radius: 8px;
}
.article-share__label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--blog-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .85rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .18s;
}
.share-btn:hover { opacity: .85; }
.share-btn--wa   { background: #0f7a40; color: #fff; }   /* vert WhatsApp assombri : AA 5,41:1 */
.share-btn--fb   { background: #1567d4; color: #fff; }   /* bleu Facebook assombri : AA 5,35:1 */
.share-btn--copy { background: #edf5fb; color: var(--blog-blue); border: 1.5px solid var(--blog-border); }
.share-btn--copy.copied { background: #d4edda; color: #155724; border-color: #c3e6cb; }

/* ── Box auteur ──────────────────────────────────────────────────────────── */
.article-author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--blog-bg);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
}
.article-author-box img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.article-author-box strong { display: block; font-weight: 700; color: var(--blog-text); margin-bottom: .3rem; }
.article-author-box p { font-size: .85rem; color: var(--blog-muted); line-height: 1.5; margin-bottom: .4rem; }
.article-author-box a { font-size: .82rem; color: var(--blog-blue); text-decoration: none; font-weight: 600; }
.article-author-box a:hover { text-decoration: underline; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.article-sidebar { position: sticky; top: 100px; }
.sidebar-card {
  background: #fff;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 1.25rem;
  box-shadow: var(--blog-shadow);
}
.sidebar-card h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--blog-text);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.sidebar-card p { font-size: .85rem; color: var(--blog-muted); line-height: 1.55; }
.sidebar-cat-list { list-style: none; padding: 0; margin: 0; }
.sidebar-cat-list li { border-bottom: 1px solid #eef3f6; }
.sidebar-cat-list li:last-child { border-bottom: none; }
.sidebar-cat-list a {
  display: block;
  padding: .5rem .25rem;
  font-size: .85rem;
  color: var(--blog-text);
  text-decoration: none;
  transition: color .18s, padding-left .18s;
}
.sidebar-cat-list a:hover { color: var(--blog-blue); padding-left: .4rem; }

/* ── Articles associés ────────────────────────────────────────────────────── */
.related-articles {
  background: var(--blog-bg);
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--blog-border);
}
.related-articles__title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--blog-text);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ── Mobile nav toggle (blog pages) ─────────────────────────────────────── */
@media (max-width: 768px) {
  .article-sidebar { position: static; top: auto; }
  .cat-tabs { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; }
  .cat-tab { flex-shrink: 0; }
}

/* ── Articles en arabe (RTL) ──────────────────────────────────────────────── */
[dir="rtl"] .article-body th { text-align: right; }
[dir="rtl"] .sidebar-cat-list a:hover { padding-left: 0; padding-right: .4rem; }

/* ── Classes remplaçant les attributs style= (CSP style-src 'self') ───────── */
.blog-empty__btn { margin-top: 1rem; }

.article-hero-img img {
  width: 100%;
  border-radius: 12px;
  max-height: 420px;
  object-fit: cover;
}

.sidebar-btn {
  display: block;
  text-align: center;
  margin-top: .75rem;
}
.sidebar-btn--wa {
  background: #0f7a40;
  color: #fff;
  border-radius: 6px;
  padding: .55rem;
  text-decoration: none;
  font-weight: 600;
  margin-top: .5rem;
}
.sidebar-btn--wa:hover { background: #0d6836; color: #fff; }
.sidebar-phone {
  margin-top: .75rem;
  font-size: .82rem;
  color: var(--blog-muted);
}
.sidebar-card--spaced { margin-top: 1rem; }

/* ── Blog en arabe : la mise en page vient de style.css (LTR), on inverse ─── */
[dir="rtl"] body { font-family: 'Almarai', 'Poppins', sans-serif; }

[dir="rtl"] .breadcrumb,
[dir="rtl"] .article-meta,
[dir="rtl"] .blog-card__meta,
[dir="rtl"] .blog-card__footer,
[dir="rtl"] .article-share { direction: rtl; }

[dir="rtl"] .sidebar-cat-list a:hover { padding-left: 0; padding-right: .4rem; }

@media (max-width: 1080px) {
  [dir="rtl"] nav {
    right: auto;
    left: -100%;
    box-shadow: 5px 0 15px rgba(0, 0, 0, .1);
  }
  [dir="rtl"] nav.active { left: 0; right: auto; }
}
