/* =====================================================================
 * Weda Blog System — HUB / Archive (page liste d'articles)
 * Rendu Gutenberg natif, cohabitation avec Breakdance.
 * Pixel-perfect d'après Figma 42R7JoA7h4vlGJUONQJxbx (HUB 3531:12225,
 * carte d'article 3539:6931).
 * ===================================================================== */

:root {
  /* Tokens spécifiques hub (complètent ceux de blog-front.css) */
  --weda-hub-card-radius: 16px;
  --weda-hub-img-radius: 8px;
  --weda-hub-card-w: 416px;
  --weda-hub-grid-gap: 48px;
  --weda-hub-card-pad: 16px;
  --weda-hub-card-gap: 24px;
  --weda-hub-card-img-h: 252px;
  --weda-hub-card-shadow: 0 -8px 24px -4px rgba(56, 67, 208, .05),
                          0 -6px 12px -6px rgba(56, 67, 208, .05);
  --weda-hub-accent-orange: #FD9104;
  --weda-hub-accent-magenta: #C02988;
}

/* ---------- Conteneur hub ---------- */
.weda-hub {
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: var(--weda-blog-container);
  margin: 0 auto;
  /* + de marge sous le header, - d'espace avant le footer (calé maquette : bandeau ~ flush footer) */
  padding: clamp(100px, 14vw, 200px) 0 0;
  color: var(--weda-blog-text);
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.weda-hub * { box-sizing: border-box; }

/* ---------- Hero / titre ---------- */
/* BugHerd #26 : le bloc titre était plus étroit (1080) que la grille (1348) → paraissait en retrait. Élargi. */
.weda-hub__head { text-align: center; margin: 0 auto clamp(28px, 3vw, 40px); max-width: 1348px; }
.weda-hub__title {
  margin: 0 0 16px;
  color: var(--weda-blog-text);
  font-size: clamp(30px, 3vw, 40px);   /* maquette 3531:13809 : Medium 40/48 (était clamp→52, trop gros) */
  line-height: 1.2;
  font-weight: 500;                     /* maquette : Medium 500 (était 600) */
  letter-spacing: -.01em;
}
.weda-hub__title-light { font-weight: 300; }
.weda-hub__subtitle {
  margin: 0 auto;
  max-width: 1200px;                    /* BugHerd #26 : élargi (colonne jugée trop étroite) */
  color: rgba(0, 0, 0, .5);             /* maquette : Noir 50% (était --weda-blog-muted) */
  font-size: 20px;
  line-height: 30px;
}

/* ---------- Barre de filtres (toggle catégories) ---------- */
.weda-hub__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto clamp(32px, 4vw, 48px);
  padding: 8px;
  background: var(--weda-blog-blue-50);
  border-radius: 100px;
}
.weda-hub__filter {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-radius: 100px;
  background: transparent;
  color: rgba(0, 0, 0, .7);
  font-family: inherit;
  font-size: 16px;       /* BugHerd #2 : Outfit Semibold 16px */
  line-height: 1;
  font-weight: 600;      /* Semibold */
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
a.weda-hub__filter { text-decoration: none; }
.weda-hub__filter:hover { background: rgba(56, 67, 208, .12); }
.weda-hub__filter.is-active,
.weda-hub__filter[aria-pressed="true"],
a.weda-hub__filter[aria-current="page"] {
  background: rgba(56, 67, 208, .3);
  color: var(--weda-blog-blue-700);
}

/* ====================================================================
 * Carte d'article (composant atomique) — Figma 3539:6931
 * ==================================================================== */
.weda-card {
  position: relative;            /* ancre le stretched-link (BugHerd #8) */
  display: flex;
  flex-direction: column;
  gap: var(--weda-hub-card-gap);
  padding: var(--weda-hub-card-pad);
  background: #fff;
  border-radius: var(--weda-hub-card-radius);
  box-shadow: var(--weda-hub-card-shadow);
  text-decoration: none;
  color: inherit;
}
/* BugHerd #8 : toute la carte cliquable. Le CTA « Lire l'article » devient un
   lien étiré couvrant la carte (un seul lien → reste accessible). */
.weda-card__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.weda-card { cursor: pointer; }
.weda-card__top { display: flex; flex-direction: column; gap: var(--weda-hub-card-gap); }

/* Image + tags */
.weda-card__media {
  position: relative;
  width: 100%;
  height: var(--weda-hub-card-img-h);
  border-radius: var(--weda-hub-img-radius);
  overflow: hidden;
  background: var(--weda-blog-blue-50);
}
/* `.weda-card__media` (0,2,0) pour battre `.breakdance img { height:auto }` (0,1,1) qui empêchait
 * l'image de remplir le média à hauteur fixe → fond blue-50 visible sous l'image en mobile. */
.weda-card__media .weda-card__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.weda-card__placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ECF1FB, #F9FAFB);
  color: var(--weda-blog-blue-700); font-size: 22px; font-weight: 600;
}
.weda-card__badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.weda-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px 2px 2px;
  background: #fff;
  border-radius: 100px;
  font-size: 14px;
  line-height: 18.2px;
  color: #000;
  white-space: nowrap;
}
.weda-card__badge-dot {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  border-radius: 100px;
  background: rgba(56, 67, 208, .3); /* défaut : bleu */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.weda-card__badge-dot img { width: 11px; height: 11px; display: block; }
.weda-card__badge--orange .weda-card__badge-dot { background: rgba(253, 145, 4, .3); }
.weda-card__badge--magenta .weda-card__badge-dot { background: rgba(192, 41, 136, .3); }

/* Méta (date · temps de lecture) */
.weda-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(0, 0, 0, .5);
  font-size: 14px;
  line-height: 18.2px;
}
.weda-card__sep { width: 1px; align-self: stretch; background: rgba(0, 0, 0, .5); }
.weda-card__readtime { display: inline-flex; align-items: center; gap: 8px; }
.weda-card__readtime svg { width: 13px; height: 13px; display: block; }

/* Titre */
.weda-card__title {
  margin: 0;
  color: #000;
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -.2px;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CTA Lire l'article */
.weda-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--weda-blog-blue-700);
  text-decoration: none;
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -.2px;
  font-weight: 400;
}
.weda-card__cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 15px;
  background: var(--weda-blog-blue-700);
  color: #fff;
}
.weda-card__cta-icon svg { width: 9px; height: 9px; display: block; }
.weda-card:hover .weda-card__cta { text-decoration: underline; }

/* ====================================================================
 * Article à la une (carte horizontale) — Figma 3539:7851
 * ==================================================================== */
/* BugHerd #3 : à la une = marge 230px sur frame 1728 → 1268px de large (40px de
   moins que la grille de chaque côté). La grille reste à 1348px (marge 190px). */
.weda-hub__featured { width: 100%; max-width: 1268px; margin: 0 auto clamp(24px, 3vw, 32px); }
.weda-card--featured {
  flex-direction: row;
  align-items: center;          /* bloc texte centré verticalement (Figma) */
  gap: 24px;
  background: var(--weda-blog-blue-50);  /* #ECF1FB */
  border-radius: 15px;
  box-shadow: 0 0 6px rgba(56, 67, 208, .05), 0 0 12px rgba(56, 67, 208, .05);
}
.weda-card--featured .weda-card__media {
  flex: 0 0 618px;
  max-width: 618px;
  height: 348px;
}
.weda-card--featured .weda-card__body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 24px 16px;
  min-width: 0;
}
.weda-card--featured .weda-card__title {
  font-size: 32px;
  line-height: 38px;
  font-weight: 500;             /* Outfit Medium */
  -webkit-line-clamp: 2;
}
.weda-card--featured .weda-card__cta {
  align-self: flex-end;         /* CTA aligné à droite (Figma) */
  margin-top: 0;
}
.weda-card__excerpt {
  margin: 0;
  color: rgba(0, 0, 0, .7);
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -.2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ====================================================================
 * Grille d'articles
 * ==================================================================== */
.weda-hub__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--weda-hub-grid-gap);
}

/* Section "Les actus immanquables" */
.weda-hub__section { margin-top: clamp(48px, 6vw, 80px); }
.weda-hub__section-title {
  margin: 0 0 clamp(20px, 2.5vw, 32px);
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.15;
  font-weight: 500;
}

/* État vide */
.weda-hub__empty { text-align: center; color: var(--weda-blog-muted); padding: 48px 0; font-size: 18px; }
.weda-card.is-hidden { display: none; }
.weda-hub__grid.is-loading { opacity: .5; transition: opacity .15s ease; pointer-events: none; }

/* ---------- Pagination (dots + flèches) — Figma "Dots" ---------- */
.weda-hub__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: clamp(28px, 3vw, 40px);
}
.weda-hub__pagination[hidden] { display: none; }
.weda-hub__dots { display: flex; align-items: center; gap: 8px; }
.weda-hub__dot {
  appearance: none;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--weda-blog-blue-700);
  opacity: .2;
  cursor: pointer;
  transition: opacity .15s ease, width .15s ease;
}
/* Maquette (Dots 3710:8482) : tous les dots 8×8, l'actif est simplement à pleine
 * opacité (pas d'allongement en pilule). BugHerd #27. */
.weda-hub__dot.is-active { opacity: 1; }
.weda-hub__nav {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--weda-blog-blue-700);
  cursor: pointer;
}
.weda-hub__nav svg { width: 7px; height: 13px; }  /* chevron (BugHerd #4) */
.weda-hub__nav--prev { transform: scaleX(-1); }
.weda-hub__nav:disabled { opacity: .25; cursor: default; }

/* ---------- Section "Les actus immanquables" (carrousel) ---------- */
.weda-hub__section-title .is-light { font-weight: 300; }
.weda-hub__section-title { text-align: center; font-weight: 500; }
.weda-hub__carousel { overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.weda-hub__carousel::-webkit-scrollbar { height: 0; }
.weda-hub__carousel-track { display: flex; gap: var(--weda-hub-grid-gap); }
/* 3 cartes visibles par vue, largeur fixe (pas de shrink) → le reste défile */
.weda-hub__carousel-track > .weda-card {
  flex: 0 0 calc((100% - 2 * var(--weda-hub-grid-gap)) / 3);
  scroll-snap-align: start;
}

/* ---------- Bandeau newsletter — Figma 4029:14799 ---------- */
.weda-hub__bandeau { margin-top: clamp(48px, 6vw, 80px); }
.weda-hub__bandeau-card {
  position: relative;
  min-height: 332px;
  background: var(--weda-blog-blue-50); /* #ECF1FB */
  border-radius: 15px;
  padding: 48px 50px;
  overflow: hidden;
}
.weda-hub__bandeau-image {
  position: absolute;
  right: 120px;
  top: 95%;
  width: 389px;
  height: 545px;
  border-radius: 15px;
  object-fit: cover;
  transform: translateY(-50%) rotate(10.17deg);
  box-shadow: 0 24px 60px rgba(7, 31, 95, .18);
  pointer-events: none;
}
.weda-hub__bandeau-body {
  position: relative;
  z-index: 1;
  max-width: 600px;
  min-height: 236px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
/* BugHerd #6 : titre dynamique → ligne 1 Outfit Medium 40px, ligne 2 Light 40px */
.weda-hub__bandeau-title { margin: 0; font-size: 40px; line-height: 48px; font-weight: 500; color: #000; }
.weda-hub__bandeau-title .is-light { font-weight: 300; }
.weda-hub__bandeau-text { margin: 0; font-size: 20px; line-height: 1.5; color: rgba(0, 0, 0, .7); }
.weda-hub__bandeau-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--weda-blog-blue-700);
  border-radius: 100px;
  color: var(--weda-blog-blue-700);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  text-decoration: none;
}
.weda-hub__bandeau-cta:hover { background: var(--weda-blog-blue-700); color: #fff; }
/* BugHerd #7 : petit chevron à droite du CTA « Je m'inscris » */
.weda-hub__bandeau-cta-icon { display: inline-flex; align-items: center; margin-left: 8px; }
.weda-hub__bandeau-cta-icon svg { width: 6px; height: 11px; }

/* ====================================================================
 * Responsive — tablette (≤1023px) et mobile (≤767px, frame 390px)
 * ==================================================================== */
@media (max-width: 1023px) {
  .weda-hub__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .weda-card--featured { flex-direction: column; }
  .weda-card--featured .weda-card__media { flex-basis: auto; max-width: none; width: 100%; height: 300px; }
  .weda-card--featured .weda-card__body { padding: 0; }
  .weda-card--featured .weda-card__title { font-size: 28px; }
  /* Bandeau : visuel incliné masqué (le bandeau mobile est une variante distincte) */
  .weda-hub__bandeau-image { display: none; }
  .weda-hub__bandeau-card { min-height: 0; }
  .weda-hub__bandeau-body { max-width: none; min-height: 0; }
}

@media (max-width: 1023px) {
  .weda-hub__carousel-track { gap: 32px; }
  .weda-hub__carousel-track > .weda-card { flex-basis: calc((100% - 32px) / 2); }
}

@media (max-width: 767px) {
  /* Gutter 30px (Figma WEDA-blog-cat-mobi) + top pour dégager le header OVERLAY Breakdance
   * (⚠️ ne PAS descendre sous la hauteur du header, sinon le contenu passe dessous). */
  .weda-hub { width: 100%; padding: 130px 30px 0; }
  .weda-hub__grid { grid-template-columns: 1fr; gap: 24px; }
  .weda-hub__filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    border-radius: 999px;
    -webkit-overflow-scrolling: touch;
  }
  .weda-hub__filter { flex: 0 0 auto; }
  /* Sur mobile, l'article à la une = carte blanche verticale avec extrait (pas le bloc bleu desktop) */
  .weda-card--featured {
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-radius: var(--weda-hub-card-radius);
    box-shadow: var(--weda-hub-card-shadow);
    gap: var(--weda-hub-card-gap);
  }
  .weda-card--featured .weda-card__media { flex-basis: auto; max-width: none; width: 100%; height: 252px; }
  .weda-card--featured .weda-card__body { padding: 0; gap: 12px; }
  .weda-card--featured .weda-card__title { font-size: 22px; line-height: 28px; }
  .weda-card--featured .weda-card__excerpt { font-size: 16px; line-height: 1.5; }
  .weda-card--featured .weda-card__cta { align-self: flex-start; }  /* CTA à gauche sur mobile */
  .weda-hub__carousel-track { gap: 16px; }
  .weda-hub__carousel-track > .weda-card { flex-basis: 86%; }
  .weda-hub__bandeau-card { padding: 28px 22px; }
  .weda-hub__bandeau-title { font-size: 28px; line-height: 34px; }
  .weda-hub__section-title { font-size: 28px; line-height: 34px; }
}

/* Override `.breakdance a` (global) sur les CTA du hub (carte, bandeau). */
.weda-card .weda-card__cta { color: var(--weda-blog-blue-700); }
.weda-hub__bandeau .weda-hub__bandeau-cta { color: var(--weda-blog-blue-700); }
.weda-hub__bandeau .weda-hub__bandeau-cta:hover { color: #fff; }
.weda-card .weda-card__cta:hover { color: var(--weda-blog-blue-700); }
