/* no-js fallback: present the final, static layout when JS is disabled */
html:not(.js) #the-e,
html:not(.js) #the-e svg,
html:not(.js) #slogan {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}
html:not(.js) #program-coming {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
}
html:not(.js) nav {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* when JS is present, allow the intro elements to be visible so JS/GASP
   can set explicit pre-animation states (via gsap.set) before playing */
/* keep the-e as flex so its contents remain centered when JS is enabled */
html.js #the-e {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
}
html.js #the-e svg,
html.js #slogan {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}
html.js #program-coming {
    display: none !important;
    opacity: 0 !important;
}

/* if intro already played, present the final rendered state immediately */
html.intro-played #entro-block {
    background: rgba(0,0,0,0) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html.intro-played #the-e,
html.intro-played #the-e svg,
html.intro-played #slogan {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}
html.intro-played #program-coming {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
}
/* keep program at bottom even when other intro elements are removed */
#entro-block #program-coming {
    margin-top: auto;
    align-self: center;
}
/* ensure navbar is visible after intro has been played (GSAP may have set it to 0) */
html.intro-played nav {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
    /*
    MAIN PAGE*/

/* hide footer on index page */
body.index-page footer {
    display: none;
}

#main-page {
    height: 100%;
    width: 100%;
    /* padding-top: var(--space-2xl); */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    overflow-y: scroll;
}

/*
 * Keep the desktop home page on the document scroller. The fixed intro and
 * background layers cover the viewport, so a nested, fixed overflow container
 * does not reliably receive wheel/trackpad input. It also prevents the global
 * window scroll listener from seeing the home-page scroll.
 */
@media (min-width: 769px) {
    body.index-page {
        padding-top: 0;
    }

    body.index-page .page-contents {
        margin-top: 0;
    }

    #main-page {
        min-height: 100vh;
        height: auto;
        position: relative;
        overflow: visible;
    }
}
@media (max-width: 768px) {
    #main-page {
        min-height: 110vh;
        position: relative;
        overflow: visible;
        height: auto;
    }
}

#entro-block {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    color: var(--accent);
    backdrop-filter: blur(2rem);
    -webkit-backdrop-filter: blur(2rem);
    background: rgba(0,0,0,0);
    z-index: 99999; 
}

#the-e {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 5;
}

#the-e svg {
    width: 35vmin;
    height: auto;
    max-width: 90%;
    max-height: 90%;
}

#slogan h1, #program-coming{
    font-size: var(--fs-md);
    padding-bottom: var(--space-xl);
}


@media (max-width: 768px) {
    #program-coming{
        text-align: left;
        margin-bottom: var(--space-xl);
        padding-left: 1rem;
        padding-right: 25%;
}
}


.background-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    z-index: 1;
}
.background-slideshow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0; /* keep overlay behind the intro block */
    background: linear-gradient(to top, #00000080 0%, transparent 100%);
}


#fixed-info {
    color: var(--accent);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    pointer-events: none; /* let clicks pass through except where children enable it */
    z-index: 40;
}

#fixed-info > #festival-date {
    grid-column: 1 / 2;
    align-self: start;
    justify-self: start;
    margin: var(--space-md);
    margin-top: 50vh;
    pointer-events: auto;
    z-index: 41;
}

/* tagline lives in the second, scrollable block */
.text-layer #tagline {
    position: relative;
    bottom: 0;
    left: 0;
    grid-column: span 4;
    align-self: start;
    justify-self: start;
    padding: var(--space-lg);
    font-size: var(--fs-sm) !important;
    text-shadow: 0px 0px 4px black;
    z-index: 10;
}

#fixed-info > #location-spots {
    grid-column: 6 / 7;
    align-self: start;
    justify-self: end;
    margin: var(--space-md);
    margin-top: 50vh !important;
    pointer-events: auto;
    z-index: 41;

    @media (max-width: 768px) {
        margin: 0;
    }
}

#fixed-info > #image-caption {
    /* TODO: caption is a bit off */
    grid-column: 6 / 7;
    align-self: end;
    justify-self: end;
    width: auto;
    height: auto;
    position: relative; /* positioned inside fixed grid */
    z-index: 42;
}

#fixed-info > #image-caption .image-caption-inner {
    position: relative;
    right: 0;
    bottom: 0;
    width: 14rem;
    padding: 0;
    pointer-events: auto; 
}

@media (max-width: 768px) {
    .background-slideshow {
        position: fixed;
        height: 100vh;
    }
}

.background-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.background-slide.active {
    opacity: 1;
}



/* nav logo */
body.index-page #nav-logo {
    position: static;
    grid-column: 1 / 2;
    grid-row: 1 / 1;
    width: 165px;
    height: auto;
    z-index: 10;
    display: block !important;
}
@media (max-width: 768px) {
    body.index-page #nav-logo {
        width: auto;
        height: 100%;
    }
}

#hero-h1 {
    background-color: transparent;
    z-index: 10;
    font-size: var(--fs-md);
    font-weight: normal;
    color: var(--accent);
    text-shadow: var(--shadow);
    margin: 0;
    line-height: 96%;
}
/* br is used as a new paragraph in big bodys of text elsewhere */
#hero-h1 br {
    margin: 0 !important;
}
    @media (max-width: 768px) {
    #hero-h1 {
        font-size: var(--fs-md);
        /* position: absolute; */
        top: 6.5rem;
    }
}

/* when hero text is moved into nav */
nav #hero-h1 {
    grid-column: 2 / 3;
    grid-row: 1 / 1;
    align-self: end;
}

nav.menu-active #hero-h1 {
    text-shadow: none;
}

#logo {
    grid-column: 5 / 7;
    grid-row: 1 / 1;
    justify-self: end;
    align-self: end;
    color: var(--accent);
    z-index: 10;
    /* line-height: 1; */
    padding-block: var(--space-xl);
}

.text-layer {
    /* max-height: 110svh; */
    /* height: 100%; */
    color: var(--accent);
    margin-top: 100vh; /* place this block after the 1st (intro) block */
    /* min-height: 100vh; */
    position: relative;
    z-index: 4;
}

    @media (max-width: 768px) {
    #tagline {
        /* grid-column: 1 / -1; */
        font-size: var(--fs-xl) !important;
        line-height: 1.1;
        margin-bottom: var(--space-5xl);
    }

    #location-spots {
        /* grid-column: 1 / -1; */
        /* justify-self: end; */
        /* margin: 0 !important;
        margin-top: 50vh !important; */
        margin-block: var(--space-lg);
        /* text-align: right; */
        font-size: var(--fs-sm);
    }
    #festival-date{
        margin: 0 !important;
        margin-top: 40vh !important;
        font-size: var(--fs-sm);
        grid-column: 1 / 4;
        /* margin-top: 15vh; */
    }
}


#image-caption {
    position: relative;
    z-index: 50;
    color: var(--accent);
    text-shadow: var(--shadow);
    font-size: var(--fs-base);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    text-align: left;
    pointer-events: none;
    width: auto;
    height: auto;
}

#image-caption.visible {
    opacity: 1;
}


#image-caption .image-caption-inner {
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: flex-start;
    transform-origin: bottom left;
    pointer-events: auto;
    width: 7.5rem;
}

.actual-f-text {
    position: absolute;
    width: auto;
    transform-origin: top left;
    bottom: var(--space-md);
}

#image-caption .film-title {
    font-size: var(--fs-base);
    margin: var(--space-md);
}

#image-caption .film-details {
    font-size: var(--fs-base);
}

@media (max-width: 768px) {
    #image-caption {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        top: auto;
        padding: 0;
        text-align: left;
        width: 100%;
        height: auto;
        grid-column: 1 / -1;
        grid-row: 7 / 8; /* place it after tagline which is at row 6 */
        margin-top: var(--space-lg);
    }

    #image-caption .image-caption-inner {
        position: relative;
        transform-origin: initial;
        align-items: flex-start;
        justify-content: start;
        width: 100%;
        padding: 0;
        height: auto;
        right: auto;
        bottom: auto;
    }
    
    #image-caption .film-title {
        font-size: var(--fs-base);
    }
    
    #image-caption .film-details {
        font-size: var(--fs-base);
    }
    
    .actual-f-text {
        align-items: start;
        position: relative;
        rotate: 0deg;
        width: auto;
        border: none;
        bottom: auto;
        transform-origin: initial;
    }
}

/* screen reader only content for seo */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
