/*
Based on hugo-easy-gallery (https://github.com/liwenyip/hugo-easy-gallery/)
*/

/*
Grid Layout Styles
*/
.gallery {
    box-sizing: content-box;
}
.gallery .box {
    float: left;
    position: relative;
    /* Default: 1 tile wide */
    width: 100%;
    padding-bottom: 100%; 
}
@media only screen and (min-width : 365px) {
    /* 2 tiles */
    .gallery .box {
        width: 50%;
        padding-bottom: 50%;
    }
}
@media only screen and (min-width : 640px) {
    /* 3 tiles */
    .gallery .box {
        width: 33.3%;
        padding-bottom: 33.3%;
    }
}
@media only screen and (min-width : 768px) {
   /* 4 tiles */
   .gallery .box {
      width: 25%;
      padding-bottom: 25%;
   }
}
@media only screen and (min-width : 1440px) {
   /* 5 tiles */
   .gallery .box {
      width: 20%;
      padding-bottom: 20%;
   }
}

/*
Transition styles
*/
.gallery.hover-transition figure,
.gallery.hover-effect-zoom .img, 
.gallery:not(.caption-effect-appear) figcaption.bottomcaption,
.fancy-figure:not(.caption-effect-appear) figcaption.bottomcaption {
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
}
/*
figure styles
*/
figure {
    position:relative; /* purely to allow absolution positioning of figcaption.bottomcaption */
    overflow: hidden;
}
.gallery figure {
    position: absolute;
    left: 5px;
    right: 5px;
    top: 5px;
    bottom: 5px;
}
.gallery.hover-effect-grow figure:hover {
    transform: scale(1.05);
}
.gallery.hover-effect-shrink figure:hover {
    transform: scale(0.95);
}
.gallery.hover-effect-slidedown figure:hover {
    transform: translateY(5px);
}
.gallery.hover-effect-slideup figure:hover {
    transform: translateY(-5px);
}

/*
img / a styles
*/

.gallery .img {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}
.gallery.hover-effect-zoom figure:hover .img {
    transform: scale(1.05);
}

.gallery .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: none;
    max-width: none;
}

figure a[itemprop="contentUrl"] {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

/*
figcaption.bottomcaption styles
*/
.gallery figcaption,
.fancy-figure figcaption {
    position: absolute;
    left: 0;
    right: 0;
    background: #000;
    color: #FFF;
    text-align: center;
    font-size: 75%; /* change this if you want bigger text */
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
    cursor: pointer;
}

.gallery figcaption.topcaption {
    top: 0;
    padding: 5px;
    margin: 0px;
}

.gallery figcaption.topcaption h4 {
    margin: 0px;
}

.gallery figcaption.bottomcaption {
    bottom: 0;
}

.gallery.caption-position-none figcaption.bottomcaption,
.fancy-figure.caption-position-none figcaption.bottomcaption  {
    display: none;
}
.gallery.caption-position-center figcaption.bottomcaption,
.fancy-figure.caption-position-center figcaption.bottomcaption {
    top: 0;
    padding: 40% 5px;
}
.gallery.caption-position-bottom figcaption.bottomcaption,
.fancy-figure.caption-position-bottom figcaption.bottomcaption {
    padding: 5px;
}
.gallery.caption-effect-fade figure:not(:hover) figcaption.bottomcaption,
.gallery.caption-effect-appear figure:not(:hover) figcaption.bottomcaption,
.fancy-figure.caption-effect-fade figure:not(:hover) figcaption.bottomcaption,
.fancy-figure.caption-effect-appear figure:not(:hover) figcaption.bottomcaption {
    background: rgba(0, 0, 0, 0);
    opacity: 0;
}

/*
Hides recordings link in event gallery
B0rked on smartphones, didn't find a good solution so it's disabled for now

.gallery.caption-effect-slide.caption-position-bottom figure:not(:hover) figcaption.bottomcaption,
.fancy-figure.caption-effect-slide.caption-position-bottom figure:not(:hover) figcaption.bottomcaption {
    margin-bottom: -100%;
}

.gallery.caption-effect-slide.caption-position-center figure:not(:hover) figcaption.bottomcaption,
.fancy-figure.caption-effect-slide.caption-position-center figure:not(:hover) figcaption.bottomcaption  {
    top: 100%;
}
*/

figcaption.bottomcaption p {
    margin: auto; /* override style in theme */
}

figcaption.topcaption a {
  text-decoration: none;
}

figcaption.bottomcaption a {
  text-decoration: none;
}

figcaption.topcaption a h4,
figcaption.bottomcaption a p {
  color: #dadada;
  font-style: normal;
  text-decoration: none;
}

