/* =========================================================================
   Kazacheck — styles globaux
   Porté depuis la maquette Claude Design (Accueil.dc.html).
   Ne contient que ce qui ne peut pas vivre en style inline :
   @font-face, variables, reset, keyframes, media queries responsive, :hover.
   Les styles de mise en page restent inline dans les templates (portage 1:1).
   ========================================================================= */

/* ---------- Police Lexend (auto-hébergée, sous-set latin) ---------- */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lexend-400-NEPEPod.woff2") format('woff2');
}
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/lexend-500-NEPEPod.woff2") format('woff2');
}
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/lexend-600-NEPEPod.woff2") format('woff2');
}
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/lexend-700-NEPEPod.woff2") format('woff2');
}

/* ---------- Police Fraunces (auto-hébergée, sous-set latin) — titres éditoriaux ---------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/fraunces-400-mqmI6po.woff2") format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/fraunces-500-6BGZRP0.woff2") format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/fraunces-600-AQmZ6pP.woff2") format('woff2');
}

/* ---------- Variables de marque ---------- */
:root {
  --primary: #1D4E89;
  --primary-2: #16406E;
  --accent: #1F9D57;
  --ink: #0E1F30;
  --muted: #56697C;
  --line: #E4EAF0;
  --soft: #F6F8FB;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; scroll-behavior: smooth; }
body {
  font-family: 'Lexend', Verdana, system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
::selection { background: rgba(31, 157, 87, .25); }

/* ---------- Animations ---------- */
@keyframes ic-feed {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
@keyframes ic-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(91, 216, 154, .5); }
  70%  { box-shadow: 0 0 0 9px rgba(91, 216, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 216, 154, 0); }
}
/* Le flux « en direct » se met en pause au survol */
[data-feed]:hover [data-feedtrack] { animation-play-state: paused; }

/* Menu mobile : ouverture animée + apparition échelonnée des liens */
@keyframes ic-menu-in   { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes ic-menu-item { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
[data-menu] { animation: ic-menu-in .34s cubic-bezier(.22, .61, .36, 1); transform-origin: top center; overflow: hidden; }
[data-menu] > div > a { animation: ic-menu-item .42s cubic-bezier(.22, .61, .36, 1) backwards; }
[data-menu] > div > a:nth-child(1) { animation-delay: .05s; }
[data-menu] > div > a:nth-child(2) { animation-delay: .10s; }
[data-menu] > div > a:nth-child(3) { animation-delay: .15s; }
[data-menu] > div > a:nth-child(4) { animation-delay: .20s; }
[data-menu] > div > a:nth-child(5) { animation-delay: .25s; }
[data-menu] > div > a:nth-child(6) { animation-delay: .30s; }
[data-menu] > div > a:nth-child(7) { animation-delay: .35s; }
[data-menu] > div > a:nth-child(8) { animation-delay: .40s; }
[data-menu] > div > a:nth-child(9) { animation-delay: .45s; }

/* Liens de navigation desktop : couleur au survol */
[data-nav] a { transition: color .18s ease; white-space: nowrap; }
[data-nav] a:hover { color: var(--primary) !important; }

/* Nav desktop : menus déroulants au survol (porté de Header.dc.html) */
[data-navitem] { position: relative; }
/* Le déclencheur est un <button> pour rester atteignable au clavier : on lui retire
   son apparence native pour qu'il rende comme le <span> de la maquette. */
[data-trigger] { transition: color .18s ease; border: 0; background: none; font: inherit; }
[data-navitem]:hover [data-trigger] { color: var(--primary); }
[data-navitem]:hover [data-chev] { transform: rotate(180deg); }
[data-navitem]:focus-within [data-trigger] { color: var(--primary); }
[data-navitem]:focus-within [data-chev] { transform: rotate(180deg); }
[data-dropdown] {
  position: absolute; top: calc(100% - 2px); left: 0; min-width: 290px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 48px -20px rgba(15, 44, 73, .34); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s; pointer-events: none;
}
[data-navitem]:hover [data-dropdown],
[data-navitem]:focus-within [data-dropdown] { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
[data-dropdown] a { white-space: normal; }
[data-dropitem] { transition: background .16s ease; }
[data-dropitem]:hover, [data-dropitem]:focus-visible { background: var(--soft); }

/* Liens du footer : couleur claire au survol (porté de Footer.dc.html) */
footer a { transition: color .16s ease; }
footer a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .ic-anim { animation: none !important; }
  [data-menu], [data-menu] > div > a { animation: none !important; }
  [data-dropdown] { transition: none !important; }
  html, body { scroll-behavior: auto; }
}

/* ---------- États :hover (remplacent l'attribut style-hover de la maquette) ---------- */
.ic-step:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px -26px rgba(15, 44, 73, .4);
  border-color: #cdd9e6;
}
.ic-price:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 56px -28px rgba(15, 44, 73, .45);
}
.ic-city:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 14px 28px -18px rgba(15, 44, 73, .4);
}
/* Hub /guides : carte du guide pilier, cartes d'articles, pastille « money ». */
[data-pillar]:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 64px -36px rgba(15, 44, 73, .5);
}
.ic-guide-card:hover {
  transform: translateY(-3px);
  border-color: #d6e0ea;
  box-shadow: 0 16px 30px -22px rgba(15, 44, 73, .42);
}
.ic-money:hover {
  transform: translateY(-2px);
}

/* La carte pilier passe en une colonne quand les 320px d'image ne tiennent plus. */
@media (max-width: 720px) {
  [data-pillar] { grid-template-columns: 1fr !important; }
  [data-pillar-img] { min-height: 200px !important; aspect-ratio: 16 / 9 !important; }
}

/* =========================================================================
   Article (Task 15) — prose, directives Markdown, sommaire
   Porté depuis le bloc [data-prose] et les composants inline de Article.dc.html.
   Le corps d'article est rendu par ContentParser (Markdown -> HTML) : les
   paragraphes/listes/titres n'ont pas de style inline, d'où ces règles.
   ========================================================================= */

/* ---------- Prose (corps d'article) ---------- */
[data-prose] p {
  margin: 0 0 18px;
  font-size: 17.5px;
  line-height: 1.72;
  color: #22384C;
}
[data-prose] ul,
[data-prose] ol {
  margin: 0 0 20px;
  padding-left: 4px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
[data-prose] li {
  font-size: 17px;
  line-height: 1.62;
  color: #22384C;
}
[data-prose] strong {
  color: var(--ink);
  font-weight: 700;
}
[data-prose] a {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1.5px solid rgba(31, 157, 87, .55);
  transition: border-color .15s;
}
[data-prose] a:hover {
  border-color: var(--accent);
}
[data-prose] h2 {
  scroll-margin-top: 90px;
  margin: 44px 0 16px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.16;
  letter-spacing: -.01em;
  font-weight: 500;
  color: var(--ink);
}
[data-prose] h2:first-of-type {
  margin-top: 40px;
}
[data-prose] h3 {
  margin: 28px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}

/* ---------- Directive :::retenir (encart « À retenir ») ---------- */
.dc-note {
  display: flex;
  gap: 14px;
  background: #FBF4E9;
  border: 1px solid #F0E2C9;
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 24px 0 6px;
}
.dc-note__i {
  width: 22px;
  height: 22px;
  color: #B5731E;
  flex-shrink: 0;
  margin-top: 1px;
}
.dc-note__k {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #B5731E;
  margin-bottom: 6px;
}
.dc-note__b p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: #5e4a23;
}

/* ---------- Directive :::stats (cartes chiffres) ---------- */
.dc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 22px 0 6px;
}
.dc-stat {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.dc-stat b {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.02em;
}
.dc-stat--accent b {
  color: var(--accent);
}
.dc-stat span {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- Directive :::cta (bandeau milieu d'article) ---------- */
.dc-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
  background: var(--primary);
  border-radius: 18px;
  padding: 24px clamp(22px, 3vw, 30px);
  margin: 32px 0;
  color: #fff;
}
.dc-cta__txt {
  flex: 1;
  min-width: 220px;
}
.dc-cta__txt strong {
  display: block;
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: inherit;
}
.dc-cta__txt span {
  display: block;
  font-size: 14.5px;
  color: rgba(255, 255, 255, .78);
  margin-top: 3px;
}
a.dc-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--accent);
  color: #073D23;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 12px;
  border-bottom: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .4);
  transition: transform .15s ease;
}
a.dc-cta__btn:hover {
  border-color: transparent;
  transform: translateY(-2px);
}

/* ---------- Directive :::source (citation officielle) ---------- */
.dc-source {
  font-size: 13.5px;
  color: var(--muted);
  margin: 14px 0 0;
}
.dc-source a {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1.5px solid rgba(31, 157, 87, .55);
}
.dc-source a:hover {
  border-color: var(--accent);
}

/* ---------- Sommaire (scrollspy, contrôleur Stimulus « toc ») ---------- */
[data-toc-target].is-active {
  color: var(--primary) !important;
  border-left-color: var(--primary) !important;
  font-weight: 600 !important;
}

/* ---------- Sommaire des pages légales ---------- */
/* Survol repris de la maquette ; l'état actif du scrollspy prend le même style,
   scopé pour que la règle du sommaire d'article (filet à gauche) ne fuite pas ici. */
[data-legal-toc] a {
  transition: background .15s, color .15s;
}
[data-legal-toc] a:hover,
[data-legal-toc] a[data-toc-target].is-active {
  background: var(--soft);
  color: var(--primary) !important;
  border-left-color: transparent !important;
  font-weight: 500 !important;
}

/* Corps des pages légales : une colonne sous 820px, sommaire remonté au-dessus. */
@media (max-width: 820px) {
  [data-legal-grid] { grid-template-columns: 1fr !important; }
  [data-legal-toc] { position: static !important; top: auto !important; order: -1; margin-bottom: 8px; }
}
@media (max-width: 560px) {
  [data-legal-identity] { grid-template-columns: 1fr !important; }
}

/* ---------- Chips de filtrage (hub /guides, contrôleur Stimulus « cluster-filter ») ---------- */
[data-cluster-filter-target="chip"].is-active {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #fff !important;
}
[data-cluster-filter-target="chip"].is-active .chip-dot {
  background: #fff !important;
}

/* Mise en page article (TOC + corps) : une colonne sous 980px */
@media (max-width: 980px) {
  [data-layout] { grid-template-columns: 1fr !important; }
  [data-toc-aside] { position: static !important; top: auto !important; order: -1; max-height: none !important; }
}

/* =========================================================================
   Responsive (porté à l'identique depuis la maquette)
   ========================================================================= */
[data-burger] { display: none; }
[data-reass-item]:first-child { border-left: none; }

/* Tablette & mobile : header replié (breakpoint 920px, porté de Header.dc.html) */
@media (max-width: 920px) {
  [data-nav]  { display: none !important; }
  [data-hcta] { display: none !important; }
  [data-burger] { display: inline-flex !important; }
}
@media (min-width: 921px) {
  [data-menu] { display: none !important; }
}

/* Bandeau réassurance empilé */
@media (max-width: 760px) {
  [data-reass-item] { border-left: none !important; }
  [data-reass-item]:not(:first-child) { border-top: 1px solid var(--line) !important; }
}

/* Mobile : marges et tailles */
@media (max-width: 560px) {
  [data-hero-cta] { flex-direction: column; align-items: stretch !important; }
  [data-hero-cta] > a { justify-content: center; }
  [data-sec] { padding-left: 18px !important; padding-right: 18px !important; }
  [data-hero] { gap: 32px !important; }
  [data-reass-wrap] { margin-top: -24px !important; }
  [data-report-outer] { padding: 16px 16px 56px !important; }
  [data-report-inner] { padding: 15px !important; }
  h1 { font-size: clamp(30px, 8.5vw, 40px) !important; }
  [data-badge-certif] { font-size: 11px !important; padding: 6px 10px !important; gap: 5px !important; max-width: 62% !important; }
  [data-badge-dispo]  { font-size: 11px !important; padding: 6px 10px !important; gap: 5px !important; }
}

/* Mur d'avis : colonnes responsives */
@media (max-width: 880px) {
  [data-revgrid] { grid-template-columns: 1fr 1fr !important; }
  [data-revcol="2"] { display: none !important; }
}
@media (max-width: 560px) {
  [data-revgrid] { grid-template-columns: 1fr !important; height: 520px !important; }
  [data-revcol="1"] { display: none !important; }
}
[data-revgrid]:active { cursor: grabbing; }

/* ---------- Pages d'erreur (porté de Erreur.dc.html) ---------- */
@keyframes kz-rise  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes kz-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(-3deg); } }
@keyframes kz-ping  { 0% { transform: scale(1); opacity: .5; } 70% { transform: scale(2.6); opacity: 0; } 100% { opacity: 0; } }

[data-rise] { animation: kz-rise .6s cubic-bezier(.22, .61, .36, 1) backwards; }
[data-rise="1"] { animation-delay: .06s; }
[data-rise="2"] { animation-delay: .14s; }
[data-rise="3"] { animation-delay: .22s; }
[data-rise="4"] { animation-delay: .30s; }

@media (prefers-reduced-motion: reduce) {
  [data-rise], [data-float], [data-ping] { animation: none !important; }
}

/* Hovers des pages d'erreur (remplacent les attributs style-hover de .claude/design-system/site/Erreur.dc.html, lignes 72–73 et 81). */
[data-err-cta-primary]:hover { color: #fff; }
[data-err-cta-ghost]:hover { border-color: var(--primary); color: var(--ink); }
[data-err-link]:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 14px 28px -18px rgba(15, 44, 73, .4);
  color: var(--ink);
}

@media (max-width: 560px) {
  [data-err-cta] { flex-direction: column; align-items: stretch !important; }
  [data-err-cta] > a { justify-content: center; }
  [data-err-links] { grid-template-columns: 1fr !important; }
}
