/* ====== Galéries ====== */

/* Conteneur scrollable pour les galeries */
.scrollHeight-galery {
	max-height: 71.5vh;      /* hauteur visible */
	min-height: 71.5vh;
}

/* adaptation mobile */
@media screen and (max-width: 768px) {
    .scrollHeight-galery {
    max-height: 68.5vh;      /* hauteur visible */
	min-height: 68.5vh;
    }
}

.gallery, .articlesGallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  padding: 0.5em;
  background-color: floralwhite;
}

.thumb, .articleThumb {
  position: relative;
  display: block;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
}

.thumb img, .articleThumb img {
  width: 100%;
  max-height:190px;
  display: block;
  transition: transform 0.3s ease;
  object-fit:cover;
}

.articleThumb img {
	max-height:248px;
}
 
.thumb:hover img, .articleThumb:hover img {
  transform: scale(1.05);
}

.thumb:hover .thumb-caption {
  opacity: 1;
}

.thumb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  text-align: center;
  padding: 5px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.month-separator {
  grid-column: 1 / -1;
  text-align: left;
  font-weight: bold;
  font-size: 1.1em;
  margin: 5px 0 5px;
  color: #555;
  border: 1px solid #ccc;
  border-bottom;unset;
  background-color: aliceblue;
}

.btn-sort {
  background: #2a6;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 10px;
}

.btn-sort:hover {
  background: #249;
}

/* gallery articles pdf*/
.pdf-gallery { /*in tab articles*/
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(149px, 1fr));
    gap: 12px;
}

.pdf-thumb {
    position: relative;
    width: 100%;
    cursor: pointer;
    text-align: center;
	border: 1px solid #ccc;
	border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    margin-bottom: 8px;
}

.pdf-thumb canvas {
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pdf-caption {
    margin-top: 0.3em;
    font-size: 0.85em;
    color: #333;
}

.pdf-item {
    text-align: center;
}

.lightbox {
	position:fixed;
	inset:0; background:rgba(0,0,0,0.85);
	display:flex;
	align-items:center;
	justify-content:center; z-index:9999;
}
.lightbox[style*="display:none"] { /* respect inline display */
	display:none;
}

.lightbox figure {
	position:relative;
	max-width:90%;
	max-height:90%;
	margin:0;
	display:flex;
	flex-direction:column;
	align-items:center;
}
.lightbox img {
	max-width:100%;
	max-height:80vh;
	border-radius:8px;
	box-shadow:0 4px 15px rgba(0,0,0,0.5);
}
.lightbox figcaption {
	margin-top:10px;
	color:#fff;
	text-align:center;
	font-size:1rem;
}

.lightbox .close {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 40px;
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-weight: bold;
  z-index: 1001;
}
.lightbox .close:hover {
  color: #ccc;
}

.lightbox .nav {
	position:absolute;
	top:50%;
	transform:translateY(-50%);
	background:none;
	border:none;
	font-size:2.6rem;
	color:#fff;
	cursor:pointer;
	padding:0 18px;
}
.lightbox .prev {
	left:18px;
}
.lightbox .next {
	right:18px;
}

#toggle-order {
  margin: 10px 0;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #007bff;
  color: white;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
#toggle-order:hover {
  background: #0056b3;
}

/* video galery */
.video-gallery video {
  max-height: 300px;
  width: 100%;
  object-fit: contain; /* pour que la vidéo ne soit pas déformée */
}

div#videoGrid {
	display:grid;
	grid-template-columns:repeat(auto-fill,minmax(224px,1fr));
	gap:12px;"
}

figure {
    display: block;
    margin-block-start: 0.2em;
    margin-block-end: 0.2em;
    margin-inline-start: 10px;
    margin-inline-end: 10px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* affichage message en haut à droite de l'écran */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #d4edda; /* vert pour succès */
  color: #155724;
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.toast.show {
  opacity: 1;
}

.fade-out {
  transition: opacity 0.5s ease, height 0.5s ease, margin 0.5s ease, padding 0.5s ease;
  opacity: 0;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}