/* HANDOUT
   Page nue destinée à l'impression : un document par page, aucun décor.
   Elle ne partage rien avec styles.css, d'où sa propre feuille. */

* {
  box-sizing: border-box;
}

.c-handout {
  margin: 0;
  padding: 0;

  background: #f2f4f7;
  font-family: 'Open Sans', Arial, sans-serif;
  color: black;
}

/* Une page = une feuille A4 */
.c-page {
  width: 21cm;
  height: 29.7cm;
  margin: 20px auto;
  padding: 1.4cm;

  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);

  display: flex;
  flex-direction: column;
}

.c-page__note {
  margin: 0 0 0.8cm;
  font-size: 10pt;
  color: #444444;
}

/* Un document seul, qui occupe la hauteur restante */
.c-page__figure {
  flex: 1 1 auto;
  min-height: 0;

  display: flex;
  justify-content: center;
  align-items: center;
}

.c-page__figure img {
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}

/* Plusieurs documents empilés sur la même feuille */
.c-page__stack {
  flex: 1 1 auto;
  min-height: 0;

  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 0.4cm;
}

.c-page__item {
  display: grid;
  grid-template-columns: 1.1cm 1fr;
  align-items: center;
  min-height: 0;
}

.c-page__letter {
  font-size: 14pt;
  font-weight: 800;
}

.c-page__item img {
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  justify-self: center;
}

@page {
  size: A4;
  margin: 1.2cm;
}

@media print {
  .c-handout {
    background: white;
  }

  .c-page {
    width: auto;
    min-height: 0;
    height: 25.5cm;
    margin: 0;
    padding: 0;

    box-shadow: none;
    page-break-after: always;
  }

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