/* ============================================================================
   FEUILLE DE STYLE — Damien Poulain
   ----------------------------------------------------------------------------
   Organisation :
     1. Variables (couleurs, largeurs)   4. En-tête / navigation
     2. Base / réinitialisation          5. Pages (accueil, formations…)
     3. Utilitaires                      6. Pied de page
   Les couleurs sont centralisées dans :root — changez-les une fois, partout.
   ========================================================================== */

/* -- 1. Variables ---------------------------------------------------------- */
:root {
  --bg: #f6f7f6; /* fond général            */
  --text: #1c211f; /* texte principal         */
  --muted: #5f6b65; /* texte secondaire        */
  --border: #e4e7e5; /* bordures claires        */
  --card: #ffffff; /* fond des cartes         */

  --header-bg: #232826; /* barre du haut           */
  --footer-bg: #1b1f1d; /* pied de page            */

  --green: #618764; /* vert accent (actif)     */
  --green-dark: #2b5748; /* vert foncé (titres)     */
  --green-light: #9cb080; /* vert clair (survol)     */

  --maxw: 1120px; /* largeur max du contenu  */
  --radius: 12px;
}

/* -- 2. Base --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family:
    'Geist',
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* -- 3. Utilitaires -------------------------------------------------------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Texte riche (descriptions de formations, mentions légales) */
.rich-text p {
  margin: 0 0 12px;
}
.rich-text p:last-child {
  margin-bottom: 0;
}
.rich-text h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--green-dark);
}

/* Cadre d'image avec repli en cas d'image manquante                        */
/* (fond à rayures + libellé, puis l'image réelle apparaît si elle charge)  */
.media {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: repeating-linear-gradient(
    135deg,
    #eef1ef,
    #eef1ef 10px,
    #e7ebe8 10px,
    #e7ebe8 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.media__label {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: #8a948e;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 6px;
  word-break: break-all;
}
.media__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0; /* invisible tant que l'image n'a pas chargé */
  transition: opacity 0.2s ease;
}
.media__img.is-loaded {
  opacity: 1;
}

/* -- 4. En-tête & navigation ---------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid #2f3633;
}
.site-header__inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  flex: none;
  background: none;
  border: none;
  padding: 0;
}
.logo__mark {
  width: 40px;
  height: 40px;
  display: flex;
  flex: none;
}
.logo__mark svg {
  display: block;
}
.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}
.logo__name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.logo__tagline {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa49e;
}

.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.nav-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #cdd4d0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.nav-btn:hover {
  background: #2f3633;
  color: #fff;
}
.nav-btn.is-active {
  background: var(--green);
  color: #fff;
}
.nav-btn.is-active:hover {
  background: #529068;
}

.contact-btn {
  flex: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #3a423e;
  border-radius: 8px;
  color: #cdd4d0;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.contact-btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Bouton burger — masqué par défaut, affiché en mobile (voir media query) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: none;
  border: 1px solid #3a423e;
  border-radius: 8px;
  cursor: pointer;
  flex: none;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #cdd4d0;
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Bouton de contact flottant — masqué par défaut, affiché en mobile */
.contact-fab {
  display: none;
}

/* -- 5. Zone principale & pages ------------------------------------------- */
.site-main {
  flex: 1 0 auto;
}
.site-main__inner {
  padding: clamp(40px, 6vw, 80px) 24px;
}

/* Système de pages : masquées par défaut, affichées via .is-active         */
.page {
  display: none;
}
.page.is-active {
  display: block;
}

/* Titres communs */
.page-title {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0;
}
.section-subtitle {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 14px 0 0;
  text-wrap: pretty;
}

/* --- Page Accueil --- */
.hero {
  max-width: 760px;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0;
}
.hero__subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.45;
  font-weight: 500;
  color: var(--green-dark);
  margin: 16px 0 0;
}
.hero__intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 24px 0 0;
  text-wrap: pretty;
}
.hero__hook {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.45;
  font-weight: 500;
  color: var(--green-dark);
  margin: 16px 0 0;
}

.expertise {
  margin-top: clamp(48px, 7vw, 88px);
}

/* Grille des 4 cartes : 4 de front sur large écran, 2×2 puis 1 colonne ensuite */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
}
.stat-card__stat {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--green-dark);
  margin-bottom: 10px;
}
.stat-card__text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}

/* --- Page Les Formations --- */
.page-intro {
  max-width: 680px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.formations-list {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3vw, 40px);
}
.formation {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 40px);
  align-items: flex-start; /* le contenu est long : on aligne en haut */
}
.formation--reverse {
  flex-direction: row-reverse;
}

.formation__media {
  flex: 1 1 300px;
  min-width: 280px;
}
/* L'illustration garde un ratio fixe et reste visible pendant la lecture */
.formation__media .media {
  aspect-ratio: var(--media-ratio, 16 / 9);
  position: sticky;
  top: 88px; /* sous l'en-tête collant (64px) + marge */
}

.formation__body {
  flex: 1 1 380px;
  min-width: 280px;
  padding: 8px 4px;
}
.formation__title {
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 6px;
}
.formation__subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--green-dark);
  margin: 0 0 16px;
}

/* Infos-clés en pastilles (Public, Méthode, Durée, Prérequis…) */
.fmt-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 22px;
}
.fmt-fact {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  background: #f1f3f1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}
.fmt-fact strong {
  color: var(--green-dark);
  font-weight: 600;
}

/* Blocs titrés (objectifs, points forts…) */
.fmt-section {
  margin: 0 0 22px;
}
.fmt-section:last-child {
  margin-bottom: 0;
}
.fmt-section__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}

/* Listes : marqueur coloré via ::before, aligné proprement sur plusieurs lignes */
.fmt-list,
.fmt-check,
.fmt-arrow {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fmt-list li,
.fmt-check li,
.fmt-arrow li {
  position: relative;
  padding-left: 26px;
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}
.fmt-list li:last-child,
.fmt-check li:last-child,
.fmt-arrow li:last-child {
  margin-bottom: 0;
}
.fmt-list li::before,
.fmt-check li::before,
.fmt-arrow li::before {
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}
.fmt-list li::before {
  content: '•';
  left: 6px;
}
.fmt-check li::before {
  content: '✓';
}
.fmt-arrow li::before {
  content: '→';
}

/* --- Page Pourquoi me choisir (argumentaire en prose) --- */
.why {
  max-width: 820px;
}
.why-lead {
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--green-dark);
  margin: 0;
  text-wrap: pretty;
}

/* Bandeau de mots-clés (Indépendant • Expérimenté…) */
.why-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}
.why-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--green-dark);
  background: #eef5ee;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

.why-section {
  margin-top: clamp(32px, 4.5vw, 48px);
}
.why-section__title {
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 14px;
}
.why-p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 12px;
  text-wrap: pretty;
}
.why-p:last-child {
  margin-bottom: 0;
}
.why-section .fmt-check {
  margin: 4px 0;
}
.why-note {
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--green-dark);
  margin: 16px 0 0;
  text-wrap: pretty;
}

/* Compétences : label en gras + filet vert à gauche */
.why-creds {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.why-creds li {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  padding-left: 16px;
  border-left: 3px solid var(--green);
  border-radius: 0;
}
.why-creds strong {
  color: var(--green-dark);
  font-weight: 600;
}

/* Tableau « Vos attentes / Ma réponse » */
.why-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  margin-top: 6px;
}
.why-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.why-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--green-dark);
}
.why-table td {
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.55;
  vertical-align: top;
  color: #3b443f;
  border-bottom: 1px solid #eef0ef;
}
.why-table td.why-table__key {
  font-weight: 600;
  color: var(--green-dark);
  background: #f3f6f2;
  width: 38%;
}
.why-table tr:last-child td {
  border-bottom: none;
}

/* Bouton d'appel à l'action */
.cta-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 20px;
  padding: 12px 22px;
  background: var(--green);
  color: #ffffff;
  text-decoration: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.15s ease;
}
.cta-btn:hover {
  background: #529068;
}

/* --- Page Mentions légales --- */
.mentions {
  max-width: 760px;
}
.mentions__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 24px;
}
.mentions__body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

/* -- 6. Pied de page ------------------------------------------------------ */
.site-footer {
  flex: none;
  background: var(--footer-bg);
  border-top: 1px solid #2a302d;
}
.site-footer__inner {
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
}
.footer-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}
.footer-items span {
  font-size: 13px;
  color: #8a948e;
}
.mentions-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: #9aa49e;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.mentions-link:hover {
  color: var(--green-light);
}

/* ==========================================================================
   MOBILE (≤ 940px) : menu burger + bouton de contact flottant
   Seuil à 940px = largeur en dessous de laquelle l'en-tête ne tient plus
   sur une seule ligne (le bouton e-mail est long).
   ========================================================================== */
@media (max-width: 940px) {
  /* En-tête : on montre le burger, on cache la nav en ligne et le bouton e-mail */
  .nav-toggle {
    display: flex;
  }
  .contact-btn {
    display: none;
  }

  /* La nav devient un panneau déroulant sous la barre, ouvert par le burger */
  .main-nav {
    display: none;
    width: 100%;
  }
  .site-header.nav-open .main-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0 12px;
  }
  .main-nav .nav-btn {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
  }

  /* Bouton de contact flottant, ancré en bas de l'écran */
  .contact-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    padding: 13px 18px;
    background: var(--green);
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  }
  .contact-fab::before {
    content: '';
    width: 18px;
    height: 18px;
    flex: none;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><path d='m3 7 9 6 9-6'/></svg>")
      center / contain no-repeat;
  }

  /* Espace en bas du pied de page pour ne pas être masqué par le bouton flottant */
  .site-footer__inner {
    padding-bottom: 84px;
  }
}
