/* =========================
   PHOTO GALLERY
   ========================= */


.gallery {
  width: 650px;

  margin: 15px auto 25px;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}


/* =========================
   GENERAL THUMBNAIL STYLE
   ========================= */

#gallery img {
  display: block;

  width: 100% !important;
  height: 150px !important;

  margin: 0 !important;
  padding: 0 !important;

  object-fit: cover;
  object-position: center top;

  border: 1px solid #ccc;
  border-radius: 4px;

  box-sizing: border-box;

  cursor: pointer;

  transition:
    transform .18s ease,
    box-shadow .18s ease;
}

#gallery img:hover {
  transform: scale(1.04);

  box-shadow: 0 4px 10px rgba(0, 0, 0, .22);

  position: relative;
  z-index: 2;
}


/* =========================
   LIGHTBOX
   ========================= */

.lightbox {
  position: fixed;
  inset: 0;

  display: none;

  align-items: center;
  justify-content: center;

  padding: 40px 70px;

  background: rgba(0, 0, 0, .9);

  box-sizing: border-box;
  overflow: hidden;

  z-index: 9999;
}

.lightbox.open {
  display: flex;
}


/* =========================
   LIGHTBOX CONTENT
   ========================= */

.lightbox__content {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;

  width: fit-content;
  height: auto;

  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 80px);

  margin: 0;
  padding: 0;

  box-sizing: border-box;
}


/* =========================
   LIGHTBOX IMAGE
   ========================= */

#lightbox .lightbox__img {
  display: block;

  width: auto !important;
  height: auto !important;

  max-width: calc(100vw - 140px) !important;
  max-height: calc(100vh - 180px) !important;

  margin: 0 !important;
  padding: 0 !important;

  object-fit: contain !important;

  border: 0 !important;
  border-radius: 6px;

  box-shadow: 0 10px 35px rgba(0, 0, 0, .5);
}


/* =========================
   LIGHTBOX CAPTION
   ========================= */

.lightbox__caption {
  display: block;

  width: 100%;
  max-width: 100%;

  flex: 0 0 auto;

  margin: 8px 0 0;
  padding: 7px 10px;

  background: rgba(255, 255, 255, .95);
  color: #000;

  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;

  border-radius: 4px;

  box-sizing: border-box;
}


/* =========================
   LIGHTBOX CLOSE BUTTON
   ========================= */

.lightbox__close {
  position: absolute;

  top: 6px;
  right: 8px;

  margin: 0;
  padding: 0;

  border: 0;

  background: transparent;
  color: #fff;

  font-size: 32px;
  line-height: 1;

  cursor: pointer;

  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);

  z-index: 2;
}


/* =========================
   PREVIOUS / NEXT
   ========================= */

.lightbox__prev,
.lightbox__next {
  position: fixed;

  top: 50%;

  transform: translateY(-50%);

  margin: 0;
  padding: 0;

  border: 0;

  background: transparent;
  color: #fff;

  font-size: 54px;
  line-height: 1;

  cursor: pointer;

  z-index: 10000;
}

.lightbox__prev {
  left: 25px;
}

.lightbox__next {
  right: 25px;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  color: #b31b1b;
}


/* =========================
   GO TO TOP
   ========================= */

#goTopBtn {
  position: fixed;

  right: 20px;
  bottom: 20px;

  display: none;

  padding: 10px 15px;

  background: #333;
  color: #fff;

  border-radius: 5px;

  font-size: 14px;
  text-decoration: none;

  z-index: 9999;
}

#goTopBtn:hover {
  color: #fff;
  text-decoration: none;
}

/* Photos page - no left menu */
#sag {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}