/**
 * Styles mutualisés pour les fiches formation « courtes » (hub management).
 *
 * Périmètre minimal (v1) :
 *  — Bloc A : ton Lille (sections pierre, titres, cartes hero) — réutilisable sur d’autres pages du site.
 *  — Bloc B : UX modèle issu de boite-a-outils-du-manager-lille.html
 *    (accordéons .rh-page-accordion, programme modulaire, FAQ <details>, scroll ancres).
 *
 * Prérequis : la page définit :root avec au moins --brand-orange, --brand-orange-dark,
 *   --gray-*, --nav-h, --breadcrumb-sticky-h (fiches type BOM), --lille-stone.
 *
 * Fiches formation à aligner progressivement (lien + retrait du doublon inline) :
 *   boite-a-outils-du-manager-lille.html (référence),
 *   formation-la-delegation-lille.html, la-gestion-du-conflit-lille.html,
 *   formation-manager-coach-lille.html, formation-vision-action.html,
 *   formation-soft-skills-teletravail-lille.html, les-leviers-de-la-motivation.html,
 *   + les autres parcours courts listés sur formations-en-management-lille.html.
 *
 * FAQ : le style accordéon ci-dessous cible details.faq-item uniquement ;
 * les anciennes FAQ en div (.faq-item sans <details>) ne sont pas modifiées.
 */

/* ——— Bloc A : identité Lille (sections / titres / carte hero) ——— */

.section-local-tone {
  background-color: var(--lille-stone) !important;
}

.section-title-local {
  display: inline-block;
}

.section-title-local::after {
  content: "";
  display: block;
  width: 72px;
  height: 2px;
  margin-top: 10px;
  background: rgba(165, 87, 69, 0.65);
}

.hero-local-card {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-top: 2px solid rgba(165, 87, 69, 0.45);
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.05);
}

@media (max-width: 768px) {
  .section-title-local::after {
    width: 56px;
    margin-top: 8px;
    background: rgba(165, 87, 69, 0.55);
  }

  .hero-local-card {
    border-top: 2px solid rgba(165, 87, 69, 0.38);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.04);
  }
}

/* ——— Bloc B : ancres + accordéons + programme + FAQ <details> ——— */

main section[id],
main div[id],
main details.rh-page-accordion[id] {
  scroll-margin-top: calc(var(--nav-h) + var(--breadcrumb-sticky-h) + 0.5rem);
}

@media (min-width: 768px) {
  main section[id],
  main div[id],
  main details.rh-page-accordion[id] {
    scroll-margin-top: calc(var(--nav-h) + var(--breadcrumb-sticky-h) + 3.15rem);
  }
}

.rh-page-accordion {
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  margin-bottom: 1.15rem;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.rh-page-accordion > summary.rh-page-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--gray-900);
  padding: 1.1rem 1.25rem;
  list-style: none;
  transition: background 0.2s;
  border-bottom: 1px solid transparent;
}

.rh-page-accordion > summary.rh-page-accordion-summary::-webkit-details-marker {
  display: none;
}

.rh-page-accordion > summary.rh-page-accordion-summary::before {
  content: "";
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--brand-orange);
  border-bottom: 2px solid var(--brand-orange);
  transform: rotate(45deg);
  transition: transform 0.2s;
  align-self: center;
}

.rh-page-accordion[open] > summary.rh-page-accordion-summary {
  border-bottom-color: var(--gray-200);
  background: var(--gray-50);
}

.rh-page-accordion[open] > summary.rh-page-accordion-summary::before {
  transform: rotate(-135deg);
}

.rh-page-accordion > summary.rh-page-accordion-summary:hover {
  background: var(--gray-50);
}

.rh-page-accordion--orange > summary.rh-page-accordion-summary {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-dark) 100%);
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.rh-page-accordion--orange > summary.rh-page-accordion-summary::before {
  border-color: #fff;
}

.rh-page-accordion--orange[open] > summary.rh-page-accordion-summary {
  background: linear-gradient(135deg, #a72b00 0%, var(--brand-orange) 100%);
  color: #fff;
}

.rh-page-accordion--orange > summary.rh-page-accordion-summary:hover {
  /* Évite le fond gris de la règle générale (texte blanc illisible) */
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-dark) 100%);
  color: #fff;
  filter: brightness(1.05);
}

.rh-page-accordion--dark {
  border-color: var(--gray-700);
  background: var(--gray-900);
}

.rh-page-accordion--dark > summary.rh-page-accordion-summary {
  background: var(--gray-900);
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.rh-page-accordion--dark > summary.rh-page-accordion-summary:hover {
  background: #111827;
}

.rh-page-accordion--dark[open] > summary.rh-page-accordion-summary {
  background: #0f172a;
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.rh-page-accordion--dark > summary.rh-page-accordion-summary::before {
  border-color: rgba(255, 255, 255, 0.85);
}

.rh-page-accordion-panel > section:first-child {
  margin-top: 0;
}

@media (max-width: 768px) {
  .rh-page-accordion > summary.rh-page-accordion-summary {
    font-size: 1.05rem;
    padding: 1rem 1.1rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  clip-path: inset(50%);
}

#programme-modules {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  #programme-modules {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Programme : intro jours + modules */

.programme-intro-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

@media (min-width: 768px) {
  .programme-intro-row {
    grid-template-columns: 1fr minmax(260px, 36ch);
    align-items: center;
  }
}

.programme-intro-note {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin: 0;
}

@media (min-width: 768px) {
  .programme-intro-note {
    padding-top: 0.25rem;
    border-left: 3px solid var(--gray-200);
    padding-left: 1.25rem;
  }
}

.programme-jours-summary {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.programme-jours-summary .jour1-intro {
  margin-bottom: 0.5rem;
}

.programme-jours-summary .jour1-subtitle {
  font-style: italic;
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, #fff 100%);
  border-radius: 0.5rem;
  border-left: 4px solid var(--brand-orange);
}

.programme-jour1 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.programme-jour1 .jour1-intro {
  margin-bottom: 0.5rem;
}

.programme-jour1 .jour1-subtitle {
  font-style: italic;
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, #fff 100%);
  border-radius: 0.5rem;
  border-left: 4px solid var(--brand-orange);
}

.programme-module {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.programme-module:hover {
  box-shadow: 0 8px 24px -8px rgba(189, 50, 0, 0.15);
  border-color: var(--gray-300);
}

.programme-module-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.programme-module-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-dark) 100%);
  color: #fff;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

.programme-module-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.35;
}

.programme-module-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.programme-module-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--gray-700);
}

.programme-module-row strong {
  flex-shrink: 0;
  min-width: 6.5rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600);
}

.programme-module-row .row-content {
  flex: 1;
}

.programme-module-row.livrable {
  border-top: 1px dashed var(--gray-200);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.programme-module-row.livrable strong {
  color: var(--brand-orange);
}

@media (max-width: 768px) {
  .programme-module {
    padding: 1.25rem 1.1rem;
  }
}

/* Programme : JS = détail masqué + bouton ; sans JS = visible */

.programme-detail-toggle {
  display: none;
}

#programme.programme-detail-js .programme-detail-toggle {
  display: flex;
}

#programme.programme-detail-js .programme-module-body {
  display: none;
}

#programme.programme-detail-js .programme-module-header {
  margin-bottom: 0;
}

#programme.programme-detail-js .programme-module.module-open .programme-module-body {
  display: flex;
}

#programme.programme-detail-js .programme-module.module-open .programme-module-header {
  margin-bottom: 1rem;
}

#programme.programme-detail-js .programme-module .programme-module-header {
  cursor: pointer;
}

.programme-detail-toggle {
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 420px;
  margin: 1.5rem auto 0;
  padding: 1rem 1.5rem;
  background: var(--brand-orange);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1.0625rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(189, 50, 0, 0.2);
}

.programme-detail-toggle:hover {
  background: var(--brand-orange-dark);
  color: #fff;
  box-shadow: 0 4px 8px rgba(189, 50, 0, 0.25);
}

.programme-detail-toggle svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

#programme.programme-detail-js.programme-all-open .programme-detail-toggle svg {
  transform: rotate(180deg);
}

@media (max-width: 480px) {
  .programme-module-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .programme-module-num {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }

  .programme-module-row {
    flex-direction: column;
    gap: 0.25rem;
  }

  .programme-module-row strong {
    min-width: auto;
  }
}

details.faq-item {
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}

details.faq-item summary.faq-question {
  display: block;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-900);
  padding: 1rem 1.25rem;
  list-style: none;
  transition: background 0.2s;
}

details.faq-item summary.faq-question::-webkit-details-marker {
  display: none;
}

details.faq-item summary.faq-question::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--brand-orange);
  border-bottom: 2px solid var(--brand-orange);
  margin-right: 0.6rem;
  margin-bottom: 0.15rem;
  transform: rotate(45deg);
  vertical-align: middle;
  transition: transform 0.2s;
}

details.faq-item[open] summary.faq-question::before {
  transform: rotate(-135deg);
  margin-bottom: 0;
}

details.faq-item summary.faq-question:hover {
  background: var(--gray-50);
}

details.faq-item .faq-answer {
  color: var(--gray-700);
  padding: 0 1.25rem 1rem 1.75rem;
}

/* ——— Bloc C : hero grille + cartes « pour vous » (fiches alignées modèle) ——— */

.fiche-hero-top {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin-bottom: 1.35rem;
  min-width: 0;
}

.fiche-hero-intro-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: stretch;
  min-width: 0;
}

@media (min-width: 768px) {
  .fiche-hero-intro-row {
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 15.5rem);
    column-gap: 1.35rem;
    align-items: stretch;
  }
}

.fiche-hero-visual {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  min-width: 0;
  align-self: stretch;
}

.fiche-hero-visual .fiche-hero-aside-img {
  margin: 0;
  display: block;
  width: auto;
  max-width: min(220px, 100%);
  height: auto;
}

@media (max-width: 767px) {
  .fiche-hero-intro-row .fiche-hero-visual {
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-end;
    padding-top: 0.15rem;
  }
}

.fiche-hero-copy {
  min-width: 0;
}

.fiche-hero-proofs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.fiche-hero-proofs li {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-800);
  padding: 0.4rem 0.7rem;
  background: var(--gray-50);
  border-radius: 0.4rem;
  border: 1px solid var(--gray-200);
}

.fiche-hero-aside-img {
  border-radius: 0.75rem;
}

@media (max-width: 767px) {
  .fiche-hero-visual .fiche-hero-aside-img {
    max-width: 200px;
  }
}

.fiche-pour-vous-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .fiche-pour-vous-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
  }

  .fiche-hero-pour-qui-row .fiche-pour-vous-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1280px) {
  .fiche-hero-pour-qui-row .fiche-pour-vous-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

.fiche-pour-vous-card {
  margin: 0;
  height: 100%;
}

.fiche-hero-pour-qui-row {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: stretch;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  background: linear-gradient(180deg, #fff 0%, var(--gray-50) 100%);
}

.fiche-pour-vous-wrap {
  flex: 1;
  min-width: 0;
}

/* ——— Bloc D : menu mobile sans JS (case à cocher + #mobile-menu juste après </nav>) ——— */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  z-index: 50;
  transition: box-shadow 0.3s ease;
  overflow: visible;
  font-family: inherit;
}

#navbar.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-container {
  width: 100%;
  position: relative;
  padding: 0;
  overflow: visible;
}

@media (max-width: 767px) {
  .nav-container {
    overflow: visible;
  }
}

.nav-menu {
  padding-left: 0.75rem;
  padding-right: 2rem;
  min-width: 0;
}

.nav-link {
  font-family: inherit;
  letter-spacing: normal;
}

.nav-link.nav-link-current {
  color: var(--brand-orange) !important;
}

.nav-link.nav-link-current::after {
  width: 100%;
}

.nav-link.nav-link-current:hover {
  color: var(--brand-orange-dark) !important;
}

.mobile-page-context {
  width: min(8.5rem, calc(100vw - 12rem));
  padding: 0.2rem 0.4rem;
}

.mobile-page-context a:last-child {
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (min-width: 768px) {
  .mobile-page-context {
    display: none !important;
  }
}

.burger-btn {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

@media (min-width: 768px) {
  .burger-btn {
    display: none !important;
  }
}

.burger-svg {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  stroke: #374151;
}

.burger-svg-rail {
  transition: opacity 0.2s ease;
}

.burger-svg-x {
  display: none;
}

#navbar:has(#mobile-menu-toggle:checked) .burger-svg-lines {
  display: none;
}

#navbar:has(#mobile-menu-toggle:checked) .burger-svg-x {
  display: block;
}

#navbar:has(#mobile-menu-toggle:checked) .burger-svg-rail {
  opacity: 0;
}

.mobile-menu {
  display: none;
  background-color: #fff;
  border-top: 1px solid var(--gray-100);
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
  }
}

@media (max-width: 767px) {
  #navbar:has(#mobile-menu-toggle:checked) ~ #mobile-menu {
    display: block !important;
    position: fixed !important;
    top: calc(8rem + 1.25rem) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: calc(100vh - 9.25rem) !important;
    max-height: calc(100dvh - 9.25rem) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    z-index: 49 !important;
    background-color: #fff !important;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  #navbar:has(#mobile-menu-toggle:checked) ~ #mobile-menu .mobile-menu-inner {
    padding-top: 1.35rem;
    padding-bottom: 2rem;
  }
}

.mobile-menu-inner {
  padding: 0.5rem 1rem 1rem;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  font-weight: 500;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.mobile-menu a:hover {
  background-color: var(--gray-50);
  color: var(--brand-orange);
}

.mobile-menu .nav-link-current {
  color: var(--brand-orange) !important;
}

.mobile-menu a.btn.btn-primary {
  color: #fff !important;
  background-color: var(--brand-orange) !important;
}

.mobile-menu a.btn.btn-primary:hover {
  color: #fff !important;
  background-color: var(--brand-orange-dark) !important;
}

.mobile-menu .btn {
  display: block;
  margin: 0.5rem 1rem 0;
}

.spacer {
  height: var(--nav-h);
  min-height: var(--nav-h);
  flex-shrink: 0;
}

/* Fil d'Ariane sticky : rester sous #navbar (z-index 50) si un ancêtre casse position:sticky
   (overflow, etc.) — évite que le fil « remonte » visuellement au-dessus du menu. */
nav.breadcrumb-nav {
  z-index: 40 !important;
}

/* overflow non visible sur main annule le sticky des descendants ; rappel pour les fiches longues. */
main#main-content {
  overflow-x: visible;
  overflow-y: visible;
}
