/* ===== Hero Section Component CSS ===== */
/* This file handles ONLY styling - layout is managed by site-grid-rails.css */

/* ===== CSS Custom Properties ===== */
:root {

  --hero-slider-height-mobile: 40vh;
  --hero-slider-height-small: 30vh;
  --hero-slider-height-desktop: 650px;
}

/* ===== Utility Classes ===== */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ===== Text Rendering Optimization ===== */
.hero * {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: always;
}
/* ===== Hero Section Styling ===== */
.hero {
  background-color: #F9F6F4;
  padding-block: var(--global-padding-desktop);
  position: relative;
}

/* ===== Two-Column Grid Layout ===== */
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--global-gap-desktop);
  align-items: center;
  height: auto;
  min-height: auto;
  max-height: none;
  contain: layout;
}
/* ===== 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);
  font-size: 40px; 
  line-height: 1 !important;
  letter-spacing: -0.02em;
  font-weight: 500;
  font-style: normal;
  color: var(--ica-green-deep);
  margin: 0 0 clamp(0.5rem, 2vw, 1.5rem) 0;
  text-align: left;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  transition: font-family 0.1s ease-out;
}
/* Specific font-size breakpoints for hero headline */
@media (max-width: 379px) {
  .hero__headline {
    font-size: 40px !important;
  }
}
@media (min-width: 380px) and (max-width: 399px) {
  .hero__headline {
    font-size: 42px !important;
  }
}
@media (min-width: 400px) and (max-width: 449px) {
  .hero__headline {
    font-size: 45px !important;
  }
}
@media (min-width: 450px) and (max-width: 500px) {
  .hero__headline {
    font-size: 51px !important;
  }
}
@media (min-width: 500px) and (max-width: 549px) {
  .hero__headline {
    font-size: 57px !important;
  }
}
@media (min-width: 550px) and (max-width: 599px) {
  .hero__headline {
    font-size: 64px !important;
  }
}
@media (min-width: 600px) and (max-width: 649px) {
  .hero__headline {
    font-size: 70px !important;
  }
}
@media (min-width: 650px) and (max-width: 700px) {
  .hero__headline {
    font-size: 75px !important;
  }
}
@media (min-width: 700px) and (max-width: 749px) {
  .hero__headline {
    font-size: 38px !important;
  }
}
@media (min-width: 750px) and (max-width: 799px) {
  .hero__headline {
    font-size: 40px !important;
  }
}
@media (min-width: 800px) and (max-width: 849px) {
  .hero__headline {
    font-size: 42px !important;
  }
}
@media (min-width: 850px) and (max-width: 899px) {
  .hero__headline {
    font-size: 45px !important;
  }
}
@media (min-width: 900px) and (max-width: 949px) {
  .hero__headline {
    font-size: 50px !important;
  }
}
@media (min-width: 950px) and (max-width: 999px) {
  .hero__headline {
    font-size: 55px !important;
  }
}
@media (min-width: 1000px) and (max-width: 1049px) {
  .hero__headline {
    font-size: 56px !important;
  }
}
@media (min-width: 1050px) and (max-width: 1099px) {
  .hero__headline {
    font-size: 60px !important;
  }
}
@media (min-width: 1100px) and (max-width: 1200px) {
  .hero__headline {
    font-size: 63px !important;
  }
}
@media (min-width: 1200px) {
  .hero__headline {
    font-size: 70px !important;
  }
}



/* Desktop Hero Slider - Fixed height with viewport units */
@media (min-width: 1280px) {
  .hero__slider {
    max-height: var(--hero-slider-height-desktop);
    aspect-ratio: unset;
  }
}
/* 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 loading optimization comment retained */
}
/* 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;
}
/* Additional Paragraph */
.hero__paragraph {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.7);
  margin: 0;
  text-align: justify;
}
/* ===== Common Flex Container Properties ===== */
.hero__actions,
.hero__actions-row {
  display: flex;
  align-items: stretch;
  visibility: visible;
  opacity: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.hero__actions {
  margin-left: 5px;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 0.5rem;
  padding: 3px;
  justify-content: flex-start;
  contain: layout style;
}

.hero__actions-row {
  gap: 1.75rem;
  justify-content: stretch;
}
/* First Row: Learn More & Donate Today - ALWAYS horizontal and responsive */
.hero__actions-row:first-child {
  flex-direction: row;
  flex-wrap: nowrap;
}
/* Second Row: Stay Inspired - Full width on its own row */
.hero__actions-row:last-child {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0;
}
/* Button Layout - Visual styling handled by ica-buttons.css */
.hero__actions .btn-ica {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  text-align: center;
  gap: 1.5rem;
}

.hero__actions .btn-ica--full-width {
  flex: 1 1 auto;
  min-width: 100%;
  text-align: center;
}
/* ===== 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: 90%;
  aspect-ratio: unset;
  height: 60vh;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  background: var(--ica-bg);
  min-height: 300px;
  contain: layout style paint;
  will-change: transform;
}
/* Individual Slides */
.hero__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1); /* Simplified transition */
  z-index: 1;
}
.hero__slide.active {
  opacity: 1;
  z-index: 3;
}
.hero__slide.prev {
  opacity: 0;
  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: var(--global-padding-mobile) 0;
  }
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--global-gap-mobile);
  }
  .hero__content {
    order: 1;
    text-align: left;
    align-items: flex-start;
  }
  .hero__media {
    order: 2;
  }
  .hero__slider,
  .hero__placeholder {
    height: var(--hero-slider-height-mobile) !important;
    width: 100% !important;
    min-height: 0 !important;
  }
  .hero__actions {
    justify-content: flex-start;
  }
}
/* Small Mobile Breakpoint */
@media (max-width: 479px) {
  .hero {
    padding: 1.5rem 0;
  }
}
/* Extra Small Mobile Breakpoint */
@media (max-width: 510px) {
  .hero__actions-row:first-child {
    gap: 1.5rem;
    justify-content: flex-start;
    align-items: flex-start;
  }
  .hero__actions-row:last-child {
    gap: 0;
    justify-content: flex-start;
    align-items: flex-start;
  }
  .btn-ica{
    font-size: 14px;
  }
}

/* Small screens (up to 400px) */
@media (max-width: 400px) {
  .hero__slider,
  .hero__placeholder {
    height: var(--hero-slider-height-small) !important;
    aspect-ratio: unset !important;
  }
  .btn-ica {
    font-size: 12px !important;
  }
}
/* ===== Accessibility & Motion Preferences ===== */
@media (prefers-reduced-motion: reduce) {
  .hero__slide {
    transition: 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 ===== */
.hero .hero__actions,
.hero .hero__actions-row {
  display: flex;
  visibility: visible;
  opacity: 1;
  pointer-events: none;
  cursor: default;
}

.hero .hero__actions-row > a,
.hero .hero__actions-row > button {
  display: inline-block;
  pointer-events: auto;
  cursor: pointer;
}
/* ===== HERO POPUP SYSTEM ===== */
