/* Despani: {gallery ...} embeds (GalleryEmbedPlugin): compact slideshow, in-text figures, the teaser picture, grid. */
.x2-gembed{margin:18px 0 22px;padding:0;max-width:100%;--gx-accent:var(--xp-accent,#8b1a1a);--gx-h:320px}
.x2-gembed img{border:0!important;box-shadow:none!important;margin:0!important;padding:0!important;float:none!important}
.x2-gembed .x2-gembed-item{cursor:zoom-in;text-decoration:none!important}
/* slideshow: one picture at a time, at most --gx-h tall, natural proportions (no black bands); arrows + counter overlaid */
.x2-gembed-view{position:relative;max-width:100%}
.x2-gembed-stage{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;height:var(--gx-h);
  -webkit-overflow-scrolling:touch;scrollbar-width:none;outline:none;border-radius:10px}
.x2-gembed-stage::-webkit-scrollbar{display:none}
.x2-gembed-stage:focus-visible{box-shadow:0 0 0 3px var(--gx-accent)}
.x2-gembed-stage .x2-gembed-item{position:relative;flex:0 0 100%;width:100%;height:100%;scroll-snap-align:center;display:flex;align-items:center;justify-content:center}
.x2-gembed-stage .x2-gembed-item img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;display:block;border-radius:8px!important}
.x2-gembed-stage .x2-gembed-cap{position:absolute;left:50%;transform:translateX(-50%);bottom:8px;max-width:calc(100% - 120px);padding:3px 10px;border-radius:6px;
  color:#fff;font-size:12.5px;line-height:1.35;background:rgba(0,0,0,.58);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.x2-gembed-prev,.x2-gembed-next{position:absolute;top:50%;transform:translateY(-50%);z-index:2;width:38px;height:38px;border-radius:50%;border:0;
  background:rgba(0,0,0,.42);color:#fff;font-size:26px;line-height:1;cursor:pointer;display:grid;place-items:center;padding:0 0 3px;
  transition:background .15s,opacity .15s;opacity:.85}
.x2-gembed-prev{left:8px}.x2-gembed-next{right:8px}
.x2-gembed-prev[hidden],.x2-gembed-next[hidden]{display:none}
.x2-gembed-view:hover .x2-gembed-prev,.x2-gembed-view:hover .x2-gembed-next{opacity:1}
.x2-gembed-prev:hover,.x2-gembed-next:hover{background:var(--gx-accent)}
.x2-gembed-count{position:absolute;top:8px;right:8px;z-index:2;padding:2px 8px;border-radius:999px;background:rgba(0,0,0,.5);color:#fff;
  font-size:11.5px;line-height:1.5;font-variant-numeric:tabular-nums;pointer-events:none}
.x2-gembed-foot{font-size:13px;color:#666;margin-top:6px;text-align:center}
.x2-gembed-foot a{color:var(--gx-accent);font-weight:600}
/* figure: 1-2 pictures inside the text */
.x2-gembed-figure{text-align:center}
.x2-gembed-figure .x2-gembed-pics{display:flex;gap:10px;justify-content:center;align-items:flex-start}
.x2-gembed-figure .x2-gembed-item{display:block;min-width:0}
.x2-gembed-figure .x2-gembed-item img{display:block;max-width:100%;max-height:var(--gx-h);width:auto;height:auto;border-radius:8px!important}
.x2-gembed-pair .x2-gembed-item{flex:1 1 0}
.x2-gembed-pair .x2-gembed-item img{max-height:260px;margin:0 auto!important}
.x2-gembed-figcap{font-size:13px;line-height:1.4;color:#666;margin:6px auto 0;max-width:640px;text-align:center}
/* intro: the teaser picture beside the lead paragraph (before "read more") */
.x2-gembed-intro{float:left;width:40%;max-width:300px;margin:4px 18px 10px 0}
.x2-gembed-intro .x2-gembed-item{display:block}
.x2-gembed-intro .x2-gembed-item img{display:block;width:100%;height:auto;max-height:260px;object-fit:cover;border-radius:8px!important}
.x2-gembed-intro .x2-gembed-figcap{font-size:12px;text-align:left;margin-top:4px}
/* grid */
.x2-gembed-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px}
.x2-gembed-grid .x2-gembed-item{position:relative;display:block;aspect-ratio:1;overflow:hidden;border-radius:10px;background:#eee}
.x2-gembed-grid .x2-gembed-item img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .25s}
.x2-gembed-grid .x2-gembed-item:hover img{transform:scale(1.04)}
.x2-gembed-grid .x2-gembed-cap{position:absolute;left:0;right:0;bottom:0;padding:16px 8px 6px;color:#fff;font-size:12px;background:linear-gradient(transparent,rgba(0,0,0,.7))}
/* the labelled "open in gallery" button added to the engine lightbox's top bar */
.xlb .x2-gembed-open{width:auto!important;padding:0 14px!important;border-radius:999px!important;font-size:13px;font-weight:600;white-space:nowrap;
  display:inline-flex;align-items:center;text-decoration:none!important;color:#fff!important;background:rgba(255,255,255,.14)}
.xlb .x2-gembed-open:hover{background:rgba(255,255,255,.26)}
.xlb .x2-gembed-open[hidden]{display:none}
@media (max-width:640px){
  .x2-gembed{--gx-h:230px}
  .x2-gembed-pair .x2-gembed-item img{max-height:180px}
  .x2-gembed-intro{float:none;width:auto;max-width:none;margin:0 0 12px}
  .x2-gembed-intro .x2-gembed-item img{max-height:240px}
  .x2-gembed-prev,.x2-gembed-next{width:32px;height:32px;font-size:22px}
}
