/**
 * Page « La charte du bon voisin »
 * Desktop 590:10946 · Mobile 590:11156 — specs validées étape 1
 */

.charte-page {
  --charte-bg: #f7f9fc;
  --charte-bg-alt: #f5f7fa;
  --charte-ink: #071a35;
  --charte-body: #262626;
  --charte-muted: #8c9eb8;
  --charte-purple: #7d3bed;
  --charte-callout: #e8f0fc;
  --charte-icon-blue: #e8f0fc;
  --charte-icon-purple: #f0e8fc;
  --charte-pad-x: 130px;
  --charte-content: 1180px;
  background: var(--charte-bg);
  color: var(--charte-body);
  font-family: "Roboto", sans-serif;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

.charte-page *,
.charte-page *::before,
.charte-page *::after {
  box-sizing: border-box;
}

.charte-page p,
.charte-page span,
.charte-page h2 {
  margin: 0;
}

.charte-page h1,
.charte-page h2 {
  color: var(--charte-ink);
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.charte-hero__inner,
.charte-principles__inner,
.charte-disclaimer__inner {
  width: 100%;
  max-width: var(--charte-content);
  margin: 0 auto;
}

/* Hero : pt 48 | pb 40 | px 130 */
.charte-hero {
  width: 100%;
  padding: 48px var(--charte-pad-x) 40px;
}

.charte-page h1.charte-hero__title {
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 48px;
  letter-spacing: 0;
  color: var(--charte-ink);
}

/* Principles : bg #f5f7fa | pt 48 | pb 56 | px 130 | gap 24 */
.charte-principles {
  width: 100%;
  background: var(--charte-bg-alt);
  padding: 48px var(--charte-pad-x) 56px;
}

/* Grille Figma : 3 colonnes × 2 rangées | gap 24 | à 1180 → colonnes = 377 */
.charte-principles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  align-items: start;
}

/* Carte : largeur = 1fr de la grille (à 1180 → ~377) | hauteur 288 */
.charte-card {
  width: 100%;
  min-width: 0;
  height: 288px;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 14px;
  /* Figma : drop-shadow(0px 2px 6px rgba(0,0,0,0.06)) — pas box-shadow (blur ≠) */
  box-shadow: none;
  filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.06));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  padding: 32px;
  overflow: visible;
  transition: transform 0.28s ease, filter 0.28s ease;
}

@media (hover: hover) and (pointer: fine) {
  .charte-card:hover {
    transform: translateY(-4px);
    filter: drop-shadow(0px 10px 18px rgba(7, 26, 53, 0.12));
  }
}

.charte-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex: 0 0 auto;
}

/* Icon Round : 48×48 | radius 14 */
.charte-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.charte-card--blue .charte-card__icon {
  background: #e8f0fc;
}

.charte-card--purple .charte-card__icon {
  background: #f0e8fc;
}

.charte-card__icon img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

/* Numéro : Inter Medium 13 / lh 44 | #8c9eb8 | flex 1 0 0 (Figma) */
.charte-card__num {
  flex: 1 0 0;
  min-width: 1px;
  text-align: right;
  color: #8c9eb8;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 44px;
  letter-spacing: 0;
}

/* Content gap titre→desc 8 | width 313 dans carte 377-64 */
.charte-card__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}

.charte-page h2.charte-card__title {
  margin: 0;
  width: 100%;
  flex: 0 0 auto;
  color: #071a35;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 0;
}

/* Desc : Roboto Medium 16/24 | W 100% | H hug */
.charte-card__body {
  display: block;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  flex: 0 0 auto;
  color: #262626;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

/* Disclaimer : pt 40 | pb 40 | px 130 */
.charte-disclaimer {
  width: 100%;
  padding: 40px var(--charte-pad-x);
}

/* Callout : pad 32 | radius 16 | border-left 3 #7d3bed | gap 20 | bg #e8f0fc */
.charte-callout {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
  background: #e8f0fc;
  border-left: 3px solid #7d3bed;
  border-radius: 16px;
  padding: 32px;
}

.charte-callout__icon {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: #071a35;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.charte-callout__icon img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

/* Disclaimer text : Inter Medium 16 / lh 1.6 | #071a35 */
.charte-callout__text {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  color: #071a35;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

body:has(#charte-page) footer#bottomPage {
  margin-top: 0 !important;
}

/* Reveal au scroll — opacity seule (comme économie collaborative) */
.charte-reveal {
  opacity: 0;
  transition: opacity 0.55s ease;
}

.charte-reveal.is-visible {
  opacity: 1;
}

.charte-card.charte-reveal {
  /* Délai uniquement sur l’opacity — hover transform/filter immédiat */
  transition:
    opacity 0.55s ease var(--charte-delay, 0ms),
    transform 0.28s ease,
    filter 0.28s ease;
}

@media (prefers-reduced-motion: reduce) {
  .charte-reveal {
    opacity: 1;
    transition: none;
  }

  .charte-card,
  .charte-card.charte-reveal {
    transition: none;
  }

  .charte-card:hover {
    transform: none;
    filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.06));
  }
}

/* Mobile 590:11156 — specs validées étape 1 */
@media (max-width: 768px) {
  .charte-page {
    --charte-pad-x: 16px;
    --charte-content: none;
  }

  .charte-hero__inner,
  .charte-principles__inner,
  .charte-disclaimer__inner {
    max-width: none;
  }

  /* Hero : pt 32 | pb 24 | px 16 */
  .charte-hero {
    padding: 32px 16px 24px;
  }

  /* Titre : Quicksand Bold 24/32 #071a35 */
  .charte-page h1.charte-hero__title {
    font-family: "Quicksand", sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 32px;
    letter-spacing: 0;
    color: #071a35;
  }

  /* Principles : bg #f5f7fa | py 32 | px 16 | stack gap 16 */
  .charte-principles {
    padding: 32px 16px;
  }

  .charte-principles__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Carte : W 100% | H hug | pad 24 | radius 12 | gap 16 */
  .charte-card {
    width: 100%;
    height: auto;
    min-height: 0;
    border-radius: 12px;
    padding: 24px;
    gap: 16px;
  }

  /* Icon Area : space-between */
  .charte-card__top {
    justify-content: space-between;
    gap: 0;
    align-items: center;
  }

  /* Icon Round : 40×40 | radius 10 | glyph 20×20 (inchangé) */
  .charte-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  /* Numéro : Inter Medium 13 | lh normal | #8c9eb8 */
  .charte-card__num {
    flex: 0 0 auto;
    min-width: 0;
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: normal;
    letter-spacing: 0;
    color: #8c9eb8;
  }

  /* Gap titre→desc 6 */
  .charte-card__text {
    gap: 6px;
  }

  /* Titre carte : Roboto SemiBold 16/24 #071a35 */
  .charte-page h2.charte-card__title {
    font-family: "Roboto", sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0;
    color: #071a35;
  }

  /* Desc : Roboto Medium 16/24 #262626 (hérité desktop, explicite) */
  .charte-card__body {
    font-family: "Roboto", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #262626;
  }

  /* Disclaimer : pt 24 | pb 32 | px 16 */
  .charte-disclaimer {
    padding: 24px 16px 32px;
  }

  /* Callout : pad 20 | radius 12 | gap 16 */
  .charte-callout {
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
  }

  /* Info Round : 36×36 | r 18 | glyph 18×18 */
  .charte-callout__icon {
    width: 36px;
    height: 36px;
    border-radius: 18px;
  }

  /* Callout texte : Inter Medium 14 / lh 1.5 #071a35 */
  .charte-callout__text {
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
    color: #071a35;
  }
}

/* Tablette : pad-x réduit ; grille desktop 3 cols (cartes en 1fr) */
@media (min-width: 769px) and (max-width: 1199px) {
  .charte-page {
    --charte-pad-x: 40px;
    --charte-content: none;
  }

  .charte-hero__inner,
  .charte-principles__inner,
  .charte-disclaimer__inner {
    max-width: none;
  }
}
