/* Tumblr-specific detail layout */
#grid .image-count,
.slideshow-container .slide-number-text {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 15;
}

div.closeup {
  display: flex;
  flex-direction: column; /* Force info below image */
  align-items: flex-start;
  justify-content: flex-start;
  background: #f0f0f0; /* Match base.css closeup background */
  width: 100%;
}

div.closeup img {
  object-fit: contain;
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  flex: 0 0 auto;
}

/* NPF (New Post Format) styling */
.body-content {
  width: 100%;
  background: #f9f9f9;
  padding-bottom: 16px;
}

.body-content.has-slideshow figure {
  display: none;
}

.npf_row {
  display: flex;
  flex-direction: row;
  gap: 4px;
  width: 100%;
  margin-bottom: 4px;
}

.npf_row figure {
  margin: 0;
  flex: 1;
  position: relative;
}

.npf_row figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* Keep anything that comes with the post on the light background */
.body-content p {
  padding: 0px 16px;
  flex: 1;
  position: relative;
}

.body-content figure {
  margin: 0 0 10px 0;
  position: relative;
}

.tmblr-alt-text-helper {
  display: none;
}

.body-content img {
  max-width: 100%;
  height: auto;
}

.slideshow-container {
  text-align: left;
}

/* Keep anything that comes with the post on the light background */
div.caption-container {
  width: 100%;
  background: #f9f9f9;
}

blockquote.caption {
  margin: 16px 16px 0px 16px;
}

div.caption-container p {
  margin-bottom: 16px;
}

/* Slideshow container */
.slideshow-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f9f9f9;
  margin: auto;
  overflow: hidden;
}

/* Hide the images by default */
.slideshow-container .slide {
  display: none;
  height: 100%;
  width: 100%;
  /*
  align-items: center;
  justify-content: center;
  */
}

.slideshow-container .slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /*
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    */
    display: block;
}

/* Style for the navigation container */
.slideshow-nav {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

/* Next & previous buttons */
.slideshow-container .prev, .slideshow-container .next {
  cursor: pointer;
  padding: 8px 12px;
  color: black;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 3px;
  user-select: none;
  background-color: rgba(241, 241, 241, 0.8);
  display: inline-block;
  margin: 0 5px;
}

/* On hover, add a darker background color */
.slideshow-container .prev:hover, .slideshow-container .next:hover {
  background-color: #ddd;
}

/* Fading animation */
.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}
