/* ── Palette du site ── */
:root {
  --blog-bg:      #065cc2;
  --blog-surface: #2973cc;
  --blog-accent:  #afcdf1;
  --blog-text:    #ffffff;
  --blog-light:   #f0f6ff;
}

/* ── Hero ── */
.blog-hero {
  background: linear-gradient(160deg, #065cc2 0%, #2973cc 65%, #3d8de0 100%);
  padding: 120px 0 60px;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23afcdf1' fill-opacity='0.08'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.blog-hero h1 { font-family: 'Quicksand', sans-serif; font-weight: 700; color: #fff; }
.blog-hero .accent { color: #afcdf1; }
.blog-hero p { color: rgba(255,255,255,.85); }

/* ── Hero badge ── */
.blog-hero-badge {
  background: rgba(175,205,241,.15);
  border: 1px solid rgba(175,205,241,.45);
  border-radius: 50px;
  padding: 6px 20px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #afcdf1;
  display: inline-block;
  margin-bottom: 18px;
}

/* ── Search ── */
.blog-search-wrap { max-width: 520px; margin: 0 auto; }
.blog-search-wrap .input-group { border-radius: 50px; overflow: hidden; box-shadow: 0 4px 24px rgba(6,92,194,.4); }
.blog-search-wrap input { border: none; padding: 14px 20px; font-size: .95rem; background: #fff; color: #314862; }
.blog-search-wrap input:focus { box-shadow: none; outline: none; }
.blog-search-wrap .btn-search { background: #afcdf1; border: none; color: #065cc2; padding: 0 24px; font-weight: 700; }
.blog-search-wrap .btn-search:hover { background: #c8dbf5; }

/* ── Content section ── */
.blog-content-section { background: #f0f6ff; }

/* ── Filters ── */
.blog-filters { padding: 32px 0 8px; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid #c5d9f0;
  border-radius: 50px;
  padding: 7px 18px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  background: #fff;
  color: #2973cc;
  margin: 4px 3px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.filter-pill:hover { background: #2973cc; border-color: #2973cc; color: #afcdf1; }
.filter-pill.active { background: #065cc2; border-color: #065cc2; color: #afcdf1; box-shadow: 0 4px 14px rgba(6,92,194,.3); }
.badge-count { background: rgba(255,255,255,.2); border-radius: 50px; font-size: .7rem; padding: 1px 7px; min-width: 22px; text-align: center; }
.filter-pill:not(.active) .badge-count { background: #dbeafa; color: #2973cc; }

/* ── Stats ── */
.blog-stats { font-size: .85rem; color: #4a7ab5; padding-bottom: 4px; }
.blog-stats strong { color: #065cc2; }

/* ── Sort select ── */
#sortSelect { border-color: #c5d9f0; color: #065cc2; }
#sortSelect:focus { border-color: #065cc2; box-shadow: 0 0 0 .2rem rgba(6,92,194,.15); }

/* ── Cards ── */
.blog-card {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(6,92,194,.10);
  transition: transform .28s, box-shadow .28s;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.blog-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(6,92,194,.2); }

.blog-card-img-wrap { position: relative; overflow: hidden; height: 180px; flex-shrink: 0; }
.blog-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.blog-card:hover .blog-card-img-wrap img { transform: scale(1.07); }

.blog-card-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #065cc2;
  color: #afcdf1;
  font-size: .7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.blog-card-type {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(175,205,241,.92);
  color: #065cc2;
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
}

.blog-card-body { padding: 18px 20px 14px; flex: 1; display: flex; flex-direction: column; }

.blog-card-title { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 1rem; color: #13447f; line-height: 1.4; margin-bottom: 8px; }
.blog-card-title a { color: inherit; text-decoration: none; }
.blog-card-title a:hover { color: #065cc2; }

.blog-card-desc { font-size: .85rem; color: #4a6080; line-height: 1.55; flex: 1; margin-bottom: 12px; }

.blog-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.blog-card-tag {
  background: #e8f1fb;
  color: #065cc2;
  border: 1px solid #c5d9f0;
  border-radius: 50px;
  font-size: .68rem;
  padding: 2px 9px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.blog-card-tag:hover { background: #065cc2; color: #afcdf1; border-color: #065cc2; }

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e8f1fb;
  padding-top: 12px;
  margin-top: auto;
}
.blog-card-date { font-size: .75rem; color: #8aaccc; display: flex; align-items: center; gap: 5px; }
.blog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #065cc2;
  color: #afcdf1;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 700;
  padding: 5px 14px;
  text-decoration: none;
  transition: all .2s;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.blog-card-link:hover { background: #2973cc; color: #fff; }

/* ── Quiz badges ── */
.quiz-meta { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.quiz-badge {
  background: #dbeafa;
  color: #065cc2;
  border: 1px solid #b8d3f0;
  border-radius: 50px;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.diff-debutant      { background: #e8f5e9; color: #2e7d32; border-color: rgba(46,125,50,.3); }
.diff-intermediaire { background: #fff8e1; color: #f57f17; border-color: rgba(245,127,23,.3); }
.diff-avance        { background: #fce4ec; color: #c62828; border-color: rgba(198,40,40,.3); }

/* ── Loader ── */
.blog-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 320px; gap: 18px; }
.spinner-ring {
  width: 52px;
  height: 52px;
  border: 4px solid #c5d9f0;
  border-top-color: #065cc2;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: #4a7ab5; font-size: .9rem; }

/* ── Empty state ── */
.blog-empty { text-align: center; padding: 80px 20px; }
.blog-empty i { font-size: 3rem; color: #b8d3f0; margin-bottom: 16px; display: block; }
.blog-empty h4 { color: #4a7ab5; font-weight: 600; }
.blog-empty .btn-reset { background: #065cc2; color: #afcdf1; border-radius: 50px; padding: 8px 22px; font-weight: 600; border: none; }
.blog-empty .btn-reset:hover { background: #2973cc; color: #fff; }

/* ── Pagination ── */
.blog-pagination { padding: 40px 0 20px; }
.blog-pagination .page-link {
  border: 2px solid #c5d9f0;
  color: #065cc2;
  border-radius: 8px !important;
  padding: 8px 14px;
  font-weight: 600;
  transition: all .2s;
  margin: 0 3px;
  background: #fff;
}
.blog-pagination .page-link:hover,
.blog-pagination .page-item.active .page-link { background: #065cc2; border-color: #065cc2; color: #afcdf1; }
.blog-pagination .page-item.disabled .page-link { opacity: .4; pointer-events: none; }

/* ── Error banner ── */
.fetch-error {
  background: #fff5f5;
  border: 1px solid #ffe0e0;
  border-radius: 10px;
  padding: 14px 18px;
  color: #c0392b;
  font-size: .88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .blog-hero { padding: 100px 0 40px; }
  .blog-hero h1 { font-size: 1.7rem; }
  .filter-pill { font-size: .75rem; padding: 6px 13px; }
  .blog-card-img-wrap { height: 155px; }
}
