.photo_theater_grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}

.photo_theater_thumb {
  aspect-ratio: 3 / 2;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px;
  cursor: pointer;
  display: block;
  overflow: hidden;
  padding: 5px;
}

.photo_theater_thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.photo_theater_thumb:hover img {
  opacity: 0.85;
}

.photo_theater {
  align-items: stretch;
  background: transparent;
  bottom: 0;
  display: flex;
  justify-content: stretch;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10001;
}

.photo_theater[hidden] {
  display: none;
}

body.photo_theater_open {
  overflow: hidden;
}

body.photo_theater_open #popup {
  z-index: 10002;
}

.photo_theater_stage {
  align-items: stretch;
  background: rgba(0, 0, 0, 0.5);
  border: 20px solid rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  display: flex;
  height: 100%;
  width: 100%;
}

.photo_theater_frame {
  align-items: center;
  background: #000;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
  position: relative;
}

.photo_theater_edges {
  background: rgba(255,255,255,.9);
  border-radius: 5px;
  bottom: 0;
  left: 0;
  margin: 0 15px 15px 15px;
  padding: 10px;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: 1;
}

.photo_theater_edges .edge_wrap {
  pointer-events: auto;
}

.photo_theater_img {
  display: block;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  opacity: 1;
  transition: opacity 0.15s ease;
  width: auto;
}

.photo_theater_img.is_loading {
  opacity: 0.35;
}

.photo_theater_story {
  background: #fff;
  color: #333;
  flex: 0 0 410px;
  overflow: auto;
  text-align: left;
  width: 410px;
}

.photo_theater_count {
  color: #999;
  display: block;
  font-size: 12px;
  padding: 14px 16px 0;
}

.photo_theater_story_body {
  padding: 12px 16px 20px;
}

.photo_theater_loading {
  color: #999;
  margin: 0;
}

.photo_theater_story_body .node-creator,
.photo_theater_story_body > .story_body {
  margin: 0 0 10px;
}

.photo_theater_story_body > .story_body p {
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.photo_theater_close,
.photo_theater_prev,
.photo_theater_next {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  position: absolute;
}

.photo_theater_close {
  background: black;
  border: 3px solid white;
  border-radius: 100%;
  box-shadow: rgba(0, 0, 0, 0.5) 0px 1px 5px;
  font-size: 150%;
  padding: 5px 8px;
  right: 10px;
  top: 10px;
  z-index: 2;
}

.photo_theater_close:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}

.photo_theater_story .feedback > .timestamp {
  padding: 0 0 10px 0;
}

.photo_theater_story .feedback > .timestamp .feed-story-icon {
  margin-right: 5px;
}

.photo_theater .timestamp .ui_separator {
  padding: 0 3px;
}

.photo_theater_story .commentbox {
  padding: 8px 10px;
}

.photo_theater_story .commentbox > .ui_group > .ui_group_img {
  float: left;
  margin: 0 8px 0 0;
  width: 36px;
}

.photo_theater_story .commentbox > .ui_group > .ui_group_content {
  margin-left: 44px;
}

.photo_theater_story .commentbox .story_template {
  padding-right: 0;
}

.photo_theater_prev,
.photo_theater_next {
  font-size: 0;
  height: 80px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  z-index: 2;
}

.photo_theater_prev {
  left: 4px;
}

.photo_theater_next {
  right: 4px;
}

.photo_theater_prev:before,
.photo_theater_next:before {
  font-size: 42px;
  line-height: 80px;
}

.photo_theater_prev:before {
  content: "\2039";
}

.photo_theater_next:before {
  content: "\203A";
}

.photo_theater_prev:hover,
.photo_theater_next:hover {
  color: #ccc;
}

@media screen and (max-width: 800px) {
  .photo_theater {
    align-items: flex-start;
    overflow: auto;
  }

  .photo_theater_stage {
    flex: 0 0 auto;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    width: 100%;
  }

  .photo_theater_frame {
    flex: 0 0 auto;
    height: 52vh;
  }

  .photo_theater_story {
    flex: 0 0 auto;
    overflow: visible;
    width: 100%;
  }
}

@media screen and (max-width: 570px) {
  .photo_theater_grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .photo_theater_edges {
    border-bottom: 1px dashed #ddd;
    border-radius: 0;
    margin: 0;
  }
}
