* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Open Sans', Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
  color: #808080;
}

img {
  max-width: 100%;
}

h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: black;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 2px;
  word-spacing: 10px;
}

h2 {
  font-size: 30px;
  font-weight: bold;
  text-transform: uppercase;
}

h3 {
  margin-top: 50px;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 500;
}

strong {
  color: black;
  font-weight: 600;
}

/* CONTAINER */

.o-container {
  position: relative;
  max-width: 600px;
  padding: 0 20px;
  margin: auto;
}

.o-container--medium {
  max-width: 800px;
}

.o-container--large {
  max-width: 1200px;
}

/* REVEAL ZONE */

.o-reveal-zone {
  position: relative;
  padding: 0 50px;
  margin: 50px -50px;

  transition: height 1s;
}

/*
.o-reveal-zone {
  display: none;
}

.o-reveal-zone--unlock {
  display: block;
}
*/

.o-reveal-zone--hidden {
  height: 60px;
  cursor: pointer;
  overflow: hidden;
  transition: none;
}

.o-reveal-zone::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;

  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-image: linear-gradient(
    135deg,
    rgba(215, 227, 243, 0) 25%,
    rgba(215, 227, 243, 1) 25%,
    rgba(215, 227, 243, 1) 50%,
    rgba(215, 227, 243, 0) 50%,
    rgba(215, 227, 243, 0) 75%,
    rgba(215, 227, 243, 1) 75%,
    rgba(215, 227, 243, 1) 100%
  );
  background-size: 56.57px 56.57px;

  color: black;
  text-align: center;

  opacity: 0.5;
  transition: opacity 1s;
  pointer-events: none;
}

.o-reveal-zone--hidden::after {
  content: 'Cliquez ici pour afficher la solution';
  opacity: 1;
  transition: none;
}

.o-reveal-zone--hidden.o-reveal-zone--clue::after {
  content: 'Cliquez ici pour afficher une aide';
}

.o-reveal-zone--hidden.o-reveal-zone--ideas::after {
  content: 'Cliquez ici pour afficher des réponses';
}

.o-reveal-zone > * {
  opacity: 1;
  transition: opacity 1s 1s;
}

.o-reveal-zone--hidden > * {
  opacity: 0;
  transition: none;
}

.o-reveal-zone > div {
  border: 1px solid transparent;
}

.o-reveal-zone > div::before {
  content: '';
  display: block;
  margin-bottom: 50px;
}

.o-reveal-zone > div::after {
  content: '';
  display: block;
  margin-top: 50px;
}

@media (max-width: 660px) {
  .o-reveal-zone {
    padding: 0 20px;
    margin: 50px -20px;
  }
}

/* FIGURE */

.o-figure {
  position: relative;
  margin: 50px 0;
  padding: 20px;
  background: white;
  border: 1px solid #003e90;
}

.o-figure > img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

.o-figure__caption {
  display: block;
  font-size: 12px;
  text-align: center;
  color: #666666;
}

.o-figure__download {
  position: absolute;
  right: 15px;
  bottom: 0;

  transform: translateY(50%);
}

.o-figure__button {
  margin: 0 5px;
  padding: 5px 10px;
  border-radius: 10px;
  background: #003e90;

  font-size: 12px;
  color: white;
  text-decoration: none;

  opacity: 0;
  transition: opacity 1s;
}

.o-figure:hover .o-figure__button,
.o-figure__button:focus {
  opacity: 1;
}

.o-figure__button:hover,
.o-figure__button:focus {
  background: #429ffd;
}

/* LIGHTBOX
   Certains arbres sont trop grands pour rester lisibles à la taille de la
   page. Un clic les ouvre en plein écran, un second les affiche à leur
   taille réelle et permet alors de se déplacer dedans. */

.o-figure > img {
  cursor: zoom-in;
}

/* Dans une zone repliée, le clic sert d'abord à révéler la solution. */
.o-reveal-zone--hidden .o-figure > img {
  cursor: pointer;
}

.c-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;

  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  overflow: auto;

  background: rgba(0, 26, 58, 0.92);
  cursor: zoom-out;
}

.c-lightbox[hidden] {
  display: none;
}

.c-lightbox__image {
  max-width: 100%;
  max-height: 100%;

  padding: 10px;
  background: white;
  cursor: zoom-in;
}

.c-lightbox--zoomed {
  justify-content: flex-start;
  align-items: flex-start;
}

.c-lightbox--zoomed .c-lightbox__image {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.c-lightbox__close {
  position: fixed;
  top: 12px;
  right: 16px;

  width: 40px;
  height: 40px;
  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: transparent;

  font-size: 24px;
  line-height: 1;
  color: white;
  cursor: pointer;
}

.c-lightbox__close:hover,
.c-lightbox__close:focus {
  background: white;
  color: #003e90;
}

/* INSTRUCTION */

.o-instruction {
  padding: 0 20px;
  margin: 20px 0;
  border: 1px solid currentColor;
  background: #dfedff;
  color: #00367d;
}

.o-instruction p {
  margin: 0;
}

.o-instruction--teacher {
  background: #fffaeb;
  color: #c49600;
}

.o-instruction::before {
  content: '';
  display: block;
  margin-bottom: 20px;
}

.o-instruction::after {
  content: '';
  display: block;
  margin-top: 20px;
}

.o-instruction__title {
  font-weight: 600;
  text-transform: uppercase;
}

/* ANSWER
   Composants de copie. Ils n'ont de sens que sur un sujet imprimé : des
   lignes pour rédiger, des cases à cocher, et une zone à dessiner. */

.o-answer {
  margin: 20px 0 30px;
}

.o-answer__line {
  height: 32px;
  border-bottom: 1px solid #a8bdd6;
}

.o-choices {
  margin: 15px 0 25px;
  padding: 0;
  list-style: none;
}

.o-choices li {
  position: relative;
  margin-bottom: 12px;
  padding-left: 34px;
}

.o-choices li::before {
  content: '';
  position: absolute;
  top: 0.15em;
  left: 0;

  width: 18px;
  height: 18px;
  border: 1px solid #00367d;
  background: white;
}

.o-draw {
  margin: 20px 0;
  min-height: 320px;
  border: 1px dashed #7a97bd;
}

/* Une question et sa zone de réponse forment un tout : à l'impression elles
   ne doivent jamais se retrouver de part et d'autre d'une coupure de page. */
.o-question {
  margin-bottom: 30px;
}

/* TOP BAR */

.c-top-bar {
  padding: 20px 0;
}

.c-top-bar__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.c-top-bar__title {
  flex: none;
  margin: 0;

  color: black;
  font-size: 24px;
  text-transform: uppercase;
  font-weight: 900;
  white-space: nowrap;
}

.c-top-bar__title a {
  color: inherit;
  font: inherit;
  text-decoration: none;
}

.c-top-bar__logo {
  display: inline-block;
  width: 30px;
  height: 30px;
  margin-right: 4px;

  position: relative;
  top: 6px;
  vertical-align: baseline;
}

.c-top-bar__logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.c-top-bar__title a:hover,
.c-top-bar__title a:focus {
  color: #429ffd;
}

.c-top-bar__baseline {
  max-width: 400px;
  text-align: right;
}

.c-top-bar__baseline strong {
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .c-top-bar__content {
    flex-direction: column;
  }

  .c-top-bar__title,
  .c-top-bar__baseline {
    width: 100%;
    max-width: none;
    text-align: center;
  }

  .c-top-bar__baseline {
    margin-top: 20px;
  }
}

/* SECTION */

.c-section {
}

.c-section__content::before {
  content: '';
  display: block;
  height: 1px;
  margin-bottom: 50px;
}

.c-section__content::after {
  content: '';
  display: block;
  height: 1px;
  margin-top: 50px;
}

.c-section--odd {
  background: #f2f3f7;
}

.c-section--blue {
  background-color: #429ffd;
  background-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1),
    transparent 10%,
    transparent 90%,
    rgba(0, 0, 0, 0.1)
  );
  color: white;
}

.c-section--yellow {
  background-color: #ffc300;
  background-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1),
    transparent 10%,
    transparent 90%,
    rgba(0, 0, 0, 0.1)
  );
  color: white;
}

.c-section__title {
  margin-bottom: 50px;
  text-align: center;
}

.c-section--yellow .c-section__title,
.c-section--blue .c-section__title {
  color: white;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 30px;
  text-transform: uppercase;
  font-weight: 900;
}

/* Le titre porte 50px de marge basse : on la réduit quand un bouton le suit,
   pour que les deux se lisent comme un même bloc. */
.c-section__title--with-action {
  margin-bottom: 20px;
}

.c-section__action {
  margin: 0;
  text-align: center;
}

.c-section__button {
  display: inline-block;
  padding: 8px 22px;
  border: 1px solid currentColor;
  border-radius: 5px;

  color: white;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;

  transition: all 0.5s;
}

.c-section__button + .c-section__button {
  margin-left: 12px;
}

.c-section__button:hover,
.c-section__button:focus {
  background-color: white;
  color: #003e90;
}

/* BOX LIST */

.c-box-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-gap: 20px;
  align-items: stretch;

  margin: 0;
  padding: 0;
  list-style: none;
}

.c-box-list__item {
  height: 100%;
}

/* BOX LIST */

.c-box {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  background: #ffc300;

  font-family: 'Playfair Display', Georgia, serif;
  color: black;
  text-decoration: none;

  box-shadow: 20px 20px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.5s;
}

.c-box:any-link:hover,
.c-box:focus {
  transform: translate(0, -20px);
}

@media (max-width: 700px) {
  .c-box:any-link:hover,
  .c-box:focus {
    transform: translate(0, 0);
  }
}

.c-box--blue {
  background: #429ffd;
}

.c-box--yellow {
  background: #ffc300;
}

.c-box__top {
  display: flex;
  flex-direction: column;
  flex: auto;
  padding: 20px 30px;
}

.c-box__title {
  color: #fff;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
}

.c-box__description {
  margin: 10px 0;
}

.c-box__details {
  margin-top: auto;
  padding-top: 20px;
  line-height: 42px;
}

.c-box__tag {
  display: inline-block;
  vertical-align: bottom;
  height: 38px;
  line-height: 38px;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.1);

  color: black;
  font-size: 14px;
  font-family: sans-serif;
  text-align: center;
}

.c-box__tag img {
  display: inline-block;
  vertical-align: sub;
  width: 16px;
  margin-right: 2px;
}

.c-box__action {
  position: relative;
  padding: 20px 30px;
  background: rgba(0, 0, 0, 0.1);
}

.c-box__button {
  display: inline-block;
  padding: 5px 20px;
  border: 1px solid rgba(0, 0, 0, 0.8);
  border-radius: 5px;

  color: rgba(0, 0, 0, 0.8);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;

  transition: all 0.5s;
}

.c-box:hover .c-box__button,
.c-box:focus .c-box__button {
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
}

.c-box__duration {
  position: absolute;
  right: 20px;
  top: 20px;

  color: white;
  font-family: sans-serif;
}

/* BOTTOM NAV */

.c-bottom-nav {
  position: relative;
  z-index: 10;
  margin: 50px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.c-bottom-nav__previous {
  margin-right: auto;
}

.c-bottom-nav__next {
  margin-left: auto;
}

/* FOOTER */

.c-footer {
  background: #003e90;
  color: white;
}

.c-footer__content {
  padding: 40px 0;
}

.c-footer__logo {
  max-width: 160px;
  margin: 0 auto;
}

.c-footer__title a {
  display: block;
  color: inherit;
  font-size: 24px;
  text-transform: uppercase;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
  text-align: center;
}

.c-footer__title a:hover,
.c-footer__title a:focus {
  color: #429ffd;
}

.c-footer__text {
  max-width: 300px;
  margin: 0 auto;
  text-align: center;
}

.c-footer__text a {
  color: inherit;
  text-decoration: none;
}

.c-footer__text a:hover,
.c-footer__text a:focus {
  text-decoration: underline;
}

/* PRINT */

@media print {
  .c-top-bar,
  .c-bottom-nav,
  .c-footer {
    display: none;
  }

  .c-section {
    color: black;
    background: none;
  }
  .c-section .c-section__title {
    color: black;
    margin-bottom: 20px;
  }
  .c-section__content::before {
    margin-bottom: 20px;
  }
  .c-section__content::after {
    margin-top: 20px;
  }

  .o-instruction {
    color: black;
    background: none;
    page-break-inside: avoid;
    page-break-after: always;
  }

  .o-instruction--no-page-break {
    page-break-after: initial;
  }

  .c-section__action,
  .c-lightbox {
    display: none !important;
  }

  .o-container {
    max-width: none;
  }

  /* Sujets d'examen : de quoi écrire et dessiner sur le papier. */
  .o-answer__line {
    height: 0.95cm;
  }

  /* La zone de tracé occupe seule sa page : autant la remplir. */
  .o-draw {
    min-height: 12cm;
    page-break-inside: avoid;
  }

  .o-question {
    page-break-inside: avoid;
    margin-bottom: 18px;
  }

  /* Un peu plus dense sur le papier : sans cela une question bascule seule
     sur la page suivante et le sujet gagne une page pour rien. */
  .o-choices {
    margin: 10px 0 15px;
  }

  .o-choices li {
    margin-bottom: 7px;
  }

  .u-new-page {
    page-break-before: always;
  }

  h1,
  h2,
  h3,
  h4 {
    margin-top: 20px;
    margin-bottom: 20px;
    page-break-after: avoid;
  }

  /* SOLUTIONS
     À l'écran, le JS replie toutes les zones (o-reveal-zone--hidden) et fige une
     hauteur inline au clic. Sur papier il n'y a pas de clic possible : on déplie
     tout, y compris les zones que personne n'a ouvertes. Le !important est requis
     pour passer devant la hauteur inline posée par le script. */
  .o-reveal-zone,
  .o-reveal-zone--hidden {
    height: auto !important;
    overflow: visible;
    page-break-inside: avoid;

    padding: 0 15px;
    margin: 20px 0;
    border-left: 3px solid #003e90;
  }

  .o-reveal-zone > *,
  .o-reveal-zone--hidden > * {
    opacity: 1 !important;
  }

  /* Le fond hachuré et l'invite « Cliquez ici… » n'ont aucun sens imprimés. */
  .o-reveal-zone::after,
  .o-reveal-zone--hidden::after,
  .o-reveal-zone--hidden.o-reveal-zone--clue::after,
  .o-reveal-zone--hidden.o-reveal-zone--ideas::after {
    content: none;
  }

  /* On garde malgré tout un repère : le lecteur doit voir d'un coup d'œil
     qu'il s'agit d'une solution et non de la suite de l'énoncé. */
  .o-reveal-zone::before {
    content: 'Solution';
    display: block;
    margin-bottom: 10px;

    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #003e90;
  }

  .o-reveal-zone--clue::before {
    content: 'Aide';
  }

  .o-reveal-zone--ideas::before {
    content: 'Réponses';
  }

  /* Les deux cales de 50px servent au dépliage animé, inutiles sur papier. */
  .o-reveal-zone > div::before {
    margin-bottom: 10px;
  }

  .o-reveal-zone > div::after {
    margin-top: 10px;
  }

  /* FIGURES */

  .o-figure {
    page-break-inside: avoid;
  }

  /* Boutons PNG / XML / « Agrandir et modifier » ajoutés par le JS. */
  .o-figure__download {
    display: none;
  }

  /* LIENS
     Un lien externe imprimé sans son URL n'est pas suivable. */
  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 11px;
    color: #666666;
    word-break: break-all;
  }

  p,
  li {
    orphans: 3;
    widows: 3;
  }
}
