/* Shared ZACO Entity Media Gallery / Lightbox. One runtime for Product, Project and taxonomy landings. */
.zaco-fe-media-gallery{position:relative;min-width:0}
.zaco-fe-media-gallery__preview{display:grid;gap:var(--zaco-fe-space-3,12px);min-width:0}
.zaco-fe-media-gallery--hero .zaco-fe-media-gallery__preview{display:block;height:100%}
.zaco-fe-media-gallery--mosaic .zaco-fe-media-gallery__preview{grid-template-columns:minmax(0,2fr) minmax(0,1fr);grid-template-rows:1fr 1fr}
.zaco-fe-media-gallery--mosaic .zaco-fe-media-gallery__trigger.is-lead{grid-row:1/span 2}
.zaco-fe-media-gallery--grid .zaco-fe-media-gallery__preview{grid-template-columns:repeat(3,minmax(0,1fr))}
.zaco-fe-media-gallery__trigger{position:relative;width:100%;height:100%;min-height:10rem;padding:0;border:0;border-radius:var(--zaco-fe-radius-card,8px);overflow:hidden;background:var(--zaco-fe-surface-soft,#f4f5f3);cursor:zoom-in;text-align:inherit}
.zaco-fe-media-gallery__trigger img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .28s ease}
.zaco-fe-media-gallery__trigger:hover img,.zaco-fe-media-gallery__trigger:focus-visible img{transform:scale(1.025)}
/* Nine bounded focal combinations; object-position has no interoperable x/y subproperties. */
.zaco-fe-media-gallery__trigger img[data-focal-x="left"][data-focal-y="top"]{object-position:left top}.zaco-fe-media-gallery__trigger img[data-focal-x="left"][data-focal-y="center"]{object-position:left center}.zaco-fe-media-gallery__trigger img[data-focal-x="left"][data-focal-y="bottom"]{object-position:left bottom}
.zaco-fe-media-gallery__trigger img[data-focal-x="center"][data-focal-y="top"]{object-position:center top}.zaco-fe-media-gallery__trigger img[data-focal-x="center"][data-focal-y="center"]{object-position:center center}.zaco-fe-media-gallery__trigger img[data-focal-x="center"][data-focal-y="bottom"]{object-position:center bottom}
.zaco-fe-media-gallery__trigger img[data-focal-x="right"][data-focal-y="top"]{object-position:right top}.zaco-fe-media-gallery__trigger img[data-focal-x="right"][data-focal-y="center"]{object-position:right center}.zaco-fe-media-gallery__trigger img[data-focal-x="right"][data-focal-y="bottom"]{object-position:right bottom}
.zaco-fe-media-gallery__count{position:absolute;right:.8rem;bottom:.8rem;padding:.42rem .68rem;border-radius:var(--zaco-fe-radius-control,6px);background:rgba(15,24,20,.78);color:#fff;font:600 .8rem/1.1 var(--zaco-fe-font-ui,inherit);backdrop-filter:blur(6px)}
.zaco-fe-media-gallery__play,.zaco-fe-gallery-thumb__play{position:absolute;inset:50% auto auto 50%;width:2.8rem;height:2.8rem;transform:translate(-50%,-50%);border-radius:50%;background:rgba(255,255,255,.92);box-shadow:0 6px 22px rgba(0,0,0,.18)}
.zaco-fe-media-gallery__play::before,.zaco-fe-gallery-thumb__play::before{content:"";position:absolute;left:53%;top:50%;transform:translate(-50%,-50%);border-left:.65rem solid #173126;border-top:.42rem solid transparent;border-bottom:.42rem solid transparent}
.zaco-fe-media-gallery__video-placeholder{display:block;width:100%;height:100%;min-height:10rem;background:linear-gradient(135deg,#202a25,#65736b)}
.zaco-fe-gallery-dialog{width:min(96vw,1500px);max-width:1500px;height:min(94vh,980px);max-height:94vh;padding:0;border:0;border-radius:10px;background:#111;color:#fff;overflow:hidden}
.zaco-fe-gallery-dialog::backdrop{background:rgba(0,0,0,.88)}
.zaco-fe-gallery-dialog__frame{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.zaco-fe-gallery-dialog__header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:1rem;align-items:center;padding:.8rem 1rem;border-bottom:1px solid rgba(255,255,255,.14)}
.zaco-fe-gallery-dialog__header h2{margin:0;color:#fff;font:600 1rem/1.2 var(--zaco-fe-font-ui,inherit)}
.zaco-fe-gallery-dialog__counter{font:500 .85rem/1 var(--zaco-fe-font-ui,inherit);color:rgba(255,255,255,.72)}
.zaco-fe-gallery-dialog__close{color:#fff;border-color:rgba(255,255,255,.35)}
.zaco-fe-gallery-dialog__stage{min-height:0;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center}
.zaco-fe-gallery-dialog__slides{height:100%;min-height:0}
.zaco-fe-gallery-slide{height:100%;margin:0;display:grid;grid-template-rows:minmax(0,1fr) auto;place-items:center;min-width:0}
.zaco-fe-gallery-slide[hidden]{display:none}
.zaco-fe-gallery-slide img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.zaco-fe-gallery-slide__video{width:min(100%,1100px);height:min(70vh,760px);display:grid;place-items:center;background:#000}
.zaco-fe-gallery-slide__video iframe,.zaco-fe-gallery-slide__video video{display:block;width:100%;height:100%;border:0;object-fit:contain}
.zaco-fe-gallery-slide__video-start{min-width:10rem;padding:.8rem 1rem;border:1px solid rgba(255,255,255,.5);border-radius:6px;background:rgba(255,255,255,.08);color:#fff;cursor:pointer}
.zaco-fe-gallery-slide figcaption{width:100%;padding:.65rem 1rem;text-align:center;color:rgba(255,255,255,.78);font:400 .88rem/1.4 var(--zaco-fe-font-ui,inherit)}
.zaco-fe-gallery-dialog__nav{width:3.25rem;height:3.25rem;margin:.5rem;border:1px solid rgba(255,255,255,.35);border-radius:50%;background:rgba(0,0,0,.28);color:#fff;font-size:2rem;line-height:1;cursor:pointer;z-index:2}
.zaco-fe-gallery-dialog__thumbs{display:flex;gap:.5rem;overflow-x:auto;padding:.7rem 1rem;border-top:1px solid rgba(255,255,255,.14);scrollbar-width:thin}
.zaco-fe-gallery-thumb{position:relative;flex:0 0 5.1rem;height:3.7rem;padding:0;border:2px solid transparent;border-radius:5px;overflow:hidden;background:#222;cursor:pointer}
.zaco-fe-gallery-thumb.is-active{border-color:#fff}.zaco-fe-gallery-thumb img{width:100%;height:100%;object-fit:cover}.zaco-fe-gallery-thumb__play{width:1.6rem;height:1.6rem}.zaco-fe-gallery-thumb__play::before{border-left-width:.42rem;border-top-width:.28rem;border-bottom-width:.28rem}
@media (max-width:48rem){.zaco-fe-media-gallery--mosaic .zaco-fe-media-gallery__preview{grid-template-columns:1fr 1fr;grid-template-rows:auto}.zaco-fe-media-gallery--mosaic .zaco-fe-media-gallery__trigger.is-lead{grid-column:1/-1;grid-row:auto;aspect-ratio:4/3}.zaco-fe-media-gallery--grid .zaco-fe-media-gallery__preview{grid-template-columns:repeat(2,minmax(0,1fr))}.zaco-fe-gallery-dialog{width:100vw;height:100dvh;max-height:none;border-radius:0}.zaco-fe-gallery-dialog__nav{width:2.65rem;height:2.65rem;margin:.15rem}.zaco-fe-gallery-dialog__header{gap:.55rem;padding:.65rem}.zaco-fe-gallery-thumb{flex-basis:4.4rem;height:3.2rem}}
@media (prefers-reduced-motion:reduce){.zaco-fe-media-gallery__trigger img{transition:none}.zaco-fe-media-gallery__trigger:hover img,.zaco-fe-media-gallery__trigger:focus-visible img{transform:none}}
/* GAL-2 Product Single integration: preserve accepted 3-track Hero geometry. */
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-media-gallery,
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-media-gallery__preview,
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-media-gallery__trigger{height:100%;min-height:inherit;border-radius:0}
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-media-gallery__count{z-index:3;top:var(--zaco-fe-space-4);bottom:auto}
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-gallery-dialog img{position:static;inset:auto;width:auto;height:auto;max-width:100%;max-height:100%;transform:none}
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-gallery-thumb img{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover}
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-gallery-slide__video iframe,
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-gallery-slide__video video{position:static;inset:auto;width:100%;height:100%;transform:none}
.zaco-fe-media-gallery__preview-caption{position:absolute;left:.75rem;bottom:.75rem;z-index:2;max-width:calc(100% - 1.5rem);padding:.38rem .58rem;border-radius:5px;background:rgba(18,30,25,.72);color:#fff;font:500 .78rem/1.2 var(--zaco-fe-font-ui,inherit);backdrop-filter:blur(5px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* GAL-3 Project integration: shared lightbox, accepted 1+2 story-gallery geometry. */
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared{display:block;min-height:0;height:100%;align-self:stretch}
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery,
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery__preview{height:100%;min-height:0}
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery--mosaic .zaco-fe-media-gallery__preview{grid-template-columns:minmax(0,var(--zaco-fe-story-media-major-track)) minmax(0,var(--zaco-fe-story-media-minor-track));grid-template-rows:repeat(2,minmax(0,1fr));gap:var(--zaco-fe-project-gallery-gap)}
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery__trigger{min-height:0;border-radius:var(--zaco-fe-stitch-card-radius)}
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery__trigger.is-lead{grid-column:1;grid-row:1/span 2}
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-gallery-dialog img{position:static;inset:auto;width:auto;height:auto;max-width:100%;max-height:100%;transform:none}
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-gallery-thumb img{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover}
@media (max-width:900px){.zaco-fe-stitch-project .zaco-fe-project-gallery--shared{height:auto;aspect-ratio:var(--zaco-fe-story-media-tablet-ratio)}.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery--mosaic .zaco-fe-media-gallery__preview{height:100%}}
@media (max-width:620px){.zaco-fe-stitch-project .zaco-fe-project-gallery--shared{aspect-ratio:auto}.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery--mosaic .zaco-fe-media-gallery__preview{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto}.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery__trigger.is-lead{grid-column:1/-1;grid-row:auto;aspect-ratio:var(--zaco-fe-story-media-mobile-major-ratio)}.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery__trigger:not(.is-lead){aspect-ratio:var(--zaco-fe-story-media-mobile-minor-ratio)}}
/* Shared focal utility for non-gallery hero crops that use the same lead media. */
.zaco-fe-focal-media[data-focal-x="left"][data-focal-y="top"]{object-position:left top}.zaco-fe-focal-media[data-focal-x="left"][data-focal-y="center"]{object-position:left center}.zaco-fe-focal-media[data-focal-x="left"][data-focal-y="bottom"]{object-position:left bottom}
.zaco-fe-focal-media[data-focal-x="center"][data-focal-y="top"]{object-position:center top}.zaco-fe-focal-media[data-focal-x="center"][data-focal-y="center"]{object-position:center center}.zaco-fe-focal-media[data-focal-x="center"][data-focal-y="bottom"]{object-position:center bottom}
.zaco-fe-focal-media[data-focal-x="right"][data-focal-y="top"]{object-position:right top}.zaco-fe-focal-media[data-focal-x="right"][data-focal-y="center"]{object-position:right center}.zaco-fe-focal-media[data-focal-x="right"][data-focal-y="bottom"]{object-position:right bottom}
/* GAL-4 Layout integration: full-row Layout media uses the shared wide mosaic.
 * Desktop/tablet: one major visual + up to four supporting visuals; all further
 * media stay in the same lightbox sequence. Mobile becomes a scroll-snap strip. */
.zaco-fe-layout-gallery--shared{display:block!important;min-width:0;overflow:hidden}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide .zaco-fe-media-gallery__preview{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));
  gap:var(--zaco-fe-space-3,12px);height:clamp(26rem,42vw,38rem);min-height:0
}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide .zaco-fe-media-gallery__trigger{min-height:0;height:100%;aspect-ratio:auto}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide .zaco-fe-media-gallery__trigger.is-lead{grid-column:1/span 2;grid-row:1/span 2}
/* 1: one bounded cinematic stage; no empty track and no count action. */
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="1"] .zaco-fe-media-gallery__preview{display:block;height:auto;min-height:0}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="1"] .zaco-fe-media-gallery__trigger{display:block;width:100%;height:auto;aspect-ratio:16/9;min-height:0}
/* 2: balanced pair. */
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="2"] .zaco-fe-media-gallery__preview{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:1fr;height:clamp(22rem,34vw,32rem)}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="2"] .zaco-fe-media-gallery__trigger.is-lead{grid-column:auto;grid-row:auto}
/* 3: classic 1+2 bounded mosaic. */
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="3"] .zaco-fe-media-gallery__preview{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));height:clamp(26rem,40vw,36rem)}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="3"] .zaco-fe-media-gallery__trigger.is-lead{grid-column:1;grid-row:1/span 2}
/* 4: lead half + three supporting views; the last support fills the lower-right row. */
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="4"] .zaco-fe-media-gallery__trigger:nth-child(2){grid-column:3;grid-row:1}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="4"] .zaco-fe-media-gallery__trigger:nth-child(3){grid-column:4;grid-row:1}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery[data-count="4"] .zaco-fe-media-gallery__trigger:nth-child(4){grid-column:3/span 2;grid-row:2}
/* 5+ previews remain a deliberate 1+4 composition; View All carries the full count. */
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-5 .zaco-fe-media-gallery__trigger:nth-child(2),
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-6 .zaco-fe-media-gallery__trigger:nth-child(2){grid-column:3;grid-row:1}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-5 .zaco-fe-media-gallery__trigger:nth-child(3),
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-6 .zaco-fe-media-gallery__trigger:nth-child(3){grid-column:4;grid-row:1}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-5 .zaco-fe-media-gallery__trigger:nth-child(4),
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-6 .zaco-fe-media-gallery__trigger:nth-child(4){grid-column:3;grid-row:2}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-5 .zaco-fe-media-gallery__trigger:nth-child(5),
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-6 .zaco-fe-media-gallery__trigger:nth-child(5){grid-column:4;grid-row:2}
/* 7+ media: lead half + six supporting views (2×3); the lightbox keeps
   the complete sequence beyond the seven visible preview tiles. */
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-7 .zaco-fe-media-gallery__preview{grid-template-rows:repeat(3,minmax(0,1fr));height:clamp(30rem,46vw,42rem)}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-7 .zaco-fe-media-gallery__trigger.is-lead{grid-column:1/span 2;grid-row:1/span 3}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-7 .zaco-fe-media-gallery__trigger:nth-child(2){grid-column:3;grid-row:1}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-7 .zaco-fe-media-gallery__trigger:nth-child(3){grid-column:4;grid-row:1}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-7 .zaco-fe-media-gallery__trigger:nth-child(4){grid-column:3;grid-row:2}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-7 .zaco-fe-media-gallery__trigger:nth-child(5){grid-column:4;grid-row:2}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-7 .zaco-fe-media-gallery__trigger:nth-child(6){grid-column:3;grid-row:3}
.zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--count-7 .zaco-fe-media-gallery__trigger:nth-child(7){grid-column:4;grid-row:3}
@media (max-width:40rem){
  .zaco-fe-layout-gallery--shared{overflow:visible}
  .zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide .zaco-fe-media-gallery__preview,
  .zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide[data-count="2"] .zaco-fe-media-gallery__preview,
  .zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide[data-count="3"] .zaco-fe-media-gallery__preview{
    display:flex;height:auto;min-height:0;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:inline mandatory;
    gap:var(--zaco-fe-space-3,12px);padding-bottom:.35rem
  }
  .zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide .zaco-fe-media-gallery__trigger,
  .zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide .zaco-fe-media-gallery__trigger.is-lead{
    flex:0 0 84%;width:84%;height:auto;aspect-ratio:4/3;grid-column:auto;grid-row:auto;scroll-snap-align:start
  }
  .zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide[data-count="1"] .zaco-fe-media-gallery__preview{display:block;overflow:visible;padding-bottom:0}
  .zaco-fe-layout-gallery--shared .zaco-fe-media-gallery--mosaic-wide[data-count="1"] .zaco-fe-media-gallery__trigger{width:100%;aspect-ratio:4/3}
}
/* Gallery dialogs always show uncropped source media even inside crop-heavy Hero/Story containers. */
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery .zaco-fe-gallery-slide img,
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-gallery-slide img{object-fit:contain}
.zaco-fe-stitch-product .zaco-fe-product-hero__media--gallery > .zaco-fe-product-hero__caption{pointer-events:none}

/* 0.5.63 shared gallery UX hardening: action cue, sparse states and integration geometry. */
.zaco-fe-media-gallery__count{display:inline-flex;align-items:center;gap:.45rem;background:rgba(255,255,255,.92);color:#17231d;border:1px solid rgba(255,255,255,.78);box-shadow:0 8px 24px rgba(0,0,0,.14);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);font-weight:650}
.zaco-fe-media-gallery__count-divider{opacity:.45}.zaco-fe-media-gallery__count-action{font-weight:650}
.zaco-fe-gallery-dialog__close{display:grid;place-items:center;width:2.75rem;height:2.75rem;padding:0;border:1px solid rgba(255,255,255,.38);border-radius:50%;background:rgba(255,255,255,.08);color:#fff;cursor:pointer}
.zaco-fe-gallery-dialog__close:is(:hover,:focus-visible){background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.68)}
/* Restore the accepted Project story balance: equal narrative/media columns and an equal-width 1+2 mosaic. */
.zaco-fe-stitch-project .zaco-fe-project-story__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.zaco-fe-stitch-project .zaco-fe-project-gallery--shared .zaco-fe-media-gallery--mosaic .zaco-fe-media-gallery__preview{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (max-width:48rem){
  .zaco-fe-stitch-project .zaco-fe-project-story__grid{grid-template-columns:minmax(0,1fr)}
}
