.nils-gallery {
clear: both;
margin: 0 0 32px;
max-width: none;
width: 100%;
}
.nils-gallery::after {
clear: both;
content: "";
display: table;
}
.nils-gallery__item {
float: left;
margin: 0 3% 0 0;
transition: all .5s;
width: 30.33%;
}
.nils-gallery__link {
color: inherit;
text-decoration: none;
}
.nils-gallery__link--cover {
background: #f2f2f2;
box-shadow: 0 0 1px rgba(0, 0, 0, .5);
display: block;
height: 240px;
overflow: hidden;
transition: all .5s;
width: 100%;
}
.nils-gallery__item:hover .nils-gallery__link--cover,
.nils-gallery__item:focus-within .nils-gallery__link--cover {
box-shadow: 0 0 15px rgba(0, 0, 0, .25);
}
.nils-gallery__link--hidden {
display: none;
}
.nils-gallery__image {
border: 0;
display: block;
height: auto;
max-width: none;
width: 100%;
}
.nils-gallery__caption {
background: rgba(163, 153, 30, .75);
color: #fff;
display: inline-block;
font-family: "Raleway", Arial, sans-serif;
font-size: 20px;
height: 50px;
left: 20px;
line-height: 50px;
margin: 0 0 -70px;
padding: 0 20px;
position: relative;
text-align: center;
top: -70px;
transition: all .5s;
white-space: nowrap;
}
.nils-gallery__item:hover .nils-gallery__caption,
.nils-gallery__item:focus-within .nils-gallery__caption {
background: rgba(81, 77, 51, .75);
}
.nils-gallery-lightbox {
align-items: center;
background: rgba(0, 0, 0, .7);
bottom: 0;
display: none;
justify-content: center;
left: 0;
padding: 5em 72px;
position: fixed;
right: 0;
top: 0;
z-index: 999999;
}
.nils-gallery-lightbox.is-open {
display: flex;
}
.nils-gallery-lightbox__image {
box-shadow: 0 .2em 1em rgba(0, 0, 0, .6);
display: block;
max-height: calc(100vh - 10em);
max-width: 100%;
object-fit: contain;
}
.nils-gallery-lightbox__button {
align-items: center;
background: none;
border: 0;
color: #fff;
cursor: pointer;
display: flex;
font-size: 48px;
height: 48px;
justify-content: center;
line-height: 1;
padding: 0;
position: absolute;
width: 48px;
}
.nils-gallery-lightbox__button:hover,
.nils-gallery-lightbox__button:focus {
background: none !important;
color: #fff !important;
opacity: 1;
}
.nils-gallery-lightbox__close {
right: 18px;
top: 18px;
}
.nils-gallery-lightbox__prev {
left: 18px;
top: 50%;
transform: translateY(-50%);
}
.nils-gallery-lightbox__next {
right: 18px;
top: 50%;
transform: translateY(-50%);
}
@media (max-width: 900px) {
.nils-gallery__item {
margin: 0 2% 30px;
width: 46%;
}
}
@media (max-width: 800px) {
.nils-gallery__item {
width: 96%;
}
.nils-gallery__link--cover {
height: auto;
}
.nils-gallery-lightbox {
padding: 44px 16px;
}
.nils-gallery-lightbox__prev,
.nils-gallery-lightbox__next {
bottom: 18px;
top: auto;
transform: none;
}
}