.ez-bento-gallery {
  --ez-bento-bg: #02070c;
  --ez-bento-panel: #0b1924;
  --ez-bento-line: #294757;
  --ez-bento-text: #f5f8fa;
  --ez-bento-muted: #a9bac4;
  --ez-bento-accent: #35dce4;
  --ez-bento-cell: 320px;
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ez-bento-text);
  background: rgba(2, 7, 12, 0.97);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.ez-bento-gallery.is-open { opacity: 1; visibility: visible; }
.ez-bento-gallery * { box-sizing: border-box; }
.ez-bento-gallery.is-lightbox-open .ez-bento-head,
.ez-bento-gallery.is-lightbox-open .ez-bento-rail-wrap {
  visibility: hidden;
  pointer-events: none;
}

.ez-bento-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ez-bento-rail-nav { width: 44px; height: 44px; padding: 0; border-radius: 50%; font: 34px/1 Arial, sans-serif; }
.ez-bento-rail-nav:disabled { opacity: 0.3; cursor: default; }
.ez-bento-rail-nav:focus-visible { outline: 2px solid var(--ez-bento-accent); outline-offset: 3px; }
.ez-bento-rail { transition: transform 0.25s ease; }
.ez-bento-rail-wrap.is-dragging .ez-bento-rail { transition: none; }

.ez-bento-head {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 24px;
  padding: 26px clamp(22px, 4vw, 64px) 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ez-bento-heading { min-width: 0; }
.ez-bento-heading h2 { display: flex; align-items: center; gap: 9px; margin: 0; color: #fff; font-size: clamp(28px, 3.4vw, 48px); line-height: 1.12; }
.ez-bento-title-icon { display: block; flex: 0 0 auto; width: 0.78em; height: 0.78em; transform-origin: center; transform-style: preserve-3d; backface-visibility: visible; will-change: transform; filter: drop-shadow(0 0 7px rgba(53, 220, 228, 0.72)); animation: ezBentoTitleIconFlip 3.4s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
.ez-bento-heading p { margin: 9px 0 0; color: var(--ez-bento-muted); font-size: 14px; }
.ez-bento-drag-hint { margin-left: auto; align-self: center; color: var(--ez-bento-muted); font-size: 13px; white-space: nowrap; }
.ez-bento-drag-hint strong { color: var(--ez-bento-accent); }

.ez-bento-rail-nav,
.ez-bento-close,
.ez-bento-lightbox-close,
.ez-bento-lightbox-nav {
  appearance: none;
  border: 1px solid #355365;
  color: #fff;
  background: #132531;
  cursor: pointer;
}

.ez-bento-close,
.ez-bento-lightbox-close {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.ez-bento-close:hover,
.ez-bento-lightbox-close:hover,
.ez-bento-lightbox-nav:hover { background: #203d4d; border-color: var(--ez-bento-accent); }

.ez-bento-rail-wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; cursor: grab; }
.ez-bento-rail-wrap.is-dragging { cursor: grabbing; }
.ez-bento-rail-wrap::before,
.ez-bento-rail-wrap::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  width: 64px;
  pointer-events: none;
}
.ez-bento-rail-wrap::before { left: 0; background: linear-gradient(90deg, var(--ez-bento-bg), transparent); }
.ez-bento-rail-wrap::after { right: 0; background: linear-gradient(-90deg, var(--ez-bento-bg), transparent); }

.ez-bento-rail {
  min-height: 100%;
  display: grid;
  grid-auto-flow: column dense;
  grid-template-rows: repeat(2, var(--ez-bento-cell));
  grid-auto-columns: var(--ez-bento-cell);
  align-content: center;
  gap: 14px;
  width: max-content;
  padding: 8px clamp(24px, 5vw, 74px) 34px;
  transform: translate3d(0, 0, 0);
  touch-action: pan-y;
  user-select: none;
}

.ez-bento-tile {
  appearance: none;
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ez-bento-line);
  border-radius: 18px;
  color: #fff;
  background: var(--ez-bento-panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  text-align: left;
  cursor: pointer;
  animation: ezBentoRise 0.52s both;
}
.ez-bento-tile.is-feature { grid-column: span 2; grid-row: span 2; }
.ez-bento-tile.is-tall { grid-row: span 2; }
.ez-bento-tile.is-wide { grid-column: span 2; }
.ez-bento-tile > img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform 0.55s ease, filter 0.35s ease; }
.ez-bento-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 46%, rgba(0, 7, 12, 0.9)); opacity: 0.42; pointer-events: none; transition: opacity 0.35s ease; }
.ez-bento-tile:hover > img { transform: scale(1.035); filter: brightness(0.88); }
.ez-bento-tile:hover::after { opacity: 1; }
.ez-bento-tile:focus-visible { outline: 2px solid #0dfc9b; outline-offset: 3px; }

.ez-bento-caption { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 16px; opacity: 0; transform: translateY(8px); pointer-events: none; text-shadow: 0 1px 5px #000; transition: opacity 0.35s ease, transform 0.35s ease; }
.ez-bento-caption .gallery-caption-title { display: block; margin: 0 0 5px; color: #fff; font-size: 16px; font-weight: 800; line-height: 1.35; }
.ez-bento-caption .gallery-caption-text { display: -webkit-box; overflow: hidden; color: #d2dde3; font-size: 12px; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ez-bento-tile.is-feature .ez-bento-caption,
.ez-bento-tile.is-wide .ez-bento-caption { right: auto; width: 60%; }
.ez-bento-tile:hover .ez-bento-caption,
.ez-bento-tile:focus-visible .ez-bento-caption { opacity: 1; transform: none; }

.ez-bento-lightbox {
  position: absolute;
  inset: 0;
  z-index: 12010;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.94);
  opacity: 0;
  visibility: hidden;
  isolation: isolate;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.ez-bento-lightbox.is-open { opacity: 1; visibility: visible; }
.ez-bento-lightbox figure { position: relative; display: grid; place-items: center; width: 90vw; height: 90vh; margin: 0; }
.ez-bento-lightbox-image { display: block; width: auto; height: auto; max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 13px; box-shadow: 0 24px 72px rgba(0, 0, 0, 0.65); }
.ez-bento-lightbox-caption { position: absolute; left: 50%; bottom: 6px; width: min(780px, calc(100% - 42px)); padding: 13px 18px 14px; transform: translateX(-50%); border: 1px solid rgba(108, 197, 210, 0.38); border-radius: 12px; color: #fff; background: rgba(3, 13, 20, 0.62); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-align: left; }
.ez-bento-lightbox-caption .gallery-caption-title { display: block; margin-bottom: 4px; color: #62e5e9; font-size: 15px; font-weight: 800; line-height: 1.4; }
.ez-bento-lightbox-caption .gallery-caption-text { display: block; color: #f3f6f8; font-size: 13px; line-height: 1.65; }
.ez-bento-lightbox-counter { position: absolute; left: 22px; top: 20px; z-index: 2; min-width: 64px; padding: 8px 12px; border-radius: 999px; color: #fff; background: rgba(7, 22, 31, 0.88); font-size: 13px; text-align: center; }
.ez-bento-lightbox-close { position: absolute; z-index: 3; right: 22px; top: 18px; }
.ez-bento-lightbox-nav { position: absolute; z-index: 3; top: 50%; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-top: -32px; padding: 0; border-radius: 50%; color: #fff; background: rgba(19, 37, 49, 0.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); font-size: 0; line-height: 0; }
.ez-bento-lightbox-nav::before { display: block; font-family: Arial, Helvetica, sans-serif; font-size: 44px; font-weight: 400; line-height: 1; transform: translateY(-2px); }
.ez-bento-lightbox-nav:hover { background: rgba(32, 61, 77, 0.82); }
.ez-bento-lightbox-prev { left: calc(5vw - 42.67px); }
.ez-bento-lightbox-prev::before { content: "\2039"; }
.ez-bento-lightbox-next { right: calc(5vw - 42.67px); }
.ez-bento-lightbox-next::before { content: "\203A"; }
.ez-bento-lightbox-nav:disabled { opacity: 0.25; cursor: default; }

@keyframes ezBentoRise { from { opacity: 0; transform: translateY(16px) scale(0.975); } to { opacity: 1; transform: none; } }
@keyframes ezBentoTitleIconFlip {
  0%, 14% { transform: perspective(180px) rotateY(0deg); }
  43%, 57% { transform: perspective(180px) rotateY(180deg); }
  86%, 100% { transform: perspective(180px) rotateY(0deg); }
}

/* Contact page: make the two gallery-entry ripples easier to notice. */
.xb-contact-items .xb-item--location .open-gallery-btn::before,
.xb-contact-items .xb-item--location .open-gallery-btn::after {
  inset: -1px;
  border: 1px solid #0dfc9b;
  box-shadow: 0 0 6px rgba(13, 252, 155, 0.42), inset 0 0 4px rgba(13, 252, 155, 0.16);
  animation: ezGalleryButtonRipple 1.9s cubic-bezier(0.2, 0.65, 0.3, 1) infinite;
}
.xb-contact-items .xb-item--location .open-gallery-btn::after {
  border-color: #35dce4;
  box-shadow: 0 0 8px rgba(53, 220, 228, 0.38);
  animation-delay: 0.95s;
}
@keyframes ezGalleryButtonRipple {
  0% { opacity: 0.58; transform: scale(1); filter: blur(0); }
  55% { opacity: 0.26; }
  100% { opacity: 0; transform: scale(1.24, 1.41); filter: blur(2px); }
}

@media (max-width: 767px) {
  .ez-bento-gallery {
    --ez-bento-cell: 44vw !important;
    padding: 0 !important;
    box-sizing: border-box;
    overflow-y: auto;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    background: #02070c;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .ez-bento-head { flex-wrap: wrap; align-items: center; gap: 12px; padding: max(15px, env(safe-area-inset-top)) 16px 12px; }
  .ez-bento-heading { flex: 1 1 100%; }
  .ez-bento-controls { margin-left: auto; }
  .ez-bento-heading h2 { font-size: 25px; }
  .ez-bento-title-icon { width: 22px; height: 22px; }
  .ez-bento-heading p { margin-top: 5px; font-size: 12px; }
  .ez-bento-drag-hint { display: none; }
  .ez-bento-close,
  .ez-bento-lightbox-close { flex-basis: 46px; width: 46px; height: 46px; }
  .ez-bento-rail-wrap::before,
  .ez-bento-rail-wrap::after { width: 20px; }
  .ez-bento-rail { min-height: 100%; grid-template-rows: repeat(2, var(--ez-bento-cell)); grid-auto-columns: var(--ez-bento-cell); gap: 12px; padding: 8px 16px 18px; }
  .ez-bento-tile,
  .ez-bento-tile.is-feature,
  .ez-bento-tile.is-tall,
  .ez-bento-tile.is-wide { grid-column: span 1; grid-row: span 1; aspect-ratio: 1; }
  .ez-bento-caption,
  .ez-bento-tile.is-feature .ez-bento-caption,
  .ez-bento-tile.is-wide .ez-bento-caption { left: 15px; right: 15px; bottom: 14px; width: auto; }
  .ez-bento-caption .gallery-caption-title { font-size: 15px; }
  .ez-bento-caption .gallery-caption-text { display: -webkit-box; font-size: 12px; -webkit-line-clamp: 3; }
  .ez-bento-lightbox {
    height: 100%;
    min-height: 100%;
    background: #000;
  }
  .ez-bento-lightbox figure { width: 94vw; height: 88%; }
  .ez-bento-lightbox-image { max-width: 94vw; max-height: 100%; border-radius: 9px; }
  .ez-bento-lightbox-caption { bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100% - 20px); padding: 11px 13px 12px; }
  .ez-bento-lightbox-caption .gallery-caption-title { font-size: 14px; }
  .ez-bento-lightbox-caption .gallery-caption-text { max-height: 4.9em; overflow-y: auto; font-size: 12px; line-height: 1.55; }
  .ez-bento-lightbox-counter { left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); }
  .ez-bento-lightbox-close { right: max(12px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); }
  .ez-bento-lightbox-nav { top: 50%; bottom: auto; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; }
  .ez-bento-lightbox-prev { left: clamp(2px, calc(3vw - 16px), 12px); }
  .ez-bento-lightbox-next { right: clamp(2px, calc(3vw - 16px), 12px); }
}

/* Mobile gallery controls stay separate from the photo grid. */
@media (max-width: 767px) {
  .ez-bento-head { padding-top: max(76px, calc(env(safe-area-inset-top) + 64px)); }
  .ez-bento-controls { display: contents; }
  .ez-bento-rail-nav {
    position: absolute;
    top: var(--ez-bento-rail-center, 50%);
    z-index: 5;
    transform: translateY(-50%);
    background: rgba(19, 37, 49, 0.88);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
  }
  .ez-bento-close,
  .ez-bento-lightbox-close {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    inline-size: 46px;
    block-size: 46px;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    padding: 0;
    border-radius: 999px !important;
    line-height: 1;
  }
  .ez-bento-rail-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    max-width: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0;
    font-size: 0;
    line-height: 0;
  }
  .ez-bento-rail-nav::before {
    content: "";
    display: block;
    width: 11px;
    height: 11px;
    border-top: 3px solid currentColor;
    border-right: 3px solid currentColor;
  }
  .ez-bento-rail-prev::before { transform: translateX(2px) rotate(-135deg); }
  .ez-bento-rail-next::before { transform: translateX(-2px) rotate(45deg); }
  .ez-bento-rail-prev { left: max(8px, env(safe-area-inset-left)); }
  .ez-bento-rail-next { right: max(8px, env(safe-area-inset-right)); }
  .ez-bento-gallery > .ez-bento-head { position: static; }
  .ez-bento-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
  }
  .ez-bento-rail-wrap {
    flex-shrink: 0;
    min-height: calc(2 * var(--ez-bento-cell) + 32px);
    margin-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .ez-bento-rail { gap: 6px; }
}

@media (hover: none) {
  .ez-bento-tile:hover > img { transform: none; filter: none; }
  .ez-bento-tile:hover::after { opacity: 0.42; }
  .ez-bento-tile:hover .ez-bento-caption { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .ez-bento-gallery *, .ez-bento-gallery { animation: none !important; transition: none !important; }
}
