/* ================================================================
   CENTRE FORMATION FFVELO - CSS (REFACTORISÉ • SANS JAUNE)
   - Conserve toutes les classes existantes
   - Factorise les couleurs/répétitions
   - FFVélo = bleu/rouge uniquement (aucun jaune)
   ================================================================ */

/* =========================
   TOKENS / VARIABLES
   ========================= */
:root {
  /* FFVélo brand */
  --ffvelo-blue: #004b9b;
  --ffvelo-red:  #e30613;

  /* Primary system (buttons, links, interactive) */
  --primary: #172983;
  --primary-hover: #303F9F;
  --primary-shadow: rgba(23, 41, 131, 0.3);

  /* Text & UI -- single blue for text, unified with primary */
  --ink: var(--primary);
  --text-light: #6c757d;
  --border-light: #dee2e6;

  /* Bootstrap body/heading/text -- all point to --primary */
  --bs-body-color: var(--primary);
  --bs-heading-color: var(--primary);
  --bs-secondary-color: var(--primary);
  --bs-tertiary-color: var(--primary);

  /* Unify Bootstrap danger with FFVélo red */
  --bs-danger: #e30613;
  --bs-danger-rgb: 227, 6, 19;

  /* Gradients */
  --grad-ffvelo: linear-gradient(90deg, var(--ffvelo-blue), var(--ffvelo-red));
  --grad-ffvelo-soft: linear-gradient(
    90deg,
    rgba(0, 75, 155, 0.10),
    rgba(227, 6, 19, 0.06)
  );

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);

  /* Motion */
  --anim: 0.3s ease;

  /* Bootstrap compatibility */
  --bs-primary: var(--primary);
  --bs-primary-rgb: 23, 41, 131;
}

/* ================================================================
   OVERRIDE BOOTSTRAP PRIMARY - conservation de ton système (factorisé)
   ================================================================ */
.bg-primary,
.badge.bg-primary,
.card-header.bg-primary {
  background-color: var(--primary) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.border-primary,
.card.border-primary {
  border-color: var(--primary) !important;
}

.border-start.border-primary,
.list-group-item.border-start.border-primary {
  border-left-color: var(--primary) !important;
}

.table-primary,
.table-primary th {
  background-color: var(--primary);
  color: white;
}

/* Buttons (factorisé) */
.btn-primary,
.btn-outline-primary {
  font-weight: 600;
  transition: all var(--anim);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Danger buttons -- unified FFVélo red */
.btn-danger {
  background-color: var(--ffvelo-red);
  border-color: var(--ffvelo-red);
  font-weight: 600;
  transition: all var(--anim);
}

.btn-danger:hover {
  background-color: #c30510;
  border-color: #c30510;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-danger {
  color: var(--ffvelo-red);
  border-color: var(--ffvelo-red);
  font-weight: 600;
  transition: all var(--anim);
}

.btn-outline-danger:hover {
  background-color: var(--ffvelo-red);
  border-color: var(--ffvelo-red);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ================================================================
   TYPOGRAPHIE & BASE
   ================================================================ */
body {
  background-color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--primary);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* ================================================================
   NAVBAR
   ================================================================ */
#navmain {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 0;
  transition: all var(--anim);
}

.navbar-brand img {
  transition: transform var(--anim);
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

#navmain .navbar-nav .nav-link {
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.01em;
  padding: 0.5rem 1rem;
  color: var(--ffvelo-blue);
  transition: all var(--anim);
  position: relative;
}

/* Dropdown menu */
.dropdown-menu {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
  margin: 0 !important;
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  transition: all var(--anim);
}

.dropdown-item:hover {
  background: var(--grad-ffvelo-soft);
  color: var(--ffvelo-blue);
  padding-left: 1.5rem;
}

.dropdown-menu-custom {
  min-width: 20rem;
  max-height: 95vh;
}

/* ================================================================
   HERO / IMAGE TOP
   ================================================================ */
div.img-top {
  height: 70vh;
  min-height: 400px;
  position: relative;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6)),
    url('/images/home_page/centre_formation.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: stretch; /* allow full height */
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  max-width: 900px;
  padding: 2rem;

  /* NEW */
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  margin-bottom: 2rem;
  opacity: 0.95;
}

.hero-actions {
  margin-top: auto;     /* pushes buttons to bottom */
  padding-top: 1.5rem; /* optional spacing */
}


/* ================================================================
   CARDS & PILLAR
   ================================================================ */
.card {
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all var(--anim);
}

/* Opt-in elevated card with hover lift -- for interactive/clickable cards */
.card-elevated {
  border: none;
  box-shadow: var(--shadow-sm);
}

.card-elevated:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-elevated .card-img-top {
  transition: transform 0.5s ease;
}

.card-elevated:hover .card-img-top {
  transform: scale(1.05);
}

.pillar {
  border: 0;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
}

.pillar:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.pillar .card-header {
  background: transparent;
  border: 0;
  padding: 1.25rem 1.25rem 0;
}

.pillar .card-title {
  font-weight: 700;
  color: var(--ink);
}

.pillar .card-body {
  padding: 1.5rem;
}

/* ================================================================
   CARDS DE FORMATIONS
   ================================================================ */
.formation-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
  background: white;
}

.formation-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.formation-card .card-img-top {
  height: 220px;
  object-fit: cover;
}

/* (Conservé : ce badge est vert, pas jaune) */
.formation-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.formation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.formation-meta i {
  color: var(--primary);
  margin-right: 0.25rem;
}

/* ================================================================
   SECTIONS
   ================================================================ */
.section {
  padding: 4rem 0;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--ink);
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-light);
  margin-bottom: 3rem;
}

.section-bg-light {
  background-color: #f8f9fa;
}

.section-bg-gradient {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

/* Section heading -- unified treatment */
.section-heading {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.section-heading strong {
  display: block;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

/* Séparateur de section */
.section-divider {
  height: 4px;
  width: 80px;
  background: var(--grad-ffvelo);
  margin: 1.5rem 0 2rem;
  border-radius: 2px;
}

/* Page hero -- unified header for all inner pages */
.page-hero {
  background: var(--bs-light);
  padding: 3rem 0;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.page-hero .section-divider {
  margin: 0 auto 1rem;
}

.page-hero .lead {
  max-width: 700px;
  margin: 0 auto;
}

/* ================================================================
   STATS / CHIFFRES CLÉS
   (refactor : enlève l'ancien dégradé jaune)
   ================================================================ */
.stat-box {
  text-align: center;
  padding: 2rem;
  border-radius: 1rem;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  background: var(--grad-ffvelo);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.badge-dot {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.badge-dot::before {
  content: "";
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.success-badge {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.info-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 12px rgba(23, 41, 131, 0.2);
}

/* ================================================================
   LISTE DES FORMATIONS
   (refactor : enlève border-left hover jaune)
   ================================================================ */
.formation-list-item {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
  border-left: 4px solid var(--primary);
}

.formation-list-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--ffvelo-red);
}

.formation-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* ================================================================
   ARTICLES / ACTUALITÉS
   ================================================================ */
.article-card {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
  background: white;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.article-image {
  height: 250px;
  object-fit: cover;
  width: 100%;
  transition: transform 0.5s ease;
}

.article-card:hover .article-image {
  transform: scale(1.05);
}

.article-content {
  padding: 1.5rem;
}

.article-date {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
}

.article-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* ================================================================
   BOUTONS AMÉLIORÉS
   (refactor : enlève btn-cta jaune -> FFVélo gradient)
   ================================================================ */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all var(--anim);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* CTA en FFVélo bleu/rouge */
.btn-cta {
  background: linear-gradient(135deg, var(--ffvelo-blue), var(--ffvelo-red));
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 75, 155, 0.25);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(227, 6, 19, 0.25);
  color: white;
}

/* ================================================================
   UTILITIES
   ================================================================ */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--anim);
}

a:hover {
  color: var(--primary);
}

.text-outline {
  -webkit-text-stroke: 0.3px black;
}

.line-clamp-4 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.line-clamp-6 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}

.checklist li {
  padding: .25rem 0;
}

/* Subtle horizontal rule matching card borders */
.hr-subtle {
  border-top: 1px solid var(--border-light);
  opacity: 1;
}

/* Fixed-height cover image */
.img-cover-400 {
  height: 400px;
  object-fit: cover;
}

.subtle {
  opacity: .85;
}

/* Turbo loading overlay */
.turbo-overlay {
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.turbo-spinner {
  width: 3rem;
  height: 3rem;
}

/* Step number badge (VAE steps, etc.) */
.step-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Team member photo / placeholder */
.team-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.team-placeholder {
  width: 100px;
  height: 100px;
}

.team-placeholder-icon {
  font-size: 2.5rem;
}

/* Avatar circle (profile) */
.avatar-circle {
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
  font-weight: 600;
}

/* ================================================================
   FOOTER
   ================================================================ */
footer {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-top: 4px solid transparent;
  border-image: var(--grad-ffvelo) 1;
}

footer a {
  color: var(--text-light);
  transition: all var(--anim);
}

footer a:hover {
  color: var(--primary);
  padding-left: 0.25rem;
}

footer .fs-5 {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1rem;
}

#img-qualiopi,
#img-ocsport {
  transition: transform var(--anim);
}

#img-qualiopi:hover,
#img-ocsport:hover {
  transform: scale(1.05);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }

  .dropdown-menu-custom {
    min-width: 10rem;
  }

  .navbar-collapse {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding-top: 0.75rem;
  }

  #navmain .navbar-nav .nav-link {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
  }

  #navmain .dropstart .nav-link {
    border-bottom: none;
  }

  #navmain .navbar-nav .nav-link::before {
    display: none;
  }

  .section {
    padding: 2rem 0;
  }

  .stat-box {
    margin-bottom: 1rem;
  }
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Focus states améliorés */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(23, 41, 131, 0.25);
}

/* ================================================================
   QUALIOPI BADGE
   ================================================================ */
.qualiopi-badge {
  display: inline-block;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--anim);
}

.qualiopi-badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ================================================================
   LOADING STATES
   ================================================================ */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================================================
   NAVBAR FIX: underline on ::before + chevron caret (FINAL)
   - underline visible on hover + active + dropdown open
   ================================================================ */
#navmain .nav-link {
  position: relative;
}

#navmain .nav-link:hover,
#navmain .nav-link:focus,
#navmain .nav-link.active,
#navmain .nav-item.show > .nav-link {
  color: var(--ffvelo-red) !important;
}

/* Underline (shared) */
#navmain .navbar-nav .nav-link::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  transform: translateX(-50%);
  transition: width 0.25s ease;
  background: var(--grad-ffvelo);
}

#navmain .navbar-nav .nav-link:hover::before,
#navmain .navbar-nav .nav-link.active::before,
#navmain .nav-item.show > .nav-link::before {
  width: 80%;
}

/* Dropdown caret = chevron (no triangle, no underline conflict) */
#navmain .dropdown-toggle::after {
  content: "\f282"; /* bi-chevron-down */
  font-family: "Bootstrap-icons";
  border: 0 !important;
  display: inline-block;
  width: auto;
  height: auto;
  background: none;
  position: static;
  margin-left: .4rem;
  vertical-align: middle;
  transition: transform .2s ease;
}

#navmain .nav-item.show .dropdown-toggle::after {
  transform: rotate(180deg);
}

#navmain .dropdown-toggle {
  padding-right: 1.25rem;
}

.pillar-number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ffvelo-red);
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Fiche formation -- sticky jump-link bar */
.fiche-toc {
  position: sticky;
  top: 56px; /* fallback; overridden by sticky-nav controller */
  z-index: 1019;
  background: white;
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 0;
}

.fiche-toc > .container {
  overflow-x: auto;
  white-space: nowrap;
  justify-content: start;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
  padding-bottom: 0.35rem;
}

@media (min-width: 1200px) {
  .fiche-toc > .container {
    justify-content: center;
  }
}

.fiche-toc > .container::-webkit-scrollbar {
  height: 4px;
}

.fiche-toc > .container::-webkit-scrollbar-track {
  background: transparent;
}

.fiche-toc > .container::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

.fiche-toc a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  flex-shrink: 0;
}

.fiche-toc a:hover {
  color: var(--primary);
}

.fiche-toc a.active {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Hide Trix attachment metadata (filename, file size) in rendered content */
figure.attachment figcaption,
figure[data-trix-attachment] figcaption {
  display: none;
}

figure.attachment img,
figure[data-trix-attachment] img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

/* Catalog filter — horizontal scroll bar (same pattern as .fiche-toc) */
.catalog-toc {
  position: sticky;
  top: 56px;
  z-index: 1019;
  background: white;
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 0 .75rem;
  margin-bottom: 1.5rem;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.catalog-toc > div {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
  padding-bottom: 0.35rem;
}

@media (min-width: 992px) {
  .catalog-toc {
    text-align: center;
  }

  .catalog-toc > div {
    display: inline-flex !important;
  }
}

.catalog-toc > div::-webkit-scrollbar {
  height: 4px;
}

.catalog-toc > div::-webkit-scrollbar-track {
  background: transparent;
}

.catalog-toc > div::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

/* Catalog filter buttons — gradient border via double background */
#catalogNav .catalog-filter {
  flex-shrink: 0;
  border: 2px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box,
              var(--grad-ffvelo) border-box;
  color: var(--ffvelo-blue);
  cursor: pointer;
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .03em;
  transition: all .2s ease;
}

#catalogNav .catalog-filter:hover {
  background: var(--ffvelo-red) border-box;
  border: 2px solid transparent;
  color: #fff;
}

#catalogNav .catalog-filter.active {
  background: var(--ffvelo-red) border-box;
  border: 2px solid transparent;
  color: #fff;
  box-shadow: 0 .125rem .5rem rgba(227, 6, 19, .25);
}
