.wd23-gallery-trigger { cursor: zoom-in; }
.wd23-gallery-trigger:focus-visible { outline: 3px solid #d2a04c; outline-offset: 5px; }
.wd23-gallery-dialog[hidden] { display: none !important; }
.wd23-gallery-dialog {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem;
  align-items: center;
  gap: clamp(.25rem, 1vw, 1rem);
  padding: clamp(.75rem, 2vw, 1.5rem);
  background: rgba(10, 10, 10, .97);
  color: #fff;
}
body:has(.wd23-gallery-dialog:not([hidden])) { overflow: hidden; }
.wd23-gallery-dialog__figure {
  display: grid;
  place-items: center;
  gap: .5rem;
  min-width: 0;
  margin: 0;
}
.wd23-gallery-dialog__figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 6rem);
  width: auto;
  height: auto;
  object-fit: contain;
}
.wd23-gallery-dialog__figure figcaption {
  color: #e8e8e8;
  font: 600 .9rem/1.4 system-ui, sans-serif;
  letter-spacing: .08em;
}
.wd23-gallery-dialog button {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  background: rgba(24,24,24,.75);
  color: #fff;
  font: 300 2rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.wd23-gallery-dialog button:hover,
.wd23-gallery-dialog button:focus-visible {
  background: #fff;
  color: #161616;
  outline: 2px solid #d2a04c;
  outline-offset: 3px;
}
.wd23-gallery-dialog__close { position: absolute; top: clamp(.75rem, 2vw, 1.5rem); right: clamp(.75rem, 2vw, 1.5rem); z-index: 1; }
.wd23-gallery-dialog__nav--prev { grid-column: 1; grid-row: 1; }
.wd23-gallery-dialog__figure { grid-column: 2; grid-row: 1; }
.wd23-gallery-dialog__nav--next { grid-column: 3; grid-row: 1; }
@media (max-width: 600px) {
  .wd23-gallery-dialog { grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; gap: .15rem; padding: .5rem; }
  .wd23-gallery-dialog button { width: 2.75rem; height: 2.75rem; }
  .wd23-gallery-dialog__figure img { max-height: calc(100dvh - 6.5rem); }
}

/* Gallery controls share the navigation menu's clean line treatment. */
.wd23-gallery-dialog button { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.wd23-gallery-dialog button:hover, .wd23-gallery-dialog button:focus-visible { background: transparent; color: var(--essential-gold, #d2a04c); }
.wd23-gallery-dialog__nav svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease, color .25s ease; }
.wd23-gallery-dialog__nav--prev:hover svg { transform: translateX(-4px); }
.wd23-gallery-dialog__nav--next:hover svg { transform: translateX(4px); }
.wd23-gallery-dialog__close-lines { position: relative; display: block; width: 1.7rem; height: 1.7rem; transition: transform .3s ease; }
.wd23-gallery-dialog__close-lines span { position: absolute; top: 50%; left: 0; width: 100%; height: 1.5px; background: currentColor; transform: rotate(45deg); transition: transform .3s ease; }
.wd23-gallery-dialog__close-lines span + span { transform: rotate(-45deg); }
.wd23-gallery-dialog__close:hover .wd23-gallery-dialog__close-lines { transform: rotate(90deg); }
.wd23-gallery-dialog__figure figcaption { font-size: .76rem; letter-spacing: .12em; }

/* Keep gallery arrow focus visible through its stroke without a bounding box. */
.wd23-gallery-dialog button:is(:hover, :focus, :focus-visible) {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Show the complete source photograph in the scrolling gallery. */
.essential-project-story__slide .essential-project-story__image-mask img { height: auto !important; max-height: none !important; object-fit: contain !important; }
