/* Composants : blocs réutilisables dans le contenu des pages. */

/* Fil d'Ariane */

.breadcrumb ol {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.page .breadcrumb li {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 1rem;
}

.breadcrumb li + li::before {
  content: "/\00a0";
  padding: 0 5px;
  opacity: 0.8;
}

/* Texte des pages : mêmes réglages que l'éditeur d'origine (Verdana 16px justifié) */

.page p,
.page li,
.page h2,
.page h3 {
  font-family: var(--font-content);
  font-size: 16px;
  text-align: justify;
}

.page h2 {
  margin: 0 0 20px;
  color: var(--color-title);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.43;
}

.page h3 {
  margin: 0 0 20px;
  text-decoration: underline;
}

.link-list {
  padding: 0;
  list-style: none;
  overflow-wrap: anywhere;
}

.link-list li {
  margin-bottom: 20px;
}

.outline {
  padding: 0;
  list-style: none;
}

.outline ol {
  margin: 10px 0;
  padding-left: 60px;
  list-style: lower-alpha;
}

.outline > li {
  margin-bottom: 10px;
}

/* Bouton */

.button {
  display: inline-block;
  padding: 6px 12px;
  background: var(--color-link);
  border: 0;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.button:hover,
.button:focus {
  background: #d0bd3d;
  color: #ffffff;
}

/* Images */

.figure {
  max-width: 500px;
  margin: 0 0 20px;
}

.figure img {
  display: block;
}

.figure figcaption {
  margin-top: 5px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.figure-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: start;
}

@media (min-width: 768px) {
  .figure--left,
  .figure--right {
    max-width: 40%;
  }

  .figure--left {
    float: left;
    margin-right: 20px;
  }

  .figure--right {
    float: right;
    margin-left: 20px;
  }
}

/* Colonnes texte / illustration */

.columns {
  display: grid;
  gap: 20px;
  align-items: start;
}

@media (min-width: 768px) {
  .columns--wide-first {
    grid-template-columns: 3fr 1fr;
  }

  .columns--wide-last {
    grid-template-columns: 1fr 3fr;
  }
}

/* Listes de catégories et de pages */

.cards {
  clear: both;
}

.card {
  margin-bottom: 20px;
}

.page .card__title {
  margin: 0 0 10px;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 1.714rem;
  line-height: 1.25;
  text-align: left;
}

.page .card__subtitle {
  color: var(--color-title);
  font-size: 22px;
}

/* Vidéo */

.video {
  aspect-ratio: 16 / 9;
  margin-bottom: 20px;
}

.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Galerie photo + visionneuse en CSS pur (:target) */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
  clear: both;
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.gallery a:hover img {
  opacity: 0.8;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  margin: 0;
  padding: 30px;
  background: rgb(0 0 0 / 92%);
  color: #ffffff;
  text-align: center;
}

.lightbox:target {
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 10px;
}

.lightbox img {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox figcaption {
  position: relative;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
}

.lightbox__nav,
.lightbox__close {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: rgb(0 0 0 / 60%);
  border-radius: 50%;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  translate: 0 -50%;
}

.lightbox__nav--prev {
  left: 10px;
}

.lightbox__nav--next {
  right: 10px;
}

.lightbox__close {
  top: 10px;
  right: 10px;
}

/* Quiz en CSS pur : la correction s'affiche selon la réponse cochée (:has). */

.quiz__question {
  margin: 0 0 20px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
}

.quiz__question legend {
  margin-bottom: 10px;
  padding: 0;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 1.714rem;
  line-height: 1.25;
}

.quiz__question .figure {
  max-width: 180px;
}

.quiz__option {
  display: block;
  padding: 3px 0;
  cursor: pointer;
}

.page .quiz__feedback {
  display: none;
  margin: 10px 0;
  font-size: 14px;
  font-weight: 700;
}

.quiz__feedback--right {
  color: var(--color-success);
}

.quiz__feedback--wrong {
  color: var(--color-error);
}

.page .quiz__question:has(.quiz__option--correct input:checked) .quiz__feedback--right,
.page
  .quiz__question:has(.quiz__option:not(.quiz__option--correct) input:checked)
  .quiz__feedback--wrong {
  display: block;
}
