// Name:            Slideshow
// Description:     Defines styles for a slideshow
//
// Component:       `wk-slideshow`
//
// Modifier:        `wk-slideshow-fullscreen`
//
// Sub-modifier:    `wk-slideshow-fade-out`
//                  `wk-slideshow-scroll-forward-in`
//                  `wk-slideshow-scroll-forward-out`
//                  `wk-slideshow-scroll-backward-in`
//                  `wk-slideshow-scroll-backward-out`
//                  `wk-slideshow-scale-out`
//                  `wk-slideshow-swipe-forward-in`
//                  `wk-slideshow-swipe-forward-out`
//                  `wk-slideshow-swipe-backward-in`
//                  `wk-slideshow-swipe-backward-out`
//
// States:          `wk-active`
//
// Uses:            Cover (JS)
//
// Markup:
//
// <!-- wk-slideshow -->
// <ul class="wk-slideshow" data-wk-slideshow>
//     <li><img src="" width="" height="" alt=""></li>
// </ul>
//
// ========================================================================


/* ========================================================================
   Component: Slideshow
 ========================================================================== */

/*
 * 1. Create position context
 * 2. Create stacking context to prevent z-index issues with other components
 * 3. Set width because child elements are positioned absolute. Height is set via JS
 * 4. Reset list style
 * 5. Clip child elements
 * 6. Deactivate browser history navigation in IE11
 */

.wk-slideshow {
    /* 1 */
    position: relative;
    /* 2 */
    z-index: 0;
    /* 3 */
    width: 100%;
    /* 4 */
    margin: 0;
    padding: 0;
    list-style: none;
    /* 5 */
    overflow: hidden;
    /* 6 */
    touch-action: pan-y;
}

/*
 * Sub-object item
 * 1. Position items above each other
 * 2. Expand to parent container width
 * 3. Hide by default
 */

.wk-slideshow > li {
    /* 1 */
    position: absolute;
    top: 0;
    left: 0;
    /* 2 */
    width: 100%;
    /* 3 */
    opacity: 0;
}

/*
 * Active
 * 1. Stack at first
 * 2. Show slide
 */

.wk-slideshow > .wk-active {
    /* 1 */
    z-index: 10;
    /* 2 */
    opacity: 1;
}

/*
 * Hide default images which is only relevant to keep existing proportions
 */

.wk-slideshow > li > img { visibility: hidden; }

/*
 * Pointer for controls
 */

[data-wk-slideshow-slide] { cursor: pointer; }


/* Modifier: `wk-slideshow-fullscreen`
 ========================================================================== */

.wk-slideshow-fullscreen,
.wk-slideshow-fullscreen > li { height: 100vh; }


/* Animations
 ========================================================================== */

/*
 * Fade
 */

 .wk-slideshow-fade-in {
     -webkit-animation: wk-fade 0.5s linear;
     animation: wk-fade 0.5s linear;
 }

.wk-slideshow-fade-out {
    -webkit-animation: wk-fade 0.5s linear reverse;
    animation: wk-fade 0.5s linear reverse;
}

/*
 * Scroll
 */

.wk-slideshow-scroll-forward-in {
    -webkit-animation: wk-slide-right 0.5s ease-in-out;
    animation: wk-slide-right 0.5s ease-in-out;
}

.wk-slideshow-scroll-forward-out {
    -webkit-animation: wk-slide-left 0.5s ease-in-out reverse;
    animation: wk-slide-left 0.5s ease-in-out reverse;
}

.wk-slideshow-scroll-backward-in {
    -webkit-animation: wk-slide-left 0.5s ease-in-out;
    animation: wk-slide-left 0.5s ease-in-out;
}

.wk-slideshow-scroll-backward-out {
    -webkit-animation: wk-slide-right 0.5s ease-in-out reverse;
    animation: wk-slide-right 0.5s ease-in-out reverse;
}

/*
 * Scale
 */

.wk-slideshow-scale-out {
    -webkit-animation: wk-fade-scale-15 0.5s ease-in-out reverse;
    animation: wk-fade-scale-15 0.5s ease-in-out reverse;
}

/*
 * Swipe
 */

.wk-slideshow-swipe-forward-in {
    -webkit-animation: wk-slide-left-33 0.5s ease-in-out;
    animation: wk-slide-left-33 0.5s ease-in-out;
}

.wk-slideshow-swipe-forward-out {
    -webkit-animation: wk-slide-left 0.5s ease-in-out reverse;
    animation: wk-slide-left 0.5s ease-in-out reverse;
}

.wk-slideshow-swipe-backward-in {
    -webkit-animation: wk-slide-right-33 0.5s ease-in-out;
    animation: wk-slide-right-33 0.5s ease-in-out;
}

.wk-slideshow-swipe-backward-out {
    -webkit-animation: wk-slide-right 0.5s ease-in-out reverse;
    animation: wk-slide-right 0.5s ease-in-out reverse;
}

.wk-slideshow-swipe-forward-in:before,
.wk-slideshow-swipe-backward-in:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    background: rgba(0,0,0,0.6);
    -webkit-animation: wk-fade 0.5s ease-in-out reverse;
    animation: wk-fade 0.5s ease-in-out reverse;
}


// Hooks
// ========================================================================

.hook-slideshow-misc;

.hook-slideshow-misc() {}
