/* ===================================================================
   Courtney Lewis - landing page overrides
   Load AFTER responsive.css and fader.min.css.
====================================================================== */


/* Navigation + logo (hide on scroll down, show on scroll up) lives at
   the end of css/responsive.css, so it applies to every page. */


/* -------------------------------------------------------------------
   Background image scrolls with the page (no fixed / parallax lock)
---------------------------------------------------------------------- */
.cover-background-landing,
.cover-background-landing.parallax {
    background-attachment: scroll !important;
}


/* -------------------------------------------------------------------
   Desktop / tablet / landscape: the whole photo fits in one screen
   The hero is locked to the window height and the photo is scaled to
   that height (never cropped top/bottom). 26% keeps the figure in view
   when the screen is narrower than the photo.
---------------------------------------------------------------------- */
@media (min-width: 768px), (orientation: landscape) {
    .cover-background-landing {
        height: 100vh !important;
        background-color: #0a0806 !important;
        background-size: auto 100% !important;
        background-position: 26% center !important;
    }
    .cover-background-landing > .container.full-screen {
        height: 100% !important;          /* overrides the inline height set by the theme JS */
    }
    /* quotes: vertically centered instead of pushed down by a 25% top margin */
    .cover-background-landing .container-fluid.row {
        height: 100%;
        margin: 0 !important;
        padding-top: 100px;               /* clears the logo bar */
        padding-bottom: 40px;
        align-content: center !important;
        align-items: center;
    }
    /* quotes column: col-7 + offset-6 = 13 of 12 columns, so it ran past
       the screen edge. Pin it to the right half, ending inside the page margin. */
    .cover-background-landing .col-7 {
        flex: 0 0 auto;
        width: 44%;
        max-width: 600px;
        margin-left: auto !important;     /* cancels offset-6, pushes it right */
        margin-right: 3%;                 /* breathing room from the screen edge */
        padding: 0;
    }
    .cover-background-landing .rotate-content {
        width: 100%;
    }
}
/* screens wider than the photo (16:10): photo on the left, its right edge
   fades into the photo's own dark tone, which fills the rest */
@media (min-aspect-ratio: 16/10) {
    .cover-background-landing {
        background-image:
            linear-gradient(to right, rgba(10,8,6,0) 75%, rgba(10,8,6,1) 100%),
            url("../images/bg/home.jpg?v=20261113") !important;
        background-size: 160vh 100%, auto 100% !important;   /* 160vh = photo width at full height */
        background-position: left center, left center !important;
        background-repeat: no-repeat !important;
    }
}


/* -------------------------------------------------------------------
   Rotating quotes - smooth cross fade (driven by js/quotes.js)
   All quotes share one grid cell, so the list is as tall as the
   longest quote and nothing jumps when they change.
---------------------------------------------------------------------- */
#quotes {
    display: grid;
    height: auto !important;
    min-height: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
}
#quotes > li {
    grid-area: 1 / 1;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    list-style: none;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 1.2s;   /* hide only after the fade out ends */
}
#quotes > li.is-active {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

/* large, soft opening quotation mark above each quote */
#quotes > li::before {
    content: "\201C";
    display: block;
    height: .42em;
    margin-bottom: 26px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 120px;
    line-height: .8;
    color: #d1e3e3;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}
#quotes > li.is-active::before {
    opacity: .45;
    transform: none;
    transition: opacity 1.6s ease .6s, transform 1.6s ease .6s;
}

/* fade out: the whole quote + source together */
#quotes > li blockquote,
#quotes > li cite {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
#quotes > li.is-active blockquote { opacity: 1; transition: none; }

/* fade in: the words come into focus one after another (--i set by js/quotes.js) */
#quotes .q-word {
    display: inline-block;
    opacity: 0;
    filter: blur(6px);
    transform: translateY(.18em);
    transition: opacity 0s 1.1s, filter 0s 1.1s, transform 0s 1.1s;   /* reset once faded out */
}
#quotes > li.is-active .q-word {
    opacity: 1;
    filter: blur(0);
    transform: none;
    transition: opacity .9s ease, filter .9s ease, transform .9s ease;
    transition-delay: calc(1s + var(--i) * 55ms);
}

/* source: small letter-spaced capitals, after the last word */
#quotes cite {
    margin-top: 30px;
    font-size: 13px;
    line-height: 1.6;
    font-style: normal;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: #d1e3e3;
}
#quotes > li.is-active cite {
    opacity: 1;
    transition: opacity 1.2s ease-in-out;
    transition-delay: calc(1.6s + var(--n, 20) * 55ms);
}

@media (prefers-reduced-motion: reduce) {
    #quotes > li,
    #quotes > li::before,
    #quotes > li blockquote,
    #quotes > li cite,
    #quotes .q-word,
    #quotes > li.is-active::before,
    #quotes > li.is-active blockquote,
    #quotes > li.is-active .q-word,
    #quotes > li.is-active cite {
        transition-duration: .01s !important;
        transition-delay: 0s !important;
        filter: none !important;
        transform: none !important;
    }
}


/* -------------------------------------------------------------------
   Mobile (phones, portrait)
   1. background image fills the full screen height
   2. quotes sit at the bottom, under the portrait
---------------------------------------------------------------------- */
@media (max-width: 767px) and (orientation: portrait) {

    /* 1. full height background, portrait centered and NOT cropped.
          The photo is scaled so the whole figure fits the screen width
          (220vw wide = 137.5vw tall); its bottom edge fades into the
          photo's own dark tone, which fills the rest of the screen.
          26% = horizontal position that puts the figure (approx. 17%-57%
          of the photo) in the middle of the screen. */
    .cover-background-landing {
        background-color: #0a0806 !important;
        background-image:
            linear-gradient(to bottom, rgba(10,8,6,0) 65%, rgba(10,8,6,1) 96%),
            url("../images/bg/home.jpg?v=20261113") !important;
        background-size: 220vw 137.5vw, 220vw auto !important;
        background-position: 26% 10px, 26% 10px !important;
        background-repeat: no-repeat !important;
        height: auto !important;
        min-height: 100vh;
        min-height: 100svh;
    }
    /* overrides the inline height the theme JS sets on .full-screen */
    .cover-background-landing > .container.full-screen {
        height: 100vh !important;
        height: 100svh !important;
        max-width: 100%;
        padding: 0;
    }

    /* 2. quotes: full width, anchored to the bottom of the screen */
    .cover-background-landing .container-fluid.row {
        height: 100%;
        margin: 0 !important;
        padding: 0 24px calc(40px + env(safe-area-inset-bottom)) !important;
        display: flex;
        align-content: flex-end !important;
        align-items: flex-end !important;
    }
    .cover-background-landing .col-7 {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        margin-left: 0 !important;      /* cancels offset-6 */
        padding: 0;
    }
    .cover-background-landing .rotate-content {
        display: block !important;      /* theme hides it at 640px and below */
        width: 100%;
    }
    .cover-background-landing #quotes {
        align-items: end;               /* every quote ends on the same line */
        text-align: center;
    }
    .cover-background-landing #quotes blockquote {
        font-size: 17px !important;
        line-height: 26px !important;
        margin-bottom: 0 !important;
        text-shadow: 0 1px 4px rgba(0,0,0,.6);
    }
    .cover-background-landing #quotes cite {
        font-size: 11px;
        line-height: 18px;
        letter-spacing: .26em;
        margin-top: 16px;
    }
    .cover-background-landing #quotes > li::before {   /* smaller quotation mark, centered */
        font-size: 72px;
        margin-bottom: 14px;
    }
}