/* Giux-Lab Gallery frontend. License: GPL-3.0-or-later */
.gxg-gallery{
  --gxg-stage-height:520px;
  --gxg-caption-height:64px;
  --gxg-caption-bg:rgba(35,21,24,.96);
  margin:1.35rem 0;
  width:100%;
  max-width:100%;
  min-width:0;
}
.gxg-stage{
  position:relative;
  width:100%;
  max-width:100%;
  height:var(--gxg-stage-height);
  min-height:0;
  background:#0f0f10;
  border-radius:9px;
  overflow:hidden;
  box-shadow:0 1px 0 rgba(255,255,255,.05) inset;
  touch-action:pan-y;
}
.gxg-slide{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  margin:0;
  padding:0;
  width:100%;
  height:100%;
}
.gxg-slide.gxg-transitioning{transition:transform .28s cubic-bezier(.22,.61,.36,1);will-change:transform;}
.gxg-slide[hidden]{display:none!important;}
.gxg-image-wrap{
  position:relative;
  display:flex;
  flex:1 1 auto;
  min-height:0;
  min-width:0;
  align-items:center;
  justify-content:center;
  padding:12px 54px;
  background:#101011;
  overflow:hidden;
}
.gxg-image{
  display:block;
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  object-fit:contain;
  object-position:center;
  user-select:none;
  -webkit-user-drag:none;
}
.gxg-gallery:not(.gxg-expanded) .gxg-image{cursor:zoom-in;}
.gxg-image:focus-visible{outline:2px solid rgba(217,183,106,.9);outline-offset:3px;}
.gxg-caption{
  box-sizing:border-box;
  flex:0 0 var(--gxg-caption-height);
  height:var(--gxg-caption-height);
  margin:0;
  padding:.72rem 1rem;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:auto;
  background:var(--gxg-caption-bg,rgba(35,21,24,.96));
  color:var(--gxg-caption,#d9b76a);
  border-top:1px solid rgba(217,183,106,.16);
  text-shadow:0 1px 0 rgba(0,0,0,.35);
  line-height:1.4;
  text-align:center;
}
.gxg-caption-empty{padding:0;border-top:0;}
.gxg-caption-probe{
  position:absolute!important;
  left:-100000px!important;
  top:0!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  display:block!important;
  visibility:hidden!important;
  overflow:visible!important;
  pointer-events:none!important;
}
.gxg-tools{
  position:absolute;
  top:10px;
  right:10px;
  display:flex;
  gap:7px;
  opacity:0;
  pointer-events:none;
  transition:opacity .14s linear;
  z-index:8;
}
.gxg-image-wrap:hover .gxg-tools,.gxg-image-wrap:focus-within .gxg-tools,.gxg-expanded .gxg-tools{opacity:1;pointer-events:auto;}
.gxg-tool{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.18);
  border-radius:6px;
  background:rgba(10,10,11,.68);
  color:#fff;
  text-decoration:none;
  cursor:pointer;
  padding:6px;
  backdrop-filter:blur(3px);
  transition:background .12s linear,transform .10s ease-out,box-shadow .10s ease-out;
}
.gxg-tool[hidden]{display:none!important;}
.gxg-tool:hover,.gxg-tool:focus{background:var(--gxg-accent,#7a1a3c);color:#fff;outline:2px solid rgba(255,255,255,.72);outline-offset:1px;}
.gxg-tool:active{transform:scale(.90);box-shadow:0 1px 2px rgba(0,0,0,.35) inset;}
.gxg-tool svg{width:19px;height:19px;fill:currentColor;}
.gxg-expanded .gxg-expand{display:none;}
.gxg-watermark{
  position:absolute;
  right:14px;
  bottom:14px;
  width:clamp(44px,7vw,86px);
  height:clamp(24px,4.5vw,50px);
  background-repeat:no-repeat;
  background-position:right bottom;
  background-size:contain;
  opacity:.48;
  pointer-events:none;
  z-index:4;
}
.gxg-prev,.gxg-next{
  position:absolute;
  top:calc((100% - var(--gxg-caption-height))/2);
  transform:translateY(-50%);
  z-index:9;
  width:42px;
  height:56px;
  border:1px solid rgba(255,255,255,.20);
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  background:rgba(8,8,9,.44);
  color:rgba(255,255,255,.92);
  cursor:pointer;
  opacity:.72;
  transition:opacity .14s linear,background .14s linear,transform .10s ease-out,box-shadow .10s ease-out;
  backdrop-filter:blur(3px);
}
.gxg-prev{left:8px;}
.gxg-next{right:8px;}
.gxg-prev svg,.gxg-next svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}
.gxg-stage:hover .gxg-prev:not(:disabled),.gxg-stage:hover .gxg-next:not(:disabled),.gxg-prev:focus:not(:disabled),.gxg-next:focus:not(:disabled){opacity:1;background:rgba(8,8,9,.72);}
.gxg-prev:active:not(:disabled),.gxg-next:active:not(:disabled),.gxg-prev.is-pressed:not(:disabled),.gxg-next.is-pressed:not(:disabled){opacity:1;background:var(--gxg-accent,#7a1a3c);transform:translateY(-50%) scale(.88);box-shadow:0 1px 1px rgba(0,0,0,.30) inset,0 0 0 1px rgba(255,255,255,.10);}
.gxg-prev:disabled,.gxg-next:disabled{opacity:0;pointer-events:none;}
.gxg-counter{
  position:absolute;
  left:50%;
  bottom:calc(var(--gxg-caption-height) + 10px);
  transform:translateX(-50%);
  z-index:9;
  min-width:3.6rem;
  padding:.28rem .55rem;
  border-radius:999px;
  background:rgba(8,8,9,.54);
  color:#fff;
  font-size:.84rem;
  font-variant-numeric:tabular-nums;
  text-align:center;
  pointer-events:none;
  backdrop-filter:blur(3px);
}
.gxg-gallery-link-wrap{margin:.65rem 0 0;text-align:right;font-size:.95rem;}
.gxg-gallery-link{color:var(--gxg-accent,#7a1a3c);font-weight:600;text-decoration:none;}
.gxg-gallery-link:hover{text-decoration:underline;}
.gxg-empty{padding:1rem;border:1px dashed #999;background:#fafafa;}

/* Viewer in sovraimpressione. Il viewer incorporato resta al suo posto e torna
 * alla stessa geometria quando la sovraimpressione viene chiusa. */
html.gxg-overlay-open{overflow:hidden;}
.gxg-overlay-backdrop{
  position:fixed;
  inset:0;
  z-index:999980;
  border:0;
  padding:0;
  margin:0;
  width:100%;
  height:100%;
  background:rgba(12,8,10,.965)!important;
  background-image:none!important;
  color:transparent!important;
  box-shadow:none!important;
  outline:0!important;
  filter:none!important;
  backdrop-filter:blur(4px) saturate(.62) brightness(.58);
  cursor:default;
  transition:none!important;
}
.gxg-overlay-backdrop:hover,
.gxg-overlay-backdrop:focus,
.gxg-overlay-backdrop:focus-visible,
.gxg-overlay-backdrop:active{
  background:rgba(12,8,10,.965)!important;
  background-image:none!important;
  box-shadow:none!important;
  outline:0!important;
  filter:none!important;
}
.gxg-overlay-backdrop[hidden]{display:none!important;}
.gxg-expanded .gxg-stage{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(1180px,calc(100vw - 28px));
  max-width:calc(100vw - 28px);
  height:var(--gxg-stage-height);
  z-index:999990;
  box-shadow:0 18px 60px rgba(0,0,0,.48),0 0 0 1px rgba(255,255,255,.08);
}
.gxg-overlay-close{
  position:absolute;
  top:10px;
  left:10px;
  z-index:12;
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.20);
  border-radius:6px;
  padding:6px;
  background:rgba(10,10,11,.72);
  color:#fff;
  cursor:pointer;
  backdrop-filter:blur(3px);
}
.gxg-overlay-close[hidden]{display:none!important;}
.gxg-overlay-close:hover,.gxg-overlay-close:focus{background:var(--gxg-accent,#7a1a3c);outline:2px solid rgba(255,255,255,.72);outline-offset:1px;}
.gxg-overlay-close:active{transform:scale(.90);box-shadow:0 1px 2px rgba(0,0,0,.35) inset;}
.gxg-overlay-close svg{width:20px;height:20px;fill:currentColor;}
.gxg-expanded .gxg-image{cursor:default;}

.gxg-zoom-open{overflow:hidden;}
.gxg-zoom-modal{position:fixed;inset:0;z-index:1000010;background:rgba(0,0,0,.93);}
.gxg-zoom-modal[hidden]{display:none!important;}
.gxg-zoom-toolbar{position:absolute;top:14px;right:14px;display:flex;gap:7px;z-index:3;}
.gxg-zoom-btn{min-width:38px;height:38px;border:0;border-radius:5px;background:rgba(255,255,255,.14);color:#fff;font-size:1rem;cursor:pointer;}
.gxg-zoom-btn:hover,.gxg-zoom-btn:focus{background:var(--gxg-accent,#7a1a3c);outline:2px solid #fff;outline-offset:1px;}
.gxg-zoom-btn:active{transform:scale(.90);box-shadow:0 1px 2px rgba(0,0,0,.35) inset;}
.gxg-zoom-close{font-size:1.6rem;line-height:1;}
.gxg-zoom-canvas{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none;}
.gxg-zoom-canvas.is-dragging{cursor:grabbing;}
.gxg-zoom-image{max-width:94vw;max-height:92vh;width:auto;height:auto;transform-origin:center center;user-select:none;-webkit-user-drag:none;will-change:transform;}

.gxg-download-page{display:flex;flex-direction:column;gap:1.5rem;}
.gxg-download-item{display:grid;grid-template-columns:minmax(260px,42%) 1fr;gap:1.25rem;border-bottom:1px solid #d8dde2;padding-bottom:1.5rem;}
.gxg-download-thumb img{display:block;max-width:100%;height:auto;}
.gxg-download-meta h2{margin-top:0;}
.gxg-download-button{display:inline-block;padding:.5rem .8rem;border-radius:5px;background:var(--gxg-accent,#7a1a3c);color:#fff!important;text-decoration:none;}

@media (hover:none){
  .gxg-tools{opacity:.88;pointer-events:auto;}
  .gxg-prev:not(:disabled),.gxg-next:not(:disabled){opacity:.84;}
}
@media (max-width:720px){
  .gxg-image-wrap{padding:8px 38px;}
  .gxg-prev,.gxg-next{width:34px;height:46px;}
  .gxg-prev{left:3px;}
  .gxg-next{right:3px;}
  .gxg-tools{top:7px;right:7px;gap:5px;}
  .gxg-tool{width:32px;height:32px;padding:6px;}
  .gxg-counter{bottom:calc(var(--gxg-caption-height) + 7px);font-size:.78rem;}
  .gxg-gallery-link-wrap{text-align:left;}
  .gxg-download-item{grid-template-columns:1fr;}
  .gxg-expanded .gxg-stage{width:calc(100vw - 10px);max-width:calc(100vw - 10px);border-radius:6px;}
  .gxg-overlay-close{top:7px;left:7px;width:32px;height:32px;}
  .gxg-caption{padding:.58rem .7rem;font-size:.92rem;}
}
@media (max-width:420px){
  .gxg-image-wrap{padding:6px 34px;}
  .gxg-prev,.gxg-next{width:31px;height:44px;border-radius:6px;}
  .gxg-tool{width:30px;height:30px;}
}
@media (prefers-reduced-motion:reduce){.gxg-slide.gxg-transitioning,.gxg-prev,.gxg-next,.gxg-tool{transition:none!important;}}

/* Azioni sotto la galleria e modalità catalogo. */
.gxg-gallery-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin:.72rem 0 0;font-size:.92rem;}
.gxg-gallery-action{display:inline-flex;align-items:center;min-height:38px;padding:.45rem .72rem;border:1px solid rgba(217,183,106,.34);border-radius:6px;background:rgba(0,0,0,.20);color:var(--gxg-caption,#d9b76a);font-weight:650;text-decoration:none;line-height:1.25;transition:background-color .14s ease,border-color .14s ease,transform .08s ease;}
.gxg-gallery-action:hover,.gxg-gallery-action:focus-visible{background:rgba(0,0,0,.32);border-color:rgba(217,183,106,.62);color:var(--gxg-caption,#d9b76a);text-decoration:none;}
.gxg-gallery-action:active{transform:translateY(1px);}
.gxg-gallery-action-download::before{content:"↓";display:inline-block;margin-right:.38rem;font-weight:800;}
.gxg-gallery-catalog{--gxg-catalog-border:rgba(122,26,60,.20);}
.gxg-gallery-catalog .gxg-download-page{gap:1rem;}
.gxg-gallery-catalog .gxg-download-item{padding:1rem;border:1px solid var(--gxg-catalog-border);border-radius:8px;background:rgba(255,255,255,.035);}
.gxg-gallery-catalog .gxg-download-thumb{display:flex;align-items:center;justify-content:center;min-height:220px;background:#101011;border-radius:6px;overflow:hidden;}
.gxg-gallery-catalog .gxg-download-thumb img{max-height:520px;width:auto;height:auto;object-fit:contain;}
.gxg-gallery-catalog .gxg-download-meta{min-width:0;overflow-wrap:anywhere;}
.gxg-gallery-catalog .gxg-download-meta h2{font-size:1.12rem;line-height:1.35;}
.gxg-gallery-catalog .gxg-download-meta p{margin:.55rem 0;}
@media (max-width:720px){.gxg-gallery-actions{justify-content:flex-start;flex-direction:column;align-items:flex-start}.gxg-gallery-catalog .gxg-download-item{padding:.75rem}.gxg-gallery-catalog .gxg-download-thumb{min-height:0}}

/* Viewer / Catalogue switch (v0.2.0). */
.gxg-mode-switcher{margin:0 0 1rem;}
.gxg-mode-switch{display:flex;flex-wrap:wrap;gap:.4rem;margin:0 0 .75rem;}
.gxg-mode-button{min-height:38px;padding:.45rem .8rem;border:1px solid rgba(122,26,60,.28);border-radius:6px;background:rgba(255,255,255,.04);color:inherit;font:inherit;font-weight:650;cursor:pointer;}
.gxg-mode-button:hover,.gxg-mode-button:focus-visible{border-color:var(--gxg-accent,#7a1a3c);outline:2px solid rgba(122,26,60,.38);outline-offset:1px;}
.gxg-mode-button.is-active{background:var(--gxg-accent,#7a1a3c);border-color:var(--gxg-accent,#7a1a3c);color:#fff;}
.gxg-mode-pane[hidden]{display:none!important;}
