/*
 * Full-size photograph overlay shared by articles and slideshows.
 * The page remains fixed beneath it so closing returns to the same sentence.
 */
.ipms-photo-lightbox[hidden] {
  display: none;
}

.ipms-photo-lightbox {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(.5rem, 2vw, 1.5rem);
  color: #fff;
}

.ipms-photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 13, 27, .92);
  backdrop-filter: blur(4px);
}

.ipms-photo-lightbox-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(96rem, 100%);
  height: min(58rem, calc(100dvh - clamp(1rem, 4vw, 3rem)));
  max-height: calc(100vh - 1rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .38);
  background: #09172b;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .55);
}

.ipms-photo-lightbox-panel > header,
.ipms-photo-lightbox-panel > footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem clamp(.75rem, 2vw, 1.25rem);
  background: #101b33;
}

.ipms-photo-lightbox-panel > header {
  border-bottom: 1px solid rgba(255, 255, 255, .28);
}

.ipms-photo-lightbox-panel > footer {
  border-top: 1px solid rgba(255, 255, 255, .28);
}

.ipms-photo-lightbox-panel > header > div {
  min-width: 0;
}

.ipms-photo-lightbox-panel > header strong {
  display: block;
  font: 800 .78rem/1.25 "DM Sans", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ipms-photo-lightbox-panel > header [data-lightbox-caption] {
  display: block;
  max-width: 70ch;
  margin-top: .2rem;
  overflow: hidden;
  color: #d8dee8;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ipms-photo-lightbox button {
  min-width: 2.9rem;
  min-height: 2.75rem;
  padding: .55rem .85rem;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: 800 .76rem/1 "DM Sans", sans-serif;
  cursor: pointer;
}

.ipms-photo-lightbox button:hover,
.ipms-photo-lightbox button:focus-visible {
  border-color: #f2b84b;
  outline: none;
  background: #f2b84b;
  color: #101b33;
}

.ipms-photo-lightbox [data-lightbox-close] span {
  margin-left: .35rem;
  font-size: 1.2rem;
  line-height: .5;
}

.ipms-photo-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%) 0 0 / 2rem 2rem,
    linear-gradient(-45deg, rgba(255, 255, 255, .035) 25%, transparent 25%) 0 0 / 2rem 2rem,
    #07111f;
  touch-action: none;
  user-select: none;
}

.ipms-photo-lightbox-stage img {
  flex: 0 0 auto;
  align-self: center;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
  object-position: center center;
  transform-origin: center;
  transition: transform 120ms ease-out;
  will-change: transform;
  pointer-events: none;
}

.ipms-photo-lightbox-stage.is-zoomed {
  cursor: grab;
}

.ipms-photo-lightbox-stage.is-dragging {
  cursor: grabbing;
}

.ipms-photo-lightbox-stage.is-dragging img {
  transition: none;
}

.ipms-photo-lightbox-zoom {
  display: grid;
  grid-template-columns: repeat(3, minmax(3rem, auto));
}

.ipms-photo-lightbox-zoom button + button {
  border-left: 0;
}

.ipms-photo-lightbox-panel > footer p {
  margin: 0;
  color: #d8dee8;
  font-size: .75rem;
  text-align: right;
}

/* The JavaScript supplies the fixed positioning needed by mobile Safari. */
body.ipms-photo-lightbox-open {
  overflow: hidden;
}

[data-ipms-lightbox] img,
.review-inline-figure a img,
.static-article-image a img {
  cursor: zoom-in;
}

@media (max-width: 44rem) {
  .ipms-photo-lightbox {
    padding: 0;
  }

  .ipms-photo-lightbox-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100vh;
    border: 0;
  }

  .ipms-photo-lightbox-panel > header [data-lightbox-caption] {
    max-width: 52vw;
  }

  .ipms-photo-lightbox-panel > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .ipms-photo-lightbox-zoom {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .ipms-photo-lightbox-panel > footer p {
    font-size: .7rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ipms-photo-lightbox-stage img {
    transition: none;
  }
}
