/* ==== IMPACT SECTION - FULL CSS ==== */
/* Note: CSS variables are defined globally in style.css */

.ica-impact{ 
  padding: 50px 0; 
  background: var(--ica-lavender); /* ICA lavender background */
  height: auto; /* Flexible height */
  min-height: auto; /* No minimum constraint */
  max-height: none; /* No maximum constraint */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2rem; /* Add top margin to ensure separation from previous section */
  contain: layout; /* CSS containment for better performance */
  font-display: swap; /* Font loading optimization to prevent CLS */
  /* Animation initial state */
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: auto; /* Optimize for animations */
}

/* Add base horizontal spacing for the section content */
.ica-impact .section__inner--wide {
  padding-left: clamp(2rem, 5vw, 3rem);
  padding-right: clamp(2rem, 5vw, 3rem);
}

.ica-impact__grid{
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
  width: 100%;
}

/* Grid order: Content first (left), Media second (right) */
.ica-impact__copy {
  order: 1; /* Content comes first */
  /* Animation initial state */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: auto; /* Optimize for animations */
}

/* Media/slider */
.ica-impact__media{ 
  position: relative; 
  display: flex;
  justify-content: center;
  align-items: center;
  order: 2; /* Image slider comes second */
  margin: 0; /* Remove default margins */
  padding: 0; /* Remove default padding */
  /* Animation initial state */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: auto; /* Optimize for animations */
}

/* Image Slider Container - Base styles */
.ica-impact__slider {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  background: var(--ica-lavender);
  contain: layout; /* CSS containment for better performance */
  will-change: auto; /* Optimize for animations */
}

/* Individual Slides */
.ica-impact__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  will-change: auto; /* Optimize for animations */
}

.ica-impact__slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 3;
}

.ica-impact__slide.prev {
  opacity: 0;
  transform: scale(1.05);
  z-index: 2;
}

/* Slide Images */
.ica-impact__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback Placeholder */
.ica-impact__placeholder {
  width: 100%;
  aspect-ratio: 14 / 15;
  background: var(--ica-lavender);
  border: 2px dashed rgba(0, 0, 0, 0.2);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.7);
}

.ica-impact__placeholder-content {
  text-align: center;
  padding: 2rem;
}

.ica-impact__placeholder-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.ica-impact__placeholder p {
  font-family: var(--font-body);
  font-size: 1.125rem;
  margin: 0;
  opacity: 0.8;
}

.impact-logo{
  position: absolute; 
  left: 50%; 
  top: 50%; 
  transform: translate(-50%, -50%);
  width: clamp(160px, 24vw, 280px);
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.25));
  pointer-events: none;
  z-index: 4;
}

/* Copy column */
.ica-impact__copy .eyebrow{
  font-size: 85px; /* Fixed 85px for all screens */
  font-weight: 300;
  line-height: 1; 
  color: var(--ica-green-deep); 
  margin: 0 0 .6rem;
  font-family: var(--font-heading) !important;
  font-display: swap; /* Font loading optimization for CLS prevention */
  min-height: 1.1em; /* Prevent layout shift during font load */
}

.ica-impact__copy h3{
  font-size: 19px; /* Fixed 19px for desktop screens */
  line-height: 1.3em; 
  margin: .4rem 0 1rem; 
  color: var(--ica-green-deep);
  font-weight: 600;
  font-family: var(--font-ui) !important; /* Termina for impact title */
  letter-spacing: -0.2px; /* looks dense */
  font-display: swap; /* Font loading optimization for CLS prevention */
  min-height: 1.3em; /* Prevent layout shift during font load */
}

.ica-impact__copy p{ 
  font-family: "roboto-condensed", sans-serif !important;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 400;
  color: var(--ica-text-muted, rgba(0, 0, 0, 0.7));
  margin: 0;
  text-align: left;
  font-display: swap; /* Font loading optimization for CLS prevention */
  min-height: 2.6em; /* Prevent layout shift during font load */
}

/* Session info container - parent container */
.session-info-container {
  margin: 0.7rem 0 0 0; /* Top margin from main paragraph */
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* 1.5rem gap between session info children */
}

/* Session info lines in Termina font - children */
p.session-info {
  font-family: var(--font-ui) !important; /* Termina font */
  font-size: 19px !important;
  font-weight: 600 !important;
  color: var(--ica-green-deep) !important;
  margin: 0 !important; /* No margin on the paragraph itself */
  text-align: left !important;
  display: block !important;
  line-height: 1.3 !important;
  font-display: swap; /* Font loading optimization for CLS prevention */
  min-height: 1.3em; /* Prevent layout shift during font load */
}

/* CTA Buttons Container - Two buttons in one row */
.impact-cta-buttons {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.2rem;
  align-items: flex-start;
}

/* Buttons now use the ICA button system (.btn-ica .btn-ica--primary) */
/* Custom button sizing for IMPACT section */
.impact-cta-buttons .btn-ica {
  flex: 0 1 auto;
  width: auto;
  max-width: 160px;
  min-width: 140px;
  white-space: nowrap;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-ui) !important;
}

.impact-cta-buttons .btn-ica: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);
}

/* Summer button styling - white background with green-deep text on hover */
.impact-cta-buttons .btn-ica:nth-child(2) {
  background: var(--ica-white);
  color: var(--ica-green-deep);
}

.impact-cta-buttons .btn-ica:nth-child(2):hover {
  background: var(--ica-green-deep);
  color: var(--ica-white);
  border-color: var(--ica-green-deep);
}


/* Desktop - Ensure desktop dimensions */
@media (min-width: 1025px){
  .ica-impact__slider {
    width: 530px !important; /* Desktop width */
    height: 450px !important; /* Desktop height */
  }
}

/* Medium screens - 3:4 aspect ratio */
@media (max-width: 1024px) and (min-width: 768px){
  .ica-impact__slider {
    width: 100% !important;
    max-width: 500px;
    aspect-ratio: 3 / 4 !important; /* 3:4 aspect ratio */
    height: auto !important;
  }
}

/* Responsive */
@media (max-width: 1024px){
  .ica-impact__grid{ 
    grid-template-columns: 1fr; 
    gap: 2rem;
  }
  
  /* Reset order on mobile/tablet - stack vertically */
  .ica-impact__copy {
    order: 2; /* Content second on mobile */
  }
  
  .ica-impact__media {
    order: 1; /* Image slider first on mobile */
  }
  
  .ica-impact {
    margin-top: 1.5rem; /* Reduced top margin on medium screens */
  }
  
  /* Add horizontal spacing for medium screens */
  .ica-impact .section__inner--wide {
    padding-left: clamp(1.5rem, 4vw, 2.5rem);
    padding-right: clamp(1.5rem, 4vw, 2.5rem);
  }
  
  /* Mobile slider - 16:9 aspect ratio */
  .ica-impact__slider {
    width: 100% !important;
    max-width: 100%;
    aspect-ratio: 16 / 9 !important; /* 16:9 aspect ratio for mobile */
    height: auto !important;
  }
}

@media (max-width: 768px){
  .ica-impact {
    padding: clamp(2rem, 4vw, 3rem) 0;
    margin-top: 1rem; /* Further reduced top margin on mobile */
  }
  
  .ica-impact__grid{
    gap: 1.5rem;
  }
  
  
  /* Add horizontal spacing for mobile */
  .ica-impact .section__inner--wide {
    padding-left: clamp(1rem, 4vw, 2rem);
    padding-right: clamp(1rem, 4vw, 2rem);
  }
  
  /* Keep buttons in one row on mobile */
  .impact-cta-buttons {
    flex-direction: row;
    gap: 1rem;
    width: auto;
  }
  
  /* Mobile button sizing */
  .impact-cta-buttons .btn-ica {
    min-width: 150px;
    max-width: 170px;
  }
}

@media (max-width: 560px){
  .ica-impact {
    padding: clamp(1.5rem, 3vw, 2rem) 0;
    margin-top: 0.5rem; /* Minimal top margin on small mobile */
  }
  
  .ica-impact__grid{
    gap: 1rem;
  }
  
  .impact-logo{ 
    width: clamp(140px, 40vw, 200px); 
  }
  
  /* Ensure proper spacing on small mobile */
  .ica-impact .section__inner--wide {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Small mobile maintains 16:9 aspect ratio */
  .ica-impact__slider,
  .ica-impact__placeholder {
    aspect-ratio: 16/9;
  }
  
  .impact-cta-buttons {
    gap: 0.75rem;
    flex-direction: row; /* Ensure buttons stay in one row */
  }
  
  /* Small mobile button sizing */
  .impact-cta-buttons .btn-ica {
    min-width: 140px;
    max-width: 160px;
  }
}

/* Very small screens */
@media (max-width: 375px){
  .ica-impact {
    padding: 1.5rem 0;
  }
  
  .ica-impact .section__inner--wide {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .ica-impact__grid {
    gap: 0.75rem;
  }
  
  .impact-cta-buttons {
    gap: 0.5rem;
  }
}

/* ===== ANIMATION CLASSES ===== */

/* Animation trigger classes */
.ica-impact.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.ica-impact__media.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.ica-impact__copy.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
.ica-impact__media.animate-in {
  transition-delay: 0.2s; /* Media animates second */
}

.ica-impact__copy.animate-in {
  transition-delay: 0.1s; /* Copy animates first */
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */

/* Responsive H2 heading font sizes */
@media (max-width: 980px) and (min-width: 900px){
  .ica-impact__copy .eyebrow {
    font-size: 75px; /* H2 heading font size for 900-980px screens */
  }
}

@media (max-width: 950px) and (min-width: 850px){
  .ica-impact__copy .eyebrow {
    font-size: 70px; /* H2 heading font size for 850-950px screens */
  }
}

@media (max-width: 850px) and (min-width: 769px){
  .ica-impact__copy .eyebrow {
    font-size: 65px; /* H2 heading font size for 769-850px screens */
  }
}

@media (max-width: 767px){
  .ica-impact__copy .eyebrow {
    font-size: 85px; /* H2 heading font size for all screens below 767px */
  }
}

@media (max-width: 540px){
  .ica-impact__copy .eyebrow {
    font-size: 70px; /* H2 heading font size for screens below 540px */
  }
}


/* Responsive H3 subheading font sizes */
@media (max-width: 1240px) and (min-width: 1100px){
  .ica-impact__copy h3 {
    font-size: 20px; /* H3 subheading font size for 1100-1240px screens */
  }
}

@media (max-width: 1100px) and (min-width: 778px){
  .ica-impact__copy h3 {
    font-size: 18px; /* H3 subheading font size for 778-1100px screens */
  }
}

@media (max-width: 778px) and (min-width: 769px){
  .ica-impact__copy h3 {
    font-size: 17px; /* H3 subheading font size for 769-778px screens */
  }
}

@media (max-width: 767px){
  .ica-impact__copy h3 {
    font-size: 18px; /* H3 subheading font size for all screens below 767px */
  }
}

@media (max-width: 540px){
  .ica-impact__copy h3 {
    font-size: 17px; /* H3 subheading font size for screens below 540px */
  }
}

