/* =========================================================
   styles_series.css
   Unique styles for "Taking Jesus Seriously"
   Styles common to multiple pages have been moved to styles_common.css
   ========================================================= */

:root {  /* These global variables are available for all stylesheets the browser calls  */
	--content-gap: 0.2rem; /* Used in conjunction with menu-width to calculate content width */
}



/* ---------- General ---------- */


.image_container {
    margin: 0 auto;
    max-width: 60%;
}




/* ---------- Main picture fading ---------- */

.main_picture_fade {
    position: relative;
    display: block;
}

.main_picture_fade img:nth-child(1) {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
}

.main_picture_fade img:nth-child(2) {
    position: absolute;
    width: 100%;
    height: auto;
    top: 0;
    left: 0;
    opacity: 0;
    animation: fadeOverlay 30s infinite;
}

@keyframes fadeOverlay {
    0%   { opacity: 1; }
    75%  { opacity: 1; }
    85%  { opacity: 0; }
    90%  { opacity: 0; }
    100% { opacity: 1; }
}

/* ---------- Scrolly sections ---------- */

.spacer {
    height: 20vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.scrolly {
    height: 300vh;
    position: relative;
}

.sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
}

.bg_1 {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bg_3 {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
}

.bg_3.zooming {
    animation: slowZoom 60s ease-out forwards;
    transform-origin: center center;
}

.scrolly_text {
    will-change: transform;
}

@keyframes slowZoom {
    0%   { transform: scale(1); }
    100% { transform: scale(1.4); }
}

/* =========================================================
   DESKTOP
   ========================================================= */
@media only screen and (min-width: 641px) {



    .first_para {
        margin-top: 0;
    }

    .story {
        font-family: 'Trebuchet MS','Verdana';
        margin-left: 1em;
        margin-right: 1em;
        font-style: italic;
    }

    .story p {
        color: #00a;
        line-height: 1.3;
        font-size: 0.8rem;
    }

    .bible_inline {
        display: inline;
        color: #171;
        line-height: 1.3;
        font-size: 1rem;
        font-style: italic;
        font-weight: bold;
    }


    .top_row {
        display: none;
    }

    .popout_panel {
        display: none;
        position: fixed;
        z-index: 8;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 50%;
        max-height: 320px;
        background-color: #fff;
        border: 1px solid #ccc;
        padding: 20px;
        box-shadow: 0 2px 5px rgba(0,0,0,.1);
    }

    .popout_panel_scrollable_div {
        max-height: 230px;
        overflow-y: auto;
        color: #171;
        border: 1px solid #ccc;
        padding: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,.1);
    }

    .popout_panel_scrollable_div p {
        line-height: 1.1rem;
        font-size: 0.9rem;
        margin-left: 0.1em;
        margin-right: 0.1em;
    }

    .overlay_1 {
        position: absolute;
        z-index: 10;
        overflow: hidden;
        top: 20%;
        left: 60%;
        width: 40%;
        max-width: 400px;
        height: 60%;
        background: rgba(255,255,255,0);
        padding: 20px;
        box-sizing: border-box;
        border-radius: 12px;
        object-fit: contain;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .overlay_2,
    .overlay_3 {
        position: absolute;
        z-index: 10;
        left: 10%;
        width: 50%;
        max-width: 600px;
        height: 60%;
        background: rgba(255,255,255,.8);
        opacity: 0;
        transition: opacity 3s ease-in-out;
        padding: 20px;
        box-sizing: border-box;
        overflow: hidden;
        border-radius: 12px;
        border: 1px solid rgba(0,0,0,.5);
    }

    .overlay_2 { top: 20%; }
    .overlay_3 { top: 20%; }

    .overlay_visible {
        opacity: 1;
    }

    .sidebox {
        height: auto;
        max-height: 75%;
        width: auto;
        opacity: 0.7;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media only screen and (max-width: 640px) {

    .story {
        font-family: 'Trebuchet MS','Verdana';
        margin-left: 0.5em;
        margin-right: 0.5em;
        font-style: italic;
    }

    .story p {
        color: #00a;
        line-height: 1.3;
        font-size: 0.8rem;
    }

    .bible_inline {
        display: inline;
        color: #171;
        line-height: 1.3;
        font-size: 1rem;
        font-style: italic;
        font-weight: bold;
    }

    .popout_panel {
        display: none;
        position: fixed;
        z-index: 8;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60%;
        max-height: 380px;
        background-color: #fff;
        border: 1px solid #ccc;
        padding: 20px;
        box-shadow: 0 2px 5px rgba(0,0,0,.1);
    }

    .popout_panel_scrollable_div {
        max-height: 290px;
        overflow-y: auto;
        color: #171;
        border: 1px solid #ccc;
        padding: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,.1);
    }

    .popout_panel_scrollable_div p {
        line-height: 1.1rem;
        font-size: 0.9rem;
        margin-left: 0.1em;
        margin-right: 0.1em;
    }

    .overlay_1 {
        position: absolute;
        z-index: 10;
        overflow: hidden;
        top: 2%;
        left: 1%;
        width: 98%;
        max-width: 350px;
        height: 33%;
        background: rgba(255,255,255,.5);
        border-radius: 12px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .overlay_2 {
        position: absolute;
        z-index: 10;
        top: calc(2% + 33% + 2%);
        left: 10%;
        width: 80%;
        max-width: 600px;
        height: 53%;
    }

    .overlay_3 {
        position: absolute;
        z-index: 10;
        top: 10%;
        left: 10%;
        width: 80%;
        max-width: 600px;
        height: 80%;
    }

    .overlay_2,
    .overlay_3 {
        background: rgba(255,255,255,.8);
        opacity: 0;
        transition: opacity 3s ease-in-out;
        padding: 20px;
        box-sizing: border-box;
        overflow: hidden;
        border-radius: 12px;
        border: 1px solid rgba(0,0,0,.5);
    }

    .overlay_visible {
        opacity: 1;
    }

    .sidebox {
        height: 100%;
        width: auto;
        max-width: none;
        position: static;
    }
}