/* EWB 3.0.0: shared gallery correction, 7 September 2026. */
.ewb-lightbox .ewb-lightbox-dialog {
  box-sizing:border-box;
  width:min(980px,calc(100vw - 24px));
  height:min(760px,calc(100vh - 24px));
  height:min(760px,calc(100dvh - 24px));
  max-height:calc(100dvh - 24px);
  grid-template-rows:minmax(0,1fr) auto;
}
.ewb-lightbox .ewb-lightbox-stage {
  display:block;
  position:relative;
  min-width:0;
  min-height:0;
  padding:0;
}
.ewb-lightbox .ewb-lightbox-stage > img {
  position:absolute!important;
  inset:54px 60px 14px!important;
  width:calc(100% - 120px)!important;
  height:calc(100% - 68px)!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  object-fit:contain!important;
  object-position:center!important;
  border-radius:0;
  box-shadow:none;
}
.ewb-lightbox .ewb-lightbox-footer {min-width:0;gap:10px;flex-wrap:wrap}
.ewb-lightbox .ewb-lightbox-caption {min-width:0;flex:1 1 180px;white-space:normal;overflow-wrap:anywhere;font-size:.85rem;line-height:1.35;max-height:3.6em;overflow:auto}
.ewb-lightbox .ewb-lightbox-counter {margin-left:auto}
.ewb-lightbox.is-single-image .ewb-lightbox-stage > img {left:24px!important;right:24px!important;width:calc(100% - 48px)!important}
.ewb-lightbox-direct {font-size:.8rem;font-weight:700;color:#155b9f;white-space:nowrap}
.ewb-lightbox .ewb-lightbox-error {position:absolute;inset:54px 60px 14px;display:grid;place-content:center;text-align:center;padding:16px;color:#173653}
.ewb-lightbox .ewb-lightbox-error[hidden],.ewb-lightbox .ewb-lightbox-stage > img[hidden] {display:none!important}

/* Override the legacy masonry gallery's second hover label. */
.project-gallery-v5.project-gallery-v11 a.project-slideshow-slide-v12::after {content:none!important;display:none!important}
.project-gallery-v5.project-gallery-v11 .project-slideshow-open-v12 {opacity:1;transform:none}
.project-gallery-v5.project-gallery-v11 .project-slideshow-thumbs-v12 {justify-content:flex-start;scroll-padding:12px}
.project-contact-grid-v18 {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0 22px}
.project-contact-grid-v18 .project-contact-item-v18 {min-width:0;padding:12px 15px;border:1px solid #d8e4ee;border-radius:12px;background:#f6faff;overflow-wrap:anywhere;line-height:1.6}
.gf-lead-grid {grid-template-columns:repeat(3,minmax(0,1fr))}

/* A definite image box avoids percentage-height grid sizing in all engines. */
#ewbGenericModal.ewb-modal-image .ewb-modal-body {position:relative!important;display:block!important;min-width:0!important;min-height:0!important;overflow:hidden!important;padding:0!important}
#ewbGenericModal.ewb-modal-image .ewb-modal-body > img {
  position:absolute!important;inset:12px!important;
  width:calc(100% - 24px)!important;height:calc(100% - 24px)!important;
  max-width:none!important;max-height:none!important;margin:0!important;transform:none!important;
  object-fit:contain!important;object-position:center!important;
}
#ewbGenericModal .ewb-modal-body > [hidden] {display:none!important}
@media(max-width:760px) {
  .ewb-lightbox {padding:12px!important}
  .ewb-lightbox .ewb-lightbox-stage > img {inset:52px 12px 56px!important;width:calc(100% - 24px)!important;height:calc(100% - 108px)!important}
  .ewb-lightbox .ewb-lightbox-nav {top:auto;bottom:8px;transform:none}
  .ewb-lightbox.is-single-image .ewb-lightbox-stage > img {left:14px!important;right:14px!important;bottom:12px!important;width:calc(100% - 28px)!important;height:calc(100% - 64px)!important}
  .ewb-lightbox .ewb-lightbox-error {inset:52px 42px 12px}
  .ewb-lightbox .ewb-lightbox-footer {padding:10px 12px}
  .project-contact-grid-v18,.gf-lead-grid {grid-template-columns:minmax(0,1fr)}
}
