/* Owner-supplied equipment photography on the equipment overview pages. */
.equipment-photo-hero__picture {
  position: absolute;
  inset: 0;
  display: block;
}

.equipment-photo-gallery {
  padding-block: clamp(3.25rem, 6vw, 5.25rem);
}

.equipment-photo-gallery__heading {
  max-width: 62rem;
  margin: 0 0 clamp(1.75rem, 3.5vw, 2.5rem);
  text-align: left;
}

.equipment-photo-gallery__heading p:last-child {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--text-muted, #5b6374);
}

.equipment-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(1.25rem, 2.8vw, 2.25rem);
}

.equipment-photo {
  min-width: 0;
  margin: 0;
}

.equipment-photo__open {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--muted-surface, #f1eee9);
  box-shadow: 0 2px 6px rgba(27, 35, 71, .08), 0 14px 30px rgba(27, 35, 71, .08);
  color: inherit;
  cursor: zoom-in;
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out);
}

.equipment-photo__open:focus-visible {
  outline-offset: 4px;
}

.equipment-photo__open picture {
  display: block;
  width: 100%;
  height: 100%;
}

.equipment-photo__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .22s var(--ease-out);
}

.equipment-photo__open:hover,
.equipment-photo__open:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(27, 35, 71, .12), 0 18px 38px rgba(27, 35, 71, .12);
}

.equipment-photo__open:hover .equipment-photo__image,
.equipment-photo__open:focus-visible .equipment-photo__image {
  transform: scale(1.025);
}

.equipment-photo__model {
  margin-top: .9rem;
  color: var(--text-muted, #5b6374);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.section--navy .equipment-photo__model {
  color: rgba(255, 255, 255, .82);
}

.equipment-photo-dialog {
  width: max-content;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 18px;
  background: #111522;
  color: #fff;
  color-scheme: dark;
}

.equipment-photo-dialog::backdrop {
  background: rgba(7, 10, 20, .9);
}

.equipment-photo-dialog__content {
  display: grid;
  justify-items: center;
  gap: .8rem;
}

.equipment-photo-dialog__top {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}

.equipment-photo-dialog__image {
  display: block;
  width: min(calc(100vw - 4rem), calc(80vh - 11.2rem), 720px);
  width: min(calc(100vw - 4rem), calc(80dvh - 11.2rem), 720px);
  height: auto;
  max-height: min(900px, calc(100vh - 14rem));
  max-height: min(900px, calc(100dvh - 14rem));
  object-fit: contain;
}

.equipment-photo-dialog__model {
  color: rgba(255, 255, 255, .82);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.equipment-photo-dialog__controls {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
}

.equipment-photo-dialog button {
  min-height: 44px;
  padding: .55rem 1rem;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}

.equipment-photo-dialog button:hover {
  background: rgba(255, 255, 255, .17);
}

@media (max-width: 920px) {
  .equipment-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .equipment-photo-gallery {
    padding-block: 2.75rem;
  }

  .equipment-photo-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .equipment-photo__open,
  .equipment-photo__image {
    transition: none;
  }

  .equipment-photo__open:hover,
  .equipment-photo__open:focus-visible {
    transform: none;
  }

  .equipment-photo__open:hover .equipment-photo__image,
  .equipment-photo__open:focus-visible .equipment-photo__image {
    transform: none;
  }
}

@media (min-width: 721px) {
  .equipment-photo-gallery { padding-block: clamp(3rem, 5vw, 4rem); }
  .equipment-photo-gallery:where(.section--muted:has(+ .section--muted)),
  .equipment-photo-gallery:where(.section--muted + .section--muted) {
    padding-block: clamp(1.75rem, 2.2vw, 2rem);
  }
}
