/* www.flatline.tv -- shared image lightbox, used by the sheet pages and /upload */

body.kephrii-lightbox-open {overflow: hidden;}

#kephrii-lightbox {
  background: rgba(0,0,0,.88);
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  box-sizing: border-box;
}
#kephrii-lightbox.is-open {
  display: flex;
  animation: kephrii-lightbox-fade .18s ease;
}

#kephrii-lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  max-height: 100%;
}

#kephrii-lightbox-image {
  background: rgba(255,255,255,.04);
  border: solid 3px #cc9933;
  box-sizing: border-box;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  opacity: 0;
  transition: opacity .2s ease;
}
#kephrii-lightbox-image.ready {opacity: 1;}

#kephrii-lightbox-bar {
  background: #151515;
  border: solid 3px #cc9933;
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 12px 12px 18px;
}
#kephrii-lightbox-label {
  display: flex;
  align-items: baseline;
  min-width: 0;
}
#kephrii-lightbox-caption {
  font-family: 'Silka Bold', sans-serif;
  font-size: 15px;
  color: #f7efde;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#kephrii-lightbox-counter {
  font-family: 'Silka SemiBold', sans-serif;
  font-size: 13px;
  color: #cc9933;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}
#kephrii-lightbox-counter.hidden {display: none;}

#kephrii-lightbox-copy {
  font-family: 'Silka Bold', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: #cc9933;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 15px;
  padding: 12px 18px;
}
#kephrii-lightbox-copy:hover {background: #926e25;}
#kephrii-lightbox-copy.copied {background: #f7efde; color: #151515;}
#kephrii-lightbox-copy.hidden {display: none;}

#kephrii-lightbox-close {
  font-family: 'Silka Bold', sans-serif;
  font-size: 34px;
  line-height: 1;
  color: #f7efde;
  background: transparent;
  border: solid 3px transparent;
  cursor: pointer;
  width: 54px;
  height: 54px;
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 0px;
  transition: color .15s ease, border-color .15s ease;
}
#kephrii-lightbox-close:hover {color: #cc9933; border-color: #cc9933;}

/* gallery arrows -- solid backing so they stay legible over any image */
#kephrii-lightbox-prev,
#kephrii-lightbox-next {
  font-family: 'Silka Bold', sans-serif;
  font-size: 40px;
  line-height: 1;
  color: #f7efde;
  background: rgba(21,21,21,.85);
  border: solid 3px #cc9933;
  cursor: pointer;
  width: 54px;
  height: 72px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0px 0px 4px 0px;
  transition: background .15s ease, color .15s ease;
}
#kephrii-lightbox-prev {left: 20px;}
#kephrii-lightbox-next {right: 20px;}
#kephrii-lightbox-prev:hover,
#kephrii-lightbox-next:hover {background: #cc9933; color: #151515;}
#kephrii-lightbox-prev.hidden,
#kephrii-lightbox-next.hidden {display: none;}

/* make room at the sides so the arrows don't sit on top of the image */
#kephrii-lightbox.has-gallery {padding-left: 100px; padding-right: 100px;}

/* sheet-page links that resolve to a kephrii.com image get a zoom cursor
   instead of the usual "opens elsewhere" arrow affordance */
a.link.opens-preview {cursor: zoom-in;}

@keyframes kephrii-lightbox-fade {
  from {opacity: 0;}
  to   {opacity: 1;}
}

@media only screen and (max-width: 550px) {
  #kephrii-lightbox {padding: 70px 15px 15px 15px;}
  #kephrii-lightbox-image {max-height: calc(100vh - 220px);}
  #kephrii-lightbox-bar {width: 100%;}
  #kephrii-lightbox-close {top: 10px; right: 10px;}

  /* no room to flank the image on a phone, so the arrows sit over its edges --
     still vertically centred, which keeps them on the image rather than
     stranded in the empty space below it */
  #kephrii-lightbox.has-gallery {padding-left: 15px; padding-right: 15px;}
  #kephrii-lightbox-prev,
  #kephrii-lightbox-next {
    width: 44px;
    height: 58px;
    font-size: 32px;
  }
  #kephrii-lightbox-prev {left: 8px;}
  #kephrii-lightbox-next {right: 8px;}
}
