/**
 * NexusLIMS Detail Page - Image Gallery
 * Slideshow, gallery navigation, captions, and preview images
 */

/* Slideshow container */
.slide {
    display: none;
    margin: 0 auto;
    width: fit-content;
}

.slideshow-container {
    position: relative;
    margin: auto;
    margin-bottom: 2em;
    max-width: max-content;
}

.slideshow-col {
    padding: 0;
    margin-top: var(--spacing-md);  /* 1rem */
    margin-bottom: var(--spacing-md);  /* 1rem, was -1em (negative margin removed) */
}

/* Gallery images */
img.nx-img {
   max-height: 500px;
   max-width: 100%;
   margin-left: auto;
   margin-right: auto;
   display: block;
}

img.nx-img.aa-img {
    display: block;
    width: 400px;
}

img.nx-img.aa-img.hidden {
    display: none;
}

img.dataset-preview-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    max-width: 400px;
}

/* Gallery navigation */
.gal-nav {
    /* Parameters for the 'next' and 'prev' buttons on the slideshow gallery */
}

.gal-prev:hover, .gal-next:hover {
    /* Have a background appear when the prev/next buttons are hovered over */
}

/* Gallery selection */
div#img_gallery {
  /* Make entire gallery unselectable to prevent highlighting when clicking nav buttons */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Gallery caption */

.gallery-caption > * {
    /* make the rows of the caption take the full */
    width: 100%;
}

.gallery-caption > span, .gallery-caption > a {
    /* Make caption spans selectable */
    -webkit-touch-callout: text !important;
    -webkit-user-select: text !important;
    -khtml-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

.gallery-caption {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    flex: 0 1 auto;
    max-width: 400px;
    margin: 0 auto;
    align-items: center;
}

/* Position link icons outside centering calculation */
.gallery-caption a {
    position: relative;
}

.gallery-caption sup.link-icon {
    position: absolute;
    margin-left: 0.5em;
    top: 0.05em;
}

div#img_gallery .fa-stack-2x{
    color: #aaa;
    -webkit-transition: color 0.25s linear;
    -moz-transition: color 0.25s linear;
    -o-transition: color 0.25s linear;
    transition: color 0.25s linear;
}

div#img_gallery:hover .fa-stack-2x {
    color: #337ab7;
}

div#img_gallery .fa-stack:hover .fa-stack-2x {
    color: #23527c;
}

.nx-caption {
    color: black;
    font-size: 14px;
    padding: 8px 12px;
    width: 100%;
    text-align: center;
    line-height: 150%;
}

.nx-caption .row {
    margin: 0;
}
.nx-caption .row > * {
    padding: 0;
}

.gallery-caption-row {
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.gal-nav-container {
    flex: 0 0 auto;
    width: auto;
}

sup.link-icon {
    font-size: xx-small;
}

.gallery-filename {
    width: min(50vw, 350px);  /* Cap maximum at 350px to prevent jarring width reduction */
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    color: #4b65a0
}

@media (min-width: 768px) {
    .gallery-filename {
        width: 150px;
    }
}

@media (min-width: 992px) {
    .gallery-filename {
        width: 230px;
    }
}

@media (min-width: 1200px) {
   .gallery-filename {
        width: 350px;
   }
}

/* Dataset description displayed below the gallery via JS (outside .slide so it
   never affects the slide's fit-content width or the arrow row's height). */
.nx-dataset-description {
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.4em;
    text-align: center;
    padding: 0.25rem 1rem 0;
    opacity: 0.85;
    overflow-wrap: break-word;
    min-height: 1.4em; /* reserve space so the gallery doesn't shift when empty */
}

/* Activity images */
/* .aa-img-col {
    padding-top: 10px;
    margin-top: 1em;
} */
