/* Shared Bengali Heritage Keyframe Animations & Responsive Enhancements */

@keyframes kgDrop {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  15% { opacity: 1; transform: translateY(0) scaleX(0.9); }
  78% { transform: translateY(38px) scale(0.8, 1.3); opacity: 1; }
  100% { transform: translateY(42px) scale(1.6, 0.25); opacity: 0; }
}

@keyframes kgSteam {
  0% { transform: translateY(10px) scaleX(0.85); opacity: 0; }
  30% { opacity: 0.85; }
  100% { transform: translateY(-34px) scaleX(1.25); opacity: 0; }
}

@keyframes kgBubble {
  0% { transform: scale(0); opacity: 0; }
  25% { opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes kgFlicker {
  0%, 100% { transform: scaleY(0.92) skewX(2deg); }
  50% { transform: scaleY(1.16) skewX(-3deg); }
}

@keyframes kgDheki {
  0%, 12%, 100% { transform: rotate(-3deg); }
  55%, 80% { transform: rotate(9deg); }
}

@keyframes kgKanthaFlow {
  0% { background-position: 0 0; }
  100% { background-position: 36px 0; }
}

@keyframes kgMarquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes kgRipple {
  0% { transform: scale(0.84); opacity: 0.65; }
  70% { opacity: 0.18; }
  100% { transform: scale(1.38); opacity: 0; }
}

@keyframes kgBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes kgFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes kgSpinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.anim-kg-drop { animation: kgDrop 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.anim-kg-steam-1 { animation: kgSteam 2.8s ease-out infinite; }
.anim-kg-steam-2 { animation: kgSteam 2.8s ease-out 0.9s infinite; }
.anim-kg-steam-3 { animation: kgSteam 2.8s ease-out 1.8s infinite; }
.anim-kg-bubble { animation: kgBubble 1.8s ease-in-out infinite; }
.anim-kg-flicker { animation: kgFlicker 0.9s ease-in-out infinite; transform-origin: bottom center; }
.anim-kg-dheki { animation: kgDheki 2.2s ease-in-out infinite; transform-origin: 50% 60%; }
.anim-kg-marquee { display: flex; width: max-content; animation: kgMarquee 28s linear infinite; }
.anim-kg-marquee:hover { animation-play-state: paused; }
.anim-kg-ripple { animation: kgRipple 2.8s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
.anim-kg-ripple-delay { animation: kgRipple 2.8s cubic-bezier(0.16, 1, 0.3, 1) 1.4s infinite; }
.anim-kg-breathe { animation: kgBreathe 3.4s ease-in-out infinite; }
.anim-kg-float { animation: kgFloat 4.5s ease-in-out infinite; }
.anim-kg-spin-slow { animation: kgSpinSlow 36s linear infinite; }

/* Nakshi Kantha Stitched Border Motif */
.nakshi-border {
  background-image:
    repeating-linear-gradient(90deg, #B85D19 0 8px, transparent 8px 14px),
    repeating-linear-gradient(90deg, #2D5A3C 0 8px, transparent 8px 14px),
    repeating-linear-gradient(0deg, #B85D19 0 8px, transparent 8px 14px),
    repeating-linear-gradient(0deg, #2D5A3C 0 8px, transparent 8px 14px);
  background-size: 28px 2px, 28px 2px, 2px 28px, 2px 28px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

/* Responsive Desktop Wide Mode Enhancement for Mobile-First Reference Themes */
@media (min-width: 1024px) {
  .ref-wide-desktop #truth-hook,
  .ref-wide-desktop section[aria-labelledby="pairing-receipt-heading"] {
    max-width: 920px !important;
  }
  .ref-wide-desktop section[aria-labelledby="pairing-receipt-heading"] ul,
  .ref-wide-desktop section[aria-labelledby="pairing-receipt-heading"] ol {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 24px !important;
  }
  .ref-wide-desktop #combo > div {
    max-width: 860px !important;
  }
}

/* Live Visual Editor Hover Highlight */
.cms-live-edit-active [data-cms-editable="true"]:hover,
.cms-live-edit-active h1:hover,
.cms-live-edit-active h2:hover,
.cms-live-edit-active h3:hover,
.cms-live-edit-active h4:hover,
.cms-live-edit-active p:hover,
.cms-live-edit-active img:hover {
  outline: 2px dashed #D97706 !important;
  outline-offset: 3px !important;
  cursor: pointer !important;
  position: relative;
}

/* Modern Heritage & Kinetic Animations for Custom Themes */
@keyframes kgFogDrift {
  0%, 100% { transform: translate3d(-4%, 0, 0) scaleX(1.04); opacity: 0.48; }
  50% { transform: translate3d(4%, -4px, 0) scaleX(1.08); opacity: 0.72; }
}

@keyframes kgFogDriftReverse {
  0%, 100% { transform: translate3d(4%, 0, 0) scaleX(1.05); opacity: 0.35; }
  50% { transform: translate3d(-4%, 4px, 0) scaleX(1.02); opacity: 0.6; }
}

@keyframes kgEmberRise {
  0% { transform: translate3d(0, 0, 0) scale(0.7); opacity: 0; }
  20% { opacity: 0.9; }
  75% { transform: translate3d(10px, -68px, 0) scale(1.1); opacity: 0.65; }
  100% { transform: translate3d(-6px, -95px, 0) scale(0.35); opacity: 0; }
}

@keyframes kgMoltenDrip {
  0%, 10% { transform: translateY(-6px) scaleY(0.8); opacity: 0; }
  25% { transform: translateY(0px) scaleY(1); opacity: 1; }
  75% { transform: translateY(42px) scaleY(1.25); opacity: 0.95; }
  100% { transform: translateY(58px) scaleY(0.4); opacity: 0; }
}

@keyframes kgShimmerSweep {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes kgMandalaSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes kgOrbitFloat {
  0%, 100% { transform: translateY(0px) translateX(0px); }
  50% { transform: translateY(-10px) translateX(4px); }
}

@keyframes kgWaveDrift {
  0%, 100% { transform: translateX(0px); }
  50% { transform: translateX(-18px); }
}

@keyframes kgLeafSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@keyframes kgStampPop {
  0% { transform: scale(1.22) rotate(-12deg); opacity: 0.2; }
  65% { transform: scale(0.96) rotate(-5deg); opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); opacity: 1; }
}

@keyframes kgThreadFlow {
  0% { background-position: 0 0; }
  100% { background-position: 0 28px; }
}

@keyframes kgMarqueeReverse {
  0% { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.anim-kg-fog { animation: kgFogDrift 14s ease-in-out infinite; }
.anim-kg-fog-rev { animation: kgFogDriftReverse 18s ease-in-out infinite; }
.anim-kg-ember { animation: kgEmberRise 3.8s ease-out infinite; }
.anim-kg-molten { animation: kgMoltenDrip 3s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
.anim-kg-shimmer {
  background-size: 200% 100%;
  animation: kgShimmerSweep 3.5s linear infinite;
}
.anim-kg-mandala { animation: kgMandalaSpin 60s linear infinite; }
.anim-kg-orbit { animation: kgOrbitFloat 4.2s ease-in-out infinite; }
.anim-kg-wave { animation: kgWaveDrift 9s ease-in-out infinite; }
.anim-kg-leaf { animation: kgLeafSway 5s ease-in-out infinite; transform-origin: bottom center; }
.anim-kg-stamp { animation: kgStampPop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-kg-thread {
  background-image: repeating-linear-gradient(
    to bottom,
    currentColor 0 8px,
    transparent 8px 16px
  );
  background-size: 2px 28px;
  background-repeat: repeat-y;
  animation: kgThreadFlow 1.6s linear infinite;
}
.anim-kg-marquee-rev {
  display: flex;
  width: max-content;
  animation: kgMarqueeReverse 30s linear infinite;
}
.anim-kg-marquee-rev:hover { animation-play-state: paused; }

/* Global Color Scheme Override Helpers */
.ct-override-active.ct-bg,
.ct-override-active .ct-bg { background-color: var(--ct-bg) !important; }
.ct-override-active .ct-bg-alt { background-color: var(--ct-bg-alt) !important; }
.ct-override-active .ct-card {
  background-color: var(--ct-card) !important;
  border-color: var(--ct-border) !important;
}
.ct-override-active.ct-text-main,
.ct-override-active .ct-text-main { color: var(--ct-text-main) !important; }
.ct-override-active .ct-text-muted { color: var(--ct-text-muted) !important; }
.ct-override-active .ct-accent-bg {
  background-color: var(--ct-accent) !important;
  color: var(--ct-accent-text) !important;
}
.ct-override-active .ct-accent-text { color: var(--ct-accent) !important; }
.ct-override-active .ct-border { border-color: var(--ct-border) !important; }

/* Hide scrollbars for horizontal mobile swipe strips */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .anim-kg-drop,
  .anim-kg-steam-1,
  .anim-kg-steam-2,
  .anim-kg-steam-3,
  .anim-kg-bubble,
  .anim-kg-flicker,
  .anim-kg-dheki,
  .anim-kg-marquee,
  .anim-kg-marquee-rev,
  .anim-kg-ripple,
  .anim-kg-ripple-delay,
  .anim-kg-breathe,
  .anim-kg-float,
  .anim-kg-spin-slow,
  .anim-kg-fog,
  .anim-kg-fog-rev,
  .anim-kg-ember,
  .anim-kg-molten,
  .anim-kg-shimmer,
  .anim-kg-mandala,
  .anim-kg-orbit,
  .anim-kg-wave,
  .anim-kg-leaf,
  .anim-kg-thread {
    animation: none !important;
  }
}
