/* ═══════════════════════════════════════════════════
   intervenant.stark.a3n.fr — Thème reveal.js IRIS
   Dérivé de la DA du site étudiant (cours.iris.a3n.fr)
   ═══════════════════════════════════════════════════ */

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

:root {
  --an-yellow:  #fdc500;
  --an-yellow-soft: rgba(253, 197, 0, 0.15);
  --an-navy:    #001434;
  --an-navy-soft: rgba(0, 20, 52, 0.85);
  --an-purple:  #9b51e0;
  --an-orange:  #fda100;
  --an-grey:    #f7f7f7;
  --an-text:    #001434;
  --an-muted:   #566080;
}

/* ─── Reset reveal overrides ─── */
/* Scope overflow:hidden uniquement aux pages reveal.js, pas à la landing */
html:has(.reveal), body:has(.reveal) { height: 100%; margin: 0; padding: 0; overflow: hidden; }

.reveal {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 32px;
  color: var(--an-text);
  background: #ffffff;
}

.reveal .slides {
  text-align: left;
  width: 100% !important;
  height: 100% !important;
}

/* Slides de contenu — padding et répartition verticale équilibrée */
.reveal .slides > section,
.reveal .slides > section > section {
  padding: 3vh 3vw;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.3em;
}

.reveal .slides section.present { overflow-y: auto; }

/* Slide cover (couverture) — centrage fort */
.reveal .slides > section.slide-cover,
.reveal .slides > section > section.slide-cover {
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
}

/* Slide section (chapitre) — centrage vertical fort */
.reveal .slides > section.slide-section,
.reveal .slides > section > section.slide-section {
  justify-content: center !important;
  padding: 4vh 5vw !important;
}

/* ─── Typographie ─── */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--an-navy);
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.4em 0;
}

.reveal h1 {
  font-size: 2.2em;
  font-weight: 800;
}

.reveal h1 .accent,
.reveal h2 .accent,
.reveal h3 .accent {
  color: var(--an-yellow);
  background: linear-gradient(90deg, var(--an-yellow) 0%, var(--an-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.reveal h2 { font-size: 1.6em; }
.reveal h3 { font-size: 1.2em; color: var(--an-purple); margin-top: 0.8em; }

.reveal p,
.reveal li {
  font-size: 0.95em;
  line-height: 1.45;
  color: var(--an-text);
}

.reveal ul,
.reveal ol {
  display: block;
  margin: 0.5em 0;
  padding-left: 1.2em;
}

.reveal ul li { list-style-type: none; position: relative; padding-left: 1em; margin-bottom: 0.4em; }
.reveal ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 10px; height: 3px;
  background: var(--an-yellow);
  border-radius: 2px;
}

.reveal strong { color: var(--an-navy); font-weight: 700; }
.reveal em     { color: var(--an-purple); font-style: italic; }

.reveal a {
  color: var(--an-purple);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

/* ─── Code blocks ─── */
.reveal pre {
  background: var(--an-navy);
  color: #f5f5f5;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 20, 52, 0.12);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62em;
  line-height: 1.4;
  margin: 0.4em 0;
  overflow: auto;
  max-height: 78vh;
  width: auto;
}

.reveal pre:not(.mermaid) {
  display: block;
  white-space: pre;
}

.reveal pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.reveal :not(pre) > code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--an-yellow-soft);
  color: var(--an-navy);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ─── Tables ─── */
.reveal table {
  margin: 0.6em 0;
  border-collapse: collapse;
  width: 100%;
  font-size: 0.82em;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 20, 52, 0.08);
}

.reveal table th,
.reveal table td {
  padding: 0.5em 0.8em;
  border-bottom: 1px solid #e0e4e9;
  text-align: left;
  vertical-align: top;
}

.reveal table th {
  background: var(--an-navy);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9em;
  letter-spacing: 0.02em;
}

.reveal table tr:nth-child(even) td {
  background: var(--an-grey);
}

/* Tables très denses (ex: comparatif 5 colonnes) — permet scroll horizontal */
.reveal .table-wrap {
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
}

/* ─── Blockquote / callout ─── */
.reveal blockquote {
  background: var(--an-grey);
  border-left: 4px solid var(--an-yellow);
  border-radius: 6px;
  padding: 12px 20px;
  margin: 0.8em 0;
  font-style: normal;
  font-size: 0.85em;
  box-shadow: none;
  width: auto;
}

/* ─── Callout cards (boxes) ─── */
.callout {
  background: var(--an-yellow-soft);
  border-left: 4px solid var(--an-yellow);
  padding: 16px 22px;
  border-radius: 8px;
  margin: 0.8em 0;
  font-size: 0.9em;
  line-height: 1.45;
}

.callout p, .callout ul, .callout ol { margin: 0.3em 0; font-size: inherit; }
.callout ul, .callout ol { padding-left: 1.2em; }
.callout ul li { padding-left: 0.5em; margin-bottom: 0.2em; }
.callout.yellow { background: var(--an-yellow-soft); border-left-color: var(--an-yellow); }

.callout.purple { background: rgba(155,81,224,0.1); border-left-color: var(--an-purple); }
.callout.navy   { background: rgba(0,20,52,0.06);  border-left-color: var(--an-navy); }
.callout.orange { background: rgba(253,161,0,0.1); border-left-color: var(--an-orange); }

.callout strong:first-child {
  display: block;
  color: var(--an-navy);
  margin-bottom: 0.4em;
  font-family: 'Poppins', sans-serif;
  font-size: 1.05em;
}

/* ─── Title slide (cover) ─── */
.reveal .slide-cover {
  background: linear-gradient(135deg, var(--an-navy) 0%, #002867 100%);
  color: #fff;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px !important;
  text-align: center !important;
}

.reveal .slide-cover h1 { color: #fff; font-size: 3.2em; margin-bottom: 0.2em; }
.reveal .slide-cover h1 .accent { -webkit-text-fill-color: var(--an-yellow); background: none; color: var(--an-yellow); }
.reveal .slide-cover p { color: rgba(255,255,255,0.82); font-size: 1em; }
.reveal .slide-cover .iris-logo { height: 64px; margin-bottom: 40px; }
.reveal .slide-cover .subtitle { font-family: 'Poppins', sans-serif; font-size: 1.1em; letter-spacing: 0.15em; text-transform: uppercase; color: var(--an-yellow); margin-bottom: 10px; }

/* ─── Section slide (chapter separator) ─── */
.reveal .slide-section {
  background: var(--an-yellow);
  color: var(--an-navy);
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  padding: 60px !important;
}

.reveal .slide-section h2 {
  font-size: 4em;
  color: var(--an-navy);
  line-height: 1;
}

/* Sur fond jaune, l'accent jaune est invisible — on bascule en blanc */
.reveal .slide-section h1 .accent,
.reveal .slide-section h2 .accent,
.reveal .slide-section h3 .accent {
  color: #ffffff !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ffffff !important;
  background-clip: initial !important;
  text-shadow: 0 2px 12px rgba(0, 20, 52, 0.18);
}

.reveal .slide-section p {
  color: var(--an-navy);
}

.reveal .slide-section .chapter-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  font-weight: 600;
  color: rgba(0, 20, 52, 0.65);
  margin-bottom: 0.3em;
  letter-spacing: 0.3em;
}

/* ─── Two columns layout ─── */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin: 0.5em 0;
}

.columns.thirds {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 22px;
}

.columns > div { min-width: 0; }
.columns > div p, .columns > div li { font-size: 0.9em; }
.columns h3 { margin-top: 0 !important; font-size: 1.05em; }

/* ─── ASCII art in <pre> (pipelines) — garde la lisibilité ─── */
.reveal pre.ascii-art,
.reveal pre[data-ascii] {
  font-size: 0.6em;
  line-height: 1.3;
  padding: 14px 18px;
}

/* Responsive — sur petit écran / print, on relâche */
@media (max-width: 900px) {
  .columns, .columns.thirds { grid-template-columns: 1fr; gap: 12px; }
  .reveal { font-size: 22px; }
  .reveal table { font-size: 0.75em; }
}

/* ─── Footer branding ─── */
.reveal .slides section:not(.slide-cover):not(.slide-section)::after {
  content: '';
  position: absolute;
  bottom: 14px;
  right: 60px;
  width: 90px;
  height: 32px;
  background: url('/img/iris-logo.png') right center / contain no-repeat;
  opacity: 0.55;
  pointer-events: none;
}

/* ─── Progress bar color ─── */
.reveal .progress {
  color: var(--an-yellow);
  height: 4px;
}

/* ─── Controls ─── */
.reveal .controls {
  color: var(--an-navy);
}

/* ─── Badge / label chips ─── */
.badge {
  display: inline-block;
  background: var(--an-navy);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  margin: 0.15em 0.3em 0.15em 0;
}

.badge.yellow { background: var(--an-yellow); color: var(--an-navy); }
.badge.purple { background: var(--an-purple); color: #fff; }

/* ─── Mermaid — conteneur qui remplit le slide, SVG scalé par son viewBox ─── */
/* Principe clé : on ne touche PAS aux dimensions internes des nœuds.
   Mermaid calcule blocs + texte ensemble, ça reste cohérent.
   Le SVG a son viewBox — en forçant width 100% sur le conteneur,
   le SVG (et donc les blocs et le texte ensemble) s'agrandit proportionnellement. */

.reveal .mermaid,
.reveal pre.mermaid {
  font-family: 'Inter', sans-serif;
  background: var(--an-grey);
  border-radius: 12px;
  padding: 18px;
  margin: 0.3em auto;
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 65vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  color: transparent;             /* cache source texte pré-render */
  white-space: normal;
  box-sizing: border-box;
}

/* SVG Mermaid : occupe toute la largeur ET la hauteur, garde aspect ratio via viewBox */
.reveal .mermaid svg,
.reveal pre.mermaid svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  color: var(--an-navy);
  display: block;
}

/* On ne touche PAS aux font-size du contenu Mermaid — Mermaid les gère.
   Uniquement le font-family pour le thème IRIS. */
.reveal .mermaid svg text,
.reveal pre.mermaid svg text,
.reveal .mermaid svg .nodeLabel,
.reveal pre.mermaid svg .nodeLabel,
.reveal .mermaid svg foreignObject div,
.reveal pre.mermaid svg foreignObject div {
  font-family: 'Inter', sans-serif !important;
}

.reveal .mermaid svg .edgeLabel,
.reveal pre.mermaid svg .edgeLabel {
  background: rgba(255, 255, 255, 0.95) !important;
}

/* Nodes — strokes plus épais pour lisibilité à distance */
.reveal .mermaid svg .node rect,
.reveal .mermaid svg .node circle,
.reveal .mermaid svg .node ellipse,
.reveal .mermaid svg .node polygon,
.reveal .mermaid svg .node path {
  stroke-width: 2.5px !important;
}

.reveal .mermaid svg .flowchart-link {
  stroke-width: 2.5px !important;
}

/* Sur un slide avec Mermaid, le schéma est flex: 1 → prend toute la hauteur restante */
.reveal .slides > section:has(.mermaid) {
  gap: 0.5em;
}
.reveal .slides > section:has(.mermaid) > *:not(.mermaid):not(pre.mermaid) {
  flex-shrink: 0;
}

/* ─── Notes / speaker ─── */
.reveal aside.notes {
  display: none;
}
