/* ===========================================================================
   Independence Day theme — 7 Oak Developers
   TEMPORARY. Loaded only while component/festival.php says the date matches.
   Deleting this file + independence-day.js + festival.php removes the theme
   entirely; nothing else depends on it.

   Scope: the preloader keeps its stock wordmark and only gains a tricolour
   exit wipe. The visible theming is the sticky-header strip and the cursor
   trail.
   =========================================================================== */

:root {
    --id-saffron: #FF9933;
    --id-white: #FFFFFF;
    --id-green: #138808;

    /* Sits on the bottom edge of the sticky menu bar. 6px, not 3px: split
       three ways, 3px gives each band a single pixel and the whole thing
       renders as one muddy grey hairline. 2px per band reads as a tricolour. */
    --id-strip-height: 6px;
}

/* ---------------------------------------------------------------------------
   1. Tricolour strip — sticky header only
   Scoped to .sticky-wrapper.sticky (main.js adds that class past 500px of
   scroll), so the header at rest is left completely untouched. Anchored to
   .menu-area, which is already position:relative, so no layout shift.
   ------------------------------------------------------------------------- */
.sticky-wrapper.sticky .menu-area::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--id-strip-height);
    z-index: 3;
    background: linear-gradient(180deg,
            var(--id-saffron) 0 33.333%,
            var(--id-white) 33.333% 66.666%,
            var(--id-green) 66.666% 100%);
}

/* ---------------------------------------------------------------------------
   2. Preloader shell
   The container restyles itself rather than leaning on .preloader, because
   independence-day.js drops that class to stop main.js fading it out early.
   ------------------------------------------------------------------------- */
.id-preloader {
    position: fixed;
    inset: 0;
    /* Above component/popup.php, which is also 99999 and sits later in the DOM,
       so on a slow load the timed callback popup would otherwise win the tie
       and open on top of the preloader. */
    z-index: 100010;
    overflow: hidden;
    background: transparent;
}

.id-preloader .id-panel {
    position: absolute;
    inset: 0;
    background-color: var(--black-color2, #1B1B1B);
}

.id-preloader .preloader-inner {
    z-index: 2;
}

.id-preloader.is-gone {
    display: none !important;
}

/* The wordmark's 60px line-box leaves ~10px of empty space under the glyphs and
   this line-box another ~5px above them, so the margin here reads about 15px
   larger than it measures. 12px lands at a ~27px optical gap, which keeps the
   greeting attached to the wordmark instead of floating below it. */
.id-preloader .id-greeting {
    margin: 12px 0 0;
    font-family: var(--title-font, sans-serif);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #E8E8E8;
}

.id-preloader .id-greeting .id-accent {
    color: var(--orange1);
}

@media (max-width: 991.98px) {
    .id-preloader .id-greeting {
        font-size: 12px;
        letter-spacing: .1em;
        margin-top: 8px;
    }
}

/* ---------------------------------------------------------------------------
   3. Unfurl wipe — three bands sweep across, then off, revealing the page.
   Deliberately NOT carrying an Ashoka Chakra: without it this reads as an
   abstract tricolour transition rather than a flag being swiped off-screen.
   ------------------------------------------------------------------------- */
.id-preloader .id-bands {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.id-preloader .id-band {
    position: absolute;
    left: 0;
    display: block;
    width: 100%;
    height: 33.34%;
    transform: translateX(-101%);
    will-change: transform;
}

.id-preloader .id-band:nth-child(1) {
    top: 0;
    background-color: var(--id-saffron);
}

.id-preloader .id-band:nth-child(2) {
    top: 33.33%;
    background-color: var(--id-white);
}

.id-preloader .id-band:nth-child(3) {
    top: 66.66%;
    background-color: var(--id-green);
}

.id-preloader.is-leaving .id-band {
    animation: id-unfurl 1.05s cubic-bezier(.76, 0, .24, 1) forwards;
}

.id-preloader.is-leaving .id-band:nth-child(2) {
    animation-delay: .07s;
}

.id-preloader.is-leaving .id-band:nth-child(3) {
    animation-delay: .14s;
}

@keyframes id-unfurl {
    0% {
        transform: translateX(-101%);
    }

    46%,
    54% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(101%);
    }
}

.id-preloader.is-leaving .preloader-inner {
    opacity: 0;
    transition: opacity .28s ease;
}

/* Drop the dark panel while the bands cover the screen, so the sweep-out
   reveals the page rather than the panel. */
.id-preloader.is-leaving .id-panel {
    opacity: 0;
    transition: opacity .01s linear .52s;
}

/* ---------------------------------------------------------------------------
   4. Jet-trail cursor canvas
   ------------------------------------------------------------------------- */
.id-trail {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9990;
    pointer-events: none;
}

/* ---------------------------------------------------------------------------
   5. Reduced motion — keep the theme, drop the movement
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .id-preloader.is-leaving {
        opacity: 0;
        transition: opacity .3s ease;
    }

    .id-preloader.is-leaving .id-band {
        animation: none;
    }

    .id-trail {
        display: none;
    }
}
