.cjb-gallery{--gallery-cols:3;display:grid;grid-template-columns:repeat(var(--gallery-cols),minmax(0,1fr));grid-auto-flow:dense;gap:12px;margin:30px 0}
.cjb-gallery figure{position:relative;margin:0!important;overflow:hidden;border-radius:16px;background:#e9ebf1;min-height:180px;box-shadow:0 7px 22px rgba(26,30,48,.10)}
.cjb-gallery .cjb-gallery-open{display:block;width:100%;height:100%;padding:0;border:0;background:none;cursor:zoom-in}
.cjb-gallery img{display:block;width:100%;height:100%;min-height:180px;aspect-ratio:4/3;object-fit:cover;transition:transform .3s ease,filter .3s ease}
.cjb-gallery .cjb-gallery-open:hover img{transform:scale(1.035);filter:brightness(.92)}
.cjb-gallery[data-layout="mosaic"] figure:nth-child(6n+1){grid-column:span 2;grid-row:span 2}
.cjb-gallery[data-layout="mosaic"] figure:nth-child(6n+1) img{aspect-ratio:1/1}
.cjb-gallery figcaption{position:absolute;left:10px;right:10px;bottom:10px;padding:7px 10px;border-radius:9px;background:rgba(17,20,34,.72);color:#fff;text-align:left;font-size:.86rem;line-height:1.25;backdrop-filter:blur(7px)}
.cjb-gallery[data-captions="off"] figcaption,.cjb-gallery figcaption:empty{display:none}
.cjb-lightbox{position:fixed;inset:0;z-index:99999;display:grid;grid-template-columns:70px minmax(0,1fr) 70px;grid-template-rows:70px minmax(0,1fr) 65px;align-items:center;background:rgba(8,10,18,.94);color:#fff;opacity:0;visibility:hidden;transition:.2s}
.cjb-lightbox.open{opacity:1;visibility:visible}
.cjb-lightbox-image{grid-column:2;grid-row:2;max-width:100%;max-height:calc(100vh - 150px);margin:auto;object-fit:contain;border-radius:8px;box-shadow:0 20px 70px rgba(0,0,0,.55)}
.cjb-lightbox-close,.cjb-lightbox-prev,.cjb-lightbox-next{border:0;background:rgba(255,255,255,.12);color:#fff;border-radius:999px;width:46px;height:46px;font-size:1.8rem;cursor:pointer}
.cjb-lightbox-close{grid-column:3;grid-row:1;justify-self:center}
.cjb-lightbox-prev{grid-column:1;grid-row:2;justify-self:center}.cjb-lightbox-next{grid-column:3;grid-row:2;justify-self:center}
.cjb-lightbox-caption{grid-column:2;grid-row:3;text-align:center;padding:10px;font-size:.95rem}.cjb-lightbox-count{grid-column:1;grid-row:1/2;justify-self:center;font-weight:700}
body.cjb-lightbox-open{overflow:hidden}
@media(max-width:760px){.cjb-gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px}.cjb-gallery figure{min-height:130px;border-radius:10px}.cjb-gallery img{min-height:130px}.cjb-gallery[data-layout="mosaic"] figure:nth-child(6n+1){grid-column:span 2}.cjb-lightbox{grid-template-columns:52px minmax(0,1fr) 52px}.cjb-lightbox-prev,.cjb-lightbox-next,.cjb-lightbox-close{width:40px;height:40px}}
@media(max-width:430px){.cjb-gallery:not([data-layout="mosaic"]){grid-template-columns:1fr!important}.cjb-gallery[data-layout="mosaic"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* Images seules : avec ou sans lien cliquable */
.article-content figure.cjb-single-image{display:block;max-width:100%;margin:28px auto;text-align:center}
.article-content figure.cjb-single-image img{display:block;max-width:100%;height:auto;margin:0 auto;border-radius:14px}
.article-content .cjb-single-image-link{display:inline-block;max-width:100%;cursor:zoom-in;text-decoration:none}
.article-content .cjb-single-image-link img{transition:transform .22s ease,filter .22s ease,box-shadow .22s ease}
.article-content .cjb-single-image-link:hover img{transform:translateY(-2px);filter:brightness(.96);box-shadow:0 14px 34px rgba(20,25,45,.18)}
.article-content figure.cjb-single-image figcaption{margin-top:9px;color:var(--muted,#697084);font-size:.9rem;line-height:1.45}
@media(max-width:620px){.article-content figure.cjb-single-image{width:100%!important;margin:20px auto}.article-content figure.cjb-single-image img{width:auto;max-width:100%;border-radius:10px}}

/* CMS 6.1 beta 3 — galeries mobiles sans superposition */
.cjb-gallery>*{min-width:0;max-width:100%}
@media(max-width:620px){
  .cjb-gallery{width:100%;max-width:100%;grid-template-columns:minmax(0,1fr)!important;grid-auto-flow:row!important}
  .cjb-gallery figure,.cjb-gallery[data-layout="mosaic"] figure:nth-child(n){grid-column:auto!important;grid-row:auto!important;width:100%;max-width:100%;min-width:0}
  .cjb-gallery img{width:100%;height:auto;aspect-ratio:auto;min-height:0}
}
