/* ===== Hero Section Component CSS ===== */
/* This file handles ONLY styling - layout is managed by site-grid-rails.css */

/* ===== CSS Variables ===== */
/* Note: CSS variables are defined globally in style.css */

/* ===== Text Rendering Optimization ===== */
/* Consolidated text rendering optimization to reduce CSS bundle size */
.hero,
.hero__content,
.hero__headline,
.hero__subhead,
.hero__paragraph,
.hero__actions {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: always;
}

/* ===== Hero Section Styling ===== */
.hero {
  background-color: #F9F6F4;
  padding-block: clamp(3rem, 6vw, 5rem);
  position: relative;
  /* Font loading optimization to prevent CLS */
  font-display: swap;
  /* CLS Prevention - Reserve space */
  min-height: 400px;
  /* Performance optimization */
  contain: layout style paint;
  will-change: auto;
}

/* ===== Two-Column Grid Layout ===== */
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  height: auto;
  min-height: auto;
  max-height: none;
  contain: layout; /* CSS containment for better performance */
}

/* ===== Content Column (Left - First) ===== */
.hero__content {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
  text-align: left;
  order: 1; /* Ensure content comes first */
}

/* Main Headline - A+ Fluid Typography Implementation */
.hero__headline {
  font-family: var(--font-heading);
  
  /* A+ Fluid Typography - Smooth scaling from 40px to 80px */
  font-size: clamp(2.5rem, 4vw + 1rem, 5rem); /* 40px to 80px */
  line-height: 1 !important;   /* Line-height set to 1 */
  letter-spacing: -0.02em;
  font-weight: 500;
  font-style: normal;
  color: var(--ica-green-deep);
  
  /* A+ Spacing - Content-driven with responsive margins */
  margin: 0 0 clamp(0.5rem, 2vw, 1.5rem) 0; /* Responsive bottom margin */
  text-align: left;
  
  /* A+ Text Handling - Better word wrapping and overflow */
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  
  /* A+ Font Loading - Jerk-free transitions */
  font-display: optional;
  transition: font-family 0.1s ease-out;
  
  /* A+ Performance - Remove problematic min-height */
  /* min-height removed - let content determine natural height */
}

/* Specific font-size breakpoints for hero headline */
@media (max-width: 480px) {
  .hero__headline {
    font-size: clamp(3.5rem, 5vw + 1rem, 5.0rem) !important;
  }
}

@media (min-width: 481px) and (max-width: 600px) {
  .hero__headline {
    font-size: clamp(4.5rem, 5vw + 1rem, 5.0rem) !important;
  }
}

@media (min-width: 601px) and (max-width: 700px) {
  .hero__headline {
    font-size: clamp(5.8rem, 5vw + 1rem, 6.5rem) !important;
  }
}

/* A+ Progressive Enhancement - Fallback for older browsers */
@supports not (font-size: clamp(1rem, 2vw, 3rem)) {
  .hero__headline {
    font-size: 2.5rem; /* Fallback for browsers without clamp support */
    line-height: 1 !important; /* Line-height set to 1 */
  }
  
  /* Fallback media queries for older browsers */
  @media (min-width: 480px) { .hero__headline { font-size: 3rem; } }
  @media (min-width: 768px) { .hero__headline { font-size: 3.5rem; } }
  @media (min-width: 1024px) { .hero__headline { font-size: 4rem; } }
  @media (min-width: 1280px) { .hero__headline { font-size: 4.5rem; } }
}

/* Italic styling for "meets" in headline */
.hero__headline em,
.hero__headline .italic-text {
  font-style: italic;
  font-family: var(--font-heading);
  font-weight: 500; /* Match main heading weight */
  font-display: swap; /* Font loading optimization */
}

/* Supporting Subhead */
.hero__subhead {
  font-family: var(--font-ui);
  font-size: 20px;
  line-height: 1.35em;
  font-weight: 600;
  font-style: normal;
  color: rgba(0, 0, 0, 0.7);
  margin: 0;
  text-align: left;
  /* Font loading optimization to prevent CLS */
  font-display: swap;
  /* Reserve space to prevent layout shift */
  min-height: 1.35em;
}



/* Additional Paragraph */
.hero__paragraph {
  font-family: var(--font-body);
  font-size: 20px; /* Default for mobile */
  line-height: 1.3;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.7);
  margin: 0;
  text-align: left;
  /* Font loading optimization to prevent CLS */
  font-display: swap;
  /* Reserve space to prevent layout shift */
  min-height: 2.6em; /* 2 lines * 1.3 line-height */
}



/* Action Buttons - CRITICAL: Ensure buttons are always visible and responsive within container */
.hero__actions {
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
  align-items: stretch;
  justify-content: flex-start;
  visibility: visible;
  opacity: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* INP Optimization - Reduce layout thrashing */
  contain: layout style;
}

/* Button Rows - CRITICAL: Ensure rows are always visible and responsive within container */
.hero__actions-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  justify-content: stretch;
  visibility: visible;
  opacity: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* First Row: Learn More & Donate Today - ALWAYS horizontal and responsive */
.hero__actions-row:first-child {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Second Row: Stay Inspired - Full width on its own row */
.hero__actions-row:last-child {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Individual Buttons - All buttons responsive within their container */
.hero__actions .btn-ica,
.hero__btn-primary,
.hero__btn-secondary,
.hero__btn-tertiary {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    text-align: center;
    justify-content: center;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem 0;
    font-family: var(--font-ui) !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-self: stretch;
    box-sizing: border-box;
}

/* Specific button classes for each hero button - CRITICAL: Force visibility */

/* Learn More Button - Primary */
.hero__btn-primary {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  /* Copy of current button styling */
  background: var(--ica-green-deep);
  color: var(--ica-bg);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.9rem 1.6rem;
  border: none;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 4px 4px 0 rgba(30, 49, 47, 0.3);
  text-decoration: none;
  font-size: 1rem;
  border-radius: 0;
  line-height: 1.2;
}

/* Consolidated button hover, active, and focus states - INP Optimized */
.hero__btn-primary:hover,
.hero__btn-secondary:hover,
.hero__btn-tertiary:hover {
  background: var(--ica-bg);
  color: var(--ica-green-deep);
  box-shadow: -6px 6px 0px 1px rgba(30.000000000000007, 49.00000000000001, 47.00000000000001, 0.45);
  transform: translateY(-2px);
  /* INP Optimization - GPU acceleration */
  will-change: transform;
}

.hero__btn-primary:active,
.hero__btn-secondary:active,
.hero__btn-tertiary:active {
  transform: scale(0.97);
  /* INP Optimization - Reduce paint complexity */
  transition: transform 0.1s ease-out;
}

.hero__btn-primary:focus,
.hero__btn-secondary:focus,
.hero__btn-tertiary:focus {
  outline: none;
  /* Accessibility - Visible focus indicator */
  box-shadow: 0 0 0 3px rgba(30, 49, 47, 0.3);
}

/* Full-width Button - All buttons are full width */
.hero__actions .btn-ica--full-width {
  flex: 1 1 auto;
  min-width: 100%;
  padding: 0.75rem 1.75rem;
}

/* ===== Media Column (Right - Second) ===== */
.hero__media {
  display: flex;
  justify-content: center;
  align-items: center;
  order: 2; /* Ensure media comes second */
}

/* Image Slider Container */
.hero__slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  background: var(--ica-bg);
  min-height: 300px;
  /* CLS Prevention - Reserve space */
  contain: layout style paint;
  /* Performance optimization */
  will-change: transform;
}


/* Individual Slides */
.hero__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: none; /* Removed scale transform to prevent text blurriness */
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1); /* Simplified transition */
  z-index: 1;
}

.hero__slide.active {
  opacity: 1;
  transform: none; /* Removed scale transform */
  z-index: 3;
}

.hero__slide.prev {
  opacity: 0;
  transform: none; /* Removed scale transform */
  z-index: 2;
}

/* Slide Images */
.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}




/* ===== Responsive Design ===== */


/* Mobile Breakpoint */
@media (max-width: 700px) {
  .hero {
    padding: clamp(2rem, 4vw, 3rem) 0;
  }
  
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero__content {
    order: 1; /* Content first on mobile */
    text-align: left; /* Keep left alignment on mobile */
    align-items: flex-start; /* Keep left alignment on mobile */
  }
  
  .hero__media {
    order: 2; /* Image below content on mobile */
  }
  
  /* Mobile gallery ratio 16:9 */
  .hero__slider,
  .hero__placeholder {
    aspect-ratio: 16/9;
    height: auto !important; /* Override fixed height to allow aspect-ratio to work */
    width: 100% !important; /* Override fixed width for mobile */
    min-height: 0 !important; /* Override min-height to allow aspect-ratio to work */
  }
  
  .hero__actions {
    align-items: stretch; /* Stretch buttons to fill container */
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* First row stays horizontal on mobile - Learn More & Donate Today */
  .hero__actions-row:first-child {
    flex-direction: row !important;
    width: 100%;
    max-width: 100%;
    gap: 1.5rem; /* Consistent gap for mobile */
    justify-content: stretch;
    align-items: stretch;
    flex-wrap: nowrap !important; /* Prevent wrapping for Learn More & Donate Today */
    box-sizing: border-box;
  }
  
  /* A+ Mobile Headline - Enhanced fluid typography for mobile */
  .hero__headline {
    font-family: var(--font-heading);
    
    /* A+ Mobile Fluid Typography - Optimized for mobile screens */
    font-size: clamp(2.25rem, 5vw + 1rem, 3.5rem); /* 36px to 56px on mobile */
    line-height: 1 !important;     /* Line-height set to 1 */
    font-weight: 500;
    color: var(--ica-green-deep);
    
    /* A+ Mobile Spacing - Optimized margins for mobile */
    margin: 0 0 clamp(0.75rem, 3vw, 1.25rem) 0;
    text-align: left;
    
    /* A+ Mobile Text Handling - Better mobile text wrapping */
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }

  /* Second row - Stay Inspired button on its own row */
  .hero__actions-row:last-child {
    flex-direction: row !important;
    width: 100%;
    max-width: 100%;
    gap: 0;
    justify-content: stretch;
    align-items: stretch;
    flex-wrap: nowrap !important;
    box-sizing: border-box;
  }
  
  /* Mobile responsive buttons with adjusted spacing */
  .hero__actions .btn-ica,
  .hero__btn-primary,
  .hero__btn-secondary,
  .hero__btn-tertiary {
    padding: 0.75rem 1.25rem;
    margin: 0.4rem 0;
    font-size: 0.9rem; /* Slightly smaller font for mobile */
  }
  
  .hero__actions .btn-ica--full-width {
    padding: 0.75rem 1.5rem;
  }
}

/* Small Mobile Breakpoint */
@media (max-width: 479px) {
  .hero {
    padding: 1.5rem 0;
  }
  
  /* Small mobile responsive buttons with compact spacing */
  .hero__btn-primary,
  .hero__btn-secondary,
  .hero__btn-tertiary {
    padding: 0.6rem 1rem;
    margin: 0.3rem 0;
    font-size: 0.85rem; /* Smaller font for small mobile */
  }
}

/* Extra Small Mobile Breakpoint - Ensure Learn More & Donate Today stay on same row */
@media (max-width: 510px) {
  /* Force first row to stay horizontal - Learn More & Donate Today */
  .hero__actions-row:first-child {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem; /* Reduce gap for very small screens */
    justify-content: flex-start;
    align-items: flex-start;
  }
  
  /* Second row - Stay Inspired button on its own row */
  .hero__actions-row:last-child {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0;
    justify-content: flex-start;
    align-items: flex-start;
  }
  
  /* Reduce button sizes for very small screens */
  .hero__btn-primary,
  .hero__btn-secondary {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem; /* Even smaller font for very small screens */
  }
  
  .hero__btn-tertiary {
    padding: 0.6rem 1rem;
    font-size: 0.8rem; /* Even smaller font for very small screens */
  }
}

/* ===== Accessibility & Motion Preferences ===== */
@media (prefers-reduced-motion: reduce) {
  .hero__slide {
    transition: none;
    transform: none;
  }
  
  .hero__slide.active,
  .hero__slide.prev {
    transform: none;
  }
}

/* ===== Print Styles ===== */
@media print {
  .hero {
    background: none !important;
    color: var(--ica-green-deep) !important;
  }
  
  .hero__slider,
  .hero__placeholder {
    display: none;
  }
  
  .hero__grid {
    grid-template-columns: 1fr;
  }
}

/* ===== CRITICAL OVERRIDES ===== */
/* Ensure hero buttons are always visible and clickable */
.hero .hero__actions,
.hero .hero__actions-row,
.hero .hero__btn-primary,
.hero .hero__btn-secondary,
.hero .hero__btn-tertiary {
  display: flex;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.hero .hero__btn-primary,
.hero .hero__btn-secondary,
.hero .hero__btn-tertiary {
  display: inline-block;
}




