/* ==========================================================================
   HAPPY DIWALI FESTIVAL BANNER
   A self-contained decoration that sits above .site-header. Every rule is
   scoped to .diwali-header-banner so nothing here can touch the logo,
   navigation, mobile menu or any existing component.

   Remove the banner: delete its include + stylesheet <link> in
   includes/header.php (see includes/diwali-banner.php for details).
   ========================================================================== */

.diwali-header-banner {
    --dw-gold: #ffd98a;
    --dw-amber: #ff9a3c;
    --dw-ember: #ff6a00;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(16px, 2.4vw, 26px) 0 clamp(12px, 2vw, 20px);
    text-align: center;
    color: #ffe9bd;
    background:
        radial-gradient(120% 150% at 50% -55%, #931c26 0%, rgba(147, 28, 38, 0) 62%),
        radial-gradient(55% 130% at 4% 108%, rgba(255, 140, 60, .2) 0%, rgba(255, 140, 60, 0) 64%),
        radial-gradient(55% 130% at 96% 108%, rgba(255, 140, 60, .2) 0%, rgba(255, 140, 60, 0) 64%),
        linear-gradient(180deg, #28060e 0%, #430a14 46%, #5c0f18 100%);
    border-bottom: 1px solid rgba(255, 205, 130, .32);
    box-shadow: inset 0 -30px 44px -30px rgba(255, 150, 60, .55);
    pointer-events: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Fine golden hairline along the very top edge. */
.diwali-header-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    height: 1px;
    opacity: .85;
    background: linear-gradient(90deg,
        rgba(255, 220, 150, 0),
        rgba(255, 232, 175, .75) 24%,
        #fff1cb 50%,
        rgba(255, 232, 175, .75) 76%,
        rgba(255, 220, 150, 0));
}

/* Soft texture + warm pools of light. Purely decorative. */
.diwali-banner__glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        radial-gradient(rgba(255, 214, 140, .55) 1px, transparent 1.5px),
        radial-gradient(circle at 14% 84%, rgba(255, 170, 70, .3), transparent 42%),
        radial-gradient(circle at 86% 84%, rgba(255, 170, 70, .3), transparent 42%);
    background-size: 20px 20px, 100% 100%, 100% 100%;
    opacity: .2;
    mix-blend-mode: screen;
    animation: diwali-breathe 9s ease-in-out infinite;
}

.diwali-banner__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.6vw, 22px);
    width: 100%;
    max-width: 1100px;
    min-height: clamp(84px, 13vw, 122px);
    margin: 0 auto;
    padding: 0 clamp(8px, 2vw, 16px);
}

.diwali-banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 clamp(2px, 1.2vw, 14px);
}

/* ------------------------------------------------------------- headline */
.diwali-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .22em;
    margin: 0;
    font-family: Georgia, "Times New Roman", "Noto Serif", serif;
    font-size: clamp(1.7rem, 4.7vw, 3.15rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: .045em;
    text-transform: uppercase;
    animation: diwali-rise .9s cubic-bezier(.22, .7, .2, 1) both;
}

.diwali-title__lamp {
    flex: 0 0 auto;
    font-size: .6em;
    line-height: 1;
    transform-origin: 50% 88%;
    filter: drop-shadow(0 0 7px rgba(255, 176, 70, .85)) drop-shadow(0 0 16px rgba(255, 120, 30, .45));
    animation: diwali-lamp 4.4s ease-in-out infinite;
}

.diwali-title__lamp:last-child {
    animation-delay: -2.2s;
}

.diwali-title__text {
    display: inline-block;
    color: #ffe3a6;
    white-space: nowrap;
    filter:
        drop-shadow(0 1px 0 rgba(70, 20, 0, .5))
        drop-shadow(0 0 12px rgba(255, 184, 76, .55))
        drop-shadow(0 0 28px rgba(255, 130, 30, .3));
}

/* Golden gradient fill + slow shimmer where background-clip:text exists. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .diwali-title__text {
        background-image: linear-gradient(100deg,
            #e7a437 0%,
            #ffe9a8 18%,
            #f4c05a 34%,
            #fff8dd 50%,
            #efb84e 66%,
            #ffe9a8 84%,
            #e7a437 100%);
        background-size: 200% 100%;
        background-position: 0% 50%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
        animation: diwali-shine 12s linear infinite;
    }
}

.diwali-subtitle {
    margin: .55em 0 0;
    font-family: Hind, "Segoe UI", system-ui, sans-serif;
    font-size: clamp(.78rem, 1.9vw, 1rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-wrap: balance;
    color: #ffe8bd;
    text-shadow: 0 0 12px rgba(255, 170, 60, .45);
    animation: diwali-rise 1s .16s cubic-bezier(.22, .7, .2, 1) both;
}

/* ---------------------------------------------------------------- diyas */
.diwali-diya-left,
.diwali-diya-right {
    position: relative;
    z-index: 1;
    flex: 0 0 clamp(98px, 15vw, 170px);
    align-self: stretch;
    min-height: clamp(78px, 12vw, 118px);
    pointer-events: none;
}

.diwali-diya {
    position: absolute;
    bottom: var(--y, 0%);
    left: var(--x, 50%);
    width: calc(var(--w, 90px) * var(--scale, 1));
    aspect-ratio: 1.5 / 1;
    transform: translateX(-50%);
    filter: saturate(1.06);
}

/* Clay bowl. Gradients only - no images, no requests. */
.diwali-diya__bowl {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50%;
    border-radius: 46% 54% 50% 50% / 82% 82% 24% 24%;
    background:
        radial-gradient(ellipse at 50% 122%, #3b1204 0 38%, transparent 64%),
        radial-gradient(ellipse at 27% 16%, #ffe2b0 0 7%, transparent 36%),
        radial-gradient(ellipse at 68% 13%, rgba(255, 222, 182, .45) 0 5%, transparent 30%),
        linear-gradient(180deg, #d97c38 0%, #b4551d 34%, #86360f 68%, #531c06 100%);
    box-shadow:
        inset 0 -4px 9px rgba(0, 0, 0, .5),
        inset 0 3px 4px rgba(255, 208, 152, .32),
        0 9px 18px rgba(60, 16, 0, .42);
}

/* The little pouring lip of a traditional clay diya. */
.diwali-diya__bowl::before {
    content: "";
    position: absolute;
    top: 12%;
    left: -8%;
    width: 30%;
    height: 46%;
    border-radius: 58% 42% 44% 56% / 60% 60% 40% 40%;
    background: linear-gradient(135deg, #c96a2b 0%, #9c4616 55%, #6d2a0b 100%);
    box-shadow: inset 0 2px 3px rgba(255, 205, 150, .35);
    transform: rotate(-8deg);
}

.diwali-diya-right .diwali-diya__bowl::before {
    right: -8%;
    left: auto;
    transform: rotate(8deg);
}

.diwali-diya__rim {
    position: absolute;
    top: -8%;
    left: 4%;
    right: 4%;
    height: 34%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 38%, #fff0cf 0 16%, #eeb97a 44%, #b46a2c 78%, #8a4519 100%);
    box-shadow:
        inset 0 1px 2px rgba(255, 248, 224, .85),
        0 1px 3px rgba(50, 15, 0, .42);
}

.diwali-diya__oil {
    position: absolute;
    top: 1%;
    left: 14%;
    right: 14%;
    height: 17%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 58%, #fffbd6 0 14%, #ffd268 40%, #e08a2b 78%, #a85a17 100%);
    box-shadow: 0 0 12px 4px rgba(255, 182, 84, .55);
    animation: diwali-oil 4.8s ease-in-out infinite;
}

.diwali-diya__wick {
    position: absolute;
    top: -6%;
    left: 50%;
    width: 3.5%;
    height: 12%;
    border-radius: 45% 45% 25% 25%;
    background: linear-gradient(180deg, #1f1309 0%, #4a3018 70%, #6b4a26 100%);
    box-shadow: 0 0 5px rgba(255, 210, 140, .8);
    transform: translateX(-50%);
}

/* Three soft layers so the flame reads as light, not a blinking dot. */
.diwali-flame {
    position: absolute;
    bottom: 51%;
    left: 50%;
    width: 19%;
    aspect-ratio: 1 / 1.62;
    transform: translateX(-50%);
    transform-origin: 50% 100%;
    animation: var(--fl, diwali-flicker-a) var(--fd, 3.2s) ease-in-out var(--d, 0s) infinite;
    filter:
        drop-shadow(0 0 5px rgba(255, 178, 72, .9))
        drop-shadow(0 0 14px rgba(255, 120, 26, .55))
        drop-shadow(0 0 26px rgba(255, 90, 10, .28));
}

.diwali-flame__core,
.diwali-flame__tip {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50% 50% 50% 50% / 66% 66% 34% 34%;
}

.diwali-flame__core {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 86%, rgba(120, 190, 255, .5) 0 5%, rgba(120, 190, 255, 0) 16%),
        radial-gradient(ellipse at 50% 80%, #fffbe2 0 11%, #ffe08a 30%, #ffae42 56%, #ff7a1a 82%, rgba(255, 84, 6, .9) 100%);
    box-shadow: inset 0 -6px 8px -4px rgba(90, 170, 255, .55);
}

.diwali-flame__tip {
    bottom: 48%;
    width: 58%;
    height: 56%;
    border-radius: 50% 50% 42% 42% / 72% 72% 28% 28%;
    transform-origin: 50% 100%;
    background: linear-gradient(180deg, rgba(255, 140, 40, 0) 0%, rgba(255, 150, 48, .85) 42%, #ffd27a 100%);
    animation: diwali-flame-tip 2.2s ease-in-out infinite;
}

.diwali-diya__halo {
    position: absolute;
    bottom: 28%;
    left: 50%;
    width: 140%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 196, 106, .4) 0%, rgba(255, 148, 48, .18) 32%, rgba(255, 120, 40, 0) 66%);
    mix-blend-mode: screen;
    transform: translateX(-50%);
    animation: diwali-halo-pulse 5.2s ease-in-out var(--d, 0s) infinite;
}

.diwali-diya__shadow {
    position: absolute;
    bottom: -7%;
    left: 6%;
    right: 6%;
    height: 14%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 50%, rgba(255, 168, 78, .5) 0%, rgba(170, 70, 16, .26) 48%, transparent 74%);
    filter: blur(2px);
}

/* ---------------------------------------------------------- LED string */
.diwali-led-lights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    height: 26px;
    padding: 0 clamp(6px, 2.2vw, 28px);
    pointer-events: none;
}

/* The wire the bulbs hang from. */
.diwali-led-lights::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: linear-gradient(90deg,
        rgba(255, 220, 160, .05),
        rgba(255, 220, 160, .5) 12%,
        rgba(255, 220, 160, .5) 88%,
        rgba(255, 220, 160, .05));
    box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.diwali-led {
    --c: #ffd88a;
    --c2: #c98a2a;
    --g: rgba(255, 216, 138, .85);
    position: relative;
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fff 0 16%, var(--c) 52%, var(--c2) 100%);
    box-shadow:
        0 0 5px 1px var(--g),
        0 0 12px 2px rgba(255, 170, 70, .18);
    animation-name: diwali-led-steady;
    animation-duration: 6.8s;
    animation-timing-function: ease-in-out;
    animation-delay: var(--dl, 0s);
    animation-iteration-count: infinite;
}

/* Short stem up to the wire. */
.diwali-led::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 1.5px;
    height: 5px;
    background: rgba(255, 225, 175, .5);
    transform: translateX(-50%);
}

/* Coloured halo - animated instead of box-shadow, so it stays cheap. */
.diwali-led::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--g) 0%, rgba(255, 180, 90, .25) 38%, transparent 70%);
    opacity: .45;
    animation: diwali-led-halo calc(var(--dur, 6.8s) * 1.15) ease-in-out var(--dl, 0s) infinite;
}

.diwali-led--red    { --c: #ff6b5c; --c2: #b32417; --g: rgba(255, 90, 70, .8); }
.diwali-led--yellow { --c: #ffe066; --c2: #c79a12; --g: rgba(255, 215, 70, .8); }
.diwali-led--green  { --c: #6ee7a0; --c2: #138a4a; --g: rgba(80, 230, 140, .75); }
.diwali-led--blue   { --c: #7db8ff; --c2: #1c5bb8; --g: rgba(100, 170, 255, .78); }
.diwali-led--white  { --c: #fff6dd; --c2: #c8a86a; --g: rgba(255, 244, 214, .85); }

/* Three gentle behaviours: hold, slow dim, and a soft fade. */
.diwali-led--steady { --dur: 6.8s; animation-name: diwali-led-steady; }
.diwali-led--slow   { --dur: 5.4s; animation-name: diwali-led-slow; }
.diwali-led--fade   { --dur: 7.6s; animation-name: diwali-led-fade; }

/* ------------------------------------------------------------ sparkles */
.diwali-sparkles {
    position: absolute;
    inset: -32% -10% -28%;
    z-index: 3;
    pointer-events: none;
}

.diwali-sparkles i {
    position: absolute;
    top: var(--y, 50%);
    left: var(--x, 50%);
    width: var(--s, 4px);
    height: var(--s, 4px);
    border-radius: 50%;
    background: radial-gradient(circle, #fffbe4 0 28%, #ffdd8a 58%, rgba(255, 190, 82, 0) 76%);
    filter: drop-shadow(0 0 4px rgba(255, 210, 120, .9));
    opacity: 0;
    transform: translate(-50%, -50%) scale(.35);
    animation:
        diwali-twinkle var(--dr, 4s) ease-in-out var(--dl, 0s) infinite,
        diwali-drift calc(var(--dr, 4s) * 2.2) ease-in-out var(--dl, 0s) infinite alternate;
}

/* Every fourth particle is a small four-point star instead of a dot. */
.diwali-sparkles i:nth-child(4n + 1) {
    border-radius: 0;
    background: linear-gradient(160deg, #fffbe4, #ffcf6b 70%);
    clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
}

/* ------------------------------------------------------------ keyframes */
@keyframes diwali-rise {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

@keyframes diwali-shine {
    from { background-position: 0% 50%; }
    to   { background-position: 200% 50%; }
}

@keyframes diwali-lamp {
    0%, 100% { transform: translateY(1px) scale(.98); opacity: .92; }
    50%      { transform: translateY(-1px) scale(1.02); opacity: 1; }
}

@keyframes diwali-breathe {
    0%, 100% { opacity: .16; }
    50%      { opacity: .26; }
}

@keyframes diwali-flicker-a {
    0%, 100% { transform: translateX(-50%) rotate(0deg) scale(1, 1); }
    20% { transform: translateX(-52%) rotate(-2.4deg) scale(.96, 1.05); }
    43% { transform: translateX(-49%) rotate(1.8deg) scale(1.03, .97); }
    66% { transform: translateX(-51%) rotate(-1.1deg) scale(.98, 1.03); }
    84% { transform: translateX(-50.5%) rotate(1.2deg) scale(1.01, .99); }
}

@keyframes diwali-flicker-b {
    0%, 100% { transform: translateX(-50%) rotate(.6deg) scale(1, 1); }
    17% { transform: translateX(-48.5%) rotate(2.4deg) scale(1.03, .96); }
    38% { transform: translateX(-51%) rotate(-1.6deg) scale(.97, 1.04); }
    61% { transform: translateX(-49.5%) rotate(2deg) scale(1.02, .98); }
    82% { transform: translateX(-52%) rotate(-2.2deg) scale(.95, 1.06); }
}

@keyframes diwali-flicker-c {
    0%, 100% { transform: translateX(-50%) rotate(-.8deg) scale(1, 1); }
    26% { transform: translateX(-51%) rotate(1.5deg) scale(.96, 1.06); }
    54% { transform: translateX(-48.5%) rotate(-2.5deg) scale(1.05, .95); }
    77% { transform: translateX(-51.5%) rotate(.9deg) scale(.99, 1.02); }
}

@keyframes diwali-flame-tip {
    0%, 100% { transform: translateX(-50%) scaleY(1) rotate(0deg); opacity: .9; }
    50%      { transform: translateX(-50%) scaleY(1.14) rotate(3deg); opacity: 1; }
}

@keyframes diwali-halo-pulse {
    0%, 100% { opacity: .72; transform: translateX(-50%) scale(1); }
    50%      { opacity: 1; transform: translateX(-50%) scale(1.07); }
}

@keyframes diwali-oil {
    0%, 100% { opacity: .88; }
    50%      { opacity: 1; }
}

@keyframes diwali-led-steady {
    0%, 100% { opacity: .92; }
    50%      { opacity: 1; }
}

@keyframes diwali-led-slow {
    0%, 100% { opacity: 1; }
    45%      { opacity: .38; }
    55%      { opacity: .48; }
}

@keyframes diwali-led-fade {
    0%, 100% { opacity: .28; }
    50%      { opacity: .95; }
}

@keyframes diwali-led-halo {
    0%, 100% { opacity: .3; transform: scale(.9); }
    50%      { opacity: .62; transform: scale(1.08); }
}

@keyframes diwali-twinkle {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
    45%      { opacity: .95; transform: translate(-50%, -50%) scale(1); }
    70%      { opacity: .45; transform: translate(-50%, -50%) scale(.8); }
}

@keyframes diwali-drift {
    from { translate: 0 0; }
    to   { translate: var(--dx, 2px) var(--dy, -6px); }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 900px) {
    .diwali-diya-left,
    .diwali-diya-right {
        flex-basis: clamp(76px, 13vw, 124px);
        min-height: clamp(72px, 11vw, 100px);
    }

    .diwali-diya { --scale: .84; }

    .diwali-banner__inner { min-height: 96px; gap: 8px; }

    .diwali-title { font-size: clamp(1.6rem, 5.4vw, 2.5rem); }

    .diwali-diya--2 { --scale: .7; }
}

/* Phones: the banner is redesigned, not just scaled down - compact padding,
   one diya per side, a shorter bulb string and fewer particles. */
@media (max-width: 640px) {
    .diwali-header-banner { padding: 13px 0 12px; }

    .diwali-banner__inner {
        min-height: 66px;
        gap: 2px;
        padding: 0 6px;
    }

    .diwali-diya-left,
    .diwali-diya-right {
        flex-basis: 56px;
        min-height: 62px;
        align-self: flex-end;
    }

    .diwali-diya {
        --scale: .54;
        --x: 50%;
    }

    .diwali-diya--2,
    .diwali-diya--4 { display: none; }

    .diwali-banner-content { padding: 0 2px; }

    .diwali-title {
        flex-wrap: nowrap;
        gap: .16em;
        font-size: clamp(1.15rem, 6.2vw, 2.05rem);
        letter-spacing: .035em;
    }

    .diwali-title__lamp { font-size: .56em; }

    .diwali-subtitle {
        margin-top: .45em;
        font-size: clamp(.72rem, 1.9vw, .84rem);
        letter-spacing: .07em;
        line-height: 1.35;
    }

    .diwali-led-lights {
        height: 22px;
        padding: 0 5px;
    }

    .diwali-led {
        flex-basis: 7px;
        width: 7px;
        height: 7px;
        margin-top: 4px;
    }

    .diwali-led::before { height: 4px; }
    .diwali-led::after { inset: -6px; }

    /* Thin the string out; keep it even, never flashing. */
    .diwali-led:nth-child(3n + 2) { display: none; }

    .diwali-sparkles i:nth-child(2n) { display: none; }
    .diwali-sparkles { inset: -26% -14% -24%; }
}

@media (max-width: 380px) {
    .diwali-diya-left,
    .diwali-diya-right { flex-basis: 46px; }

    .diwali-diya { --scale: .46; }
}

/* -------------------------------------------------------- accessibility */
@media (prefers-reduced-motion: reduce) {
    .diwali-header-banner *,
    .diwali-header-banner *::before,
    .diwali-header-banner *::after {
        animation: none !important;
        transition: none !important;
    }

    .diwali-title__text { background-position: 0% 50%; }
    .diwali-led { opacity: .92; }
    .diwali-led::after { opacity: .45; }
    .diwali-flame { transform: translateX(-50%); }
    .diwali-sparkles i { opacity: .5; transform: translate(-50%, -50%); }
}
