/* Communique Consultancy — fullscreen image gallery.
   Matches #gallery.gallery-fullscreen-section in index.html. */

#gallery.gallery-fullscreen-section {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #f4f7fb !important;
  isolation: isolate;
}

#gallery.gallery-fullscreen-section::before,
#gallery.gallery-fullscreen-section::after {
  display: none !important;
  content: none !important;
}

/* Override the older desktop rule that offsets section children by 68px. */
#gallery.gallery-fullscreen-section > .gallery-fullscreen-stage {
  position: relative !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  display: block !important;
  width: 100% !important;
  height: calc(100svh - var(--header-h, 88px)) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  isolation: isolate;
  outline: none;
  background: #f4f7fb;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

#gallery .gallery-fullscreen-stage:active { cursor: grabbing; }

#gallery .gallery-atmosphere {
  position: absolute;
  z-index: -1;
  inset: -5%;
  background-position: center;
  background-size: cover;
  filter: blur(30px) saturate(.82);
  opacity: .2;
  transform: scale(1.08);
  transition: background-image .7s ease, opacity .7s ease;
  pointer-events: none;
}

#gallery .gallery-fullscreen-stage::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.04), rgba(245,249,255,0) 48%, rgba(255,255,255,.04));
}

#gallery .gallery-image-frame {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#gallery .gallery-slide-image {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
  /* Explicitly remove the old -50px image offset. */
  translate: none !important;
  opacity: 0;
  filter: blur(5px);
  transform: scale(1.025) translate3d(0, .5%, 0);
  transition: opacity .86s cubic-bezier(.22,.75,.22,1), transform 1.1s cubic-bezier(.2,.72,.25,1), filter .86s ease;
  will-change: opacity, transform, filter;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

#gallery .gallery-slide-image.is-active {
  opacity: 1;
  filter: blur(0);
  transform: scale(1) translate3d(0, 0, 0);
  animation: communiqueGalleryDrift 9s ease-in-out both;
}

#gallery .gallery-slide-image.is-leaving {
  opacity: 0;
  filter: blur(5px);
  transform: scale(.985) translate3d(0, -.35%, 0);
}

@keyframes communiqueGalleryDrift {
  0% { transform: scale(1) translate3d(0,0,0); }
  100% { transform: scale(1.026) translate3d(.22%,-.12%,0); }
}

/* Keep the Explore CTA visible and separate from the fixed sound orb. */
/* #gallery .gallery-explore-perspective {
  position: absolute !important;
  z-index: 30 !important;
  top: auto !important;
  right: clamp(124px, 9vw, 156px) !important;
  bottom: clamp(18px, 2.5vh, 30px) !important;
  left: auto !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  width: auto;
  max-width: calc(100% - 180px);
  margin: 0 !important;
  padding: 7px 12px 7px 14px;
  border: 1px solid rgba(20, 36, 58, .28);
  border-radius: 999px;
  color: #172b47;
  background: rgba(255,255,255,.94);
  box-shadow: 0 7px 24px rgba(25, 43, 67, .16);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font: 600 10px/1.1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .035em;
  white-space: nowrap;
  cursor: pointer;
  transition: background .22s ease, border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}

#gallery .gallery-explore-perspective:hover {
  background: #fff;
  border-color: rgba(177, 133, 52, .8);
  box-shadow: 0 9px 28px rgba(25, 43, 67, .2);
  transform: translateY(-2px);
}

#gallery .gallery-explore-perspective:focus-visible {
  outline: 2px solid #b58a3f;
  outline-offset: 3px;
}

#gallery .gallery-explore-perspective span {
  color: #b58a3f;
  font-size: 14px;
  line-height: 1;
}

#gallery .gallery-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 760px) {
  #gallery.gallery-fullscreen-section > .gallery-fullscreen-stage {
    height: calc(100dvh - var(--header-h, 74px)) !important;
    min-height: 0 !important;
  }

  #gallery .gallery-slide-image {
    object-fit: cover !important;
    object-position: center center !important;
  }

  #gallery .gallery-explore-perspective {
    right: calc(104px + env(safe-area-inset-right, 0px)) !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 30px;
    max-width: calc(100% - 116px);
    padding: 6px 10px 6px 11px;
    gap: 7px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #gallery .gallery-slide-image,
  #gallery .gallery-explore-perspective,
  #gallery .gallery-atmosphere {
    animation: none !important;
    transition-duration: .01ms !important;
  }*/
}
