/* Carousel / photo-viewer styles for the gallery page. */

.gallery-thumbs {
   display: flex;
   flex-wrap: wrap;
   justify-content: center;
   margin: 10px 20px;
}

.gallery-thumb {
   padding: 0;
   margin: 4px;
   line-height: 0;
   background-color: #fff;
   border: 2px solid #999;
   border-radius: 4px;
   cursor: pointer;
}

.gallery-thumb:hover {
   border-color: #100057;
}

.gallery-thumb img {
   display: block;
   height: 110px;
   width: auto;
}

/* ------------------------------------------------------------------
   The floating photo window.

   The window has a FIXED size, so the bar at the top of it (which
   holds the arrows) stays in exactly the same place on the screen no
   matter how big or small the photo being shown is. The photo area
   below the bar scrolls if it ever needs to, so a photo is never
   cropped or truncated.
   ------------------------------------------------------------------ */

.lightbox {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.8);
   z-index: 1000;
   display: flex;
   align-items: center;
   justify-content: center;
}

.lightbox[hidden] {
   display: none;
}

.lightbox-window {
   position: relative;
   width: 92vw;
   max-width: 700px;
   height: 92vh;
   max-height: 740px;
   display: flex;
   flex-direction: column;
   background-color: #fff;
   border: 3px solid #000;
   border-radius: 6px;
   overflow: hidden;
}

/* The arrow bar sits at the top of the window, above the photo. */
.lightbox-bar {
   flex: 0 0 auto;
   display: flex;
   justify-content: center;
   align-items: center;
   padding: 6px 10px;
   background-color: #eee;
   border-bottom: 2px solid #000;
}

.lightbox-arrow {
   font-family: inherit;
   font-size: 1.6em;
   line-height: 1.1;
   padding: 2px 14px;
   margin: 0 10px;
   color: #000;
   background-color: #fff;
   border: 2px solid #000;
   border-radius: 6px;
   cursor: pointer;
}

.lightbox-arrow:hover {
   color: #fff;
   background-color: #100057;
}

.lightbox-counter {
   font-size: 1.1em;
}

.lightbox-close {
   position: absolute;
   top: 4px;
   right: 6px;
   font-family: inherit;
   font-size: 1.1em;
   line-height: 1.1;
   padding: 2px 8px;
   color: #000;
   background-color: #fff;
   border: 2px solid #000;
   border-radius: 6px;
   cursor: pointer;
}

.lightbox-close:hover {
   color: #fff;
   background-color: #100057;
}

/* The photo area takes up whatever is left below the bar. */
.lightbox-view {
   flex: 1 1 auto;
   overflow: auto;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 10px;
}

/* The photo is shown at its natural size, in full. The max-width and
   max-height rules only kick in if the photo is somehow too big for
   the window; the image area scrolls in that case, so it is never
   truncated or cropped. */
.lightbox-img {
   display: block;
   width: auto;
   height: auto;
   max-width: 100%;
   max-height: 100%;
}

/* Keep the page behind the floating window from scrolling. */
body.lightbox-open {
   overflow: hidden;
}
