/* Galeries élèves — affichage public
   Tailles alignées sur le site (thème Divi) : titres de projet 30 px / 500,
   légendes 18 px / 500, texte hérité du thème (14 px), 10 px entre les images.
   Modifiables via les variables ci-dessous. */
.gev-galerie, .gev-app, .gev-lb {
	--gev-titre-size: 30px;
	--gev-titre-weight: 500;
	--gev-titre-color: #333;
	--gev-legende-size: 18px;
	--gev-legende-weight: 500;
	--gev-legende-color: #333;
	--gev-gap: 10px;
}
.gev-galerie { margin: 0 0 90px; }
.gev-galerie:last-child { margin-bottom: 0; }
.gev-galerie .gev-titre { font-size: var(--gev-titre-size); font-weight: var(--gev-titre-weight); color: var(--gev-titre-color); line-height: 1.1; letter-spacing: normal; text-transform: none; margin: 0 0 20px; padding: 0 0 10px; }
.gev-texte { max-width: 46rem; margin: 0; }
.gev-galerie .gev-texte p { margin: 0 0 1em; padding: 0; }
.gev-galerie .gev-texte p:last-child { margin-bottom: 0; }
.gev-grid { margin-top: 21px; }
.gev-titre + .gev-grid { margin-top: 20px; }
.gev-meta { opacity: .7; margin: 0 0 1rem; }
.gev-item { margin: 0; padding: 0; }
.gev-galerie .gev-item figcaption { font-size: var(--gev-legende-size); font-weight: var(--gev-legende-weight); color: var(--gev-legende-color); line-height: 1.2; margin: 10px 0 0; padding: 0; }
.gev-media { display: block; position: relative; overflow: hidden; background: #f2f2f2; }
.gev-media img, .gev-media video { display: block; width: 100%; height: auto; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.gev-media video { background: #000; }
a.gev-zoom { cursor: zoom-in; }
a.gev-zoom img { transition: opacity .2s; }
a.gev-zoom:hover img { opacity: .9; }
.gev-edit-link { margin-top: .75rem; font-size: .9em; }

/* 1. Mosaïque : rangées justifiées, sans recadrage */
.gev-layout-mosaique { display: flex; flex-wrap: wrap; gap: var(--gev-gap); }
.gev-layout-mosaique::after { content: ""; flex-grow: 999999; }
.gev-layout-mosaique .gev-item { flex: calc(var(--r, 1) * 100) 1 calc(var(--r, 1) * 210px); min-width: 0; }
.gev-layout-mosaique .gev-media { aspect-ratio: var(--r, 1); }
.gev-layout-mosaique .gev-media img,
.gev-layout-mosaique .gev-media video { width: 100%; height: 100%; object-fit: cover; }

/* 2. Grille carrée */
.gev-layout-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--gev-gap); }
.gev-layout-grille .gev-media { aspect-ratio: 1; }
.gev-layout-grille .gev-media img { width: 100%; height: 100%; object-fit: cover; }
.gev-layout-grille .gev-media video { width: 100%; height: 100%; object-fit: cover; }

/* 3. Colonnes (cascade) */
.gev-layout-colonnes { columns: 3 240px; column-gap: calc(var(--gev-gap) * 2); }
.gev-layout-colonnes .gev-item { break-inside: avoid; margin-bottom: calc(var(--gev-gap) * 2); display: inline-block; width: 100%; }

/* 4. Pleine largeur */
.gev-layout-pleine .gev-item { margin-bottom: 40px; }
.gev-layout-pleine .gev-media { background: transparent; width: fit-content; max-width: 100%; }
.gev-layout-pleine .gev-media img,
.gev-layout-pleine .gev-media video { width: auto; max-width: 100%; max-height: 88vh; margin: 0; }
.gev-layout-pleine figcaption { text-align: left; }

/* 5. Diaporama */
.gev-layout-diaporama { position: relative; }
.gev-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.gev-slides::-webkit-scrollbar { display: none; }
.gev-layout-diaporama .gev-item { flex: 0 0 100%; scroll-snap-align: start; }
.gev-layout-diaporama .gev-media { height: min(72vh, 720px); display: flex; align-items: center; justify-content: center; background: #f4f4f4; }
.gev-layout-diaporama .gev-media img,
.gev-layout-diaporama .gev-media video { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.gev-layout-diaporama figcaption { text-align: center; }
.gev-nav { position: absolute; top: calc(min(72vh, 720px) / 2); transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #111; font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 1px 6px rgba(0,0,0,.2); padding: 0 0 4px; z-index: 2; }
.gev-nav:hover { background: #fff; }
.gev-prev { left: 12px; }
.gev-next { right: 12px; }
.gev-nav[disabled] { opacity: .3; cursor: default; }
.gev-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: thin; }
.gev-thumb { flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent; background: #e8e8e8; cursor: pointer; opacity: .55; transition: opacity .2s; }
.gev-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gev-thumb.is-active { opacity: 1; border-color: currentColor; }
.gev-thumb-video { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 20px; background: #222; color: #fff; }

/* Filtres */
.gev-filtres { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin: 0 0 2.5rem; }
.gev-filtre-classes { display: flex; flex-wrap: wrap; gap: .4rem; }
.gev-filtre-classes button { font: inherit; font-size: .9em; padding: .35em .9em; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; opacity: .65; }
.gev-filtre-classes button.is-active { opacity: 1; background: #111; color: #fff; border-color: #111; }
.gev-filtre-annee select { font: inherit; margin-left: .4em; }
.gev-galerie[hidden] { display: none; }

/* Bouton / indice « agrandir » sur chaque travail */
.gev-zoom-hint, .gev-zoom-btn { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; line-height: 34px; text-align: center; border: 0; padding: 0; opacity: 0; transition: opacity .2s; pointer-events: none; }
.gev-zoom-btn { pointer-events: auto; cursor: zoom-in; opacity: .75; z-index: 2; }
.gev-media:hover .gev-zoom-hint, .gev-zoom:focus-visible .gev-zoom-hint, .gev-zoom-btn:hover, .gev-zoom-btn:focus-visible { opacity: 1; }
@media (hover: none) { .gev-zoom-hint { opacity: .7; } }

/* Visionneuse */
.gev-lb { position: fixed; inset: 0; z-index: 100000; background: #0d0d0d; color: #fff; display: grid; grid-template-rows: auto 1fr auto auto; font-family: inherit; }
.gev-lb[hidden] { display: none; }
.gev-lb-top { display: flex; align-items: center; gap: 1rem; padding: 10px 12px 6px 20px; font-size: 14px; min-height: 52px; }
.gev-lb-count { opacity: .65; white-space: nowrap; }
.gev-lb-title { flex: 1; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gev-lb-tools { display: flex; gap: 4px; }
.gev-lb button { background: none; border: 0; color: #fff; cursor: pointer; opacity: .8; font: inherit; padding: 0; }
.gev-lb button:hover, .gev-lb button:focus-visible { opacity: 1; }
.gev-lb-tools button { width: 42px; height: 42px; font-size: 26px; line-height: 42px; border-radius: 50%; }
.gev-lb-tools button:hover { background: rgba(255,255,255,.1); }
.gev-lb-stage { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px; }
.gev-lb-stage img, .gev-lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; margin: 0; box-shadow: none; border: 0; border-radius: 0; }
.gev-lb-stage img { animation: gev-fade .25s ease; }
@keyframes gev-fade { from { opacity: 0; } to { opacity: 1; } }
.gev-lb-cap { text-align: center; font-size: var(--gev-legende-size, 18px); font-weight: var(--gev-legende-weight, 500); padding: 10px 20px 4px; min-height: 2.2em; }
.gev-lb-prev, .gev-lb-next { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 90px; font-size: 54px !important; line-height: 1; }
.gev-lb-prev { left: 4px; }
.gev-lb-next { right: 4px; }
.gev-lb-strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px 14px; justify-content: safe center; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.gev-lb-strip[hidden] { display: none; }
.gev-lb-thumb { flex: 0 0 54px; height: 54px; border: 2px solid transparent !important; opacity: .45 !important; background: #222 !important; border-radius: 3px; overflow: hidden; }
.gev-lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gev-lb-thumb span { font-size: 18px; }
.gev-lb-thumb.is-active { opacity: 1 !important; border-color: #fff !important; }
.gev-lb.is-fs .gev-lb-strip { display: none; }
body.gev-lb-open { overflow: hidden; }

@media (max-width: 600px) {
	.gev-layout-mosaique .gev-item { flex-basis: calc(var(--r, 1) * 130px); }
	.gev-layout-grille { grid-template-columns: repeat(2, 1fr); }
	.gev-nav { width: 38px; height: 38px; font-size: 24px; }
	.gev-lb-stage { padding: 0; }
	.gev-lb-prev, .gev-lb-next { width: 44px; font-size: 40px !important; background: rgba(0,0,0,.25) !important; }
}
.gev-thumbs[hidden] { display: none; }
