/*
  Chaney Ancestry modern photo lightbox
  Replaces the legacy Shadowbox stylesheet.
*/

html.chaney-lightbox-open,
body.chaney-lightbox-open {
  overflow: hidden;
}

.chaney-lightbox[hidden] {
  display: none;
}

.chaney-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 54px 76px 70px;
  background: rgba(0, 0, 0, 0.88);
}

.chaney-lightbox__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

.chaney-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 1400px);
  max-height: calc(100vh - 150px);
  object-fit: contain;
  background: #111;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}

.chaney-lightbox__caption {
  box-sizing: border-box;
  max-width: min(92vw, 1400px);
  margin-top: 14px;
  padding: 8px 12px;
  color: #fff;
  font: 16px/1.4 Arial, Helvetica, sans-serif;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}

.chaney-lightbox__close,
.chaney-lightbox__prev,
.chaney-lightbox__next {
  position: fixed;
  z-index: 100000;
  border: 0;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
}

.chaney-lightbox__close:hover,
.chaney-lightbox__close:focus-visible,
.chaney-lightbox__prev:hover,
.chaney-lightbox__prev:focus-visible,
.chaney-lightbox__next:hover,
.chaney-lightbox__next:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.chaney-lightbox__close {
  top: 14px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 40px;
}

.chaney-lightbox__prev,
.chaney-lightbox__next {
  top: 50%;
  width: 54px;
  height: 72px;
  margin-top: -36px;
  border-radius: 8px;
  font-size: 62px;
}

.chaney-lightbox__prev {
  left: 12px;
}

.chaney-lightbox__next {
  right: 12px;
}

@media (max-width: 700px) {
  .chaney-lightbox {
    padding: 54px 14px 72px;
  }

  .chaney-lightbox__image {
    max-width: 96vw;
    max-height: calc(100vh - 140px);
  }

  .chaney-lightbox__prev,
  .chaney-lightbox__next {
    top: auto;
    bottom: 10px;
    width: 58px;
    height: 48px;
    margin-top: 0;
    font-size: 44px;
  }

  .chaney-lightbox__prev {
    left: calc(50% - 72px);
  }

  .chaney-lightbox__next {
    right: calc(50% - 72px);
  }

  .chaney-lightbox__caption {
    font-size: 14px;
  }
}
