/* documents.css — Mémoire-documents (Ventabren.info) */

.documents-page {
  background: #f7f5f0;
  color: #2f2f2f;
  position: relative;
  overflow: hidden;
}

.documents-page::after {
  content: "";
  position: fixed;
  top: 0%;
  right: -400px;
  width: 1800px;
  height: 1800px;
  background-image: url("/images/olivier2.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right top;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.documents-page > * {
  position: relative;
  z-index: 1;
}

/* --- INTRO --- */
.documents-intro {
  max-width: 700px;
  margin: 175px auto 50px;
  padding: 0 30px;
  text-align: center;
}

.documents-intro h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 40px;
  font-weight: 500;
  color: #5a4a36;
  margin: 0 0 18px;
}

.documents-intro-ligne1 {
  font-size: 20px;
  font-weight: 500;
  color: #b68b52;
  margin: 0 0 10px;
}

.documents-intro-ligne2 {
  font-size: 16px;
  line-height: 1.7;
  color: #3a3a3a;
  margin: 0;
}

.documents-intro-mention-ia {
  font-size: 13px;
  font-style: italic;
  color: #999;
  margin: 18px 0 0;
  line-height: 1.6;
}

/* --- FILTRES --- */
.documents-filtres {
  max-width: 1000px;
  margin: 0 auto 40px;
  padding: 0 30px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 32px;
}

.documents-filtre-groupe {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.documents-filtre-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b68b52;
  margin-right: 6px;
  min-width: 60px;
  flex: 0 0 auto;
  padding-top: 6px;
}

.documents-filtre-groupe > .documents-filtre-btn {
  flex-shrink: 0;
}

.documents-filtre-boutons {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.documents-filtre-btn {
  background: #fff;
  border: 1px solid #e4ddd0;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 14px;
  color: #5a4a36;
  cursor: pointer;
  transition: all 0.2s ease;
}

.documents-filtre-btn:hover {
  border-color: rgba(182,139,82,.60);
}

.documents-filtre-btn--active {
  background: #b68b52;
  border-color: #b68b52;
  color: #fff;
}

.documents-filtre-select {
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%235a4a36'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%235a4a36' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 12px center;
  background-size: 12px;
  border: 1px solid #e4ddd0;
  border-radius: 999px;
  padding: 5px 30px 5px 13px;
  font-size: 14px;
  font-family: inherit;
  color: #5a4a36;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease;
}

.documents-filtre-select:hover {
  border-color: rgba(182,139,82,.60);
}

.documents-filtre-select:focus {
  outline: none;
  border-color: #b68b52;
}

/* --- GRILLE --- */
.documents-grille {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 30px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}

.documents-carte {
  background: #fff;
  border: 1px solid #e4ddd0;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}

.documents-carte[hidden] {
  display: none;
}

.documents-carte:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0,0,0,.10);
}

.documents-carte img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.documents-carte-legende {
  display: block;
  padding: 10px 12px 12px;
}

.documents-carte-type {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b68b52;
}

.documents-carte-annee {
  display: inline-block;
  font-size: 11px;
  color: #999;
}

.documents-carte-annee::before {
  content: "· ";
  color: #d9cfbc;
}

.documents-carte-titre {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  color: #2f2f2f;
  padding-top: 4px;
  line-height: 1.3;
}

.documents-aucun-resultat {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 20px 30px 60px;
}

.documents-voir-plus-conteneur {
  text-align: center;
  padding: 0 30px 60px;
}

.documents-voir-plus-btn {
  background: #fff;
  border: 1px solid #b68b52;
  border-radius: 999px;
  padding: 10px 28px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  color: #b68b52;
  cursor: pointer;
  transition: all 0.2s ease;
}

.documents-voir-plus-btn:hover {
  background: #b68b52;
  color: #fff;
}

.documents-empty {
  text-align: center;
  padding: 60px 30px;
  color: #999;
}

/* --- Séparateur (repris à l'identique de video.css / fiche-lieu.php) --- */
.video-related-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 360px;
  margin: 30px auto 0;
}

.video-related-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #c9a876);
}

.video-related-divider span:last-child {
  background: linear-gradient(to left, transparent, #c9a876);
}

.video-related-divider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b68b52;
  flex-shrink: 0;
}

/* Dans la lightbox documents, l'image déborde de 70px sous le bandeau :
   on dégage cet espace avant le séparateur pour qu'il ne soit plus
   masqué sous l'image. */
.documents-lightbox-contenu .video-related-divider {
  margin-top: 110px;
}

/* --- LIGHTBOX --- */
.documents-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(247, 245, 240, 0.97);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.documents-lightbox--ouvert {
  display: flex;
}

.documents-lightbox-contenu {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: visible;
  text-align: left;
  padding: 155px 0 0;
}

.documents-lightbox-bandeau {
  position: relative;
  display: flex;
  align-items: center;
  gap: 55px;
  min-height: 420px;
  max-width: 820px;
  margin: 0 auto;
  background: #d8b788;
  border-radius: 20px;
  padding: 0 100px 0 45px;
}

.documents-lightbox-image,
.documents-lightbox-texte {
  position: relative;
  z-index: 1;
}

.documents-lightbox::after {
  content: "";
  position: fixed;
  top: 0%;
  right: -400px;
  width: 1800px;
  height: 1800px;
  background-image: url("/images/olivier2.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right top;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.documents-lightbox::before {
  content: "";
  position: fixed;
  top: -40px;
  left: 0;
  width: 500px;
  height: 250px;
  background-image: url("/images/villagefiligrane-transparent.png?v=6");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left top;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

@keyframes villageFadeIn {
  from { opacity: 0; }
  to { opacity: 0.12; }
}

.documents-lightbox--ouvert::before {
  animation: villageFadeIn 1.8s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .documents-lightbox--ouvert::before {
    animation: none;
  }
}

.documents-lightbox-image {
  flex: 0 0 auto;
  width: 520px;
  max-width: 48%;
  height: 560px;
  margin: -70px 0;
  background: rgba(248, 241, 230, 0.78);
  border: 1px solid #e4ddd0;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 26px 62px rgba(0,0,0,.28);
  box-sizing: border-box;
  z-index: 2;
  cursor: zoom-in;
}

.documents-lightbox-image::before {
  content: "🔍";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: #d8b788;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 3;
}

.documents-lightbox-image:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.documents-lightbox-texte {
  flex: 1 1 auto;
  min-width: 0;
  padding: 36px 0;
}

.documents-lightbox-fermer {
  position: fixed;
  top: 24px;
  right: 30px;
  background: #fff;
  border: 1px solid #e4ddd0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  color: #5a4a36;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
  transition: all 0.2s ease;
}

.documents-lightbox-fermer:hover {
  background: #b68b52;
  border-color: #b68b52;
  color: #fff;
}

.documents-lightbox-contenu img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}

.documents-lightbox-date {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b68b52;
  margin: 0 0 6px;
}

.documents-lightbox-titre {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  color: #4a3a28;
  margin: 0 0 10px;
}

.documents-lightbox-legende {
  font-size: 18px;
  color: #5a4a36;
  margin: 0 0 18px;
}

.documents-lightbox-mention-ia {
  font-size: 12px;
  font-style: italic;
  color: rgba(74,58,40,0.65);
  margin: 0 0 16px;
}

.documents-lightbox-texte .lieu-savoir-plus-btn {
  color: #4a3a28;
  margin: 0;
}

.documents-lightbox-texte .lieu-savoir-plus-contenu {
  color: #4a3a28;
}

/* --- Bouton "Agrandir l'image" --- */
.documents-agrandir-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid rgba(74,58,40,.35);
  border-radius: 999px;
  padding: 7px 18px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: #4a3a28;
  cursor: pointer;
  transition: all .2s ease;
}

.documents-agrandir-btn:hover {
  background: #4a3a28;
  border-color: #4a3a28;
  color: #f8f1e6;
}

.documents-actions-secondaires {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.documents-video-lien {
  text-decoration: none;
}

/* --- Bouton "En savoir plus" (repris de video.css) --- */
.lieu-savoir-plus-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 20px;
  color: #b68b52;
  cursor: pointer;
  margin: 0 auto;
  padding: 6px 0;
}

.lieu-savoir-plus-icone {
  font-size: 20px;
  transition: transform 0.25s ease;
}

.lieu-savoir-plus-btn--ouvert .lieu-savoir-plus-icone {
  transform: rotate(45deg);
}

.lieu-savoir-plus-contenu {
  text-align: left;
  font-size: 15px;
  line-height: 1.7;
  color: #3a3a3a;
  margin-top: 10px;
}

/* --- ZOOM PLEIN ÉCRAN --- */
.documents-zoom {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(247, 245, 240, 0.97);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.documents-zoom--ouvert {
  display: flex;
}

.documents-zoom::after {
  content: "";
  position: fixed;
  top: 0%;
  right: -400px;
  width: 1800px;
  height: 1800px;
  background-image: url("/images/olivier2.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right top;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.documents-zoom img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 26px 62px rgba(0,0,0,.28);
}

.documents-zoom-fermer {
  position: fixed;
  top: 24px;
  right: 30px;
  background: #fff;
  border: 1px solid #e4ddd0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  color: #5a4a36;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
  transition: all 0.2s ease;
  z-index: 2;
}

.documents-zoom-fermer:hover {
  background: #b68b52;
  border-color: #b68b52;
  color: #fff;
}

/* --- RESPONSIVE --- */
@media (max-width: 800px) {
  .documents-intro {
    margin: 190px auto 40px;
    padding: 0 22px;
  }

  .documents-filtres {
    padding: 0 22px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .documents-grille {
    padding: 0 22px 40px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }

  .documents-lightbox-contenu {
    flex-direction: column;
    max-width: 100%;
    padding: 20px 0;
  }

  .documents-lightbox-bandeau {
    flex-direction: column;
    padding: 55px 24px 24px;
    gap: 24px;
    min-height: 0;
  }

  .documents-lightbox-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: -70px 0 0;
  }
}
