/* ============================================
   CRITICAL MOBILE FIXES
   Additional layer to ensure perfect mobile display
   ============================================ */

/* Prevent horizontal scroll at all costs */
html {
  width: 100%;
  scroll-behavior: smooth;
  /* NO position:relative - it breaks sticky! */
  /* NO overflow-x here either - mixed with body's overflow-x: hidden
     it makes <html> its own scroll container and breaks sticky too! */
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* NO position:relative - it breaks sticky! */
}

/* Ensure all major containers respect viewport */
/* NOTE: "nav" is intentionally excluded here. Giving a <nav> element
   overflow-x: hidden makes its overflow-y auto-compute to "auto" (per the
   CSS overflow spec), turning it into a clipping/scroll container. Since
   the header's dropdown submenu (.progress_active_78e4) is a descendant of
   .paragraph-0b9f (a <nav>), it was getting clipped and forced into a tiny
   internal scrollbar instead of opening naturally below the nav link. */
main,
section,
article,
footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header must NOT have max-width restriction for sticky to work */
header.fixed-50b2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".alert-0b1a" is intentionally excluded here for the same reason as
   "nav" above — the header's <div class="container"> wraps the nav and
   must not clip the dropdown submenu with an auto-computed overflow-y.
   It's already width-capped via max-width in style.lite_0743 so it can't cause
   horizontal overflow anyway. */
.media-clean-3eeb,
.shade_north_b797,
.shade_016c,
.cold-3205,
.search_710c,
.label_f504,
.outline_1729,
.photo_e5e4,
.module_medium_3c36,
.active-ca29,
.preview-lite-42d8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .light_e5b5 {
    padding: 8px 0;
  }
  
  .light-93c4 img {
    height: 28px;
    width: auto;
  }
  
  .button-action-8443 {
    display: none !important;
  }
  
  .detail-fc43 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .detail-fc43 svg {
    width: 14px;
    height: 14px;
  }
  
  .center_f096 {
    padding: 6px;
  }
  
  .tall-6bf9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .shade_016c,
  .shade_north_b797,
  .cold-3205,
  .search_710c,
  .button_steel_2678,
  .block-current-5030,
  .accent-wide-97cb,
  .paragraph-bddd,
  .progress-d85e,
  .pattern-stone-f54e,
  .new-d698,
  .warm-87a8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .solid-632a,
  .icon_solid_5a6b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .focus-87cb,
  .overlay_small_40c9,
  .progress_8161,
  .west-8f8c,
  .new-c97e,
  .cold_3659,
  .banner-961c {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Ensure images are responsive */
  img,
  svg,
  picture {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Better padding for mobile */
  .gas_9520,
  .article_a30a,
  .thumbnail-north-f232,
  .active-d97a,
  .highlight_smooth_dd9c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .section-fluid-365f,
  .grid-red-cf78,
  .tertiary_ea8f,
  .chip_9b68 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hovered_3e75,
  .text_52bd {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .progress_liquid_4605,
  .preview-bf2d,
  .component-motion-9fc0,
  .feature_static_1bf6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .frame_285b,
  .tall_f75f,
  .old_25a9,
  .black_eda3,
  .chip_ed4c,
  .purple_0e9a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gas_9520,
  .article_a30a,
  .active-d97a {
    max-width: none !important;
  }
  
  .alert-0b1a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .section-fluid-365f {
    font-size: 1.5rem !important;
  }
  
  .grid-red-cf78 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .wide-e6a7,
  .black_d106 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tertiary_ea8f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pattern-d4c3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .medium_7d6d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gas_9520,
  .active-d97a {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* iPhone X and notch devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* css-noise: a7ca */
.promo-block-h2 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.0;
}
