/* ============================================
   SITE.CSS — styles partagés des pages du catalogue
   (catalogue, fiches formation, informations, mentions légales)

   Consomme uniquement les variables définies dans tokens.css.
   Ce fichier ne redéfinit aucune valeur du design system : il ne fait
   qu'assembler des composants à partir des tokens officiels.
============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--type-body-size);
  line-height: var(--type-body-lh);
  color: var(--text-body);
  background: var(--surface-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
button { font-family: inherit; cursor: pointer; border: none; background: none; touch-action: manipulation; }
ul, ol { list-style: none; }
strong { font-weight: var(--fw-semibold); color: var(--text-strong); }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-title); letter-spacing: -0.02em; color: var(--text-strong); }

/* ---------- Focus visible (clavier) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2.5px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  z-index: 200;
  background: var(--tl-mint);
  color: var(--tl-teal);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: var(--font-title);
  font-weight: var(--fw-bold);
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--narrow { max-width: var(--max-width-narrow); }

/* ---------- Kicker ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--type-kicker-size);
  font-weight: var(--type-kicker-weight);
  letter-spacing: var(--type-kicker-ls);
  text-transform: var(--type-kicker-transform);
  color: var(--text-soft);
  margin-bottom: var(--space-4);
}
.kicker::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 2px;
  flex-shrink: 0;
}
.kicker--light { color: var(--tl-on-dark-55); }
.kicker--light::before { background: var(--accent-highlight); }

/* ---------- Dot signature (point rose après un titre) ---------- */
.dot { color: var(--accent-scribble); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  transition: transform var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition), border-color var(--transition);
  line-height: 1;
}
.btn--lg { padding: 18px 34px; font-size: 16px; }
.btn--mint { background: var(--accent-primary); color: var(--tl-teal); box-shadow: var(--shadow-mint); }
.btn--mint:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--tl-teal); border: 1.5px solid var(--tl-border-strong); }
.btn--ghost:hover { border-color: var(--tl-teal); }
.btn--ghost-light { background: transparent; color: var(--tl-cream); border: 1.5px solid var(--tl-border-light); }
.btn--ghost-light:hover { border-color: var(--accent-highlight); color: var(--accent-highlight); }
.btn__arrow { display: inline-block; transition: transform 260ms var(--ease-spring); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.01em;
  color: var(--tl-teal);
  white-space: nowrap;
}
.pill--lime { background: var(--pill-lime); }
.pill--mint { background: var(--pill-mint); }
.pill--pink { background: var(--pill-pink); }
.pill--soft { background: rgba(15, 59, 64, 0.08); color: var(--text-soft); }
.pill--soft-light { background: rgba(245, 241, 232, 0.12); color: var(--tl-on-dark-70); }

/* Badge "à compléter" — signale un contenu manquant, jamais un chiffre inventé */
.badge-todo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--tl-pink);
  color: var(--tl-teal);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.01em;
}
.badge-todo::before { content: '●'; font-size: 8px; }

/* ============================================
   HEADER
============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 59, 64, 0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--tl-border-light);
  padding: 16px 0;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; position: static; }
.site-header__logo {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--tl-cream);
}
.site-header__logo span { color: var(--tl-lime); }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav a {
  position: relative;
  font-size: 14.5px;
  font-weight: var(--fw-medium);
  color: var(--tl-on-dark-70);
  transition: color var(--transition);
}
.nav a:hover { color: var(--tl-cream); }
.nav a[aria-current="page"] { color: var(--tl-cream); }
.nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--tl-lime);
  border-radius: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: -8px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--tl-cream);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--tl-teal);
    border-bottom: 1px solid var(--tl-border-light);
    padding: 6px var(--gutter) 18px;
  }
  .site-header.is-open .nav { display: flex; }
  .nav a { width: 100%; padding: 13px 0; border-top: 1px solid var(--tl-border-light); }
}

/* ============================================
   BREADCRUMB
============================================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  color: var(--tl-on-dark-55);
  margin-bottom: var(--space-6);
}
.breadcrumb a { color: var(--tl-on-dark-70); }
.breadcrumb a:hover { color: var(--tl-lime); }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

/* ============================================
   SECTIONS génériques / page header
============================================ */
.section { position: relative; padding: var(--space-section) 0; }
.section--tight { padding: var(--space-16) 0; }
.section--cream { background: var(--surface-cream); }
.section--cream-bright { background: var(--surface-cream-bright); }
.section--dark { background: var(--surface-dark); color: var(--text-on-dark); }

.page-header {
  padding: clamp(48px, 8vw, 80px) 0 clamp(40px, 6vw, 56px);
  background: var(--surface-dark);
  color: var(--text-on-dark);
}
.page-header__title {
  font-family: var(--font-title);
  font-size: var(--type-title-size);
  line-height: var(--type-title-lh);
  letter-spacing: var(--type-title-ls);
  font-weight: var(--type-title-weight);
  color: var(--tl-cream);
}
.page-header__lead {
  margin-top: var(--space-5);
  font-size: var(--type-lead-size);
  color: var(--tl-on-dark-70);
  max-width: 62ch;
}

.section__header { max-width: 680px; margin-bottom: clamp(32px, 5vw, 48px); }
.section__title {
  font-family: var(--font-title);
  font-size: var(--type-heading-size);
  line-height: var(--type-heading-lh);
  letter-spacing: var(--type-heading-ls);
  font-weight: var(--type-heading-weight);
  color: var(--text-strong);
}
.section--dark .section__title { color: var(--tl-cream); }
.section__intro {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 620px;
  margin-top: var(--space-4);
}
.section--dark .section__intro { color: var(--tl-on-dark-70); }

/* ============================================
   CARDS
============================================ */
.card {
  background: var(--surface-card);
  border: 1px solid var(--tl-border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 32px);
  box-shadow: var(--shadow-soft);
}

/* ---- Cartes formation (index catalogue) ---- */
.course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 720px) {
  .course-grid { grid-template-columns: 1fr 1fr; }
}
.course-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--tl-border);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 3vw, 34px);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.course-card__meta { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.course-card__ref {
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  color: var(--text-soft);
}
.course-card__title {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.course-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: 14px;
  color: var(--text-soft);
}
.course-card__facts strong { font-weight: var(--fw-semibold); color: var(--text-strong); }
.course-card__desc { color: var(--text-soft); font-size: 15px; }
.course-card__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-weight: var(--fw-bold);
  font-size: 14.5px;
  color: var(--tl-teal);
  padding-top: var(--space-2);
}
.course-card__link .btn__arrow { transition: transform 260ms var(--ease-spring); }
.course-card:hover .course-card__link .btn__arrow { transform: translateX(4px); }

/* ============================================
   SPEC TABLE — résumé réglementaire d'une fiche formation
============================================ */
.spec-table {
  border: 1px solid var(--tl-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-card);
}
.spec-table__row {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--tl-border);
}
.spec-table__row:first-child { border-top: none; }
@media (min-width: 640px) {
  .spec-table__row { grid-template-columns: 220px 1fr; }
}
.spec-table__key {
  padding: var(--space-4) var(--space-6);
  background: var(--surface-cream);
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  color: var(--text-strong);
}
@media (min-width: 640px) {
  .spec-table__key { border-right: 1px solid var(--tl-border); }
}
.spec-table__value {
  padding: var(--space-4) var(--space-6);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
}
.spec-table__value p + p { margin-top: var(--space-2); }

/* ============================================
   DÉROULÉ TABLE (programme détaillé)
============================================ */
.schedule-table { border: 1px solid var(--tl-border); border-radius: var(--radius); overflow: hidden; }
.schedule-table th, .schedule-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--tl-border);
}
.schedule-table thead th {
  background: var(--surface-dark);
  color: var(--tl-cream);
  font-family: var(--font-title);
  font-size: 11.5px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.schedule-table tbody tr:nth-child(even) { background: var(--surface-cream); }
.schedule-table tbody tr:last-child td { border-bottom: none; }
.schedule-table td:first-child { white-space: nowrap; font-weight: var(--fw-semibold); color: var(--text-strong); }
.schedule-table td strong { display: block; color: var(--text-strong); margin-bottom: 2px; }
.schedule-table__wrap { overflow-x: auto; }

/* ============================================
   NUMBERED LIST (objectifs pédagogiques)
============================================ */
.objectives-list { display: flex; flex-direction: column; gap: var(--space-4); counter-reset: obj; }
.objectives-list li {
  counter-increment: obj;
  position: relative;
  padding-left: 44px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
}
.objectives-list li::before {
  content: counter(obj);
  position: absolute;
  left: 0; top: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--tl-lime);
  color: var(--tl-teal);
  font-family: var(--font-title);
  font-weight: var(--fw-bold);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   DISCLOSURE (blocs réglementaires repliables)
============================================ */
.disclosure {
  border: 1px solid var(--tl-border);
  border-radius: var(--radius);
  background: var(--surface-card);
  overflow: hidden;
}
.disclosure + .disclosure { margin-top: var(--space-4); }
.disclosure summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-title);
  font-weight: var(--fw-bold);
  font-size: 1.02rem;
  color: var(--text-strong);
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after {
  content: '+';
  font-size: 22px;
  font-weight: var(--fw-regular);
  color: var(--text-soft);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.disclosure[open] summary::after { transform: rotate(45deg); }
.disclosure__body {
  padding: 0 var(--space-6) var(--space-6);
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.65;
}
.disclosure__body > * + * { margin-top: var(--space-4); }
.disclosure__body h4 { font-size: 1rem; color: var(--text-strong); margin-bottom: var(--space-2); }
.disclosure__body ul { display: flex; flex-direction: column; gap: var(--space-2); }
.disclosure__body ul li { padding-left: 16px; position: relative; }
.disclosure__body ul li::before {
  content: '';
  position: absolute; left: 0; top: 9px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--tl-ink-soft);
}

/* ============================================
   NOTE / CALLOUT boxes
============================================ */
.note {
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.6;
}
.note--mint { background: rgba(61, 224, 180, 0.10); border: 1px solid rgba(61, 224, 180, 0.25); color: var(--text-body); }
.note--pink { background: rgba(245, 182, 204, 0.18); border: 1px solid rgba(245, 143, 176, 0.35); color: var(--text-body); }
.note--soft { background: rgba(15, 59, 64, 0.05); color: var(--text-soft); }
.note strong { color: var(--text-strong); }

/* ============================================
   CONTACT CTA (bas de fiche)
============================================ */
.fiche-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  justify-content: space-between;
  padding: clamp(28px, 4vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--surface-dark);
  color: var(--text-on-dark);
}
.fiche-cta__text h3 { font-size: 1.3rem; margin-bottom: var(--space-2); color: var(--tl-cream); }
.fiche-cta__text p { color: var(--tl-on-dark-70); max-width: 46ch; }
.fiche-cta__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ============================================
   FOOTER
============================================ */
.footer {
  padding: var(--space-10) 0 var(--space-8);
  background: var(--surface-dark-deep);
  color: var(--tl-on-dark-55);
  border-top: 1px solid var(--tl-border-light);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.footer__brand {
  font-family: var(--font-title);
  font-weight: var(--fw-bold);
  color: var(--tl-on-dark-70);
  font-size: 15px;
}
.footer__legal {
  font-size: 13px;
  line-height: 1.7;
  max-width: 640px;
}
.footer__legal p + p { margin-top: 2px; }
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--tl-border-light);
  font-size: 13.5px;
}
.footer a { transition: color var(--transition); }
.footer a:hover { color: var(--tl-lime); }

/* ============================================
   BULLET LIST — liste à puces générique
============================================ */
.bullet-list { display: flex; flex-direction: column; gap: 10px; }
.bullet-list li { padding-left: 18px; position: relative; }
.bullet-list li::before {
  content: '';
  position: absolute; left: 0; top: 9px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--tl-ink-soft);
}

/* ============================================
   UTILITIES
============================================ */
.stack { display: flex; flex-direction: column; gap: var(--space-6); }
.stack--sm { gap: var(--space-4); }
.stack--lg { gap: var(--space-10); }
.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;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
