.tpg-photo-gallery::after {
  content: "";
  display: block;
  clear: both;
}

.tpg-photo-gallery__sizer,
.tpg-photo-gallery__item {
  width: calc(16.6666666667% - 5px);
}

.tpg-photo-gallery__item {
  float: left;
  margin-bottom: 5px;
}

.tpg-photo-gallery__item img {
  display: block;
  max-width: 100%;
}

.tpg-photo-gallery__media-thumbnail {
  position: relative;
  display: flex;
  height: 120px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.tpg-photo-gallery__media-thumbnail:hover {
  transform: scale(1.02);
}

.tpg-photo-gallery__item--video {
  width: calc(33.3333333333% - 5px);
}

.tpg-photo-gallery__video-thumbnail,
.tpg-photo-gallery__youtube-thumbnail {
  height: 240px;
  overflow: hidden;
}

.tpg-photo-gallery__video-thumbnail {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.tpg-photo-gallery__youtube-thumbnail {
  border-radius: 0 !important;
}

.tpg-photo-gallery__youtube-thumbnail--fallback {
  background: #111;
}

.tpg-photo-gallery__video-thumbnail video,
.tpg-photo-gallery__youtube-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tpg-photo-gallery__video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.tpg-photo-gallery__video-overlay:hover {
  background: rgba(0, 0, 0, 0.5) !important;
}

.tpg-photo-gallery__video-overlay .fa-play-circle {
  color: #fff;
  font-size: 3em;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.tpg-photo-gallery__video-overlay .fa-youtube,
.tpg-photo-gallery__youtube-thumbnail--fallback .fa-youtube {
  color: #f00;
  font-size: 3em;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.tpg-photo-gallery__audio-thumbnail {
  border: 2px solid #dee2e6;
  background: #f8f9fa;
}

.tpg-photo-gallery__audio-thumbnail:hover {
  border-color: #007bff;
  background: #e9ecef;
}

.tpg-photo-gallery__audio-thumbnail i {
  margin-bottom: 8px;
  color: #28a745;
  font-size: 2.5em;
}

.tpg-photo-gallery__audio-thumbnail span {
  color: #6c757d;
  font-size: 0.9em;
  font-weight: 700;
}

@media only screen and (max-width: 991px) {
  .tpg-photo-gallery__sizer,
  .tpg-photo-gallery__item {
    width: calc(25% - 5px);
  }

  .tpg-photo-gallery__item--video {
    width: calc(50% - 5px);
  }
}
