/* IMAGES */

.image {
    margin: 4em 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.image .caption {
    font-size: 1.4em;
    line-height: 1.7em;
    display: block;
    padding: 0.714em;
    background-color: #EEE;
    color: #333;
}

.image .caption > * {
    font-size: 1em;
}

.image .caption > *:first-child {
    margin-top: 0;
}
.image .caption > *:last-child {
    margin-bottom: 0;
}

.image img {
    display: block;
    margin: 0 auto;
    width: 100%;
    height: auto;
}

.dark-mode .image .caption {
    background-color: #111;
    color: #FFF;
}

@media all and ( min-width: 720px ){

    .image:not(.left) {
        margin-left: 0;
        margin-right: 0;
    }

    .image.right {
        margin: 0 0 4em 1em;
        float: right;
        max-width: calc( ( 100% - 2em ) / 3 );
        clear: right;
    }



}



/* CAROUSEL */


.carousel {
    margin: 4em 0;
}

.id-content-bottom.container>.carousel {
    margin-right: 0;
}

.carousel ul,
.carousel li {
    display: block;
    overflow: hidden;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1em;
}

.carousel li>div,
.carousel li>a {
    display: block;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    background: transparent;
}

.carousel li>a .caption {
    border-radius: 0.5em;
    text-decoration: none;
    transition: background-color 0.25s ease-out, border-color 0.25s ease-out;
    margin: 0 0.2em 0.2em 0;
    box-shadow: 0.2em 0.2em 0 rgba(0, 0, 0, 0.1);
    border: 0.1em solid #DDDDDD;
    background-color: #EEE;
    padding: 2em 7em 2em 2em;
    position: relative;
}

.carousel li>div .caption {
    background-color: #EEE;
    padding: 2em 7em 2em 2em;
}

.carousel a .caption::before {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: calc((700/1920) * 100%);
    background-color: #DDD;
    width: 5em;
    top: 0;
    left: auto;
    transition: background-color 0.25s ease-out;
}

.dark-mode .carousel .caption::before {
    background-color: #222;
}

.carousel a:hover .caption::before,
.carousel a:focus .caption::before,
.dark-mode .carousel a:hover .caption::before,
.dark-mode .carousel a:focus .caption::before {
    background-color: #287cb3;
}

.carousel a .caption::after {
    font-family: 'FontAwesome';
    font-weight: 300;
    content: '\f138';
    position: absolute;
    font-size: 1.6em;
    top: 1.25em;
    right: 1.25em;
    line-height: 1.25em;
    transition: color 0.25s ease-out;
}

.carousel a:hover .caption::after,
.carousel a:focus .caption::after {
    color: #FFF;
}

.dark-mode .carousel li>div .caption,
.dark-mode .carousel li>a .caption {
    background-color: #111;
    border-color: #666;
}

.dark-mode .carousel li>a {
    background-color: transparent;
}

.carousel figure {
    position: relative;
    padding: 0;
}

.carousel h3 {
    font-size: 2em;
    margin: 0 0 0.25em 0;
    color: #666;
    padding-right: 4em;
    transition: color 0.25s ease-out;
}

.dark-mode .carousel h3 {
    color: #FFF;
}

.carousel a:hover h3,
.carousel a:focus h3 {
    color: #333;
}

.dark-mode .carousel a:hover h3,
.dark-mode .carousel a:focus h3 {
    color: #FFF;
}

.carousel p {
    font-size: 1.6em;
}

.carousel li {
    margin-top: 2em;
}

.carousel li:first-child {
    margin-top: 0;
}

.carousel li>a:hover .caption,
.carousel li>a:focus .caption {
    background-color: #DDDDDD;
    border-color: #999999;
    border-color: #287cb3;
}

.dark-mode .carousel li>a:hover .caption,
.dark-mode .carousel li>a:focus .caption {
    background-color: #666;
    border-color: #EEE;
    border-color: #287cb3;
    color: inherit;
}

.dark-mode .carousel li>a:hover p,
.dark-mode .carousel li>a:focus p {
    color: #FFF;
}

.carousel li>a:active .caption {
    transform: translate(0.2em, 0.2em);
    box-shadow: none;
}

.carousel .image {
    display: block;
    width: 100%;
    margin: 0 0 1em 0;
}

.carousel .image img {
    display: block;
    width: 100%;
    height: auto;
}

.carousel .caption>*:first-child {
    margin-top: 0;
}

.carousel figcaption>*:last-child {
    margin-bottom: 0;
}

@media all and (min-width: 720px) {

    .carousel .items {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .carousel .image {
        width: calc((100% - 1em)/2);
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        background-color: #EEE;
        margin: 0;
    }

    #eventsearch-template .carousel .image {
        width: calc((100% - 1.25rem)/ 3);
    }

    .carousel li.no-image {
        display: flex;
        flex-direction: column;
    }

    .carousel li.no-image>a,
    .carousel li.no-image>div,
    .carousel li.no-image figure {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    .carousel li.no-image .caption {
        flex-grow: 1;
    }

    .carousel .image {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .carousel .inner {
        width: 100%;
        height: 100%;
        padding: 0;
        position: relative;
    }

    .carousel .image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 10%;
    }

    .carousel li {
        margin-top: 1em;
    }

    .carousel .has-image .image {
        width: calc((100% - 1em)/2);
        float: right;
        margin: 0;
    }

    .carousel li.no-image:first-child,
    .carousel .no-image:first-child+.no-image:nth-child(2) {
        margin-top: 0;
    }

    .carousel li:not(.no-image) .caption {
        width: calc(((100% - 1em)/2) - 0.2em);
    }

    #eventsearch-template .carousel li:not(.no-image) .caption {
        width: calc((((100% - 1.25rem)/ 3) * 2) + .625rem);
    }

    .carousel li {
        width: 100%;
    }

    .carousel li.no-image {
        width: calc((100% - 1em)/2);
    }

    .carousel li.no-image:last-child {
        width: auto;
        flex-grow: 1;
    }

    .carousel li.expand {
        width: 100%;
    }

    .carousel .image+.caption {
        min-height: 320px;
    }

    #eventsearch-template .carousel .image+.caption {
        min-height: 200px;
    }



}



/* GALLERY */

.gallery {
    margin: 4em 0;
}

.gallery .carousel {
    margin: 0;
}

.gallery .carousel img {
    width: 100%;
}

.gallery .carousel .items {
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
}

.gallery .carousel .items li {
    width: 100%;
    margin: 0;
}

.gallery .caption {
    display: none;
}

.gallery .carousel .items li::before {
    content: none;
}

.gallery .carousel .items figure {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    background-color: #EEE;
    cursor: pointer;
    cursor: hand;
    margin: 0;
}

.gallery .carousel .items li:hover figure img,
.gallery .carousel .items li:active figure img,
.gallery .carousel .items li:focus figure img {
    transform: scale(1.1);
}

.gallery .carousel .items figure::after {
    content: '\f002';
    font-family: 'FontAwesome';
    font-weight: 300;
    font-size: 1.6em;
    position: absolute;
    top: 1.25em;
    right: 1.25em;
    color: #FFF;
}

.gallery .carousel .items figure img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 0.25s ease-out;
}


@media all and (min-width: 640px) {

    .gallery .carousel .items li {
        width: 50%;
    }
}

@media all and (min-width: 720px) {

    .gallery:not(.left):not(.right) {
        margin-right: 0;
    }

    .gallery.right {
        margin: 0 0 4em 1em;
        float: right;
        clear: right;
        max-width: calc((100% - 2em) / 3);
        width: 100%;
    }

    .gallery:not(.right) .carousel .items li {
        width: calc(100% / 3);
    }
}




/* OVERLAY */

.id-imageoverlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 1);
    z-index: 300;
}

.id-imageoverlay * {
    pointer-events: none;
}

.id-imageoverlay button {
    pointer-events: all;
}

.id-imageoverlay .inner {
    height: 90vh;
    width: calc(100vw - 10vh);
    margin: 5vh;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
}

.id-imageoverlay .inner img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.id-imageoverlay.hasvideo .inner {
    height: 80vh;
    width: calc(100vw - 20vh);
    margin: 10vh;
}

.id-imageoverlay.hasvideo .inner iframe {
    display: block;
    overflow: hidden;
    height: 80vh;
    width: calc(100vw - 20vh);
    background: transparent !important;
}

.id-imageoverlay .sbtn {
    display: block;
    overflow: hidden;
    position: fixed;
    top: 2em;
    right: 2em;
    background: none;
    border: none;
    outline: none;
    z-index: 11;
    cursor: pointer;
    cursor: hand;
}

.id-imageoverlay .caption {
    color: #FFF;
    position: absolute;
    bottom: 0em;
    left: 0;
    right: 0;
    font-size: 1em;
    line-height: 1em;
    padding: 2em;
    background-color: rgba(0, 0, 0, 0.5);
}

.id-imageoverlay .id-index {
    color: #FFF;
    font-size: 1.6em;
    line-height: 1.25em;
    position: absolute;
    top: 1.25em;
    left: 1.25em;
}

.id-imageoverlay .caption h3,
.id-imageoverlay .caption p {
    text-align: center;
}

.id-imageoverlay .caption h3 {
    font-size: 1.6em;
    line-height: 1.25em;
    margin: 0;
}

.id-imageoverlay .caption p {
    font-size: 1.4em;
    line-height: 1.7em;
    margin: 0;
}

.id-imageoverlay .caption em {
    display: block;
    font-size: 0.4em;
    line-height: 1em;
}

.id-imageoverlay .caption span {
    display: block;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 0.6em;
    margin-top: 0.5em;
}

.id-imageoverlay .previous {
    top: 50%;
    transform: translateY(-50%);
    right: auto;
    left: 0;
}

.id-imageoverlay .next {
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    left: auto;
}

.id-imageoverlay .sbtn span {
    font-size: 1em;
    height: 4em;
    width: 4em;
    line-height: 4em;
    text-indent: 100%;
    white-space: nowrap;
    color: #FFF;
    position: relative;
    display: block;
    overflow: hidden;
    transition: background-color 0.25s ease-out;
}

.id-imageoverlay .sbtn:hover span,
.id-imageoverlay .sbtn:active span,
.id-imageoverlay .sbtn:focus span {
    background-color: rgba(255, 255, 255, 0.2);
}

.id-imageoverlay .sbtn span::before {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 3em;
    line-height: 1.333em;
    height: 1.333em;
    width: 1.333em;
    text-align: center;
    font-family: 'FontAwesome';
    font-weight: 300;
    display: block;
    overflow: hidden;
    text-indent: 0;
}

.id-imageoverlay .close span::before {
    content: '\f00d';
}

.id-imageoverlay .previous span::before {
    content: '\f053';
}

.id-imageoverlay .next span::before {
    content: '\f054';
}


/* TOP WITH IMAGE */

.id-content-top.hasimage {
    background-color: #EEE;
    margin-top: 2em;
    margin-bottom: 2em;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    padding: 20em 2em 0;
}

.id-content-top.hasimage h1 {
    margin-bottom: 0;
    display: block;
    overflow: visible;
}

.id-content-top.hasimage h1 span {
    display: block;
    float: left;
    background-color: #FFF;
    padding: 0.4em;
    position: relative;
    left: -0.4em;
}

@media all and (min-width: 640px) {
    .id-content-top.hasimage {
        padding: 30em 2em 0;
    }
}

@media all and (min-width: 720px) {
    .id-content-top.hasimage {
        padding: 40em 4em 0;
    }
}

@media all and (min-width: 960px) {
    .id-content-top.hasimage {
        padding: 50em 4em 0;
        margin-bottom: 4em;
    }

    .id-content-top.hasimage h1 {
        font-size: 5em;
        margin-bottom: 0;
    }
}

.fadein {
    opacity: 0;
    animation: fadein 0.5s forwards;
}

@keyframes fadein {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}
