/* ==========================================================================
   Homepage Next Pournami Girivalam - Divine Lunar Glow
   External animation & theme stylesheet (scoped to .pournami-card)
   ========================================================================== */

.pournami-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 85% 35%, rgba(138, 59, 87, 0.38), transparent 50%),
        linear-gradient(120deg, #260911 0%, #410C1C 55%, #711B38 100%);
    border: 1px solid rgba(200, 171, 128, 0.36);
    box-shadow: 0 20px 56px rgba(28, 5, 13, 0.32);
    color: #FFF9F2;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 320ms ease,
                border-color 320ms ease;
}

.pournami-card .event-card-header,
.pournami-card .event-card-body {
    position: relative;
    z-index: 2;
}

.pournami-card .event-card-header {
    border-bottom-color: rgba(200, 171, 128, 0.24);
}

/* Text Colouring & Row Surface */
.pournami-card .event-card-heading {
    color: #F3DFBE;
}

.pournami-card .event-link-row {
    background: rgba(255, 249, 242, 0.06);
    border: 1px solid rgba(200, 171, 128, 0.22);
}

.pournami-card .event-link-row:hover {
    background: rgba(255, 249, 242, 0.11);
    border-color: rgba(200, 171, 128, 0.45);
    transform: translateY(-2px);
}

.pournami-card .event-title {
    color: #FFF9F2;
    overflow-wrap: break-word;
}

.pournami-card .event-pill {
    background: #F0DFC2;
    color: #410C1C;
    border: 1px solid #C8AB80;
    font-weight: 600;
}

.pournami-card .event-pill-secondary {
    background: rgba(35, 10, 27, 0.65);
    color: #F7E8DC;
    border: 1px solid rgba(232, 213, 184, 0.25);
    font-weight: 500;
}

.pournami-card .event-empty {
    color: rgba(247, 232, 220, 0.82);
}

/* Decorative Lunar Scene (always behind content & calendar button) */
.home-lunar-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Side-to-side Ambient Moonlight Mist */
.home-lunar-mist {
    position: absolute;
    inset: -12%;
    pointer-events: none;
    background:
        radial-gradient(ellipse 46% 42% at 80% 30%, rgba(241, 222, 186, 0.14) 0%, transparent 65%),
        radial-gradient(ellipse 40% 36% at 62% 72%, rgba(172, 70, 84, 0.16) 0%, transparent 68%);
    opacity: 0.78;
    will-change: transform, opacity;
    transition: opacity 420ms ease, transform 520ms ease;
    animation: homeLunarMist 4.8s ease-in-out 1 both;
}

/* Delicate Twinkling Stars (concentrated on right-hand background) */
.home-lunar-stars {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 68%;
    pointer-events: none;
    background-image:
        radial-gradient(1.4px 1.4px at 42% 22%, rgba(255, 249, 242, 0.85) 45%, transparent 100%),
        radial-gradient(1.2px 1.2px at 58% 68%, rgba(241, 222, 186, 0.78) 45%, transparent 100%),
        radial-gradient(1.6px 1.6px at 74% 16%, rgba(255, 249, 242, 0.9) 40%, transparent 100%),
        radial-gradient(1.2px 1.2px at 86% 48%, rgba(232, 213, 184, 0.75) 45%, transparent 100%),
        radial-gradient(1.5px 1.5px at 66% 84%, rgba(241, 222, 186, 0.82) 45%, transparent 100%),
        radial-gradient(1px 1px at 92% 78%, rgba(255, 249, 242, 0.72) 50%, transparent 100%);
    opacity: 0.65;
    will-change: opacity;
    animation: homeLunarTwinkle 4.6s ease-in-out 1 both;
}

.home-lunar-stars::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.2px 1.2px at 50% 40%, rgba(241, 222, 186, 0.8) 45%, transparent 100%),
        radial-gradient(1.5px 1.5px at 82% 28%, rgba(255, 249, 242, 0.88) 40%, transparent 100%),
        radial-gradient(1px 1px at 70% 56%, rgba(232, 213, 184, 0.7) 50%, transparent 100%);
    opacity: 0.55;
    will-change: opacity;
    animation: homeLunarTwinkleAlt 4.9s ease-in-out 0.3s 1 both;
}

/* Large Textured Background Moon (Upper-Right) */
.home-background-moon {
    position: absolute;
    top: 14px;
    right: 22px;
    width: 164px;
    aspect-ratio: 1;
    pointer-events: none;
    will-change: transform;
    animation: homeLunarDrift 4.8s ease-in-out 1 both;
}

.home-lunar-aura {
    position: absolute;
    inset: -38px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(241, 222, 186, 0.30) 24%,
        rgba(200, 171, 128, 0.14) 52%,
        transparent 74%
    );
    opacity: 0.72;
    will-change: transform, opacity;
    transition: opacity 380ms ease, transform 380ms ease;
    animation: homeLunarBreathe 4.8s ease-in-out 1 both;
}

.home-lunar-surface {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    opacity: 0.34;
    background:
        radial-gradient(circle at 28% 34%, rgba(164, 138, 102, 0.34) 0%, transparent 22%),
        radial-gradient(circle at 64% 48%, rgba(145, 116, 86, 0.28) 0%, transparent 20%),
        radial-gradient(circle at 46% 70%, rgba(160, 130, 98, 0.24) 0%, transparent 22%),
        radial-gradient(circle at 36% 60%, rgba(154, 126, 94, 0.18) 0%, transparent 15%),
        radial-gradient(circle at 32% 28%, #FFFDF8 0%, #F5E6CA 48%, #C8AB80 86%, #9E7E56 100%);
    box-shadow:
        inset -10px -12px 24px rgba(84, 60, 38, 0.38),
        inset 4px 4px 12px rgba(255, 253, 245, 0.55),
        0 0 28px rgba(241, 222, 186, 0.28);
    transition: opacity 380ms ease;
}

/* Subtle Elliptical Lunar Orbital Ring & Travelling Light */
.home-lunar-orbit {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px solid rgba(241, 222, 186, 0.20);
    transform: rotate(-18deg) scaleY(0.62);
    pointer-events: none;
}

.home-lunar-orbit-light {
    position: absolute;
    inset: -18px;
    transform: rotate(-18deg) scaleY(0.62);
    pointer-events: none;
    will-change: transform;
    animation: homeLunarOrbitSweep 5s cubic-bezier(0.22, 1, 0.36, 1) 1 both;
}

.home-lunar-orbit-light::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background: #FFFDF1;
    box-shadow: 0 0 10px 2px rgba(241, 222, 186, 0.78);
    opacity: 0.72;
}

/* Stationary Small Moon Icon beside Event Title */
.pournami-card .pournami-moon {
    position: relative;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 38%, rgba(164, 138, 102, 0.22) 0%, transparent 24%),
        radial-gradient(circle at 64% 52%, rgba(145, 116, 86, 0.20) 0%, transparent 22%),
        radial-gradient(circle at 34% 30%, #FFFDF8 0%, #F5E6CA 48%, #C8AB80 100%);
    box-shadow:
        inset -4px -5px 10px rgba(92, 66, 44, 0.28),
        0 0 16px 3px rgba(241, 222, 186, 0.38);
    animation: homeSmallMoonBreathe 4.6s ease-in-out 1 both;
}

/* Subtle Desktop Hover Response (disabled on touch devices) */
@media (hover: hover) and (pointer: fine) {
    .pournami-card:hover {
        box-shadow: 0 26px 68px rgba(28, 5, 13, 0.46);
        border-color: rgba(241, 222, 186, 0.48);
    }

    .pournami-card:hover .home-lunar-aura {
        opacity: 0.92;
        transform: scale(1.08);
    }

    .pournami-card:hover .home-lunar-surface {
        opacity: 0.42;
    }

    .pournami-card:hover .home-lunar-mist {
        opacity: 1;
        transform: translate3d(-10px, 0, 0);
    }
}

/* Keyframes (Entrance Sequence <= 5s) */
@keyframes homeLunarBreathe {
    0% {
        transform: scale(0.92);
        opacity: 0.48;
    }
    55% {
        transform: scale(1.12);
        opacity: 0.85;
    }
    100% {
        transform: scale(1);
        opacity: 0.72;
    }
}

@keyframes homeLunarDrift {
    0% {
        transform: translate3d(8px, 6px, 0);
    }
    55% {
        transform: translate3d(-7px, -6px, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes homeLunarTwinkle {
    0% { opacity: 0.15; }
    50% { opacity: 0.78; }
    100% { opacity: 0.65; }
}

@keyframes homeLunarTwinkleAlt {
    0% { opacity: 0.15; }
    50% { opacity: 0.72; }
    100% { opacity: 0.55; }
}

@keyframes homeLunarMist {
    0% {
        opacity: 0.45;
        transform: translate3d(14px, 0, 0);
    }
    60% {
        opacity: 0.88;
        transform: translate3d(-10px, 0, 0);
    }
    100% {
        opacity: 0.78;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes homeLunarOrbitSweep {
    from {
        transform: rotate(-18deg) scaleY(0.62) rotateZ(-35deg);
    }
    to {
        transform: rotate(-18deg) scaleY(0.62) rotateZ(25deg);
    }
}

@keyframes homeSmallMoonBreathe {
    0% { opacity: 0.75; }
    55% { opacity: 1; }
    100% { opacity: 1; }
}

/* Tablet */
@media (max-width: 991px) {
    .home-background-moon {
        width: 142px;
        top: 14px;
        right: 18px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .home-background-moon {
        width: 114px;
        top: 12px;
        right: 12px;
    }

    .home-lunar-aura {
        inset: -26px;
    }

    .home-lunar-orbit,
    .home-lunar-orbit-light {
        inset: -12px;
    }

    .home-lunar-stars::after {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pournami-card,
    .pournami-card *,
    .pournami-card *::before,
    .pournami-card *::after {
        animation: none !important;
        transition: none !important;
    }
}
