/*
*  story show gallery (ssg) ver: 2.1.1
*  copyright (c) 2018 roman flössler - flor@flor.cz
*
*  try story show gallery at - http://ssg.flor.cz/
*  ssg on github: https://github.com/roman-flossler/simple-scroll-gallery.git
*
*  this source code form is subject to the terms of the mozilla public
*  license, v. 2.0. if a copy of the mpl was not distributed with this
*  file, you can obtain one at http://mozilla.org/mpl/2.0/.
*  
*  there is one exception:
*  distributing story show gallery within a wordpress plugin or theme 
*  is only allowed with a permission from the author of story show gallery.
*/

@font-face {
    font-family: "open sans";
    font-style: normal;
    font-weight: 400;
    src:  format("woff");
}

#ssg_gallery,
#ssg_gallery *,
#ssg_exit,
#ssg_exit *,
#ssg_tip,
#ssg_tip * {
    font-size: 100%;
    font-family: "open sans", "helvetica neue", helvetica, arial, sans-serif;
    font-weight: normal;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    background: none;
    width: auto;
    height: auto;
    border: none;
}

/****************************************************************
 * table of contents:
 *
 *     1. basic styles
 *     2. the bottom menu
 *     3. the tip window & exit icon
 *     4. portrait mode
 *     5. landscape mode 
 *     6. smartphones - all 
 *     7. smartphones - small
 *     8. smartphones - portrait
 *     9. iphone x
 *     10. scrollbars & cursors
 */


/****************************************************************
 * 1. basic styles
 *
 * gallery overlay, images, captions, error image, logo container
 */

#ssg_gallery,
#ssg_tip {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

#ssg_galbg {
    background: #131313;
    width: 100%;
    position: fixed;
    height: 100%;
    z-index: 99990;
    top: 0;
    left: 0px;
}

#ssg_gallery {
    background: #131313;
    /* prev #0e0e0e  */
    position: absolute;
    top: 0px;
    z-index: 99991;
    width: 100%;
    text-align: center;
    left: 0px;
    padding-top: 33vh;
}

#ssg_gallery img {
    max-width: 96%;
    max-height: 90vh;
    display: inline;
    margin: 0.1em 0 0.5em 0;
    border: 1px solid black;
}

#ssg_gallery span.ssg_forlogo {
    position: relative;
}

#ssg_gallery div.ssg_imgwrap {
    position: relative;
}

#ssg_gallery div.ssg_imgwrap::after {
    content: "";
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
}

#ssg_gallery span.ssg_logo {
    display: inline-block;
    width: 16vw;
    max-width: 147px;
    min-width: 100px;
    height: 47px;
    position: absolute;
    bottom: 0.5em;
    left: 0px;
    opacity: 0.6;
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center bottom;
}

#ssg_gallery p,
#ssg_lastone p {
    display: block;
    margin: auto;
    line-height: 1.3em;
    color: #ababab;
    text-align: left;
    background: #222;
    padding: 0.4em;
    padding-bottom: 0.3em;
    margin-bottom: 13em;
    font-size: 108%;
    text-shadow: #000 0px 0px 16px;
    letter-spacing: 0.001em;
}

#ssg_gallery .notitle p.title {
    padding: 0.1em;
    margin: 6.6em 0;
    display: inline-block;
    border-radius: 0.1em;
}

#ssg_gallery p.uwtitle {
    display: none;
}

#ssg_gallery div.notitle img {
    margin-bottom: 0;
}

#ssg_gallery div.notitle span.ssg_logo {
    bottom: -0.1em;
}

#ssg_gallery p.title {
    display: inline-block;
    padding-left: 3em;
    padding-right: 3em;
    border-radius: 0.3em;
    min-width: 22vw;
}

#ssg_gallery::before,
#ssg_tip span,
#ssg_gallery .ssg_text {
    font-size: 108%;
}

#ssg_gallery figure .serror img {
    border: none;
    height: 40px;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
    padding-bottom: 1em;
    box-sizing: content-box;
}

#ssg_gallery figure .serror span.ssg_logo {
    background: none;
}

@media (min-width: 900px) {
    #ssg_gallery span.ssg_logo {
        width: 11vw;
        min-width: 130px;
    }
}


/****************************************************************
 * 2. the bottom menu
 *
 * the end menu of story show gallery. no media queries
 */

#ssg_lastone p {
    margin-bottom: 1em !important;
}

#ssg_lastone {
    width: 100%;
    margin-top: 0;
    padding-bottom: 8vw;
}

#ssg_lastone #ssg_menu a:hover {
    text-decoration: underline;
}

#ssg_lastone #ssg_menu {
    overflow: auto;
    text-align: right;
}

#ssg_menu a.ssg_link {
    display: inline-block;
    width: 33%;
    cursor: pointer;
    color: #ff706c;
    padding-top: 0.2em;
    line-height: 1.4;
    text-align: center;
    vertical-align: text-top;
}

#ssg_menu #ssgl {
    color: #989898;
    text-decoration: none;
}

#ssg_first span {
    display: inline-block;
    background-image: ;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 11px;
    width: 0.7em;
    shape-rendering: crispedges;
}


/****************************************************************
 * 3. the tip window & exit icon
 *
 * window with a little help how to use story show gallery. no media queries
 */

#ssg_gallery .ssg_tipcall {
    color: #969696;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    padding: 2em 26px 10px 3em;
    letter-spacing: 0.01em;
    top: -1px;
    background-image: ;
    background-repeat: no-repeat;
    background-position: right 4px bottom 9px;
    background-size: 15px;
    text-shadow: #000 0px 0px 6px;
    font-weight: normal;
    position: relative;
}

#ssg_gallery .ssg_tipcall:after {
    content: "";
    width: 5em;
    position: absolute;
    left: 3em;
    bottom: 12px;
    border-width: 0 0 1.3px;
    border-style: solid;
    border-color: #6f6f6f;
}

#ssg_gallery .ssg_tipcall:hover {
    text-decoration: underline;
    text-decoration-style: wavy;
}

#ssg_gallery .ssg_tipcall:hover::after {
    content: "";
    border: none;
}

#ssg_tip {
    top: 50vh;
    width: 99vw;
    padding: 0.33em 1em;
    position: fixed;
    z-index: 99992;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 1px;
    padding: 0;
}

#ssg_tip div.touch {
    display: none;
}

#ssg_tip a {
    text-decoration: underline;
    color: #ffeb3b;
    background: none;
    text-underline-position: under;
}

#ssg_tip hr {
    opacity: 0.5;
    margin: 0.5em 0;
    border-bottom: 1px solid white;
}

#ssg_tip strong {
    color: #6bddff;
    background: none;
    font-family: consolas, menlo, "lucida console", monospace;
    font-size: 141%;
    font-weight: normal;
}

#ssg_tip #ssg_tipclose {
    position: absolute;
    top: 0px;
    right: 0px;
    font-family: "times new roman", monospace;
    font-size: 181%;
    color: #bbb;
    background: #000;
    padding: 0 6px;
    border-radius: 0px 4px 0 11px;
    height: 26px;
    width: 28px;
    line-height: 27px;
}

#ssg_tip span {
    padding: 1em 2em;
    background: #2f2f2f;
    color: #fff;
    border: 1px solid black;
    border-radius: 5px;
    line-height: 2em;
    display: inline-block;
    cursor: pointer;
    position: relative;
    box-shadow: 0px 5px 19px 1px #000000e6;
}

#ssg_exit {
    top: -9px;
    left: -9px;
    position: fixed;
    width: 50px;
    height: 50px;
    border-radius: 13px;
    background-color: #0000008c;
    cursor: pointer;
    z-index: 99993;
    background-image: ;
    background-repeat: no-repeat;
    background-position: 25px 25px;
    background-size: 14px;
    opacity: 0.55;
}

#ssg_exit:hover {
    opacity: 1;
    background-color: black;
}


/****************************************************************
 * 4. portrait mode
 *
 * basic elements in portrait mode.
 */

@media (orientation: portrait) {

    #ssg_gallery img {
        max-width: 99%;
    }

    #ssg_gallery::before {
        content: "photos look better in landscape mode ;-)";
        color: #bbbbbb;
        padding-bottom: 3em;
        display: block;
        margin-top: 2em;
        font-style: italic;
    }

    .ssg_tipcall,
    #ssg_arrowdown {
        display: none;
    }

    html.ssg body {
        overflow-y: auto;
    }

    #ssg_gallery p.title {
        display: block;
        padding-left: 1em;
        padding-right: 1em;
        border-radius: 0;
    }

    #ssg_gallery #p0 {
        padding-bottom: 0.2em;
    }
}


/****************************************************************
 * 5. landscape mode
 *
 * ultrawide & standard landscape mode. a lot of media queries
 */

@media (orientation: landscape) {

    #ssg_gallery figure:not(.ssg_uwide):not(.notitle) p.title span {
        display: inline-block;
    }

    #ssg_gallery .ssg_uwide .ssg_uwblock {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    #ssg_gallery .ssg_uwide span.ssg_logo {
        bottom: 0px;
    }

    #ssg_gallery .ssg_uwide img {
        max-width: 98%;
    }

    #ssg_gallery .ssg_uwide p.uwtitle {
        display: block;
        width: 20vw;
        padding: 1em 0.5em;
        left: 0;
        margin-bottom: 0;
        margin: 0;
        z-index: 2;
        max-height: 96vh;
        -ms-overflow-style: scrollbar;
        overflow-y: auto;
        overflow-x: hidden;
        line-height: 1.3em;
        position: relative;
    }

    #ssg_gallery .notitle p.title {
        padding: 0.1em;
    }

    #ssg_gallery .ssg_uwide p.uwtitle .ssg_tipcall {
        padding-left: 0;
        padding-top: 1em;
    }

    #ssg_gallery .ssg_uwide p.uwtitle>span {
        background-color: #222222;
        position: sticky;
        bottom: 0;
        padding: 1.5em 0 1em 0;
        display: block;
        text-align: center;
    }

    #ssg_gallery .ssg_uwide p.uwtitle .ssg_tipcall:after {
        left: 0em;
    }

    #ssg_gallery .ssg_uwide p.title {
        padding: 0.1em 0;
        margin: 7em 0;
        display: inline-block;
        border-radius: 0.1em;
    }

    #ssg_gallery .ssg_uwide p.title span,
    .ssg_uwide p.title .ssg_tipcall {
        display: none;
    }

    #ssg_gallery .ssg_uwide .ssg_imgwrap {
        width: 81vw;
    }

    #ssg_gallery .ssg_uwide.ssg_captionshift p.uwtitle {
        left: 6vw;
    }

    #ssg_gallery .ssg_uwide.notitle .ssg_imgwrap {
        width: 100vw;
    }

    #ssg_gallery .ssg_uwide .ssg_imgwrap img,
    #ssg_gallery .notitle .ssg_imgwrap img {
        max-height: 96vh;
        margin: 0;
    }

    #ssg_gallery #f0.notitle:not(.ssg_uwide) .ssg_imgwrap img {
        max-height: 91vh;
        margin-bottom: 0.3em;
    }

    #ssg_gallery .ssg_uwide .ssg_imgwrap::after {
        content: none;
    }

    /* ************** p0 styles ************** */

    #ssg_gallery figure.notitle:not(.ssg_uwide) #p0 {
        padding: 0.4em;
        margin: 0 0 13em 0;
    }

    #ssg_gallery .ssg_uwide #uwp0 {
        padding-bottom: 0em;
        position: relative;
    }

    #ssg_gallery .ssg_uwide.notitle #uwp0 span {
        margin-bottom: 1.66em;
    }

    #ssg_gallery figure:not(.ssg_uwide):not(.notitle) #p0 {
        position: relative;
        display: inline-block;
        border-radius: 0.3em;
    }

    #ssg_gallery #p0 .ssg_tipcall {
        padding: 0.3em 26px 10px 3em;
        position: absolute;
        right: 3em;
        top: 48%;
        margin-top: -1em;
        line-height: normal;
        line-height: initial;
    }

    #ssg_gallery #p0 span {
        padding-right: 10em;
    }

    #ssg_gallery figure.notitle #p0 .ssg_tipcall {
        left: -6em;
        position: relative;
        top: -0.1em;
    }
}

@media (orientation: landscape) and (min-width: 1222px) {

    /* extra padding for higher resolutions */
    #ssg_gallery .ssg_uwide p.uwtitle {
        padding: 1.5em 1em;
        margin-left: 0.6em;
    }
}

@media (orientation: landscape) and (min-width: 1333px) {

    /* smaller title block for higher resolutions */
    #ssg_gallery .ssg_uwide p.uwtitle {
        width: 15vw;
        margin-left: 1.3em;
    }

    #ssg_gallery .ssg_uwide .ssg_imgwrap {
        width: 85vw;
    }
}

@media (orientation: landscape) and (min-height: 730px) {

    #ssg_gallery .ssg_uwide p.title,
    #ssg_gallery .notitle p.title {
        margin: 8em 0;
    }
}

@media (orientation: landscape) and (min-height: 1033px) {

    #ssg_gallery p.title,
    #ssg_gallery figure.notitle:not(.ssg_uwide) #p0 {
        margin-bottom: 20em;
    }

    #ssg_gallery .ssg_uwide p.title,
    #ssg_gallery .notitle p.title {
        margin: 14em 0;
    }

    #ssg_gallery span.ssg_logo {
        bottom: 1.3em;
    }

    #ssg_gallery .notitle span.ssg_logo {
        bottom: 0em;
    }

    #ssg_gallery img,
    #ssg_gallery #f0.notitle:not(.ssg_uwide) .ssg_imgwrap img {
        margin-bottom: 1.3em;
    }
}


@media (orientation: landscape) and (max-width: 900px) {

    #ssg_gallery .ssg_uwide p.title,
    #ssg_gallery .notitle p.title {
        margin: 4em 0;
    }

    #ssg_gallery .ssg_uwide.ssg_captionshift p.uwtitle {
        left: 5vw;
    }

    #ssg_gallery figure.notitle:not(.ssg_uwide) #p0 {
        margin-bottom: 6em;
        padding: 0.2em;
    }
}


/****************************************************************
 * 6. smartphones - all
 *
 * media query for all smartphones
 */

@media (max-width: 900px) and (orientation: landscape),
(max-width: 550px) and (orientation: portrait) {

    #ssg_gallery img {
        max-width: 99%;
        max-height: 89vh;
        margin: 0.1em 0 0.1em 0;
    }

    #ssg_gallery {
        padding-top: 5em;
    }

    #ssg_gallery p.title {
        padding-left: 1em;
        padding-right: 1em;
        display: block;
        border-radius: 0;
    }

    #ssg_gallery span.ssg_logo {
        background-size: 100%;
        width: 16vw;
        max-width: 133px;
        height: 44px;
        bottom: 1px;
        left: -3px;
    }

    #ssg_gallery .ssg_uwblock {
        margin-bottom: -0.1em;
    }

    #ssg_gallery p {
        margin-bottom: 6em;
        line-height: 1.1em;
    }

    #ssg_gallery p.notitle {
        padding: 0.13em;
        display: inline-block;
        border-radius: 0.1em;
    }

    #ssg_gallery #f0.notitle:not(.ssg_uwide) .ssg_imgwrap img {
        max-height: 90vh;
        margin-bottom: 0.05em;
    }

    #ssg_gallery #p0 .ssg_tipcall {
        right: 2em;
    }

    #ssg_gallery p,
    #ssg_lastone p,
    #ssg_gallery::before,
    #ssg_tip span,
    #ssg_gallery .ssg_text {
        font-size: 100%;
    }

    #ssg_exit {
        top: -6px;
        left: -6px;
        opacity: 0.49;
        background-position: 26px 26px;
    }
}


/****************************************************************
 * 7. smartphones - small
 *
 * media query for smaller smartphones (outdated models)
 */

@media (max-width: 660px) and (orientation: landscape),
(max-width: 366px) and (orientation: portrait) {

    #ssg_exit {
        border-radius: 11px;
        top: -18px;
        left: -19px;
        background-position: 30px 30px;
        background-size: 12px;
    }

    #ssg_gallery::before,
    #ssg_tip span,
    #ssg_gallery .ssg_text {
        font-size: 90%;
    }

    #ssg_gallery p,
    #ssg_lastone p {
        font-size: 90%;
        padding-top: 0.3em;
        padding-bottom: 0.3em;
    }

    #ssg_gallery .ssg_tipcall {
        background-size: 12px;
        background-position: right 6px bottom 10px;
    }

    #ssg_first span {
        background-size: 9px;
    }
}

/****************************************************************
 * 8. smartphones - portrait
 *
 * media query for all smartphones in portrait mode
 */

@media (max-width: 550px) and (orientation: portrait) {

    #ssg_gallery p,
    #ssg_lastone p {
        line-height: 1.3em;
        padding: 0.2em;
    }

    #ssg_lastone p {
        padding: 0.3em;
    }

    #ssg_gallery img {
        margin: 0.1em 0 0.5em 0;
    }

    #ssg_gallery span.ssg_logo {
        bottom: 0.5em;
    }

    #ssg_gallery .notitle p.title {
        margin: 2.5em 0;
    }

    #ssg_menu a.ssg_link {
        width: 38%;
    }

    #ssg_menu #ssgl {
        width: 23%;
    }
}


/****************************************************************
 * 9. iphone x
 *
 * secure safe area for iphone x, media query for iphone x models
 */

@supports (-webkit-overflow-scrolling: touch) {
    @media only screen and (min-width: 700px) and (max-width: 900px) and (orientation: landscape) {
        #ssg_gallery figure:not(.ssg_uwide):not(.notitle) p.title {
            padding-bottom: 1em;
        }

        #ssg_gallery figure.notitle:not(.ssg_uwide) #p0 {
            padding-bottom: 1.2em;
        }

        #ssg_gallery,
        #ssg_tip {
            font-size: 18px;
        }

        #ssg_exit {
            top: 0;
            left: 0;
        }
    }
}


/****************************************************************
 * 10. scrollbars & cursors
 *
 * media query for touch devices, no scrollbar for ie and ff
 */

html.ssg ::-webkit-scrollbar {
    background: #0e0e0e;
    /* prev #191919; */
    width: 9px;
}

html.ssg ::-webkit-scrollbar-thumb {
    -webkit-border-radius: 3px;
    -webkit-box-shadow: 0px 1px 3px #000000bf;
    background: #505050;
    background-size: 100%;
    margin-top: 6px;
    min-height: 81px;
}

html.ssg ::-webkit-scrollbar-button {
    height: 20px;
    background: black;
    height: 2px;
}

html.ssg body {
    cursor: , , text;
    overflow-x: hidden;
    background-color: #0e0e0e;
}

html.ssg .wait {
    cursor: wait;
}

@media (pointer: coarse) {

    /* loading icon for touch devices */
    html.ssg .wait #ssg_gallery::after {
        content: "";
        background-image: ;
        position: fixed;
        background-color: #0e0e0e;
        border-radius: 5px;
        bottom: 5vw;
        right: 2vw;
        width: 12px;
        height: 80px;
        filter: opacity(0.81);
        background-repeat: no-repeat;
        background-size: 8px;
        background-position: center;
    }

    #ssg_tip div.touch {
        display: block;
    }

    #ssg_tip div.classic {
        display: none;
    }

}

html.ssg {
    scrollbar-base-color: #505050;
    scrollbar-3dlight-color: #505050;
    scrollbar-highlight-color: #505050;
    scrollbar-track-color: #0e0e0e;
    /* prev #191919; */
    scrollbar-arrow-color: #191919;
    scrollbar-shadow-color: black;
}

/* ***  no scrollbars for edge and firefox, 'cause they can't paint it black
set !important to overwrite site's styles. 
white shining scrollbars in dark ambience are realy irritating. */
@supports (-ms-ime-align:auto) {

    html.ssg body,
    html.ssg {
        overflow: hidden !important;
    }
}

@supports (-moz-appearance:none) {

    html.ssg body,
    html.ssg {
        overflow: hidden !important;
    }
}

/* ***  allow ff and ie scrolling in portrait mode */
@media (orientation: portrait) {

    html.ssg body,
    html.ssg {
        overflow-y: auto !important;
    }
}

/* ***  ie10 & ie11 bug solution. ie doesn't change bg color back from black */
@media all and (-ms-high-contrast: none),
(-ms-high-contrast: active) {
    html.ssg body {
        background-color: white;
    }
}
