/* ==========================================================================
   CHARTE GRAPHIQUE LE CINQUIÈME JOUR — TUTORIEL WEB INTERACTIF
   Design Tokens & Styles Globaux (Option B : Unifié & Haute Performance)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Palette de marque Le Cinquième Jour */
  --color-primary: #1b4d58;         /* Bleu pétrole / canard emblématique */
  --color-primary-dark: #12373e;    /* Bleu pétrole profond pour survol et header */
  --color-primary-light: #e8f1f3;   /* Teinte douce pour badges et arrière-plans */
  
  --color-accent: #e89271;          /* Pêche / terracotta chaleureux pour CTA */
  --color-accent-hover: #d97d5a;    /* Nuance active pour les boutons */
  --color-accent-light: #fef1ec;    /* Fond pour alertes et tags clés */

  /* Arrière-plans et cartes */
  --color-bg: #fbfaf7;              /* Blanc cassé crème doux pour le confort de lecture */
  --color-card-bg: #ffffff;         /* Blanc pur pour détacher les modules pédagogiques */
  --color-border: rgba(27, 77, 88, 0.12); /* Séparateurs subtils bleu pétrole */
  --color-border-hover: rgba(27, 77, 88, 0.35);

  /* Typographie & Textes */
  --color-text-main: #222b30;       /* Gris anthracite très foncé (haute lisibilité) */
  --color-text-muted: #5e6b73;      /* Teinte secondaire pour horodatages et notes */
  --color-text-light: #ffffff;      /* Blanc pur pour header et badges pleins */
  
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Ombres & Rayons */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-subtle: 0 2px 8px rgba(27, 77, 88, 0.04);
  --shadow-card: 0 8px 28px rgba(27, 77, 88, 0.06);
  --shadow-hover: 0 12px 36px rgba(27, 77, 88, 0.12);
  
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   RESET & STRUCTURE DE BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--font-main);
  color: var(--color-text-main);
  background-color: var(--color-bg);
  /* Motif micro-dots reproduisant l'ambiance du CV interactif */
  background-image: radial-gradient(#d3cec4 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   HEADER DE MARQUE LE CINQUIÈME JOUR
   Fidèle au bandeau du site interactif de Jean-Noël Lefebvre
   -------------------------------------------------------------------------- */
.l5j-header {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  padding: 1.25rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 100;
}

.header-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background-color: #ffffff;
  padding: 2px;
}

.brand-info h1 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  flex-wrap: wrap;
}

.brand-meta a {
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: opacity var(--transition-fast);
}

.brand-meta a:hover {
  opacity: 0.8;
  text-decoration: underline;
}


/* --------------------------------------------------------------------------
   BARRE DE NAVIGATION RAPIDE STICKY (GLASSMORPHISM)
   -------------------------------------------------------------------------- */
.sticky-nav-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background-color: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(27, 77, 88, 0.04);
  padding: 0.65rem 0;
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none; /* Masque la scrollbar sur Firefox */
}

.nav-container::-webkit-scrollbar {
  display: none; /* Masque la scrollbar sur Chrome/Safari */
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #ffffff;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-pill:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-subtle);
}

.nav-pill-accent {
  background-color: var(--color-accent-light);
  color: var(--color-accent-hover);
  border-color: var(--color-accent);
}

.nav-pill-accent:hover {
  background-color: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

/* Décalage vertical des ancres pour ne pas être masquées par la barre sticky */
.notion-heading-block,
.tutorial-section,
.formations-banner-card {
  scroll-margin-top: 80px;
}

/* --------------------------------------------------------------------------
   LAYOUT PRINCIPAL & CONTENEUR
   -------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}

/* --------------------------------------------------------------------------
   CARTE D'INTRODUCTION
   -------------------------------------------------------------------------- */
.intro-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.intro-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background-color: var(--color-accent);
}

.intro-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.intro-desc {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.intro-desc strong {
  color: var(--color-text-main);
}

/* Pilules de caractéristiques rapides */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-card-bg);
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: default;
}

.pill:hover {
  background-color: var(--color-primary-light);
  transform: translateY(-1px);
}

.pill-accent {
  background-color: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

.pill-accent:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* --------------------------------------------------------------------------
   BANDEAU LICENCE CREATIVE COMMONS (HAUT DE PAGE)
   -------------------------------------------------------------------------- */
.cc-license-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-subtle);
  flex-wrap: wrap;
}

.cc-badge-img {
  height: 48px;
  width: auto;
}

.cc-info-card {
  flex: 1;
  min-width: 260px;
}

.cc-info-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.cc-info-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.cc-info-card a {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--color-primary);
  word-break: break-all;
}

/* --------------------------------------------------------------------------
   BANDEAUX DE SECTION STYLE NOTION
   -------------------------------------------------------------------------- */
.notion-heading-block {
  background-color: rgba(27, 77, 88, 0.08);
  border-left: 4px solid var(--color-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 2.5rem 0 1.5rem;
}

.notion-heading-block h2, 
.notion-heading-block h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0;
}

.callout-quote {
  background-color: #f0f7f9;
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  color: var(--color-primary-dark);
}

.tutorial-figure {
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}

.tutorial-figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   SECTIONS DE FORMATION & CARTES MAÎTRESSES
   -------------------------------------------------------------------------- */
.tutorial-section {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2.5rem;
}

.section-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.section-tag {
  display: inline-block;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.3;
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   VIDÉO RESPONSIVE (16:9) & BOUTON EXTERNE
   -------------------------------------------------------------------------- */
.video-container {
  margin-bottom: 2rem;
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  background-color: #111827;
}

.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.btn-youtube {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #ff0000;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.25);
}

.btn-youtube:hover {
  background-color: #d90000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   CARTE EXEMPLE D'APPLICATION (TROMBIQUIZ)
   -------------------------------------------------------------------------- */
.example-app-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
}

.example-app-img {
  width: 200px;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-subtle);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.example-app-content h3 {
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.example-app-content p {
  font-size: 0.925rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.example-app-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.example-app-link:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

/* --------------------------------------------------------------------------
   TIMELINE / CHAPITRAGE DU COURS
   -------------------------------------------------------------------------- */
.timeline-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.timeline-item {
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  transition: all var(--transition-fast);
}

.timeline-item:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-subtle);
}

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.timeline-timestamp {
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}

.timeline-label {
  font-weight: 700;
  color: var(--color-text-main);
  font-size: 1rem;
}

.timeline-bullets {
  list-style-type: none;
  padding-left: 0.5rem;
}

.timeline-bullets li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.timeline-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

/* --------------------------------------------------------------------------
   SNIPPETS DE CODE & PROMPTS
   -------------------------------------------------------------------------- */
.snippets-section {
  margin-top: 2rem;
}

.snippets-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.snippet-card {
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  transition: border-color var(--transition-fast);
}

.snippet-card:hover {
  border-color: var(--color-border-hover);
}

.snippet-header {
  background-color: #f8fafc;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast);
}

.snippet-header:hover {
  background-color: #f1f5f9;
}

.snippet-header-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.snippet-toggle-icon {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform 0.25s ease;
}

.snippet-card.is-collapsed .snippet-toggle-icon {
  transform: rotate(-90deg);
}

.snippet-card.is-collapsed .snippet-header {
  border-bottom: none;
}

.snippet-card.is-collapsed .snippet-body {
  display: none;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--color-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-copy:hover {
  background-color: var(--color-accent-hover);
  transform: scale(1.02);
}

/* État actif lorsque le code a été copié dans le presse-papier */
.btn-copy.btn-copied {
  background-color: #10b981 !important; /* Vert émeraude de succès */
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
  transform: scale(1.04);
}

.snippet-body {
  padding: 1.25rem;
  background-color: #1e293b;
  color: #f1f5f9;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  transition: all 0.3s ease;
}

/* --------------------------------------------------------------------------
   BANDEAU FORMATIONS LE CINQUIÈME JOUR (BAS DE PAGE)
   -------------------------------------------------------------------------- */
.formations-banner-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  margin-top: 3rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.formations-banner-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background-color: var(--color-primary);
}

.trainer-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-primary-light);
  box-shadow: var(--shadow-subtle);
  flex-shrink: 0;
}

.formations-content {
  flex: 1;
}

.formations-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.formations-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1.35;
  margin-bottom: 1rem;
}

.formations-text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 0.85rem;
}

.formations-cta-wrapper {
  margin-top: 1.5rem;
}

.btn-formations {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(27, 77, 88, 0.25);
}

.btn-formations:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 77, 88, 0.35);
}

@media (max-width: 640px) {
  .formations-banner-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem;
  }
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.l5j-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: auto;
}

.footer-links {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   RESPONSIVE (MOBILE)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .intro-card {
    padding: 1.5rem;
  }

  .intro-title {
    font-size: 1.4rem;
  }
}
