#storyProfilePicture {
  width: 128px;
  height: 128px;
  border-radius: 70px;
  margin-left: 3px;
  margin-top: 3px;
  cursor: pointer;
  border: 4px solid white;
}

#story-available {
  background-image: linear-gradient(rgb(186, 62, 138), #fba051);
  height: 142px;
  width: 142px;
  z-index: -10;
  border-radius: 70px;
  margin-bottom: 15px;
}

#story-available.story-not-available {
  background-image: none !important;
}

#storyViewer {
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  text-align: center;
  display: none;

  font-family: 'Helvetica Neue', sans-serif;
  font-weight: normal;
}
#storyViewer > #storyViewerDimmedBackground {
  /* This is a separate div to allow onclick events */
  background-color: rgba(0, 0, 0, 0.8);
  height: 100%;
  width: 100%;
  z-index: -1;
  position: absolute;
}

#storyViewer p {
  color: #686868;
  font-size: 20px;
  line-height: 24px;
  margin: 0 0 24px;
  text-align: center;
  text-justify: inter-word;
}

#storyViewer > #storyContent {
  width: 512px;
  max-width: 80%; /* for mobile devices */
  margin-top: 30px;
  display: inline-block;

  /* 
    To get the right aspect ratio, while still having a dynamic content size
    https://stackoverflow.com/questions/1495407/maintain-the-aspect-ratio-of-a-div-with-css
    IG content: 910px height to 512px width = ~178%
    So the `padding-bottom` sets the height of the content
  */
  padding-bottom: 178%;
}

#storyViewer > #storyContent > .storyButton {
  position: fixed;
  top: calc(910px - 450px);
  background-color: rgba(200, 200, 200, 0.88);
  padding: 10px;
  color: rgba(0, 0, 0, 0.8);
  font-weight: bolder;
  font-size: 16px;
  border-radius: 18px;
  width: 20px;
  height: 20px;
  text-align: center;
  cursor: pointer;
}

#storyViewer > #storyContent > #storyBackButton {
  left: 50px;
}

#storyViewer > #storyContent > #storyNextButton {
  right: 53px; /* no idea where the difference comes from */
}

#storyViewer > #storyContent > #storyPhotoViewer {
  width: 100%;
  padding-bottom: 178%; /* see comment in #storyContent */
  background-size: cover;
  background-repeat: no-repeat;
  background-position: 50% 50%;
}

#storyViewer > #storyContent > #storyVideoViewer {
  padding-bottom: 178%; /* see comment in #storyContent */
  width: 100%;
}

#storyViewer > #storyContent > #storyProgressBar {
  width: calc(100% + 4px);
  margin-left: -2px;
  height: 3px;
  margin-top: 10px;
  margin-bottom: 10px;
}

#storyViewer > #storyContent > #storyProgressBar > .storyProgressBarItemBg {
  border-radius: 6px;
  background-color: rgba(187, 187, 187, 0.6);
  height: 100%;
  display: inline-block;
  float: left;
}

.storyProgressBarItemFg {
  background-color: #FFF;
  height: 100%;
  border-radius: 3px;
  animation-timing-function: linear;
}

#fakeContentToPreloadImages {
  height: 0;
  width: 0;
  opacity: 0;
}

@keyframes storyViewProgress {
  from { width: 0%; }
  to { width: 100%; }
}

/* Story header */
#storyHeader {
  height: 50px;
  text-align: left;
}

#storyHeader > #storyHeaderProfilePicture {
  height: 38px;
  width: 38px;
  border-radius: 19px;
  cursor: pointer;
  margin-top: 7px;
  display: block-inline;
}

#storyHeader > #storyUserlink {
  display: block-inline;
  margin-left: 50px;
  text-align: left;
  margin-top: -40px; /* hacky */
  padding-top: 0;
  font-size: 20px;
}

#storyHeader > #storyUserlink > a {
  color: white !important;
  text-decoration: none;
}

#storyHeader > #storyTimestamp {
  color: #777;
  display: block-inline;
  margin-left: 50px;
  text-align: left;
  margin-top: -28px;
  padding-top: 0;
  font-size: 16px;
}

#storyHeader > #poweredByInstapipe {
  display: block-inline;
  margin-left: 150px;
  text-align: right;
  margin-top: -50px; /* hacky */
  padding-top: 0;
  font-size: 16px;
}

#storyHeader > #poweredByInstapipe > a {
  color: #999 !important;
  text-decoration: none;
}
