/**
 * Feuille propre à la rubrique « Découvrir ».
 *
 * Les classes d'actualité de Webflow (.item-actu, .actu-titre-container…)
 * ont été dessinées pour des titres courts : hauteurs fixes de 80 px pour le
 * titre et 100 px pour le résumé, photo placée APRÈS le bouton. Avec des
 * titres de guide, les titres se faisaient rogner et la photo d'une fiche
 * semblait appartenir à la suivante. On garde donc la palette et les polices
 * du site, mais pas ces gabarits-là.
 *
 * Écrite par la-malinette-v2/scripts/exporter-guides-vers-prod.mjs.
 */

.md-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin: 36px 0 10px;
}

.md-carte {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--blanc, #fff);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(41, 41, 41, .1);
  transition: box-shadow .2s ease, transform .2s ease;
}

.md-carte:hover,
.md-carte:focus-within {
  box-shadow: 0 8px 22px rgba(41, 41, 41, .16);
  transform: translateY(-2px);
}

.md-carte-photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background-color: var(--very-light-grey, #f5f5f5);
}

.md-carte-corps {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 20px 20px;
}

/* le titre n'est plus contraint en hauteur : il va au bout, sur autant de
   lignes qu'il lui en faut */
.md-carte-titre {
  margin: 0 0 10px;
  padding: 0;
  font-family: Exo, sans-serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  color: var(--pseudo-black, #292929);
}

.md-carte-titre a {
  color: inherit;
  text-decoration: none;
}

/* toute la carte devient cliquable, sans second lien vers la même page */
.md-carte-titre a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.md-carte-texte {
  margin: 0 0 18px;
  font-family: Exo, sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.55;
  text-align: left;
  color: #5b5b5b;
}

.md-carte-cta {
  align-self: flex-start;
  margin-top: auto;
  padding: 9px 18px;
  border-radius: 4px;
  background-color: var(--vert-clair-malinette, #a8d150);
  color: var(--pseudo-black, #292929);
  font-family: Exo, sans-serif;
  font-size: 14px;
  font-weight: 600;
}

/* ── page d'article ── */

/* En-tête centré comme le titre : retour vers la liste, titre, repères.
   L'ancien surtitre en capitales, collé à gauche sous un titre centré, ne se
   lisait pas comme un lien. */
.md-ariane {
  margin: 0 0 4px;
  font-family: Exo, sans-serif;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.md-ariane a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  color: #5d7a27;
  text-decoration: none;
  transition: background-color .15s;
}

.md-ariane a:hover,
.md-ariane a:focus-visible { background-color: #eef5de; }
.md-ariane-fleche { font-size: 17px; line-height: 1; }

.md-date {
  margin: 0 0 22px;
  font-family: Exo, sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--grey, #9e9e9e);
  text-align: center;
}

.md-hero {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* ── bloc « Pour approfondir » ── */

/* Quatre cartes avec photo, dans un conteneur centré. L'ancienne version était
   une bande grise pleine largeur : quatre colonnes de petit texte dans un
   rectangle presque vide, avec 30 px de marge et la section suivante collée
   dessous. */
.md-suite {
  padding-top: 64px;
  padding-bottom: 72px;
  border-top: 1px solid #e8e8e3;
  background-color: var(--blanc, #fff);
}

.md-suite .md-article {
  max-width: 1120px;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

.md-suite-titre {
  margin: 0 0 28px;
  font-family: Exo, sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  color: var(--pseudo-black, #292929);
}

.md-voisins {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 0 0 44px;
  padding: 0;
  list-style: none;
}

.md-voisins[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.md-voisins[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.md-voisins[data-n="1"] { grid-template-columns: minmax(0, 340px); }

.md-voisins li { margin: 0; padding: 0; }

.md-voisin {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  background-color: var(--blanc, #fff);
  box-shadow: 0 1px 5px rgba(41, 41, 41, .14);
  color: inherit;
  text-decoration: none;
  transition: box-shadow .2s ease, transform .2s ease;
}

.md-voisin:hover,
.md-voisin:focus-visible {
  box-shadow: 0 8px 22px rgba(41, 41, 41, .18);
  transform: translateY(-2px);
}

.md-voisin-photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background-color: var(--very-light-grey, #f5f5f5);
}

.md-voisin-corps {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 18px;
}

.md-voisin-titre {
  font-family: Exo, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--pseudo-black, #292929);
}

.md-voisin-meta {
  margin-top: auto;
  font-family: Exo, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #777;
}

.md-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.md-bouton {
  padding: 14px 28px;
  border-radius: 4px;
  background-color: var(--vert-clair-malinette, #a8d150);
  color: var(--pseudo-black, #292929);
  font-family: Exo, sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.md-bouton.creux {
  background-color: transparent;
  box-shadow: inset 0 0 0 2px var(--vert-clair-malinette, #a8d150);
}

@media (max-width: 991px) {
  .md-voisins,
  .md-voisins[data-n="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-voisins[data-n="1"] { grid-template-columns: minmax(0, 340px); }
}

@media (max-width: 479px) {
  .md-suite { padding-top: 44px; padding-bottom: 52px; }
  .md-suite-titre { font-size: 24px; }
  .md-voisins,
  .md-voisins[data-n="3"],
  .md-voisins[data-n="2"] { grid-template-columns: 1fr; }
}

/* colonne de lecture : à 940 px de large, une ligne dépasse 130 signes et
   l'œil perd la ligne suivante. On resserre à la mesure d'un article. */
.md-article {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.md-corps {
  font-size: 17px;
  line-height: 1.75;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.md-corps > p { margin: 0 0 1.15em; }

.md-corps h2 {
  margin: 2em 0 .6em;
  font-family: Exo, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  color: var(--pseudo-black, #292929);
}

.md-corps h3 {
  margin: 1.6em 0 .5em;
  font-family: Exo, sans-serif;
  font-size: 20px;
  font-weight: 600;
  text-align: left;
  color: var(--pseudo-black, #292929);
}

.md-corps ul,
.md-corps ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.md-corps li { margin-bottom: .4em; }

.md-corps a { color: #6f8f33; }
.md-corps a:hover { text-decoration: underline; }

.md-corps blockquote {
  margin: 1.4em 0;
  padding-left: 18px;
  border-left: 3px solid var(--vert-clair-malinette, #a8d150);
  font-style: italic;
}

.md-titre {
  margin-top: 6px;
  margin-bottom: 14px;
  text-align: center;
  font-size: 46px;
  line-height: 1.15;
}

@media (max-width: 767px) {
  .md-titre { font-size: 36px; }
  .md-corps { font-size: 16px; }
  /* justifié sur 355 px, le texte se creuse de trous entre les mots */
  .md-corps,
  .md-intro { text-align: left; }
}

/* ── filtre de la page de liste ── */

.md-filtres {
  margin: 30px 0 4px;
  padding: 18px 20px 14px;
  border-radius: 10px;
  background-color: var(--very-light-grey, #f5f5f5);
}

.md-filtres-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.md-filtres-titre {
  min-width: 108px;
  margin-right: 4px;
  font-family: Exo, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #777;
}

.md-chip {
  padding: 7px 15px;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  background-color: var(--blanc, #fff);
  font-family: Exo, sans-serif;
  font-size: 14px;
  color: #444;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.md-chip:hover { border-color: var(--vert-clair-malinette, #a8d150); }

.md-chip[aria-pressed="true"] {
  border-color: var(--vert-clair-malinette, #a8d150);
  background-color: var(--vert-clair-malinette, #a8d150);
  font-weight: 600;
  color: var(--pseudo-black, #292929);
}

.md-filtres-bilan {
  margin: 2px 0 0;
  font-family: Exo, sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #777;
}

/* ── champ de recherche ── */

.md-recherche { position: relative; margin: 0 0 18px; }

/* libellé lu par les lecteurs d'écran, invisible à l'écran : la loupe et le
   texte d'invite suffisent aux yeux */
.md-recherche-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.md-recherche-icone {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: #8a8a85;
  pointer-events: none;
}

.md-recherche input.md-recherche-champ {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 16px 0 48px;
  border: 1px solid #d6d6d0;
  border-radius: 8px;
  background-color: #fff;
  font-family: Exo, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--pseudo-black, #292929);
}

.md-recherche input.md-recherche-champ::placeholder { color: #8a8a85; opacity: 1; }

/* la croix d'effacement n'apparaît que quand du texte est saisi : la place à
   droite ne lui est réservée qu'à ce moment-là, le texte d'invite tient ainsi
   sur un téléphone */
.md-recherche input.md-recherche-champ:not(:placeholder-shown) { padding-right: 50px; }

.md-recherche input.md-recherche-champ:focus {
  outline: none;
  border-color: var(--vert-clair-malinette, #a8d150);
  box-shadow: 0 0 0 3px rgba(168, 209, 80, .35);
}

.md-recherche input.md-recherche-champ::-webkit-search-cancel-button,
.md-recherche input.md-recherche-champ::-webkit-search-decoration {
  -webkit-appearance: none;
  display: none;
}

.md-recherche-effacer {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #77776f;
  cursor: pointer;
}

.md-recherche-effacer:hover,
.md-recherche-effacer:focus-visible { background-color: #ecece7; color: #292929; }

/* display défini ci-dessus : sans cette règle, l'attribut hidden resterait sans effet */
.md-recherche-effacer[hidden] { display: none; }

.md-filtres-pied { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 2px; }
.md-filtres-pied .md-filtres-bilan { margin: 0; }

.md-reset {
  padding: 6px 14px;
  border: 1px solid var(--vert-clair-malinette, #a8d150);
  border-radius: 999px;
  background-color: #fff;
  font-family: Exo, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--pseudo-black, #292929);
  cursor: pointer;
}

.md-reset:hover { background-color: var(--vert-clair-malinette, #a8d150); }
.md-reset[hidden] { display: none; }

/* .md-carte est en display:flex, qui l'emporte sur le display:none que le
   navigateur applique à [hidden] : sans cette règle, le filtre ne masque rien. */
.md-carte[hidden] { display: none; }

/* ── repères de l'article ── */

.md-reperes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin: 4px 0 26px;
  font-family: Exo, sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #777;
}

.md-infos { white-space: nowrap; }
.md-sep { margin: 0 8px; color: #b5b5b5; }

.md-etiquette {
  padding: 4px 12px;
  border-radius: 999px;
  background-color: var(--vert-clair-malinette, #a8d150);
  font-weight: 600;
  color: var(--pseudo-black, #292929);
}

.md-credit {
  margin: 6px 0 18px;
  font-family: Exo, sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--grey, #9e9e9e);
  text-align: right;
}

.md-credit a { color: inherit; }

@media (max-width: 600px) {
  .md-filtres { padding: 14px 14px 10px; }
  .md-filtres-titre { min-width: 100%; margin-bottom: 2px; }
}

/* ── mini-album ── */

.md-album {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 34px 0 6px;
}

/* la grille suit le nombre de vues : quatre vues sur trois colonnes laissaient
   une photo seule sur la rangée du dessous */
.md-album[data-n="4"],
.md-album[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.md-album[data-n="1"] { grid-template-columns: minmax(0, 420px); }

.md-album-vue { margin: 0; }

.md-album-lien {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  cursor: zoom-in;
}

.md-album-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: var(--very-light-grey, #f5f5f5);
  transition: transform .3s ease;
}

.md-album-lien:hover .md-album-photo,
.md-album-lien:focus-visible .md-album-photo { transform: scale(1.05); }

.md-album-vue figcaption {
  margin-top: 7px;
  font-family: Exo, sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
  text-align: left;
  color: #6b6b6b;
}

.md-album-credit { display: block; color: #a6a6a6; font-size: 12px; }

.md-liens-utiles { margin-top: 22px; font-size: 15px; }

/* ── agrandissement ── */

.md-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background-color: rgba(18, 18, 18, .95);
}

.md-lightbox img {
  max-width: min(1400px, 92vw);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.md-lightbox-legende {
  max-width: 760px;
  margin: 16px 0 0;
  font-family: Exo, sans-serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  text-align: center;
  color: #dcdcdc;
}

.md-lightbox button {
  position: absolute;
  padding: 10px 18px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  opacity: .75;
}

.md-lightbox button:hover,
.md-lightbox button:focus-visible { opacity: 1; }

.md-lightbox .md-fermer { top: 8px; right: 12px; font-size: 34px; }
.md-lightbox .md-prec { left: 6px; top: 50%; transform: translateY(-50%); }
.md-lightbox .md-suiv { right: 6px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .md-album,
  .md-album[data-n="3"] { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .md-album[data-n="1"] { grid-template-columns: 1fr; }
  .md-lightbox { padding: 12px; }
  .md-lightbox img { max-height: 70vh; }
}

@media (max-width: 479px) {
  .md-grille { grid-template-columns: 1fr; gap: 22px; }
  .md-carte-titre { font-size: 19px; }
}
