/**
 * GW Elements - Base CSS Variables
 * Laviasana Design System
 */

:root {
  /* Color System - Light Mode */
  --gw-primary: 338 96% 22%;
  --gw-primary-foreground: 0 0% 100%;
  --gw-background: 0 0% 100%;
  --gw-foreground: 0 0% 8%;
  --gw-secondary: 30 10% 96%;
  --gw-secondary-foreground: 0 0% 8%;
  --gw-muted: 30 10% 94%;
  --gw-muted-foreground: 0 0% 40%;
  --gw-accent: 30 10% 96%;
  --gw-accent-foreground: 0 0% 8%;
  --gw-destructive: 0 84% 60%;
  --gw-destructive-foreground: 0 0% 100%;
  --gw-border: 30 10% 90%;
  --gw-input: 30 10% 90%;
  --gw-ring: 338 96% 22%;

  /* Custom Laviasana Tokens */
  --gw-burgundy: 338 96% 22%;
  --gw-burgundy-light: 338 60% 94%;
  --gw-cream: 40 30% 97%;
  --gw-warm-gray: 30 5% 50%;

  /* Typography */
  --gw-font-serif: 'Playfair Display', Georgia, Cambria, 'Times New Roman',
    Times, serif;
  --gw-font-sans: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif;
  --gw-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;

  /* Spacing & Sizing */
  --gw-radius: 0.25rem;
  --gw-container-narrow: 56rem;
  --gw-container-wide: 80rem;
  --gw-container-padding: 1rem;

  /* Transitions */
  --gw-transition-fast: 150ms ease;
  --gw-transition-base: 200ms ease;
  --gw-transition-slow: 300ms ease;
  --gw-transition-slower: 500ms ease;
  --gw-transition-slowest: 700ms ease;
}

/* Dark mode support (optional) */
.dark,
[data-theme='dark'] {
  --gw-background: 0 0% 6%;
  --gw-foreground: 0 0% 95%;
  --gw-secondary: 0 0% 12%;
  --gw-secondary-foreground: 0 0% 95%;
  --gw-muted: 0 0% 15%;
  --gw-muted-foreground: 0 0% 60%;
  --gw-border: 0 0% 18%;
  --gw-input: 0 0% 18%;
  --gw-primary: 338 70% 45%;
  --gw-burgundy: 338 70% 45%;
  --gw-burgundy-light: 338 30% 15%;
  --gw-cream: 0 0% 10%;
}

/* HSL color function helper */
.gw-bg-primary {
  background-color: hsl(var(--gw-primary));
}
.gw-bg-primary-foreground {
  background-color: hsl(var(--gw-primary-foreground));
}
.gw-bg-background {
  background-color: hsl(var(--gw-background));
}
.gw-bg-foreground {
  background-color: hsl(var(--gw-foreground));
}
.gw-bg-secondary {
  background-color: hsl(var(--gw-secondary));
}
.gw-bg-muted {
  background-color: hsl(var(--gw-muted));
}
.gw-bg-burgundy-light {
  background-color: hsl(var(--gw-burgundy-light));
}
.gw-bg-cream {
  background-color: hsl(var(--gw-cream));
}

.gw-text-primary {
  color: hsl(var(--gw-primary));
}
.gw-text-primary-foreground {
  color: hsl(var(--gw-primary-foreground));
}
.gw-text-foreground {
  color: hsl(var(--gw-foreground));
}
.gw-text-muted-foreground {
  color: hsl(var(--gw-muted-foreground));
}
.gw-text-background {
  color: hsl(var(--gw-background));
}

.gw-border-border {
  border-color: hsl(var(--gw-border));
}

/* Base Reset for GW Elements */
[class*='gw-'] {
  box-sizing: border-box;
}

[class*='gw-'] *,
[class*='gw-'] *::before,
[class*='gw-'] *::after {
  box-sizing: border-box;
}

/* Typography Base */
.gw-font-serif {
  font-family: var(--gw-font-serif);
}

.gw-font-sans {
  font-family: var(--gw-font-sans);
}

/* Container Utilities */
.gw-container-narrow {
  max-width: var(--gw-container-narrow);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gw-container-padding);
  padding-right: var(--gw-container-padding);
}

.gw-container-wide {
  max-width: var(--gw-container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gw-container-padding);
  padding-right: var(--gw-container-padding);
}

@media (min-width: 640px) {
  :root {
    --gw-container-padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --gw-container-padding: 2rem;
  }
}

/* Scrollbar Hide Utility */
.gw-scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.gw-scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Text Balance Utility */
.gw-text-balance {
  text-wrap: balance;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Antialiasing */
[class*='gw-'] {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ======================================
   Elementor Full Width Overrides
   Make all GW widgets break out of containers
   ====================================== */

/* Remove constraints from Elementor widget wrappers */
[class*='elementor-widget-gw-'] {
  max-width: none !important;
  width: 100% !important;
}

[class*='elementor-widget-gw-'] > .elementor-widget-container {
  max-width: none !important;
  width: 100% !important;
}

/* Remove padding/margins from parent containers */
.elementor-section:has([class*='elementor-widget-gw-']),
.elementor-container:has([class*='elementor-widget-gw-']),
.elementor-column:has([class*='elementor-widget-gw-']),
.elementor-widget-wrap:has([class*='elementor-widget-gw-']),
.e-con:has([class*='elementor-widget-gw-']),
.e-con-inner:has([class*='elementor-widget-gw-']) {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Full viewport width utility class */
.gw-fullwidth {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  max-width: none;
}

/* Container with edge-to-edge padding */
.gw-container-fullwidth {
  max-width: none;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .gw-container-fullwidth {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1280px) {
  .gw-container-fullwidth {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* ======================================
   Scroll Animations
   Entrance animations triggered on scroll
   ====================================== */

/* Base animation state - hidden */
.gw-scroll-animate {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity var(--gw-transition-slowest),
    transform var(--gw-transition-slowest);
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Visible state */
.gw-scroll-animate--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Disable animations in Elementor editor */
.elementor-editor-active .gw-scroll-animate {
  opacity: 1;
  transform: none;
}

/* Animation variants */
.gw-scroll-animate--fade {
  transform: none;
}

.gw-scroll-animate--slide-up {
  transform: translateY(3rem);
}

.gw-scroll-animate--slide-left {
  transform: translateX(3rem);
}

.gw-scroll-animate--slide-right {
  transform: translateX(-3rem);
}

.gw-scroll-animate--scale {
  transform: scale(0.95);
}

.gw-scroll-animate--visible.gw-scroll-animate--slide-left,
.gw-scroll-animate--visible.gw-scroll-animate--slide-right,
.gw-scroll-animate--visible.gw-scroll-animate--scale {
  transform: none;
}

/* Staggered children animations */
.gw-stagger-children > * {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity var(--gw-transition-slower),
    transform var(--gw-transition-slower);
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.gw-scroll-animate--visible .gw-stagger-children > *,
.gw-scroll-animate--visible.gw-stagger-children > * {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.gw-scroll-animate--visible .gw-stagger-children > *:nth-child(1),
.gw-scroll-animate--visible.gw-stagger-children > *:nth-child(1) {
  transition-delay: 0ms;
}
.gw-scroll-animate--visible .gw-stagger-children > *:nth-child(2),
.gw-scroll-animate--visible.gw-stagger-children > *:nth-child(2) {
  transition-delay: 80ms;
}
.gw-scroll-animate--visible .gw-stagger-children > *:nth-child(3),
.gw-scroll-animate--visible.gw-stagger-children > *:nth-child(3) {
  transition-delay: 160ms;
}
.gw-scroll-animate--visible .gw-stagger-children > *:nth-child(4),
.gw-scroll-animate--visible.gw-stagger-children > *:nth-child(4) {
  transition-delay: 240ms;
}
.gw-scroll-animate--visible .gw-stagger-children > *:nth-child(5),
.gw-scroll-animate--visible.gw-stagger-children > *:nth-child(5) {
  transition-delay: 320ms;
}
.gw-scroll-animate--visible .gw-stagger-children > *:nth-child(6),
.gw-scroll-animate--visible.gw-stagger-children > *:nth-child(6) {
  transition-delay: 400ms;
}
.gw-scroll-animate--visible .gw-stagger-children > *:nth-child(7),
.gw-scroll-animate--visible.gw-stagger-children > *:nth-child(7) {
  transition-delay: 480ms;
}
.gw-scroll-animate--visible .gw-stagger-children > *:nth-child(8),
.gw-scroll-animate--visible.gw-stagger-children > *:nth-child(8) {
  transition-delay: 560ms;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .gw-scroll-animate,
  .gw-stagger-children > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
