/* ═══════════════════════════════════════════
   AS DÉCAP — Centre de Ressources / Knowledge Base
   Styles complémentaires (design-system.css requis)
═══════════════════════════════════════════ */

/* ---------- Hub ---------- */
.kb-hero__search {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin-top: var(--ds-space-md);
}
.kb-hero__search input {
  flex: 1;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-family: inherit;
  font-size: .95rem;
}
.kb-hero__search input::placeholder { color: rgba(255, 255, 255, .5); }

.kb-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: var(--ds-space-lg);
}
.kb-stat { display: flex; flex-direction: column; gap: 4px; }
.kb-stat__n {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--ds-copper-light);
  line-height: 1;
}
.kb-stat__l { font-size: .8rem; font-weight: 300; color: rgba(255, 255, 255, .6); }

.kb-cat {
  margin-bottom: var(--ds-space-2xl);
}
.kb-cat:last-child { margin-bottom: 0; }
.kb-cat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(15, 26, 36, .12);
  padding-bottom: 14px;
  margin-bottom: var(--ds-space-lg);
}
.kb-cat__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--ds-midnight);
}
.kb-cat__count { font-size: .8rem; font-weight: 300; color: var(--ds-text-muted); }

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.kb-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(15, 26, 36, .08);
  border-radius: var(--ds-radius, 14px);
  padding: var(--ds-space-md);
  text-decoration: none;
  color: var(--ds-text-dark);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.kb-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(15, 26, 36, .12);
  border-color: rgba(184, 115, 75, .4);
}
.kb-card__tag {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--ds-copper);
  margin-bottom: 10px;
}
.kb-card__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.12rem;
  line-height: 1.35;
  color: var(--ds-midnight);
  margin-bottom: 8px;
}
.kb-card__text {
  font-size: .85rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ds-text-muted);
  flex: 1;
}
.kb-card__more {
  margin-top: 14px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ds-copper);
}

/* ---------- Article layout ---------- */
.kb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--ds-space-xl);
  align-items: start;
}
.kb-article { max-width: 760px; }
.kb-article p { font-size: 1rem; }
.kb-article h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  color: var(--ds-midnight);
  margin: var(--ds-space-lg) 0 var(--ds-space-sm);
}
.kb-article h3 {
  font-size: 1.15rem;
  color: var(--ds-midnight);
  margin: var(--ds-space-md) 0 8px;
}

/* AI-extraction boxes */
.kb-box {
  border-radius: 14px;
  padding: 20px 24px;
  margin: var(--ds-space-md) 0;
}
.kb-box p:last-child { margin-bottom: 0; }
.kb-box__label {
  display: inline-block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.kb-def {
  background: var(--ds-midnight);
  color: var(--ds-text-light);
}
.kb-def .kb-box__label { color: var(--ds-copper-light); }
.kb-def p { color: rgba(255, 255, 255, .9); }

.kb-tldr {
  background: rgba(184, 115, 75, .08);
  border-left: 4px solid var(--ds-copper);
}
.kb-tldr .kb-box__label { color: var(--ds-copper-dark); }
.kb-tldr ul { margin: 8px 0 0; padding-left: 20px; }
.kb-tldr li { margin-bottom: 6px; font-weight: 300; }

.kb-short {
  background: var(--ds-cream);
  border-left: 4px solid var(--ds-midnight);
}
.kb-short .kb-box__label { color: var(--ds-midnight); }

/* Practical steps */
.kb-steps { counter-reset: kbstep; list-style: none; padding: 0; margin: var(--ds-space-md) 0; }
.kb-steps li {
  position: relative;
  padding: 4px 0 18px 56px;
  font-weight: 300;
  line-height: 1.75;
}
.kb-steps li::before {
  counter-increment: kbstep;
  content: counter(kbstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ds-copper);
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kb-steps li strong { color: var(--ds-midnight); }

/* Comparison table */
.kb-table-wrap { overflow-x: auto; margin: var(--ds-space-md) 0; }
.kb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 480px;
}
.kb-table caption {
  text-align: left;
  font-size: .8rem;
  color: var(--ds-text-muted);
  margin-bottom: 10px;
}
.kb-table th, .kb-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 26, 36, .1);
  text-align: left;
  vertical-align: top;
}
.kb-table thead th {
  background: var(--ds-midnight);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
}
.kb-table tbody th { font-weight: 700; color: var(--ds-midnight); background: rgba(184, 115, 75, .06); }
.kb-table tbody tr:nth-child(even) td { background: rgba(15, 26, 36, .02); }
.kb-table .kb-yes { color: #2f7d4f; font-weight: 700; }
.kb-table .kb-no { color: #b3402f; font-weight: 700; }

/* Key figures inline */
.kb-keyfacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: var(--ds-space-md) 0;
}
.kb-keyfact {
  background: #fff;
  border: 1px solid rgba(15, 26, 36, .1);
  border-radius: 12px;
  padding: 16px;
}
.kb-keyfact__n {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--ds-copper);
  line-height: 1;
}
.kb-keyfact__l { font-size: .78rem; font-weight: 300; color: var(--ds-text-muted); margin-top: 6px; }

/* Aside / sticky */
.kb-aside { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 18px; }
.kb-aside__box {
  background: #fff;
  border: 1px solid rgba(15, 26, 36, .1);
  border-radius: 14px;
  padding: 20px;
}
.kb-aside__box h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--ds-midnight);
  margin-bottom: 12px;
}
.kb-aside__box ul { list-style: none; padding: 0; margin: 0; }
.kb-aside__box li { margin-bottom: 8px; }
.kb-aside__box a { font-size: .88rem; color: var(--ds-text-dark); text-decoration: none; font-weight: 300; }
.kb-aside__box a:hover { color: var(--ds-copper); }
.kb-aside__cta {
  background: var(--ds-midnight);
  color: #fff;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
}
.kb-aside__cta p { color: rgba(255, 255, 255, .8); font-size: .85rem; font-weight: 300; margin-bottom: 14px; }
.kb-aside__cta .ds-btn { width: 100%; }
.kb-aside__tel {
  display: block;
  margin-top: 12px;
  color: var(--ds-copper-light);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
}

/* Related articles */
.kb-related { margin-top: var(--ds-space-xl); }
.kb-related h2 { margin-bottom: var(--ds-space-md); }
.kb-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.kb-related__card {
  display: block;
  background: var(--ds-cream);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.kb-related__card:hover { border-color: var(--ds-copper); background: #fff; }
.kb-related__card span { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ds-copper); font-weight: 700; }
.kb-related__card strong { display: block; margin-top: 6px; color: var(--ds-midnight); font-family: 'Playfair Display', serif; font-weight: 600; font-size: .98rem; line-height: 1.35; }

/* Inline article CTA */
.kb-cta-inline {
  background: var(--ds-midnight);
  color: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  margin: var(--ds-space-lg) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.kb-cta-inline h3 { color: #fff; margin: 0 0 6px; font-size: 1.25rem; }
.kb-cta-inline p { color: rgba(255, 255, 255, .75); margin: 0; font-size: .9rem; font-weight: 300; }
.kb-cta-inline__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.kb-authority {
  font-size: .85rem;
  font-weight: 300;
  color: var(--ds-text-muted);
  border-top: 1px solid rgba(15, 26, 36, .1);
  margin-top: var(--ds-space-lg);
  padding-top: var(--ds-space-md);
}

@media (max-width: 920px) {
  .kb-layout { grid-template-columns: 1fr; }
  .kb-aside { position: static; flex-direction: column; }
}
