/* =============================================================================
   HERO SECTION STYLES - FIXED ALIGNMENT ISSUE
   ============================================================================= */

.hero {
  position: relative;
  min-height: 70vh;
  display: flex;

  overflow: hidden;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.hero__background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 1;
}

.hero__background--fallback {
  background: linear-gradient(135deg, var(--color-background-light) 0%, var(--color-border-light) 100%);
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.2) 0%,
    rgba(15, 23, 42, 0.4) 70%,
    rgba(15, 23, 42, 0.6) 100%
  );
  z-index: 2;
}

.hero .container {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
  
  /* CRITICAL FIX: Make container fill full hero height and align to bottom */
  display: flex;
  align-items: flex-end;
  height: 100%; /* Fill the full height of the hero */
  min-height: 70vh; /* Match the hero min-height */
}

.hero__content {
  width: 100%; /* Fix: Take full width instead of max-width: 70vh */
  max-width: 800px; /* Set a reasonable max-width in standard units */
  margin: 0;
  text-align: left;
  color: white;
  padding: 0 0 var(--spacing-3xl) 0; /* Bottom padding for spacing from edge */
}

.hero__title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-4xl);
  font-weight: 200;
  color: white;
  margin: 0; /* Fix: Remove any margins that could affect positioning */
  line-height: 1.55; /* Fix: Slightly increased for better readability */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.02em;
  
  /* Background box styling - fixed to work properly with line breaks */
  background-color: rgba(0, 0, 0, 0.2); /* Slightly more opaque for better contrast */
  padding: var(--spacing-sm) var(--spacing-sm); /* Better padding */
  display: inline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  
  /* Fix: Add word wrapping to prevent overflow issues */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* =============================================================================
   RESPONSIVE DESIGN - IMPROVED
   ============================================================================= */

@media (max-width: 1200px) {
  .hero .container {
    min-height: 70vh; /* Ensure container maintains height */
  }
  
  .hero__content {
    max-width: 700px;
  }
  
  .hero__title {
    font-size: var(--font-size-3xl);
  }
}

@media (max-width: 1024px) {
  .hero {
    min-height: 65vh; /* Slightly reduced for better mobile experience */
  }
  
  .hero .container {
    padding: 0 var(--spacing-lg);
    min-height: 65vh; /* Match hero height */
  }
  
  .hero__content {
    max-width: 600px;
    padding-bottom: var(--spacing-2xl);
  }
  
  .hero__title {
    font-size: var(--font-size-3xl);
    line-height: 1.3;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 60vh;
  }
  
  .hero .container {
    padding: 0 var(--spacing-md);
    min-height: 60vh; /* Match hero height */
  }
  
  .hero__content {
    max-width: 100%; /* Full width on mobile */
    padding-bottom: var(--spacing-xl);
  }
  
  .hero__title {
    font-size: var(--font-size-2xl);
    padding: var(--spacing-xs) var(--spacing-sm); /* Reduced padding on mobile */
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 50vh; /* Reduced for small screens */
  }
  
  .hero .container {
    min-height: 50vh; /* Match hero height */
  }
  
  .hero__content {
    padding-bottom: var(--spacing-lg);
  }
  
  .hero__title {
    font-size: var(--font-size-xl);
    line-height: 1.3;
  }
}

/* =============================================================================
   ACCESSIBILITY & PERFORMANCE
   ============================================================================= */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero__overlay {
    background: rgba(0, 0, 0, 0.7);
  }
  
  .hero__title {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    background-color: rgba(0, 0, 0, 0.8);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .hero__title {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}

/* Print styles */
@media print {
  .hero {
    min-height: auto;
    padding: var(--spacing-xl) 0;
  }
  
  .hero__content {
    padding-bottom: 0;
  }
  
  .hero__background,
  .hero__overlay {
    display: none;
  }
  
  .hero__title {
    color: black;
    text-shadow: none;
    background-color: transparent;
    border: 1px solid black;
    padding: var(--spacing-sm);
  }
}