/* DECK
   Feuille de style des présentations (/presentation/<nom>/).
   Elle est volontairement séparée de styles.css : le reste du site n'a pas
   besoin de la charger, et une diapositive ne partage presque aucune règle
   avec une page de cours. */

:root {
  --deck-blue: #429ffd;
  --deck-blue-dark: #003e90;
  --deck-blue-deep: #002a63;
  --deck-yellow: #ffc300;
  --deck-ink: #12243d;
  --deck-paper: #ffffff;
  --deck-muted: #5b6b80;
}

* {
  box-sizing: border-box;
}

.c-deck {
  height: 100vh;
  margin: 0;
  overflow: hidden;

  background: var(--deck-blue-deep);
  font-family: 'Open Sans', Arial, sans-serif;
  color: var(--deck-ink);
}

.c-deck__stage {
  position: relative;
  height: 100%;
}

/* DIAPOSITIVE */

.c-slide {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6vmin 7vmin 12vmin;

  background: var(--deck-paper);
  font-size: clamp(15px, 2.4vmin, 30px);
  line-height: 1.5;
}

.c-slide.is-current {
  display: flex;
}

/* Avant que le script ne prenne la main, on montre la première diapositive :
   sans cela la page reste blanche si le JS échoue. */
.c-deck:not(.is-ready) .c-slide:first-child {
  display: flex;
}

.c-slide__inner {
  width: min(1150px, 100%);
  max-height: 100%;
}

.c-slide__kicker {
  margin: 0 0 0.6em;
  font-size: 0.75em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--deck-blue);
}

.c-slide h2 {
  margin: 0 0 0.6em;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.1em;
  font-weight: 900;
  line-height: 1.15;
  color: var(--deck-blue-dark);
}

.c-slide h3 {
  margin: 0 0 0.4em;
  font-size: 1.05em;
  font-weight: 800;
  color: var(--deck-blue-dark);
}

.c-slide p {
  margin: 0 0 0.8em;
}

.c-slide p:last-child,
.c-slide ul:last-child {
  margin-bottom: 0;
}

.c-slide strong {
  color: var(--deck-blue-dark);
}

.c-slide em {
  color: var(--deck-muted);
}

.c-slide ul {
  margin: 0 0 0.8em;
  padding: 0;
  list-style: none;
}

.c-slide li {
  position: relative;
  margin-bottom: 0.55em;
  padding-left: 1.5em;
}

.c-slide li::before {
  content: '';
  position: absolute;
  top: 0.55em;
  left: 0;

  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--deck-yellow);
}

.c-slide li:last-child {
  margin-bottom: 0;
}

.c-slide--lead p {
  font-size: 1.25em;
}

/* Une phrase seule, mise en exergue */
.c-slide__statement {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.7em;
  line-height: 1.3;
  color: var(--deck-blue-dark);
}

/* TITRE ET INTERTITRES */

.c-slide--title,
.c-slide--section,
.c-slide--end {
  color: white;
  text-align: center;
}

.c-slide--title {
  background: linear-gradient(
    160deg,
    var(--deck-blue-dark),
    var(--deck-blue-deep)
  );
}

.c-slide--section,
.c-slide--end {
  background: var(--deck-blue);
}

.c-slide--title h1 {
  margin: 0 0 0.3em;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3em;
  font-weight: 900;
  line-height: 1.1;
}

.c-slide--title .c-slide__kicker,
.c-slide--section .c-slide__kicker,
.c-slide--end .c-slide__kicker {
  color: var(--deck-yellow);
}

.c-slide--section h2,
.c-slide--end h2 {
  margin: 0;
  font-size: 2.6em;
  color: white;
}

.c-slide--title p,
.c-slide--section p,
.c-slide--end p {
  color: rgba(255, 255, 255, 0.85);
}

.c-slide--title strong,
.c-slide--section strong,
.c-slide--end strong {
  color: var(--deck-yellow);
}

/* Les boutons de sortie ont leur propre couleur : cette règle ne vise
   que les liens ordinaires de la dernière diapositive. */
.c-slide--end a:not(.c-slide__action) {
  color: var(--deck-yellow);
}

/* Boutons de sortie, sur la dernière diapositive */

.c-slide__actions {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-top: 1.8em;
}

.c-slide__action {
  display: inline-block;
  padding: 0.6em 1.5em;

  border: 1px solid currentColor;
  border-radius: 5px;

  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: white;

  transition: all 0.4s;
}

.c-slide__action:hover,
.c-slide__action:focus {
  background: white;
  color: var(--deck-blue-dark);
}

.c-slide__action--primary {
  background: var(--deck-yellow);
  border-color: var(--deck-yellow);
  color: var(--deck-blue-dark);
}

.c-slide__action--primary:hover,
.c-slide__action--primary:focus {
  background: white;
  border-color: white;
}

/* FIGURES */

.c-slide__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.c-slide__figure img {
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;

  background: white;
  border: 1px solid var(--deck-blue-dark);
  padding: 1vmin;
}

.c-slide__figure figcaption {
  margin-top: 0.7em;
  font-size: 0.8em;
  color: var(--deck-muted);
  text-align: center;
}

.c-slide--figure h2 {
  font-size: 1.5em;
  text-align: center;
}

/* Sur une diapositive-figure, l'image prend tout ce que le titre et la
   légende laissent, au lieu d'une hauteur fixe qui gaspille l'écran.
   min-height: 0 est nécessaire pour qu'un enfant flex puisse rétrécir. */
.c-slide--figure .c-slide__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.c-slide--figure .c-slide__figure {
  flex: 1 1 auto;
  min-height: 0;
}

.c-slide--figure .c-slide__figure img {
  width: 100%;
  height: 100%;
  max-height: none;
}

/* CARTES (les quatre éléments d'un arbre) */

.c-slide__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1em;
}

.c-slide__card {
  padding: 1em 1.2em;
  border: 1px solid var(--deck-blue);
  border-top: 0.35em solid var(--deck-blue);
  background: #f4f9ff;
}

.c-slide__card h3 {
  margin-bottom: 0.25em;
}

.c-slide__card p {
  margin: 0;
  font-size: 0.9em;
}

.c-slide__card em {
  display: block;
  margin-top: 0.4em;
  font-size: 0.95em;
}

/* Consigne adressée à la classe */
.c-slide__prompt {
  padding: 1em 1.3em;
  border: 1px solid var(--deck-yellow);
  border-left: 0.4em solid var(--deck-yellow);
  background: #fffaeb;
}

/* CHROME */

.c-deck__progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 0.5vmin;
  background: rgba(0, 62, 144, 0.12);
}

.c-deck__progress-bar {
  height: 100%;
  width: 0;
  background: var(--deck-yellow);
  transition: width 0.3s;
}

.c-deck__bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1em;
  padding: 1.4vmin 2.4vmin;

  font-size: clamp(12px, 1.7vmin, 18px);
}

.c-deck__controls {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.c-deck__counter {
  min-width: 4.5em;
  text-align: center;
  color: var(--deck-muted);
  font-variant-numeric: tabular-nums;
}

.c-deck__button {
  width: 2.2em;
  height: 2.2em;
  padding: 0;

  border: 1px solid rgba(0, 62, 144, 0.25);
  border-radius: 50%;
  background: white;

  font: inherit;
  line-height: 1;
  color: var(--deck-blue-dark);
  cursor: pointer;
}

.c-deck__button:hover,
.c-deck__button:focus {
  background: var(--deck-blue);
  border-color: var(--deck-blue);
  color: white;
}

/* Sur les diapositives colorées, la barre doit rester lisible.
   La classe is-dark est posée par le script au changement de diapositive. */
.c-deck.is-dark .c-deck__counter {
  color: rgba(255, 255, 255, 0.75);
}

.c-deck.is-dark .c-deck__progress {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 700px) {
  .c-slide {
    padding: 8vmin 6vmin 16vmin;
  }

  .c-slide__grid {
    grid-template-columns: 1fr;
    gap: 0.6em;
  }

  .c-slide__figure img {
    max-height: 48vh;
  }
}

/* IMPRESSION
   Une diapositive par page, en paysage, pour distribuer le support. */

@page {
  size: A4 landscape;
  margin: 1cm;
}

@media print {
  .c-deck {
    height: auto;
    overflow: visible;
    background: white;
  }

  .c-deck__stage {
    position: static;
    height: auto;
  }

  .c-deck__bar,
  .c-deck__progress,
  .c-slide__actions {
    display: none;
  }

  .c-slide,
  .c-deck:not(.is-ready) .c-slide:first-child {
    display: flex !important;
    position: static;

    /* A4 paysage moins les marges = 19 cm utiles. On vise un peu en dessous
       pour qu'une diapositive tienne sur exactement une page. */
    height: auto;
    min-height: 18.2cm;
    padding: 1cm;

    page-break-after: always;
    page-break-inside: avoid;
    border-bottom: 1px solid #cccccc;
    font-size: 11pt;
  }

  .c-slide:last-child {
    page-break-after: auto;
  }

  .c-slide--figure .c-slide__inner {
    display: block;
    height: auto;
  }

  .c-slide--figure .c-slide__figure {
    flex: none;
  }

  .c-slide__figure img,
  .c-slide--figure .c-slide__figure img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 13cm;
  }

  /* Les aplats de couleur mangent une cartouche entière : on garde la
     hiérarchie par la typographie plutôt que par le fond. */
  .c-slide--title,
  .c-slide--section,
  .c-slide--end {
    background: white;
    color: var(--deck-ink);
  }

  .c-slide--title h1,
  .c-slide--section h2,
  .c-slide--end h2 {
    color: var(--deck-blue-dark);
  }

  .c-slide--title p,
  .c-slide--section p,
  .c-slide--end p {
    color: var(--deck-muted);
  }

  .c-slide--title strong,
  .c-slide--section strong,
  .c-slide--end strong,
  .c-slide--end a {
    color: var(--deck-blue-dark);
  }
}
