/*-- scss:defaults --*/

$presentation-font-size-root: 34px;
$presentation-h1-font-size: 2.2em;
$presentation-h2-font-size: 1.8em;
$presentation-h3-font-size: 1.4em;

/*-- scss:rules --*/

.reveal .slides {
  margin-top: 40px !important;
}

.reveal .slides section {
  padding: 0;
}

.reveal h2 {
  margin-bottom: 0.4em;
}

// Page de garde : contenu centré + bandeau de logos des financeurs en bas
// (voir title-slide.html)
.reveal .slides section#title-slide {
  top: 0 !important;
  height: 100%;
}

#title-slide .title-slide-content {
  position: absolute;
  top: 45%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
}

#title-slide .colloque {
  font-style: italic;
}

#title-slide .title-logos {
  position: absolute;
  bottom: 50px; // compense le margin-top de .slides
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: space-between; // logos de thèse à gauche, poste actuel à droite
  align-items: center;
}

#title-slide .title-logos-group {
  display: flex;
  align-items: center;
  gap: 50px;
}

// Séparateur vertical discret devant le logo du poste actuel
#title-slide .title-logos-poste {
  padding-left: 50px;
  border-left: 2px solid rgba(0, 0, 0, 0.25);
}

#title-slide .title-logo {
  width: 180px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;

  img {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
  }
}

// Steps bar at the top of each slide (see steps-header.html)
.reveal .steps-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 2.5em;
  padding: 0.5em 1em;
  font-size: clamp(10px, 1vw, 18px);
  line-height: 1.2;
  white-space: nowrap;
  background: #fff;
  border-bottom: 1px solid #ddd;

  &.hidden {
    display: none;
  }

  a {
    color: #888;
    text-decoration: none;
  }

  a:hover {
    color: #333;
  }

  a.active {
    color: #222;
    font-weight: 700;
  }

  @media print {
    display: none;
  }
}

.highlight {
  font-size: 40px;
  font-weight: bold;
  color: rgb(23, 52, 168);
  margin-top: 0.5em;
  padding-top: 0.5em;
  margin-bottom: 0.5em;
  padding-bottom: 0.5em;
}

.bigger-highlight {
  font-size: 50px;
  font-weight: bold;
  color: rgb(23, 52, 168);
  margin-top: 0.5em;
  padding-top: 0.5em;
  margin-bottom: 0.5em;
  padding-bottom: 0.5em;
}

.checklist {
  font-size: 40px;
  font-weight: bold;
  color: rgb(138, 153, 211);
  list-style-type: none;
  padding-left: 0;
}

//// Fiche de jeu de données (titre, date, url)
// ::: {.dataset}
// [Titre du jeu de données]{.dataset-title}
// [2024]{.dataset-date}
// [https://exemple.fr/donnees](https://exemple.fr/donnees){.dataset-url}
// :::
.reveal .dataset {
  font-size: 0.7em;                       // même taille que figcaption
  line-height: 1.35;
  text-align: left;
  color: #333;
  background: rgba(23, 52, 168, 0.06);
  border-left: 4px solid rgb(23, 52, 168);
  border-radius: 0 6px 6px 0;
  padding: 0.5em 0.9em;
  margin: 0.4em 0;

  p {
    margin: 0;
  }

  .dataset-title {
    display: block;
    font-weight: 700;
    color: rgb(23, 52, 168);
  }

  .dataset-date {
    display: block;
    color: #666;
  }

  .dataset-url,
  a {
    display: block;
    color: rgb(23, 52, 168);
    text-decoration: none;
    word-break: break-all;               // les URL longues ne débordent pas

    &:hover {
      text-decoration: underline;
    }
  }
}

// Keep figures and plotly outputs within the slide height
.reveal .slides section .cell-output-display,
.reveal .slides section .plotly-graph-div {
  max-height: 100%;
}

//// Mermaid
.mermaid marker {
  overflow: visible;            // stops the enlarged head from being cut off
}
.mermaid marker path,
.mermaid .arrowheadPath {
  fill: #a0703c !important;
  stroke: #a0703c !important;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(1.8);        // 1 = normal size; raise to enlarge
}

// Labels HTML de mermaid : neutralise les styles reveal (.reveal small, .reveal p)
// pour retrouver les métriques utilisées par mermaid lors du calcul des formes,
// sinon le texte n'est plus centré.
.reveal svg :is(.nodeLabel, .edgeLabel, .labelBkg) {
  p {
    margin: 0;
    line-height: 1.5;
  }
  small {
    display: block;           // ligne propre : hauteur identique au calcul mermaid
    font-size: smaller;
    line-height: 1.5;
    vertical-align: baseline;
  }
}

// Taille réglable d'un diagramme : entourer le bloc mermaid de
// ::: {.mermaid-fit style="--h: 500px; --zoom: 1.2"}
//   --h    : hauteur du diagramme (le SVG est redimensionné pour tenir dedans)
//   --zoom : agrandissement supplémentaire (1 = aucun)
.reveal .mermaid-fit {
  text-align: center;
}
.reveal .mermaid-fit svg {
  max-width: 100% !important;   // annule le max-width en px injecté par mermaid
  width: auto !important;
  height: var(--h, auto) !important;
  max-height: var(--h, 600px);
  zoom: var(--zoom, 1);
}
// Variante pleine largeur pour les diagrammes très allongés :
// ::: {.mermaid-fit .full-width}
// le SVG occupe toute la largeur et sa hauteur suit ses proportions
// (pas de boîte de hauteur fixe, donc pas de bandes blanches).
.reveal .mermaid-fit.full-width svg {
  width: 100% !important;
  height: auto !important;
  max-height: none;
  zoom: 1;
}
//// Zoom sur les images (voir zoom-images.html)
.reveal .slides section img:not(.no-zoom) {
  cursor: zoom-in;
}
.img-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.img-zoom-overlay.visible {
  opacity: 1;
}
.img-zoom-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
  background: #fff;
}

/* Espacement des références bibliographiques */
.reveal #refs .csl-entry {
  margin-bottom: 0.6em;
  line-height: 1.3;
}
