/* ==========================================================================
   THE WATER PROJECT DESIGN SYSTEM 2025 - HERO SECTIONS
   ========================================================================== */

/* 
 * Hero section layouts extracted from 2025 redesigned pages
 * The Mission Bridge pattern is the RECOMMENDED standard for all heroes
 * providing clean, accessible hero sections with optimal performance.
 */

/* ========================================
   MISSION BRIDGE HERO (RECOMMENDED STANDARD)
   ======================================== */

/* 
 * The Mission Bridge Hero Pattern is the RECOMMENDED standard for all hero sections.
 * Benefits:
 * - Clean, accessible hero sections with white background
 * - Centered content with professional styling  
 * - Perfect mobile readability
 * - WCAG AA compliance
 * - Fast loading without background image complications
 */

.motif-2025 .mission-bridge {
  background: var(--surface-elevated);
  padding: 60px 40px; /* Consistent with section padding */
  text-align: center;
  position: relative;
  margin: 0; /* Remove any default margins */
  
  /* Performance optimization */
  contain: layout style paint;
}

.motif-2025 .mission-bridge .mission-logo {
  margin-bottom: 24px;
  text-align: center !important; /* Override legacy styles */
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  transition: transform var(--duration-normal) ease;
}

.motif-2025 .mission-bridge .mission-logo:hover {
  transform: scale(1.02);
}

.motif-2025 .mission-bridge .mission-logo img {
  max-width: 200px !important;
  height: auto !important;
  display: block !important; /* Override legacy styles */
  margin: 0 auto !important; /* Force centering */
}

.motif-2025 .mission-bridge .section-header {
  max-width: 800px;
  margin: 0 auto;
}

.motif-2025 .mission-bridge h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  margin-bottom: 20px;
  line-height: var(--line-height-tight);
}

.motif-2025 .mission-bridge .mission-text {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
  margin: 0 auto;
  font-weight: var(--font-weight-light);
  letter-spacing: -0.01em;
  max-width: 700px;
}

.motif-2025 .mission-bridge .mission-text .highlight {
  color: var(--primary);
  font-weight: var(--font-weight-medium);
}

/* ========================================
   BACKGROUND IMAGE HERO (LEGACY SUPPORT)
   ======================================== */

/* 
 * Background image heroes with overlays are DEPRECATED
 * due to readability issues and complexity. 
 * Use Mission Bridge pattern instead.
 * These styles are maintained for legacy compatibility only.
 */

.motif-2025 .hero-background {
  position: relative;
  overflow: hidden;
  height: 400px;
  border-radius: var(--radius-md);
  margin: 20px auto;
  max-width: var(--container-max-width);
  
  /* Performance optimization */
  contain: layout style paint;
  will-change: transform;
  isolation: isolate;
}

.motif-2025 .hero-background__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: var(--z-base);
}

.motif-2025 .hero-background__overlay {
  position: absolute;
  inset: 0;
  background: var(--gradient-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: var(--z-raised);
}

.motif-2025 .hero-background__content {
  text-align: center;
  color: var(--gradient-text-primary);
  max-width: 600px;
}

/* ========================================
   PODS HERO PATTERN
   Dynamic project showcase with background
   ======================================== */

.motif-2025 .pods-hero {
  position: relative;
  overflow: hidden;
  min-height: 700px;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  
  /* Performance optimization */
  contain: layout style paint;
}

.motif-2025 .pods-hero__background {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
}

.motif-2025 .pods-hero__background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.motif-2025 .pods-hero__overlay {
  position: relative;
  z-index: var(--z-raised);
  height: 100%;
  min-height: 700px;
  display: flex;
  align-items: center;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.motif-2025 .pods-hero__content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 35px;
  margin: 40px 0;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========================================
   PAGE TITLE HERO
   Simple centered title sections
   ======================================== */

.motif-2025 .page-title-hero {
  background: var(--surface-elevated);
  padding: 40px 0;
  text-align: center;
}

.motif-2025 .page-title-hero h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
  margin: 0 0 16px 0;
  line-height: var(--line-height-tight);
}

.motif-2025 .page-title-hero .subtitle {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
  margin: 0 auto;
  font-weight: var(--font-weight-light);
  letter-spacing: -0.01em;
  max-width: 800px;
}

/* ========================================
   HERO CTA GROUPS
   Button groupings within hero sections
   ======================================== */

.motif-2025 .hero-cta-group {
  margin-top: 32px;
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.motif-2025 .hero-stats {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.motif-2025 .hero-stat {
  text-align: center;
  color: var(--text-muted);
}

.motif-2025 .hero-stat__number {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  display: block;
  margin-bottom: 8px;
  color: var(--heading-color);
}

.motif-2025 .hero-stat__label {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-medium);
}

/* ========================================
   RESPONSIVE HERO BEHAVIOR
   ======================================== */

@media (max-width: 767px) {
  /* Mission Bridge mobile optimization */
  .motif-2025 .mission-bridge {
    padding: 40px 20px; /* Consistent mobile padding */
    margin: 0; /* No margins */
  }
  
  .motif-2025 .mission-bridge .mission-text {
    font-size: var(--font-size-lg);
    max-width: 100%;
  }
  
  .motif-2025 .mission-bridge .mission-logo {
    margin-bottom: 20px;
  }
  
  /* PODS hero mobile optimization */
  .motif-2025 .pods-hero {
    min-height: 500px;
  }
  
  .motif-2025 .pods-hero__overlay {
    min-height: 500px;
    align-items: flex-start;
    padding: var(--space-lg);
  }
  
  .motif-2025 .pods-hero__content {
    margin: var(--space-lg) 0;
    padding: 25px 20px;
    max-width: 100%;
  }
  
  /* Page title hero mobile */
  .motif-2025 .page-title-hero {
    padding: 24px 8px 16px;
  }
  
  .motif-2025 .page-title-hero h1 {
    font-size: var(--font-size-3xl);
  }
  
  .motif-2025 .page-title-hero .subtitle {
    font-size: var(--font-size-lg);
    padding: 0 8px;
  }
  
  /* Hero CTA groups mobile */
  .motif-2025 .hero-cta-group {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }
  
  .motif-2025 .hero-cta-group .btn {
    width: 100%;
    max-width: 280px;
  }
  
  /* Hero stats mobile */
  .motif-2025 .hero-stats {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: 40px;
  }
  
  .motif-2025 .hero-stat__number {
    font-size: var(--font-size-2xl);
  }
}

/* Extra small mobile (max-width: 480px) */
@media (max-width: 480px) {
  .motif-2025 .mission-bridge {
    padding: 30px 12px 30px; /* Even tighter on small screens */
  }
  
  .motif-2025 .mission-bridge .mission-text {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
  }
  
  .motif-2025 .hero-background {
    height: 300px;
    margin: 10px 8px;
    border-radius: var(--radius-sm);
  }
}

/* ========================================
   HERO SECTION VARIANTS
   ======================================== */

/* Gradient hero for special campaigns */
.motif-2025 .hero-gradient {
  background: var(--gradient-primary);
  color: var(--gradient-text-primary);
  padding: 80px 0;
  text-align: center;
}

.motif-2025 .hero-gradient h1 {
  color: var(--gradient-text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.motif-2025 .hero-gradient .mission-text {
  color: var(--gradient-text-secondary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Minimal hero for focused content */
.motif-2025 .hero-minimal {
  background: var(--surface-elevated);
  padding: 40px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.motif-2025 .hero-minimal h1 {
  font-size: var(--font-size-3xl);
  margin-bottom: 16px;
}

.motif-2025 .hero-minimal .subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 600px;
}

/* ========================================
   THEME-SPECIFIC HERO VARIATIONS
   ======================================== */

/* Warm Earth theme hero adjustments */
[data-theme="warm-earth"] .motif-2025 .mission-bridge {
  background: var(--surface-elevated);
}

[data-theme="warm-earth"] .motif-2025 .mission-bridge .highlight {
  color: var(--primary);
}

[data-theme="warm-earth"] .motif-2025 .hero-gradient {
  background: var(--gradient-primary);
}

/* Bold Impact theme hero adjustments */
[data-theme="bold-impact"] .motif-2025 .mission-bridge {
  background: var(--surface-elevated);
  border-bottom: 3px solid var(--accent-primary);
}

[data-theme="bold-impact"] .motif-2025 .hero-gradient {
  background: var(--gradient-accent);
}

/* Field & Map theme hero adjustments */
[data-theme="field-map"] .motif-2025 .mission-bridge {
  background: var(--surface-elevated);
  border-left: 4px solid var(--accent-primary);
  border-right: 4px solid var(--accent-secondary);
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Ensure sufficient contrast for all hero text */
.motif-2025 .hero-background__content h1,
.motif-2025 .hero-background__content h2,
.motif-2025 .hero-background__content p {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Focus management for hero CTAs */
.motif-2025 .hero-cta-group .btn:focus {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .motif-2025 .hero-background__overlay {
    background: rgba(0, 0, 0, 0.8);
  }
  
  .motif-2025 .mission-bridge {
    border: 2px solid var(--text-primary);
  }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Optimize hero background images */
.motif-2025 .hero-background__image {
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .motif-2025 .mission-bridge .mission-logo:hover {
    transform: none;
  }
  
  .motif-2025 .hero-background__content * {
    animation: none !important;
    transition: none !important;
  }
}

/* ========================================
   LEGACY COMPATIBILITY
   ======================================== */

/* Support for existing class names from 2025 pages */
.motif-2025 .bgimg-about,
.motif-2025 .bgimg-sponsor,
.motif-2025 .bgimg-ways-to-give,
.motif-2025 .bgimg-water-crisis,
.motif-2025 .bgimg-solving,
.motif-2025 .bgimg-how-we-work {
  /* Map legacy background image classes to new hero-background */
  position: relative;
  overflow: hidden;
  height: 400px;
  border-radius: var(--radius-md);
  margin: 20px auto;
  max-width: var(--container-max-width);
  contain: layout style paint;
  will-change: transform;
  isolation: isolate;
}

/* Summary button positioning for legacy heroes */
.motif-2025 .hero-summary-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: var(--z-floating);
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  border: 2px solid #ffffff;
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--duration-normal) ease;
}

.motif-2025 .hero-summary-btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
