/* Filmstrip: one preserved-ratio image and a scrollable thumbnail rail. */
.iceq-gallery--filmstrip .iceq-gallery__items { position: relative; display: grid; height: min(72vh, 760px); min-height: 360px; overflow: hidden; }
.iceq-gallery--filmstrip .iceq-gallery__item { position: absolute; inset: 0; display: grid; margin: 0; place-items: center; opacity: 0; pointer-events: none; transition: opacity .38s ease; }
.iceq-gallery--filmstrip .iceq-gallery__item.is-current { opacity: 1; pointer-events: auto; }
.iceq-gallery--filmstrip .iceq-gallery__item > a { display: block; width: 100%; height: 100%; overflow: hidden; }
.iceq-gallery--filmstrip .iceq-gallery__item img,.iceq-gallery--filmstrip .iceq-gallery__item:hover img,.page-layout--project .iceq-gallery--filmstrip .iceq-gallery__item img,.page-layout--project .iceq-gallery--filmstrip .iceq-gallery__item:hover img { position: absolute!important; inset: 0!important; display: block!important; width: 100%!important; height: 100%!important; max-width: none!important; max-height: none!important; margin: 0!important; padding: 0!important; object-fit: contain!important; object-position: center!important; transform: none!important; filter: none!important; }
.iceq-filmstrip { display: flex; gap: 8px; margin-top: 12px; padding: 3px 1px; overflow: hidden; scroll-behavior: smooth; scrollbar-width: none; }
.iceq-filmstrip::-webkit-scrollbar { display: none; }
.iceq-filmstrip button { flex: 0 0 calc((100% - 24px) / 4); height: clamp(64px,10vw,110px); padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; opacity: .62; }
.iceq-filmstrip button[aria-current="true"] { border-color: var(--template-link-color, currentColor); opacity: 1; }
.iceq-filmstrip img { width: 100%; height: 100%; object-fit: cover; }
.iceq-filmstrip-nav { position: absolute; z-index: 5; top: 50%; display: grid; width: 42px; height: 42px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / 88%); color: #17263b; box-shadow: 0 5px 18px rgb(15 23 42 / 18%); cursor: pointer; font: 400 30px/1 Arial,sans-serif; transform: translateY(-50%); }
.iceq-filmstrip-nav--previous { left: 14px; }
.iceq-filmstrip-nav--next { right: 14px; }
.iceq-filmstrip-nav:focus-visible { outline: 3px solid var(--template-link-color,#2f80b9); outline-offset: 3px; }

/* Accordion never crops a photo, including the narrow previews. */
.iceq-gallery--accordion .iceq-gallery__item { background: transparent; }
.iceq-gallery--accordion .iceq-gallery__item > a { display: block; overflow: hidden; background: transparent; }
.iceq-gallery--accordion .iceq-gallery__item img,.iceq-gallery--accordion .iceq-gallery__item:hover img,.page-layout--project .iceq-gallery--accordion .iceq-gallery__item img,.page-layout--project .iceq-gallery--accordion .iceq-gallery__item:hover img { position: absolute!important; inset: 0!important; display: block!important; width: 100%!important; height: 100%!important; max-width: none!important; max-height: none!important; margin: 0!important; padding: 0!important; object-fit: contain!important; object-position: center!important; transform: none!important; filter: none!important; }

/* Stack: a real shuffled deck. Each visible photo is an independent card. */
.iceq-gallery--stack { --iceq-stack-height: min(76vh,760px); width: min(1100px,100%); margin-inline: auto; overflow: visible; }
.iceq-gallery--stack .iceq-gallery__items { position: relative; display: block; height: var(--iceq-stack-height); min-height: 430px; overflow: visible; perspective: 1400px; touch-action: pan-y; user-select: none; }
.iceq-gallery--stack .iceq-gallery__item { position: absolute; top: 50%; left: 50%; display: grid; width: min(78%,820px); height: min(78%,590px); margin: 0; padding: clamp(8px,1vw,13px); place-items: center; overflow: hidden; border: 1px solid color-mix(in srgb,currentColor 18%,transparent); border-radius: 5px; background: var(--body-bg,var(--bs-body-bg,#fff)); box-shadow: 0 13px 30px rgb(15 23 42 / 18%); opacity: 0; pointer-events: none; transform: translate3d(-50%,-46%,0) scale(.88); transform-origin: 50% 72%; transition: transform .46s cubic-bezier(.2,.78,.24,1),opacity .3s ease,box-shadow .3s ease; }
.iceq-gallery--stack .iceq-gallery__item.is-current { z-index: 5; opacity: 1; pointer-events: auto; transform: translate3d(-50%,-50%,54px) rotate(var(--iceq-stack-rotation,-1deg)); box-shadow: 0 24px 52px rgb(15 23 42 / 28%); }
.iceq-gallery--stack .iceq-gallery__item.is-current > a { cursor: grab; }
.iceq-gallery--stack .iceq-gallery__item.is-current.is-dragging > a { cursor: grabbing; }
.iceq-gallery--stack .iceq-gallery__item.is-current.is-dragging { transition: none; }
.iceq-gallery--stack .iceq-gallery__item.is-current.is-dismissing { opacity: 0; transform: translate3d(calc(-50% + var(--iceq-stack-dismiss-x)),calc(-50% - 8px),70px) rotate(var(--iceq-stack-dismiss-rotation)) scale(1.02); transition: transform .28s ease-out,opacity .22s ease-out; }
.iceq-gallery--stack .iceq-gallery__overlay { opacity: 1; background: linear-gradient(0deg,rgb(6 18 22 / 58%),transparent 42%); }
.iceq-gallery--stack .iceq-gallery__overlay i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: rgb(255 255 255 / 88%); color: #17263b; }
.iceq-gallery--stack .iceq-gallery__item.is-next { z-index: 4; opacity: .96; transform: translate3d(calc(-50% + 48px),calc(-50% + 18px),20px) rotate(6.5deg) scale(.975); }
.iceq-gallery--stack .iceq-gallery__item.is-after-next { z-index: 3; opacity: .9; transform: translate3d(calc(-50% - 46px),calc(-50% + 25px),-12px) rotate(-7deg) scale(.95); }
.iceq-gallery--stack .iceq-gallery__item.is-third-next { z-index: 2; opacity: .78; transform: translate3d(calc(-50% + 20px),calc(-50% + 42px),-35px) rotate(3deg) scale(.925); }
.iceq-gallery--stack .iceq-gallery__item.is-fourth-next { z-index: 1; opacity: .62; transform: translate3d(calc(-50% - 18px),calc(-50% + 51px),-58px) rotate(-2deg) scale(.9); }
.iceq-gallery--stack .iceq-gallery__item > a { display: grid; width: 100%; height: 100%; place-items: center; overflow: hidden; border-radius: 3px; background: color-mix(in srgb,currentColor 4%,transparent); }
.iceq-gallery--stack .iceq-gallery__item img,.page-layout--project .iceq-gallery--stack .iceq-gallery__item img { display: block; width: auto!important; height: auto!important; max-width: 100%; max-height: 100%; object-fit: contain!important; border-radius: 2px; box-shadow: none; filter: none!important; transform: none!important; pointer-events: none; }
.iceq-stack-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.iceq-stack-controls button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid color-mix(in srgb,currentColor 20%,transparent); border-radius: 50%; background: var(--body-bg,var(--bs-body-bg,#fff)); color: inherit; cursor: pointer; font: 400 25px/1 Arial,sans-serif; }
.iceq-stack-controls button:hover { border-color: var(--template-link-color,var(--bs-primary,currentColor)); color: var(--template-link-color,var(--bs-primary,currentColor)); }
.iceq-stack-controls button:focus-visible { outline: 3px solid var(--template-link-color,var(--bs-primary,currentColor)); outline-offset: 2px; }
.iceq-stack-controls span { min-width: 54px; text-align: center; font: 600 13px/1 inherit; }

/* Story: one full-screen slide, timed progress and direct navigation. */
.iceq-gallery--story { position: relative; left: 50%; width: 100vw; max-width: none; height: 100svh; margin: 0 0 0 -50vw; overflow: hidden; background: transparent; transform: none!important; }
.iceq-gallery--story .iceq-gallery__items { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: transparent; }
.iceq-gallery--story .iceq-gallery__item { position: absolute; inset: 0; display: grid; width: 100%; height: 100%; margin: 0; place-items: center; overflow: hidden; isolation: isolate; border: 0; border-radius: 0; background: transparent; opacity: 0; visibility: hidden; pointer-events: none; transform: none; transition: opacity .5s ease; }
.iceq-gallery--story .iceq-gallery__item::before,.iceq-gallery--story .iceq-gallery__item::after { display: none; }
.iceq-gallery--story .iceq-gallery__item.is-visible { visibility: visible; }
.iceq-gallery--story .iceq-gallery__item.is-current { z-index: 2; opacity: 1; pointer-events: auto; }
.iceq-gallery--story .iceq-gallery__item > a { display: grid; width: 100%; height: 100%; place-items: center; overflow: hidden; background: transparent; }
.iceq-gallery--story .iceq-gallery__item img,.iceq-gallery--story .iceq-gallery__item:hover img { position: absolute!important; z-index: 1; inset: 30px 0 8px!important; width: 100%!important; height: calc(100% - 38px)!important; max-width: none!important; max-height: none!important; border: 0; border-radius: 0; object-fit: contain!important; object-position: center!important; background: transparent; filter: none!important; box-shadow: none!important; transform: none!important; }
.iceq-gallery--story .iceq-gallery__overlay { display: none; }
.iceq-story-progress { position: absolute; z-index: 8; top: var(--iceq-story-progress-top,16px); right: var(--iceq-story-progress-side,20px); left: var(--iceq-story-progress-side,20px); display: flex; gap: 5px; color: var(--template-link-color,currentColor); pointer-events: none; transition: top .35s ease,left .35s ease,right .35s ease; }
.iceq-story-progress span { height: 3px; flex: 1; overflow: hidden; border-radius: 2px; background: rgb(127 127 127 / 30%); }
.iceq-story-progress span::after { display: block; width: 0; height: 100%; content: ''; background: currentColor; }
.iceq-story-progress span.is-complete::after,.iceq-story-progress span.is-current:last-child::after { width: 100%; }
.iceq-story-progress span.is-running::after { animation: iceq-story-progress 5s linear forwards; }
.iceq-story-nav { position: absolute; z-index: 7; top: 0; bottom: 0; width: 35%; padding: 0; border: 0; background: transparent; color: transparent; cursor: pointer; }
.iceq-story-nav--previous { left: 0; }
.iceq-story-nav--next { right: 0; }
.iceq-story-nav:disabled { cursor: default; }
@keyframes iceq-story-progress { to { width: 100%; } }

@media(max-width:700px){
  .iceq-gallery--filmstrip .iceq-gallery__items { height: 60svh; min-height: 300px; }
  .iceq-filmstrip button { flex-basis: calc((100% - 24px) / 4); height: clamp(54px,16vw,76px); }
  .iceq-filmstrip-nav { width: 38px; height: 38px; }
  .iceq-gallery--stack { --iceq-stack-height: 64svh; }
  .iceq-gallery--stack .iceq-gallery__items { min-height: 340px; }
  .iceq-gallery--stack .iceq-gallery__item { width: 78%; height: 76%; padding: 6px; }
  .iceq-gallery--stack .iceq-gallery__item.is-next { transform: translate3d(calc(-50% + 23px),calc(-50% + 13px),20px) rotate(6deg) scale(.97); }
  .iceq-gallery--stack .iceq-gallery__item.is-after-next { transform: translate3d(calc(-50% - 22px),calc(-50% + 17px),-12px) rotate(-6.5deg) scale(.945); }
  .iceq-gallery--stack .iceq-gallery__item.is-third-next { transform: translate3d(calc(-50% + 10px),calc(-50% + 28px),-35px) rotate(2.7deg) scale(.92); }
}
@media(prefers-reduced-motion:reduce){
  .iceq-gallery--filmstrip .iceq-gallery__item,.iceq-gallery--stack .iceq-gallery__item,.iceq-gallery--story .iceq-gallery__item img { transition: none; }
  .iceq-gallery--story .iceq-gallery__item { transition: none; }
}

/* Photo stack follows the restrained offset/rotation model used by card sliders. */
.iceq-gallery--stack { --iceq-stack-height: clamp(390px,62vw,650px); width: min(920px,100%); overflow: visible; }
.iceq-gallery--stack .iceq-gallery__items { height: var(--iceq-stack-height); min-height: 390px; overflow: visible; perspective: 1200px; }
.iceq-gallery--stack .iceq-gallery__item {
  width: var(--iceq-stack-card-width,min(74%,720px));
  height: var(--iceq-stack-card-height,min(78%,510px));
  padding: clamp(6px,.7vw,10px);
  border: 1px solid color-mix(in srgb,currentColor 14%,transparent);
  border-radius: 6px;
  background: var(--body-bg,var(--bs-body-bg,#fff));
  box-shadow: 0 7px 18px rgb(15 23 42 / 12%);
  transform-origin: 50% 86%;
  transition: transform .46s cubic-bezier(.2,.78,.24,1),opacity .3s ease,box-shadow .3s ease;
}
.iceq-gallery--stack.is-deck-ready .iceq-gallery__item { transition: width .34s ease,height .34s ease,transform .46s cubic-bezier(.2,.78,.24,1),opacity .3s ease,box-shadow .3s ease; }
.iceq-gallery--stack .iceq-gallery__item.is-current { transform: translate3d(-50%,-50%,48px) rotate(var(--iceq-stack-rotation,-.35deg)); box-shadow: 0 14px 32px rgb(15 23 42 / 18%); }
.iceq-gallery--stack .iceq-gallery__item.is-next { transform: translate3d(calc(-50% + 10px),calc(-50% + 10px),24px) rotate(2deg) scale(.988); opacity: 1; }
.iceq-gallery--stack .iceq-gallery__item.is-after-next { transform: translate3d(calc(-50% - 9px),calc(-50% + 19px),8px) rotate(-2.4deg) scale(.976); opacity: .96; }
.iceq-gallery--stack .iceq-gallery__item.is-third-next { transform: translate3d(calc(-50% + 6px),calc(-50% + 28px),-8px) rotate(1.4deg) scale(.964); opacity: .9; }
.iceq-gallery--stack .iceq-gallery__item.is-fourth-next { transform: translate3d(calc(-50% - 5px),calc(-50% + 36px),-24px) rotate(-1.1deg) scale(.952); opacity: .82; }
.iceq-gallery--stack .iceq-gallery__item > a { background: transparent; }
.iceq-gallery--stack .iceq-gallery__item img,.page-layout--project .iceq-gallery--stack .iceq-gallery__item img { width: 100%!important; height: 100%!important; object-fit: cover!important; }
.iceq-gallery--stack .iceq-gallery__item.is-current img,.page-layout--project .iceq-gallery--stack .iceq-gallery__item.is-current img { object-fit: contain!important; }
.iceq-gallery--stack .iceq-gallery__item:not(.is-current) .iceq-gallery__overlay { display: none; }
.iceq-gallery--stack .iceq-gallery__item.is-current .iceq-gallery__overlay { opacity: 1; }
.iceq-stack-controls { position: relative; z-index: 7; margin-top: -18px; }

/* The template reveal animation is registered after plugins; keep it from flattening the deck. */
.motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item { opacity: 0; transform: translate3d(-50%,-46%,0) scale(.88); }
.motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-current { opacity: 1; transform: translate3d(-50%,-50%,48px) rotate(var(--iceq-stack-rotation,-.35deg)); }
.motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-next { opacity: 1; transform: translate3d(calc(-50% + 10px),calc(-50% + 10px),24px) rotate(2deg) scale(.988); }
.motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-after-next { opacity: .96; transform: translate3d(calc(-50% - 9px),calc(-50% + 19px),8px) rotate(-2.4deg) scale(.976); }
.motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-third-next { opacity: .9; transform: translate3d(calc(-50% + 6px),calc(-50% + 28px),-8px) rotate(1.4deg) scale(.964); }
.motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-fourth-next { opacity: .82; transform: translate3d(calc(-50% - 5px),calc(-50% + 36px),-24px) rotate(-1.1deg) scale(.952); }
.motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-current.is-dismissing { opacity: 0; transform: translate3d(calc(-50% + var(--iceq-stack-dismiss-x)),calc(-50% - 8px),70px) rotate(var(--iceq-stack-dismiss-rotation)) scale(1.02); }
@media(max-width:700px){
  .iceq-gallery--stack { --iceq-stack-height: clamp(340px,105vw,520px); width: 100%; }
  .iceq-gallery--stack .iceq-gallery__items { min-height: 340px; }
  .iceq-gallery--stack .iceq-gallery__item { max-width: calc(100% - 48px); max-height: 430px; }
  .motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-next { transform: translate3d(calc(-50% + 8px),calc(-50% + 9px),20px) rotate(1.8deg) scale(.985); }
  .motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-after-next { transform: translate3d(calc(-50% - 7px),calc(-50% + 16px),-12px) rotate(-2deg) scale(.97); }
  .motion-ready .iceq-gallery--stack.is-deck-ready .iceq-gallery__item.is-third-next { transform: translate3d(calc(-50% + 5px),calc(-50% + 23px),-35px) rotate(1.2deg) scale(.955); }
  .iceq-stack-controls { margin-top: -10px; }
}
