/* Page Programmes — v1 */

.site-header.home-header {
  background: #ffffff !important;
}

/* Menu déroulant cohérent avec les pages Services et À propos */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0 9px;
  border: 0;
  background: transparent;
  color: #1e2a37;
  font: inherit;
  cursor: pointer;
}

.nav-dropdown-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--home-green);
  transform: translateX(-50%);
  transition: width 180ms ease;
}

.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown:focus-within .nav-dropdown-toggle::after,
.nav-dropdown-toggle.is-current::after {
  width: 100%;
}

.nav-dropdown-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 50%;
  min-width: 245px;
  padding: 9px 0;
  border: 1px solid var(--home-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(23, 55, 95, 0.10);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.home-header .nav-dropdown-menu a {
  display: block;
  padding: 10px 18px;
  color: var(--home-text);
  white-space: nowrap;
}

.home-header .nav-dropdown-menu a::after {
  display: none;
}

.home-header .nav-dropdown-menu a:hover,
.home-header .nav-dropdown-menu a:focus-visible,
.home-header .nav-dropdown-menu a.is-current {
  background: var(--home-hero-blue);
  color: var(--home-navy);
}

.service-kicker {
  margin: 0 0 14px;
  color: var(--home-green-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Hero */
.programs-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(320px, 0.9fr);
  gap: clamp(38px, 6vw, 88px);
  align-items: center;
  padding: clamp(54px, 7vw, 92px) clamp(28px, 6vw, 92px)
           clamp(112px, 11vw, 150px);
  background: var(--home-hero-blue);
}

.programs-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -2%;
  right: -2%;
  bottom: -1px;
  height: clamp(46px, 5.5vw, 78px);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0 58 C180 88 330 36 520 58 C720 82 845 98 1015 64 C1095 48 1150 50 1200 61 L1200 100 L0 100 Z' fill='%23fbfaf7'/%3E%3C/svg%3E")
    bottom center / 100% 100% no-repeat;
  pointer-events: none;
}

.programs-hero-copy {
  max-width: 810px;
}

.programs-hero h1 {
  max-width: 850px;
  margin: 0;
  color: var(--home-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 4.35vw, 4.85rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.programs-accent {
  display: block;
  width: 44px;
  height: 2px;
  margin: 20px 0 24px;
  background: var(--home-green);
}

.programs-hero-copy > p:last-child {
  max-width: 700px;
  margin: 0;
  font-size: clamp(1rem, 1.18vw, 1.12rem);
  line-height: 1.72;
}

.programs-hero-visual img {
  display: block;
  width: min(100%, 530px);
  height: auto;
  margin-inline: auto;
}

/* Catalogue */
.programs-section {
  padding: clamp(76px, 9vw, 118px) clamp(28px, 6vw, 92px)
           clamp(90px, 10vw, 132px);
  background: var(--home-paper);
}

.programs-heading {
  max-width: 820px;
  margin: 0 auto clamp(52px, 6vw, 78px);
  text-align: center;
}

.programs-heading h2 {
  margin: 0;
  color: var(--home-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 3.2vw, 3.2rem);
  font-weight: 400;
  line-height: 1.15;
}

.programs-heading .programs-accent {
  margin-left: auto;
  margin-right: auto;
}

.programs-heading p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--home-muted);
  line-height: 1.7;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(26px, 3.5vw, 46px);
  max-width: 1220px;
  margin: 0 auto;
}

.program-card {
  position: relative;
  border: 1px solid var(--home-line);
  border-radius: 22px;
  padding: clamp(30px, 4vw, 52px);
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(23, 55, 95, 0.05);
}

.program-card-featured {
  grid-column: 1 / -1;
  width: min(100%, 850px);
  justify-self: center;
}

.program-service {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: var(--home-green-dark);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.program-service img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.program-card h3 {
  max-width: 720px;
  margin: 0 0 10px;
  color: var(--home-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 400;
  line-height: 1.14;
}

.program-subtitle {
  margin: 0 0 28px;
  color: var(--home-green-dark);
  font-weight: 600;
  font-size: 1.05rem;
}

.program-summary,
.program-more-content p {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.76;
}

.program-summary {
  margin: 0;
}

/* Voir plus / Voir moins */
.program-more {
  margin-top: 22px;
}

.program-more summary {
  display: inline-flex;
  list-style: none;
  align-items: center;
  color: var(--home-navy);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.program-more summary::-webkit-details-marker {
  display: none;
}

.program-more summary:hover,
.program-more summary:focus-visible {
  color: var(--home-green-dark);
}

.program-more .label-less {
  display: none;
}

.program-more[open] .label-more {
  display: none;
}

.program-more[open] .label-less {
  display: inline;
}

.program-more-content {
  max-width: 770px;
  padding-top: 22px;
}

.program-more-content p {
  margin: 0 0 18px;
}

.program-more-content p:last-child {
  margin-bottom: 0;
}

/* PDF */
.program-actions {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--home-line);
}

.program-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--home-navy);
  font-weight: 700;
  text-decoration: none;
}

.program-pdf-link:hover,
.program-pdf-link:focus-visible {
  color: var(--home-green-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* Bandeau standard */
.programs-discovery {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .programs-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 112px;
  }

  .programs-hero-visual {
    max-width: 560px;
    margin-inline: auto;
  }

  .programs-grid {
    grid-template-columns: 1fr;
  }

  .program-card-featured {
    grid-column: auto;
    width: 100%;
  }
}

@media (max-width: 700px) {
  .nav-dropdown {
    width: 100%;
    display: block;
  }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: flex-start;
    padding: 8px 0;
  }

  .nav-dropdown-toggle::after {
    left: 0;
    transform: none;
  }

  .nav-dropdown:hover .nav-dropdown-toggle::after,
  .nav-dropdown:focus-within .nav-dropdown-toggle::after,
  .nav-dropdown-toggle.is-current::after {
    width: 48px;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    padding: 4px 0 4px 18px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

  .nav-dropdown.is-open .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
  }

  .home-header .nav-dropdown-menu a {
    padding: 8px 0;
    white-space: normal;
  }

  .programs-hero {
    padding-left: 22px;
    padding-right: 22px;
  }

  .programs-hero h1 {
    font-size: clamp(2.35rem, 10vw, 3.45rem);
  }

  .programs-section {
    padding-left: 22px;
    padding-right: 22px;
  }

  .program-card {
    border-radius: 18px;
    padding: 28px 24px;
  }

  .program-card h3 {
    font-size: clamp(1.8rem, 8vw, 2.45rem);
  }
}


/* Programmes — intégration visuelle v2 : héros, icône et appel découverte */
.programs-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.programs-hero-visual img {
  display: block;
  width: min(118%, 850px);
  max-width: none;
  height: auto;
  object-fit: contain;
}

/* Même principe que les héros validés : agrandissement visuel hors calcul de hauteur. */
@media (min-width: 981px) {
  .programs-hero-visual img {
    transform: scale(1.22);
    transform-origin: center center;
  }
}

.program-service img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.programs-discovery .discovery-v9-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.programs-discovery-illustration {
  display: block;
  width: min(100%, 760px);
  max-width: none;
  height: auto;
  object-fit: contain;
}

@media (min-width: 851px) {
  .programs-discovery-illustration {
    transform: scale(1.22);
    transform-origin: center center;
  }
}

@media (max-width: 980px) {
  .programs-hero-visual img {
    width: min(82vw, 660px);
  }
}

@media (max-width: 850px) {
  .programs-discovery-illustration {
    width: min(88vw, 720px);
  }
}

@media (max-width: 620px) {
  .programs-hero-visual img {
    width: min(94vw, 520px);
  }
  .programs-discovery-illustration {
    width: min(96vw, 600px);
  }
}

/* Programmes — ajustements visuels v2.1 validés : héros + catégorie */
@media (min-width: 981px) {
  .programs-hero-visual img {
    position: relative;
    left: -12%;
    transform: scale(1.36);
    transform-origin: center center;
  }
}

/* L’icône identifie la famille de service : elle doit se lire comme un marqueur de catégorie. */
.program-service {
  /* Le PNG conserve ~7 px transparents à droite à 58 px d’affichage.
     Un gap CSS de 2 px donne donc ~9 px d’espace visuel jusqu’au libellé. */
  gap: 2px;
}

.program-service img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 58px;
}

@media (max-width: 620px) {
  .program-service img {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }
}

/* v2.4 — alignement du marqueur de catégorie sur l’axe gauche du titre. */
.program-service {
  margin-left: -14px;
}


/* Responsive intermédiaire — transition du héros Programmes sans modifier le desktop > 1180 px. */
@media (min-width: 981px) and (max-width: 1050px) {
  .programs-hero-visual img { left: -3%; transform: scale(1.08); }
}
@media (min-width: 1051px) and (max-width: 1120px) {
  .programs-hero-visual img { left: -6%; transform: scale(1.18); }
}
@media (min-width: 1121px) and (max-width: 1180px) {
  .programs-hero-visual img { left: -9%; transform: scale(1.28); }
}

/* Responsive v2 — zone 901–980 px : conserver l’illustration dans sa colonne avant le passage vertical. */
@media (min-width: 901px) and (max-width: 980px) {
  .programs-hero-visual img {
    width: min(48vw, 480px);
    position: relative;
    left: 0;
    transform: none;
  }
}

/* Correction ciblée : sous-menu dans le flux à 390 px. */
@media (max-width: 700px) {
  .main-nav .nav-dropdown { width: 100%; min-width: 0; }
  .main-nav .nav-dropdown-menu {
    position: static; left: 0; right: auto; top: auto;
    width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
    margin: 0; padding: 4px 0 4px 18px;
    transform: none !important;
  }
  .main-nav .nav-dropdown-menu a { white-space: normal; overflow-wrap: anywhere; }
}
