/* =========================================================================
   Blocs de page et adaptations responsives
   ========================================================================= */

:root {
  /* Masque utilisé par les liens externes */
  --icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-8 8M18 14v5a1 1 0 01-1 1H5a1 1 0 01-1-1V7a1 1 0 011-1h5'/%3E%3C/svg%3E");
}

/* ---------- Illustration ---------- */

/* Les SVG portent un `viewBox` : `height: auto` suffit à conserver le
   rapport d'aspect, et évite tout étirement dans un conteneur grille. */
.illustration {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.illustration--sm {
  max-width: 260px;
  margin-inline: auto;
}

.illustration--md {
  max-width: 420px;
  margin-inline: auto;
}

/* ---------- Bandeau de page ---------- */

.page-hero {
  position: relative;
  padding-block: clamp(2.25rem, 1.5rem + 3vw, 4rem) clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  background: linear-gradient(160deg, var(--bg-mint) 0%, #f6f2fd 55%, var(--bg-peach) 100%);
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 40px;
  background: var(--bg);
  clip-path: ellipse(75% 100% at 50% 100%);
}

.page-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  align-items: center;
}

.page-hero h1 {
  margin-bottom: var(--sp-4);
  font-size: var(--step-4);
}

.page-hero__aside {
  display: grid;
  place-items: center;
  width: 100%;
}

.page-hero__aside .illustration {
  max-width: 320px;
}

.page-hero--center {
  text-align: center;
}

.page-hero--center .page-hero__inner--center {
  grid-template-columns: minmax(0, 1fr);
  max-width: 780px;
  margin-inline: auto;
  justify-items: center;
}

.page-hero--center .page-hero__aside {
  max-width: 340px;
}

/* ---------- Accueil : héros ---------- */

.hero {
  position: relative;
  padding-block: clamp(2.5rem, 1.5rem + 4.5vw, 5rem) clamp(1rem, 2rem + 2vw, 2rem);
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 8% -8%, #e6f3ec 0%, transparent 58%),
    radial-gradient(900px 480px at 96% 8%, #fdeee8 0%, transparent 55%),
    linear-gradient(168deg, #fdfefe 0%, #f7f4fd 48%, #fef6f3 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(1.5rem, 1rem + 3vw, 3rem);
  align-items: center;
}

.hero h1 {
  max-width: 15ch;
  margin-bottom: var(--sp-4);
  font-size: var(--step-5);
  font-weight: 750;
  line-height: 1.1;
}

.hero__lead {
  max-width: 46ch;
  margin-bottom: var(--sp-5);
  font-size: var(--step-1);
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.hero__stat {
  display: flex;
  flex-direction: column;
}

.hero__stat b {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--navy-800);
  line-height: 1.1;
}

.hero__stat span {
  font-size: var(--step--2);
  color: var(--ink-muted);
}

.hero__art {
  position: relative;
  display: grid;
  place-items: center;
}

.hero__art .illustration {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 520 / 480;
  height: auto;
}

/* ---------- Page ressource ---------- */

.resource-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(1.5rem, 1rem + 2.5vw, 3.5rem);
  align-items: start;
}

.prose {
  font-size: var(--step-0);
  line-height: 1.72;
  color: var(--ink-soft);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin-top: var(--sp-7);
  margin-bottom: var(--sp-4);
  padding-top: var(--sp-2);
}

.prose h3 {
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

.prose ul,
.prose ol {
  margin-bottom: var(--sp-4);
}

.prose strong {
  color: var(--ink);
  font-weight: 650;
}

.prose h2 + p,
.prose h3 + p,
.prose ul + p,
.prose ol + p {
  margin-top: 0;
}

/* Sommaire */

.toc {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-soft);
}

.toc h2 {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
}

.toc ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  counter-reset: toc;
}

.toc a {
  display: flex;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--r-xs);
  font-size: var(--step--1);
  color: var(--ink-soft);
  text-decoration: none;
}

.toc a::before {
  counter-increment: toc;
  content: counter(toc) ".";
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.toc a:hover,
.toc a.is-active {
  background: #fff;
  color: var(--navy-800);
  font-weight: 550;
}

.toc__meta {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  font-size: var(--step--2);
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* En-tête de ressource */

.resource-head {
  padding-block: var(--sp-6) var(--sp-5);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: var(--sp-6);
}

.resource-head h1 {
  margin-bottom: var(--sp-3);
  font-size: var(--step-4);
}

.resource-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: var(--step--2);
  color: var(--ink-muted);
  margin-bottom: var(--sp-4);
}

.resource-head__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.key-takeaways {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--bg-mint);
  border: 1px solid var(--green-border);
  margin-bottom: var(--sp-6);
}

.key-takeaways h2 {
  font-size: var(--step-0);
  margin-bottom: var(--sp-3);
}

.key-takeaways ul {
  margin-bottom: 0;
}

.key-takeaways li {
  font-size: var(--step--1);
}

/* Lecteur vidéo */

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-block: var(--sp-5) var(--sp-6);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--navy-900);
  border: 1px solid var(--border);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-poster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  height: 100%;
  padding: var(--sp-6);
  text-align: center;
  color: #dbe3f5;
}

.video-poster__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}

/* Navigation précédent / suivant */

.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-7);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

.pager__link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
}

.pager__link:hover {
  border-color: var(--green);
  background: var(--bg-mint);
}

.pager__link--next {
  text-align: right;
}

.pager__dir {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.pager__title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy-800);
}

/* ---------- Cartes de contact ---------- */

.contact-card {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.contact-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.contact-card__body {
  flex: 1;
  min-width: 0;
}

.contact-card h3 {
  font-size: var(--step-0);
  margin-bottom: 0.15rem;
}

.contact-card__also {
  font-size: var(--step--2);
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
}

.contact-card__what {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-bottom: var(--sp-3);
}

.contact-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem var(--sp-3);
  margin: 0;
  font-size: var(--step--2);
}

.contact-card dt {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.contact-card dd {
  margin: 0;
  color: var(--ink-muted);
}

.phone-number {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--navy-800);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.phone-number:hover {
  color: var(--red);
}

.phone-number--lg {
  font-size: var(--step-3);
}

/* Entrée sans numéro de téléphone (dispositif joignable uniquement en ligne) :
   même graisse que les numéros, mais sans couleur de lien ni interaction. */
.phone-number--label {
  margin: 0;
}

/* ---------- Étapes ---------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  counter-reset: step;
  list-style: none;
}

.steps__item {
  position: relative;
  display: flex;
  gap: var(--sp-4);
  counter-increment: step;
}

.steps__item::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--step--1);
}

.steps__item::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 2.4rem;
  bottom: -1rem;
  width: 2px;
  background: var(--border);
}

.steps__item:last-child::after {
  display: none;
}

.steps__body p:last-child {
  margin-bottom: 0;
}

.steps__title {
  font-family: var(--font-display);
  font-weight: 650;
  color: var(--navy-800);
  margin-bottom: 0.2rem;
}

/* ---------- Cartes « chemin » ---------- */

.path-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.path-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--sp-4);
}

.path-card ol {
  margin-bottom: 0;
}

/* ---------- Comparateur ---------- */

.compare td,
.compare th {
  font-size: var(--step--1);
}

/* ---------- Sélecteur de thème ---------- */

.theme-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--sp-4);
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.theme-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.theme-card__top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.theme-card__title {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 650;
  color: var(--navy-800);
}

.theme-card__desc {
  margin: 0;
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.theme-card__count {
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-soft);
  font-size: var(--step--2);
  color: var(--ink-faint);
}

/* ---------- Bandeau de mise en avant ---------- */

.cta-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-5);
  align-items: center;
  padding: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  border-radius: var(--r-xl);
  background: linear-gradient(120deg, var(--navy-800), var(--navy-700) 55%, #3a4a7a);
  color: #dbe3f5;
}

.cta-band h2 {
  color: #fff;
  margin-bottom: 0.4rem;
}

.cta-band p {
  margin: 0;
  color: #c3cde4;
  max-width: 60ch;
}

.cta-band .btn--ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.cta-band .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Page 404 ---------- */

.error-page {
  display: grid;
  place-items: center;
  min-height: 62vh;
  text-align: center;
  padding-block: var(--sp-8);
}

.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 3rem + 8vw, 8rem);
  font-weight: 750;
  line-height: 1;
  color: var(--green-soft);
  -webkit-text-stroke: 2px var(--green);
  margin-bottom: var(--sp-3);
}

/* =========================================================================
   Adaptations responsives
   ========================================================================= */

@media (max-width: 1400px) {
  /* Le libellé complet de la navigation ne tient plus : on raccourcit. */
  .site-nav__link {
    padding-inline: 0.62rem;
    font-size: 0.84rem;
  }

  .site-header__actions .btn {
    padding-inline: 1rem;
  }

  .logo__title {
    font-size: 0.95rem;
  }
}

@media (max-width: 1180px) {
  .site-nav {
    display: none;
  }

  .burger {
    display: grid;
  }

  .site-header__actions {
    margin-left: auto;
  }

  .resource-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
  }
}

@media (max-width: 900px) {
  .page-hero__inner,
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero h1 {
    max-width: 100%;
  }

  .hero__art {
    order: -1;
    max-width: 340px;
    margin-inline: auto;
  }

  .page-hero__aside {
    max-width: 260px;
    margin-inline: auto;
  }

  .cta-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .card--row {
    flex-direction: column;
  }

  .card--row .card__media {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 720px) {
  .site-header__bar {
    gap: var(--sp-2);
  }

  .site-header__actions {
    gap: 0.35rem;
  }

  .site-header__actions .btn {
    padding-inline: 0.85rem;
  }

  .hide-sm {
    display: none;
  }

  .only-sm {
    display: inline;
  }

  .section-head {
    align-items: flex-start;
  }

  .crisis-banner {
    padding: var(--sp-4);
    gap: var(--sp-4);
  }

  .crisis-banner__icon {
    width: 44px;
    height: 44px;
  }

  .site-footer__top {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .accordion__summary {
    font-size: var(--step--1);
    padding: var(--sp-4);
  }

  .hero__stats {
    gap: var(--sp-4);
  }
}

@media (max-width: 560px) {
  /* Le bouton d'urgence devient une pastille : le libellé est déjà dans
     l'attribut aria-label et dans le menu mobile. La recherche est également
     accessible depuis ce menu. */
  .header-cta .hide-sm,
  .header-cta .only-sm {
    display: none;
  }

  .header-cta {
    width: 44px !important;
    padding-inline: 0;
  }

  .header-search {
    display: none;
  }
}

@media (max-width: 520px) {
  .logo__sub {
    display: none;
  }

  .logo__mark {
    width: 38px;
    height: 38px;
  }

  .logo__title {
    font-size: 0.92rem;
  }

  .btn {
    width: 100%;
  }

  .site-header__actions .btn {
    width: auto;
  }

  .hero__actions .btn,
  .section-head__text .btn {
    width: auto;
  }
}

/* Impression : on masque les blocs non utiles */
@media print {
  .toc,
  .pager,
  .site-footer__crisis {
    display: none;
  }
}

/* ---------- Carte interactive ---------- */

.map {
  height: 520px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  margin-bottom: 0.6rem;
}

.map-note {
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.map-you span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--red);
}

.leaflet-popup-content {
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
}
.leaflet-popup-content a {
  color: var(--navy-800);
}

.place-card {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.place-card[hidden] {
  display: none;
}
.place-card__dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 0.4rem;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.place-card__body {
  min-width: 0;
}
.place-card__cat {
  margin: 0 0 0.2rem;
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.place-card__name {
  margin: 0 0 0.2rem;
  font-size: var(--step-0);
}
.place-card__addr {
  margin: 0 0 0.35rem;
  color: var(--ink-muted);
  font-size: var(--step--1);
}
.place-card__what {
  margin: 0 0 0.35rem;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

/* ---------- Vidéos ---------- */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.video-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-card[hidden] {
  display: none;
}

.video-card__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: var(--bg-soft);
  overflow: hidden;
}
.video-card__thumb img,
.video-card__thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(31, 42, 74, 0.25);
  transition: background 0.15s ease;
}
.video-card__thumb:hover .video-card__play {
  background: rgba(31, 42, 74, 0.4);
}
.video-card__play svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}
.video-card__duration {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.video-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem 1rem;
}
.video-card__title {
  margin: 0;
  font-size: var(--step-0);
  line-height: 1.3;
}
.video-card__meta {
  margin: 0;
  font-size: var(--step--1);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.video-card__why {
  margin: 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.video-card__themes {
  margin: 0;
  font-size: var(--step--2);
  color: var(--ink-faint);
}

.tag--soft {
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--border-soft);
}

.notice {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border-left: 4px solid var(--ink-muted);
  color: var(--ink-soft);
}
.notice--warn {
  border-left-color: #b07d1a;
  background: #fdf6e9;
}

