/**
 * Premium Diwali Celebration Experience — Core Styling
 * Completely namespaced under dw-* to guarantee zero collisions.
 * Hardware-accelerated with CSS transform & opacity only.
 */

/* ==========================================================================
   1. AMBIENT WARM FESTIVE LIGHTING
   ========================================================================== */
.dw-festive-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 890;
  overflow: hidden;
  contain: strict;
}

.dw-festive-ambient-glow {
  position: absolute;
  width: clamp(200px, 25vw, 360px);
  height: clamp(200px, 25vw, 360px);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.14;
  filter: blur(50px);
  transform: translate3d(0, 0, 0);
}

.dw-festive-ambient-tl {
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, #FFD36B 0%, #EA580C 50%, transparent 70%);
}

.dw-festive-ambient-tr {
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, #FFD36B 0%, #EA580C 50%, transparent 70%);
}

/* ==========================================================================
   2. WELCOME CELEBRATION (TASK 1: PURE SKY TEXT, NO POPUP CARD)
   ========================================================================== */
.dw-sky-greeting {
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.dw-festive-greeting-title {
  margin: 0 0 8px 0;
  font-family: 'Cinzel', 'Noto Sans Devanagari', 'Georgia', serif;
  font-weight: 700;
  font-size: clamp(30px, 6.5vw, 56px);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF5D9 25%, #FFD36B 60%, #D4AF37 85%, #B8860B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #FFD36B;
  filter: drop-shadow(0 2px 16px rgba(255, 215, 0, 0.6)) drop-shadow(0 4px 20px rgba(0, 0, 0, 0.95));
}

.dw-festive-greeting-sub {
  margin: 0;
  font-family: 'Noto Sans Devanagari', 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(15px, 2.2vw, 21px);
  line-height: 1.4;
  color: #FFF5D9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 16px rgba(255, 215, 0, 0.45);
  max-width: 580px;
  margin-inline: auto;
}

/* ==========================================================================
   3. TRADITIONAL HANGING LANTERNS (TASK 4: ZERO CLIPPING & HEADER HARMONY)
   ========================================================================== */
#dw-festive-lanterns-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 190px;
  pointer-events: none;
  z-index: 2005; /* Sits cleanly in front of sticky header without clipping */
  overflow: visible;
  contain: layout style;
}

.dw-festive-lantern {
  position: absolute;
  top: 0;
  line-height: 0;
  transform-origin: 50% 0;
  will-change: transform;
  animation: dwFestiveSwing 4.5s ease-in-out infinite alternate;
  pointer-events: auto;
  cursor: pointer;
  transition: filter 0.25s ease;
}

.dw-festive-lantern svg {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  overflow: visible;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.dw-festive-lantern:hover {
  filter: brightness(1.25) drop-shadow(0 0 14px rgba(255, 215, 0, 0.75));
}

@keyframes dwFestiveSwing {
  0%   { transform: rotate(-3.5deg); }
  100% { transform: rotate(3.5deg); }
}

/* Strategic margin placement that leaves logo, menu, and CTAs 100% unobstructed */
.dw-lan-1 { left: 1.5%;  width: 46px; animation-duration: 4.8s; animation-delay: -0.5s; }
.dw-lan-2 { left: 18%;   width: 42px; animation-duration: 5.2s; animation-delay: -1.8s; }
.dw-lan-5 { left: 81%;   width: 42px; animation-duration: 5.4s; animation-delay: -2.8s; }
.dw-lan-6 { right: 1.5%; width: 46px; animation-duration: 4.6s; animation-delay: -1.2s; }

@media (max-width: 1199px) {
  .dw-lan-2, .dw-lan-5 { display: none; }
  .dw-lan-1 { left: 1.5%; width: 40px; }
  .dw-lan-6 { right: 1.5%; width: 40px; }
}

@media (max-width: 767px) {
  #dw-festive-lanterns-layer { height: 120px; }
  .dw-lan-1 { left: 4px; width: 34px; transform: scale(0.85); transform-origin: 0% 0%; }
  .dw-lan-6 { right: 4px; width: 34px; transform: scale(0.85); transform-origin: 100% 0%; }
}

/* ==========================================================================
   4. SCROLL-TRIGGERED MARIGOLD TORAN
   ========================================================================== */
#dw-festive-toran-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 54px;
  pointer-events: none;
  z-index: 2004;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

#dw-festive-toran-layer.dw-toran-visible {
  transform: translateY(0);
  opacity: 1;
}

.dw-festive-toran-row {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 40px;
  box-sizing: border-box;
}

.dw-festive-scallop {
  flex: 1 1 200px;
  height: 52px;
  transform-origin: 50% 0%;
  animation: dwToranSway 6.5s ease-in-out infinite alternate;
}

.dw-festive-scallop:nth-child(even) {
  animation-duration: 7.2s;
  animation-delay: -2.8s;
}

.dw-festive-scallop svg {
  width: 100%;
  height: 52px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

@keyframes dwToranSway {
  0%   { transform: rotate(-0.6deg); }
  100% { transform: rotate(0.6deg); }
}

@keyframes dwBulbBreathe {
  0%, 100% { opacity: 0.75; transform: scale(0.95); }
  50%      { opacity: 1;    transform: scale(1.1); }
}

.dw-bulb-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: dwBulbBreathe 2.5s ease-in-out infinite;
}

@media (max-width: 640px) {
  .dw-festive-toran-row { padding: 0 12px; height: 40px; }
  .dw-festive-scallop, .dw-festive-scallop svg { height: 38px; }
}

/* ==========================================================================
   5. SIDE ENTRANCE HANGING LAMPS (DESKTOP ONLY)
   ========================================================================== */
.dw-festive-side-entrance {
  position: fixed;
  top: 0;
  width: 75px;
  height: 280px;
  pointer-events: none;
  z-index: 900;
  transform-origin: 50% 0%;
  filter: drop-shadow(0 4px 10px rgba(255, 175, 40, 0.35));
}

.dw-festive-side-left {
  left: 2px;
  animation: dwSideSwingLeft 5.5s ease-in-out infinite alternate;
}

.dw-festive-side-right {
  right: 2px;
  animation: dwSideSwingRight 5.8s ease-in-out infinite alternate;
  animation-delay: -2.6s;
}

.dw-festive-side-entrance svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

@keyframes dwSideSwingLeft {
  0%   { transform: rotate(-1.4deg); }
  100% { transform: rotate(1.4deg); }
}

@keyframes dwSideSwingRight {
  0%   { transform: rotate(1.4deg); }
  100% { transform: rotate(-1.4deg); }
}

@media (max-width: 1199px) {
  .dw-festive-side-entrance { display: none !important; }
}

/* ==========================================================================
   6. ANIMATED CORNER DIYAS (TASK 3: ZERO CONTENT OVERLAP)
   ========================================================================== */
#dw-festive-diyas-layer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  pointer-events: none;
  z-index: 995;
  overflow: visible;
}

.dw-festive-diya-unit {
  position: absolute;
  bottom: 8px;
  line-height: 0;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.dw-festive-diya-unit:hover {
  transform: translateY(-3px) scale(1.08);
  filter: drop-shadow(0 0 14px rgba(255, 200, 50, 0.75));
}

.dw-festive-diya-unit svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.dw-diya-corner-left {
  left: 14px;
  width: 44px;
}

/* Placed safely at right: 105px to leave full clearance for WhatsApp button at right: 30px */
.dw-diya-corner-right {
  right: 105px;
  width: 44px;
}

/* Flame Animations */
.dw-flame-outer,
.dw-flame-mid,
.dw-flame-core {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  will-change: transform;
}

.dw-flame-outer { animation: dwDiyaFlicker1 2.2s ease-in-out infinite; }
.dw-flame-mid   { animation: dwDiyaFlicker2 1.6s ease-in-out infinite; }
.dw-flame-core  { animation: dwDiyaFlicker3 1.2s ease-in-out infinite; }

.dw-flame-glow {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: dwDiyaGlow 2.4s ease-in-out infinite;
  will-change: opacity, transform;
}

@keyframes dwDiyaFlicker1 {
  0%, 100% { transform: rotate(0deg) scale(1, 1); opacity: 1; }
  20%      { transform: rotate(-2.4deg) scale(0.95, 1.05); opacity: 0.94; }
  45%      { transform: rotate(1.8deg) scale(1.04, 0.95); opacity: 1; }
  70%      { transform: rotate(-1.5deg) scale(0.96, 1.06); opacity: 0.92; }
}

@keyframes dwDiyaFlicker2 {
  0%, 100% { transform: rotate(0deg) scale(1, 1); }
  30%      { transform: rotate(2.0deg) scale(0.94, 1.07); }
  65%      { transform: rotate(-2.2deg) scale(1.05, 0.93); }
}

@keyframes dwDiyaFlicker3 {
  0%, 100% { transform: scale(1, 1); opacity: 0.95; }
  40%      { transform: scale(0.9, 1.12); opacity: 1; }
  75%      { transform: scale(1.08, 0.92); opacity: 0.88; }
}

@keyframes dwDiyaGlow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  35%      { opacity: 1;   transform: scale(1.08); }
  70%      { opacity: 0.85; transform: scale(0.96); }
}

/* Rising Ember Sparks */
.dw-festive-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dw-festive-spark {
  position: absolute;
  bottom: 12px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: dwSparkRise linear infinite;
}

@keyframes dwSparkRise {
  0%   { transform: translate3d(0, 0, 0) scale(0.5); opacity: 0; }
  15%  { opacity: 0.95; }
  100% { transform: translate3d(var(--dw-dx, 0px), -100px, 0) scale(1.1); opacity: 0; }
}

@media (max-width: 991px) {
  .dw-diya-corner-right { right: 85px; }
}

@media (max-width: 767px) {
  #dw-festive-diyas-layer {
    height: 50px;
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .dw-diya-corner-left { left: 8px; width: 34px; bottom: 2px; }
  .dw-diya-corner-right { right: 8px; width: 34px; bottom: 2px; }
}

/* ==========================================================================
   7. UNIFIED SPARKLE CANVAS & INTERACTIVE BURSTS
   ========================================================================== */
#dw-festive-sparkle-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9993;
}

.dw-interactive-item {
  pointer-events: auto !important;
  cursor: pointer !important;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s ease;
}

.dw-interactive-item:hover {
  filter: brightness(1.22) drop-shadow(0 0 10px rgba(255, 215, 0, 0.7));
}

.dw-interactive-jolt {
  animation: none !important;
  transform: scale(1.08) rotate(3deg) !important;
  transition: transform 0.25s ease !important;
}

/* ==========================================================================
   8. EDITORIAL DEVOTIONAL SECTION (REDESIGNED)
   ========================================================================== */
.dw-editorial-section {
  background: #1B0202 !important;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  padding: 68px 0 72px;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.dw-editorial-card {
  background: rgba(36, 4, 4, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 12px;
  padding: 44px 40px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.dw-editorial-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #C5A059;
  margin-bottom: 14px;
}

.dw-eyebrow-accent {
  display: inline-block;
  width: 26px;
  height: 1.5px;
  background: #C5A059;
  flex-shrink: 0;
}

.dw-editorial-heading,
.dw-editorial-section .dw-editorial-heading,
.dw-editorial-card h2.dw-editorial-heading {
  font-family: 'Cinzel', 'Noto Sans Devanagari', Georgia, serif !important;
  font-weight: 600 !important;
  font-size: clamp(1.55rem, 2.6vw, 2.15rem) !important;
  line-height: 1.28 !important;
  color: #FFF8E7 !important;
  margin: 0 0 16px !important;
  letter-spacing: -0.2px !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
}

.dw-editorial-desc {
  font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif !important;
  color: #EAD8C3 !important;
  font-size: 0.98rem !important;
  line-height: 1.68 !important;
  max-width: 620px !important;
  margin: 0 0 24px !important;
  opacity: 0.92 !important;
}

.dw-editorial-action-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.dw-editorial-btn {
  background: #C5A059 !important;
  color: #1C0202 !important;
  font-family: 'Poppins', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  padding: 13px 32px !important;
  border-radius: 6px !important;
  border: none !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

.dw-editorial-btn:hover {
  background: #D4AF37 !important;
  color: #1C0202 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
}

.dw-editorial-trust {
  font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif;
  font-size: 0.82rem;
  color: #C5A059;
  letter-spacing: 0.4px;
  opacity: 0.88;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dw-editorial-visual {
  width: 100%;
}

.dw-visual-frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.dw-visual-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16/9;
  transition: transform 0.4s ease;
}

.dw-visual-frame:hover .dw-visual-img {
  transform: scale(1.02);
}

.dw-visual-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(16, 2, 2, 0.92) 0%, rgba(16, 2, 2, 0.5) 65%, transparent 100%);
  padding: 12px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.74rem;
  color: #EAD8C3;
  letter-spacing: 0.4px;
}

@media (max-width: 991px) {
  .dw-editorial-section { padding: 48px 0 52px; }
  .dw-editorial-card { padding: 32px 24px; }
  .dw-editorial-desc { font-size: 0.94rem !important; }
}

@media (max-width: 767px) {
  .dw-editorial-section { padding: 40px 0 44px; }
  .dw-editorial-card { padding: 26px 18px; }
  .dw-editorial-btn { width: 100%; justify-content: center; }
  .dw-editorial-action-block { align-items: stretch; }
  .dw-editorial-trust { justify-content: center; }
}

/* ==========================================================================
   9. PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .dw-festive-lantern,
  .dw-festive-scallop,
  .dw-festive-side-entrance,
  .dw-flame-outer,
  .dw-flame-mid,
  .dw-flame-core,
  .dw-flame-glow,
  .dw-bulb-glow,
  .dw-festive-spark {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   10. HERO FIREWORKS CANVAS (Z-Index above h3c-wrap, fully pass-through)
   ========================================================================== */
/* Ensure the white booking form and its fields always sit securely on top of ambient lanterns */
.h3c-right,
.universal-v3-form,
.universal-lead-form-box-v3 {
  position: relative !important;
  z-index: 20 !important;
}

#dw-hero-fireworks-canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 12 !important;
}

/* ==========================================================================
   11. FLOATING SKY LANTERNS (Gentle Ascending Glow in Hero Sky)
   ========================================================================== */
#dw-floating-lanterns-layer {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 11 !important; /* In front of hero background, behind fireworks bursts */
  overflow: hidden !important;
}

.dw-sky-lantern-item {
  position: absolute;
  bottom: -120px;
  pointer-events: none;
  will-change: transform, opacity;
  animation: dwLanternAscend 22s linear infinite;
}

/* Decoupled inner wrapper for GPU-accelerated wind drift & rotation */
.dw-sky-lantern-inner {
  width: 100%;
  pointer-events: none;
  will-change: transform;
}

.dw-sky-lantern-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 14px rgba(255, 140, 20, 0.78)) drop-shadow(0 0 28px rgba(255, 80, 0, 0.48));
  animation: dwLanternFlicker 3.2s ease-in-out infinite alternate;
}

/* Three distinct organic wind sway presets with realistic gentle tilt */
.dw-sway-1 {
  animation: dwLanternSway1 6.2s ease-in-out infinite alternate;
}
.dw-sway-2 {
  animation: dwLanternSway2 7.4s ease-in-out infinite alternate;
}
.dw-sway-3 {
  animation: dwLanternSway3 5.8s ease-in-out infinite alternate;
}

/* Desktop Ascent (travels above 1100px hero height smoothly) */
@keyframes dwLanternAscend {
  0% {
    transform: translateY(0) scale(0.92);
    opacity: 0;
  }
  6% {
    opacity: 0.95;
  }
  75% {
    opacity: 0.88;
  }
  100% {
    transform: translateY(-1250px) scale(0.55);
    opacity: 0;
  }
}

/* Mobile Ascent (travels above tall stacked mobile hero height) */
@media (max-width: 991px) {
  .dw-sky-lantern-item {
    animation-name: dwLanternAscendMobile !important;
  }
}

@keyframes dwLanternAscendMobile {
  0% {
    transform: translateY(0) scale(0.92);
    opacity: 0;
  }
  4% {
    opacity: 0.95;
  }
  78% {
    opacity: 0.88;
  }
  100% {
    transform: translateY(-1750px) scale(0.52);
    opacity: 0;
  }
}

/* Smooth GPU Sway Variations */
@keyframes dwLanternSway1 {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(22px) rotate(2.8deg);
  }
  100% {
    transform: translateX(-18px) rotate(-2.4deg);
  }
}

@keyframes dwLanternSway2 {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(-24px) rotate(-3.2deg);
  }
  100% {
    transform: translateX(20px) rotate(2.2deg);
  }
}

@keyframes dwLanternSway3 {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(18px) rotate(2.0deg);
  }
  100% {
    transform: translateX(-22px) rotate(-2.8deg);
  }
}

/* Flame Flicker Pulse */
@keyframes dwLanternFlicker {
  0% {
    filter: drop-shadow(0 0 12px rgba(255, 130, 20, 0.72)) drop-shadow(0 0 24px rgba(255, 70, 0, 0.42));
    opacity: 0.88;
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 175, 30, 0.95)) drop-shadow(0 0 38px rgba(255, 95, 10, 0.65));
    opacity: 1;
  }
}
