/**
 * hx-comparaison.css  v1.0
 * Styles pour les pages de comparaison SEO : PA6 vs PA66, ABS vs ASA…
 * Template : single-comparaison-matieres.php
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ════════════════════════════════════════════════════════════════════════════
   VARIABLES & RESET
════════════════════════════════════════════════════════════════════════════ */
:root {
  --hx-blue:        #1a4fa3;
  --hx-blue-dark:   #102f6a;
  --hx-blue-light:  #2563eb;
  --hx-blue-faint:  #eff6ff;
  --hx-amber:       #f59e0b;
  --hx-amber-light: #fef3c7;
  --hx-amber-dark:  #b45309;
  --hx-green:       #16a34a;
  --hx-green-light: #dcfce7;
  --hx-red:         #dc2626;
  --hx-red-light:   #fee2e2;
  --hx-grey-50:     #f8fafc;
  --hx-grey-100:    #f1f5f9;
  --hx-grey-200:    #e2e8f0;
  --hx-grey-400:    #94a3b8;
  --hx-grey-600:    #475569;
  --hx-grey-800:    #1e293b;
  --hx-text:        #1a2540;
  --hx-radius:      10px;
  --hx-radius-sm:   6px;
  --hx-shadow:      0 2px 16px rgba(26,79,163,.10);
  --hx-shadow-md:   0 4px 24px rgba(26,79,163,.14);
  --hx-trans:       all .22s ease;
  --hx-inner-w:     1200px;
  --hx-col-a:       #2563eb;
  --hx-col-b:       #f59e0b;
}

.hx-cmp-wrap *,
.hx-cmp-wrap *::before,
.hx-cmp-wrap *::after {
  box-sizing: border-box;
}

.hx-cmp-wrap {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color: var(--hx-text);
  line-height: 1.65;
}

/* ── Inner container ── */
.hx-cmp-inner {
  max-width: var(--hx-inner-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Sections ── */
.hx-cmp-section {
  padding: 60px 0;
}

.hx-cmp-section:nth-child(even) {
  background: var(--hx-grey-50);
}

.hx-cmp-section__title {
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  font-weight: 700;
  color: var(--hx-blue-dark);
  margin: 0 0 32px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--hx-grey-200);
}

/* ════════════════════════════════════════════════════════════════════════════
   HERO
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-hero {
  position: relative;
  background: linear-gradient(135deg, #0d2a5e 0%, #1a4fa3 55%, #2563eb 100%);
  padding: 80px 0 64px;
  overflow: hidden;
}

.hx-cmp-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(37,99,235,.35) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(245,158,11,.20) 0%, transparent 55%);
  pointer-events: none;
}

/* ── Breadcrumb ── */
.hx-cmp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: rgba(255,255,255,.7);
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.hx-cmp-breadcrumb a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  transition: var(--hx-trans);
}
.hx-cmp-breadcrumb a:hover {
  color: #fff;
}
.hx-cmp-breadcrumb span[aria-current] {
  color: #fff;
}

/* ── Versus display ── */
.hx-cmp-hero__versus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.hx-cmp-hero__mat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hx-cmp-hero__sigle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 10px 20px;
  border-radius: var(--hx-radius);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
}
.hx-cmp-hero__sigle--a {
  background: rgba(37,99,235,.45);
  border: 2px solid rgba(37,99,235,.7);
}
.hx-cmp-hero__sigle--b {
  background: rgba(245,158,11,.35);
  border: 2px solid rgba(245,158,11,.6);
}

.hx-cmp-hero__nom {
  font-size: .83rem;
  color: rgba(255,255,255,.8);
  font-style: italic;
}
.hx-cmp-hero__famille {
  font-size: .75rem;
  color: rgba(255,255,255,.6);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hx-cmp-hero__vs {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  color: rgba(255,255,255,.35);
  letter-spacing: .1em;
  flex-shrink: 0;
}

/* ── Hero title ── */
.hx-cmp-hero__title {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.3;
}

.hx-cmp-hero__desc {
  font-size: 1rem;
  color: rgba(255,255,255,.78);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 32px;
}

/* ── Boutons ── */
.hx-cmp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--hx-radius-sm);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--hx-trans);
  white-space: nowrap;
  border: 2px solid transparent;
}

.hx-cmp-btn--hero {
  display: block;
  width: fit-content;
  margin: 0 auto;
  background: #fff;
  color: var(--hx-blue);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.hx-cmp-btn--hero:hover {
  background: var(--hx-blue-faint);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.hx-cmp-btn--primary {
  background: var(--hx-blue);
  color: #fff;
  border-color: var(--hx-blue);
}
.hx-cmp-btn--primary:hover {
  background: var(--hx-blue-dark);
  border-color: var(--hx-blue-dark);
  transform: translateY(-1px);
}

.hx-cmp-btn--outline-a {
  background: transparent;
  color: var(--hx-col-a);
  border-color: var(--hx-col-a);
}
.hx-cmp-btn--outline-a:hover {
  background: var(--hx-blue-faint);
}

.hx-cmp-btn--outline-b {
  background: transparent;
  color: var(--hx-amber-dark);
  border-color: var(--hx-col-b);
}
.hx-cmp-btn--outline-b:hover {
  background: var(--hx-amber-light);
}

.hx-cmp-btn--white {
  background: #fff;
  color: var(--hx-blue-dark);
  border-color: #fff;
}
.hx-cmp-btn--white:hover {
  background: var(--hx-blue-faint);
}

.hx-cmp-btn--ghost {
  background: transparent;
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.4);
}
.hx-cmp-btn--ghost:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.7);
}

/* ════════════════════════════════════════════════════════════════════════════
   SECTION 2 — RADAR + SCORES
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-radar-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.hx-cmp-radar-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

/* ── Score barres dual ── */
.hx-cmp-score-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hx-grey-100);
}
.hx-cmp-score-row:last-child {
  border-bottom: none;
}

.hx-cmp-score-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--hx-grey-600);
  white-space: nowrap;
}

.hx-cmp-score-bars-dual {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hx-cmp-score-bar-a,
.hx-cmp-score-bar-b {
  height: 14px;
  border-radius: 99px;
  min-width: 4px;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  transition: width .5s ease;
}

.hx-cmp-score-bar-a {
  background: linear-gradient(90deg, #93c5fd, var(--hx-col-a));
}
.hx-cmp-score-bar-b {
  background: linear-gradient(90deg, #fcd34d, var(--hx-amber-dark));
}

.hx-cmp-score-bar-a.hx-cmp-winner,
.hx-cmp-score-bar-b.hx-cmp-winner {
  box-shadow: 0 0 0 2px rgba(22,163,74,.5);
}

.hx-cmp-score-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: var(--hx-grey-600);
  white-space: nowrap;
}

.hx-cmp-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hx-cmp-dot--a { background: var(--hx-col-a); }
.hx-cmp-dot--b { background: var(--hx-col-b); }

/* ════════════════════════════════════════════════════════════════════════════
   SECTION 3 — INTRO PROSE
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-prose {
  max-width: 800px;
}
.hx-cmp-prose p {
  margin-bottom: 16px;
  font-size: .97rem;
  line-height: 1.75;
  color: var(--hx-grey-800);
}
.hx-cmp-prose strong {
  color: var(--hx-blue-dark);
}
.hx-cmp-prose a {
  color: var(--hx-blue);
  text-decoration: underline;
}

/* ════════════════════════════════════════════════════════════════════════════
   SECTION 4 — TABLEAU
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-table-section {
  background: #fff;
}

.hx-cmp-table-wrap {
  overflow-x: auto;
  border-radius: var(--hx-radius);
  border: 1px solid var(--hx-grey-200);
  box-shadow: var(--hx-shadow);
}

.hx-cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.hx-cmp-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.hx-cmp-table thead th {
  background: var(--hx-blue-dark);
  color: #fff;
  font-weight: 700;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

.hx-cmp-table thead th:first-child {
  width: 220px;
  min-width: 180px;
}

/* Colonnes A/B colorées dans l'entête */
.hx-cmp-col-a {
  border-bottom: 3px solid var(--hx-col-a) !important;
  background: #1a3a8f !important;
}
.hx-cmp-col-b {
  border-bottom: 3px solid var(--hx-col-b) !important;
  background: #1a3a8f !important;
}

.hx-cmp-table tbody tr:nth-child(even):not(.hx-cmp-tr-group) {
  background: var(--hx-grey-50);
}

.hx-cmp-table tbody tr:hover:not(.hx-cmp-tr-group) {
  background: #eff6ff;
}

.hx-cmp-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--hx-grey-200);
  vertical-align: middle;
  color: var(--hx-grey-800);
}

.hx-cmp-table td small {
  color: var(--hx-grey-400);
  font-size: .78rem;
}

/* Ligne de groupe */
.hx-cmp-tr-group {
  background: var(--hx-grey-100) !important;
}
.hx-cmp-tr-group td {
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--hx-blue-dark) !important;
  padding: 8px 16px;
}

/* Cellules gagnant / égalité */
.hx-cmp-winner {
  background: var(--hx-green-light) !important;
  font-weight: 700;
  color: var(--hx-green) !important;
}
.hx-cmp-tie {
  background: #fef9c3 !important;
  color: #854d0e !important;
}

/* Checks / croix */
.hx-cmp-check {
  color: var(--hx-green);
  font-size: 1.1rem;
  font-weight: 700;
}
.hx-cmp-cross {
  color: var(--hx-grey-400);
  font-size: 1.1rem;
}

/* Étoiles */
.hx-star {
  color: var(--hx-grey-200);
  font-size: 1rem;
}
.hx-star--on {
  color: var(--hx-amber);
}

/* Note de tableau */
.hx-cmp-table-note {
  margin-top: 16px;
  font-size: .82rem;
  color: var(--hx-grey-600);
  background: #fff7ed;
  border-left: 4px solid var(--hx-amber);
  padding: 10px 14px;
  border-radius: 0 var(--hx-radius-sm) var(--hx-radius-sm) 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   SECTION 5 — CONCLUSION + CARTES MATIÈRE
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-conclu-section {
  background: var(--hx-grey-50);
}

.hx-cmp-conclu-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 28px;
  align-items: start;
}

/* ── Cartes matière A / B ── */
.hx-cmp-mat-card {
  border-radius: var(--hx-radius);
  border: 2px solid var(--hx-grey-200);
  background: #fff;
  box-shadow: var(--hx-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hx-cmp-mat-card__header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hx-cmp-mat-card--a .hx-cmp-mat-card__header {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
}

.hx-cmp-mat-card--b .hx-cmp-mat-card__header {
  background: linear-gradient(135deg, #92400e, #f59e0b);
  color: #fff;
}

.hx-cmp-mat-card__sigle {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: .03em;
}

.hx-cmp-mat-card__tag {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .85;
  background: rgba(255,255,255,.2);
  padding: 3px 8px;
  border-radius: 99px;
}

.hx-cmp-mat-card__body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.hx-cmp-mat-card__arg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .87rem;
  color: var(--hx-grey-800);
  padding: 6px 0;
  border-bottom: 1px solid var(--hx-grey-100);
  line-height: 1.4;
}
.hx-cmp-mat-card__arg:last-child {
  border-bottom: none;
}

.hx-cmp-mat-card .hx-cmp-btn {
  margin: 12px 20px 20px;
  justify-content: center;
}

/* ── Centre conclusion ── */
.hx-cmp-conclu-center {
  /* rien de spécial, héritage de .hx-cmp-prose */
}

.hx-cmp-conclu-center .hx-cmp-btn {
  margin-top: 20px;
}

/* ════════════════════════════════════════════════════════════════════════════
   SECTION 6 — MAILLAGE INTERNE (comparatifs similaires)
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-related-section {
  background: #fff;
}

.hx-cmp-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.hx-cmp-related-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 16px;
  border-radius: var(--hx-radius);
  border: 1px solid var(--hx-grey-200);
  background: var(--hx-grey-50);
  text-decoration: none;
  text-align: center;
  transition: var(--hx-trans);
  box-shadow: var(--hx-shadow);
}
.hx-cmp-related-card:hover {
  background: var(--hx-blue-faint);
  border-color: var(--hx-blue-light);
  transform: translateY(-3px);
  box-shadow: var(--hx-shadow-md);
}

.hx-cmp-related-card__sigles {
  font-size: 1rem;
  font-weight: 700;
  color: var(--hx-blue-dark);
}

.hx-cmp-related-card__cta {
  font-size: .78rem;
  color: var(--hx-grey-600);
}

/* ════════════════════════════════════════════════════════════════════════════
   SECTION 7 — FAQ
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-faq-section {
  background: var(--hx-grey-50);
}

.hx-cmp-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 820px;
}

.hx-cmp-faq-item {
  border: 1px solid var(--hx-grey-200);
  border-radius: var(--hx-radius-sm);
  background: #fff;
  overflow: hidden;
  transition: box-shadow .2s;
}
.hx-cmp-faq-item.is-open {
  box-shadow: var(--hx-shadow);
}

.hx-cmp-faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: var(--hx-text);
  text-align: left;
  transition: background .15s;
}
.hx-cmp-faq__q:hover {
  background: var(--hx-blue-faint);
}
.hx-cmp-faq-item.is-open .hx-cmp-faq__q {
  background: var(--hx-blue-faint);
  color: var(--hx-blue-dark);
}

.hx-cmp-faq__icon {
  flex-shrink: 0;
  color: var(--hx-grey-400);
  transition: transform .25s ease;
}
.hx-cmp-faq-item.is-open .hx-cmp-faq__icon {
  transform: rotate(180deg);
  color: var(--hx-blue);
}

.hx-cmp-faq__a {
  padding: 0 20px 16px;
  font-size: .9rem;
  color: var(--hx-grey-800);
  line-height: 1.7;
}
.hx-cmp-faq__a[hidden] {
  display: none;
}
.hx-cmp-faq__a p {
  margin: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   SECTION 8 — CTA FINAL
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-cta {
  background: linear-gradient(135deg, #0d2a5e 0%, #1a4fa3 60%, #2563eb 100%);
  padding: 56px 0;
}

.hx-cmp-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.hx-cmp-cta__titre {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.hx-cmp-cta__desc {
  font-size: .95rem;
  color: rgba(255,255,255,.8);
  margin: 0;
  max-width: 540px;
}

.hx-cmp-cta__btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   SHORTCODE [hx_liens_comparaisons]
════════════════════════════════════════════════════════════════════════════ */
.hx-liens-comparaisons {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hx-liens-comparaisons li a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--hx-grey-200);
  border-radius: 99px;
  font-size: .83rem;
  font-weight: 600;
  color: var(--hx-blue);
  text-decoration: none;
  background: var(--hx-grey-50);
  transition: var(--hx-trans);
}
.hx-liens-comparaisons li a:hover {
  background: var(--hx-blue-faint);
  border-color: var(--hx-blue);
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLETTE ≤ 1024px
════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {

  .hx-cmp-radar-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hx-cmp-radar-canvas-wrap {
    max-width: 340px;
  }

  .hx-cmp-conclu-layout {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .hx-cmp-conclu-center {
    grid-column: 1 / -1;
    order: -1;
  }

  .hx-cmp-score-row {
    grid-template-columns: 110px 1fr;
    grid-template-rows: auto auto;
  }
  .hx-cmp-score-legend {
    grid-column: 1 / -1;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE ≤ 768px
════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  .hx-cmp-section {
    padding: 40px 0;
  }

  .hx-cmp-hero {
    padding: 52px 0 40px;
  }

  .hx-cmp-hero__versus {
    gap: 20px;
  }

  .hx-cmp-hero__vs {
    font-size: 2rem;
  }

  .hx-cmp-conclu-layout {
    grid-template-columns: 1fr;
  }
  .hx-cmp-conclu-center {
    order: 0;
  }

  .hx-cmp-cta__inner {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .hx-cmp-cta__desc {
    max-width: 100%;
  }

  .hx-cmp-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hx-cmp-score-row {
    grid-template-columns: 100px 1fr;
  }

  .hx-cmp-table thead th:first-child {
    min-width: 120px;
    width: 120px;
  }

  .hx-cmp-table td,
  .hx-cmp-table th {
    padding: 9px 10px;
    font-size: .83rem;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — PETIT MOBILE ≤ 480px
════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  .hx-cmp-inner {
    padding: 0 16px;
  }

  .hx-cmp-hero__versus {
    flex-direction: column;
    gap: 12px;
  }

  .hx-cmp-hero__vs {
    order: -1;
    font-size: 1.5rem;
  }

  .hx-cmp-related-grid {
    grid-template-columns: 1fr;
  }

  .hx-cmp-cta__btns {
    width: 100%;
    flex-direction: column;
  }
  .hx-cmp-btn {
    width: 100%;
    justify-content: center;
  }

  .hx-cmp-score-row {
    display: block;
  }
  .hx-cmp-score-label {
    display: block;
    margin-bottom: 4px;
  }
  .hx-cmp-score-bars-dual {
    margin-bottom: 4px;
  }
  .hx-cmp-score-legend {
    font-size: .68rem;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   ACCESSIBILITÉ — focus-visible
════════════════════════════════════════════════════════════════════════════ */
.hx-cmp-btn:focus-visible,
.hx-cmp-faq__q:focus-visible,
.hx-cmp-related-card:focus-visible {
  outline: 3px solid var(--hx-amber);
  outline-offset: 2px;
}
