/* HERO SECTION TEXT SPACING & VISIBILITY */

/* IMPORTANT: Desktop (1024px+) uses original styles - no overrides */
/* This CSS only affects screens BELOW 1024px */

/* iPad Air, iPad Mini, Asus Zenbook Fold (768-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-content {
    padding: 30px 40px !important;
  }
  .hero-headline {
    font-size: 56px !important;
    line-height: 1.05 !important;
    margin-bottom: 16px !important;
  }
  .hero-subheadline {
    font-size: 18px !important;
    line-height: 1.3 !important;
    margin-bottom: 24px !important;
  }
}

/* Nest Hub portrait (600-767px) */
@media (min-width: 600px) and (max-width: 767px) and (orientation: portrait) {
  .hero-content {
    padding: 25px 30px !important;
    min-height: 100vh !important;
  }
  .hero-headline {
    font-size: 48px !important;
    line-height: 1.05 !important;
  }
  /* Ensure all content fits on Nest Hub's unique aspect ratio */
  .hero-brands-wrapper {
    margin-top: 15px !important;
  }
}

/* Surface Duo (540px wide) - Special dual-screen handling */
@media (width: 540px) {
  .hero-content {
    padding: 20px 25px !important;
  }
  .hero-headline {
    font-size: 44px !important;
    line-height: 1.05 !important;
    margin-bottom: 12px !important;
  }
  /* Optimize for dual-screen layout */
  .hero-brands-row {
    justify-content: space-evenly !important;
  }
}

/* Large phones (414-479px) - iPhone 14 Pro Max, Galaxy S20 Ultra, Pixel 7 */
@media (min-width: 414px) and (max-width: 479px) {
  .hero-content {
    padding: 15px 20px !important;
  }
  .hero-headline {
    font-size: 40px !important;
    line-height: 1.0 !important;
    margin-bottom: 10px !important;
  }
  .hero-subheadline {
    font-size: 15px !important;
    line-height: 1.25 !important;
    margin-bottom: 18px !important;
  }
}

/* Standard Pro phones (390-413px) - iPhone 12/13/14 Pro, Galaxy A51/71 */
@media (min-width: 390px) and (max-width: 413px) {
  .hero-content {
    padding: 12px 18px !important;
  }
  .hero-headline {
    font-size: 38px !important;
    line-height: 0.95 !important;
    margin-bottom: 8px !important;
  }
  .hero-subheadline {
    font-size: 14px !important;
    line-height: 1.2 !important;
    margin-bottom: 16px !important;
  }
}

/* iPhone SE specific - EVERYTHING must fit in 667px height */
@media screen and (max-width: 375px) and (max-height: 667px) {
  /* Override iphone-se-final-fix.css with MORE specific selectors */
  html body .hero .hero-content {
    padding: 2px 16px 2px 16px !important;
    height: 100vh !important;
    max-height: 667px !important;
    overflow: hidden !important;
  }
  
  html body .hero .hero-headline {
    font-size: 30px !important;
    line-height: 28px !important;
    margin-bottom: 2px !important;
    margin-top: 0 !important;
  }
  
  html body .hero .hero-subheadline {
    font-size: 10px !important;
    line-height: 12px !important;
    margin-bottom: 2px !important;
  }
  
  html body .hero .hero-app-badges {
    margin-top: 4px !important;
    margin-bottom: 0 !important;
  }
  
  html body .hero .download-subtitle {
    margin-top: 2px !important;
    margin-bottom: 0px !important;
    font-size: 7px !important;
  }
  
  /* Adjust spacing - not too high */
  html body .hero .hero-brands-inline {
    margin-top: 2px !important; /* Changed from -4px */
    width: 100% !important;
  }
  
  html body .hero .hero-brands-wrapper {
    margin-top: 0px !important; /* Changed from -4px */
    width: 100% !important;
  }
  
  html body .hero .brands-intro {
    font-size: 7px !important;
    margin-bottom: 2px !important;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
  }
  
  html body .hero .hero-brands-row {
    margin-bottom: 1px !important;
    gap: 4px !important;
    justify-content: center !important;
    width: 100% !important;
  }
  
  html body .hero .brand-logo {
    height: 9px !important;
  }
  
  html body .hero .credibility-row {
    font-size: 7.5px !important;
    margin-top: 4px !important; /* Increased from 1px */
    margin-bottom: 2px !important; /* Added small bottom margin */
    gap: 4px 8px !important;
    justify-content: center !important;
  }
  
  /* Hide scroll CTA */
  .scroll-cta {
    display: none !important;
  }
}

/* Galaxy Z Fold closed (344px) */
@media (width: 344px) {
  .hero-content {
    padding: 8px 14px !important;
  }
  .hero-headline {
    font-size: 34px !important;
    line-height: 0.9 !important;
    margin-bottom: 6px !important;
  }
  /* Extra narrow - stack content efficiently */
  .hero-brands-row {
    gap: 4px !important;
  }
}

/* BRAND LOGOS - Ensure 2 rows of 5 on mobile/tablet only */
@media (max-width: 1023px) {
  .hero-brands-wrapper {
    width: 100% !important;
  }

  .hero-brands-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 8px !important;
  }
}

/* Scale brand logos based on screen width */
@media (max-width: 414px) {
  .brand-logo {
    height: 14px !important;
    max-width: 18% !important; /* Ensures 5 fit in row */
  }
}

@media (min-width: 415px) and (max-width: 767px) {
  .brand-logo {
    height: 16px !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .brand-logo {
    height: 20px !important;
  }
}

/* CREDIBILITY ROW - Always visible on mobile/tablet */
@media (max-width: 1023px) {
  .credibility-row {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px 12px !important;
    width: 100% !important;
    margin-top: auto !important; /* Push to bottom */
  }

  /* FREE TO DOWNLOAD TEXT */
  .download-subtitle {
    opacity: 0.8 !important;
    margin-top: 12px !important;
    margin-bottom: 8px !important;
  }
}

/* VERTICAL CENTERING FIX */
@media (max-height: 700px) {
  .hero-content {
    justify-content: flex-start !important;
    padding-top: 10px !important;
  }
}

/* LANDSCAPE ORIENTATION FIXES */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-headline {
    font-size: 32px !important;
    margin-bottom: 5px !important;
  }
  .hero-subheadline {
    font-size: 12px !important;
    margin-bottom: 10px !important;
  }
  .hero-content {
    padding: 10px 20px !important;
  }
}

/* ENSURE FULL HEIGHT USAGE - Only for screens below 1024px */
@media (max-width: 1023px) {
  .hero {
    min-height: 100vh !important;
    height: 100vh !important;
  }

  .hero-content {
    min-height: 100vh !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important; /* Prevent scrolling */
  }
}

/* TYPOGRAPHY CONSISTENCY */
* {
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Remove any interfering padding/margins */
body, html {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}

/* Desktop-only improvements - MINIMUM 1025px to avoid tablets */
@media (min-width: 1025px) {
  /* Larger subheadline for better readability */
  .hero-subheadline {
    font-size: 26px !important; /* Was 24px */
  }
  
  /* Make "Free to download" more prominent */
  .download-subtitle {
    font-size: 16px !important;
    opacity: 0.9 !important; /* Was 0.8 */
    font-weight: 500 !important;
  }
  
  /* Enhance "See How It Works" button */
  .see-how-it-works-btn {
    padding: 16px 32px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
  }
  
  /* Slightly increase brand logo contrast */
  .brand-logo {
    opacity: 0.8 !important; /* Was ~0.6 */
  }
  
  .brand-logo:hover {
    opacity: 1 !important;
  }
}

