/* ============================================
   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 (.section_huge_ff53) is a descendant of
   .secondary_3fa9 (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.highlight-1688 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".column-hovered-7ed0" 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.sidebar_49e0 so it can't cause
   horizontal overflow anyway. */
.column-3217,
.dirty_2071,
.old_2eac,
.fresh_644b,
.fluid-a4cc,
.down-5919,
.overlay_b341,
.modal-red-560e,
.clean-aaaa,
.carousel-dynamic-32a5,
.light-9003 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .popup_aa1f {
    padding: 8px 0;
  }
  
  .component-b397 img {
    height: 28px;
    width: auto;
  }
  
  .paragraph-lower-2c71 {
    display: none !important;
  }
  
  .bronze-8965 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .bronze-8965 svg {
    width: 14px;
    height: 14px;
  }
  
  .advanced_3289 {
    padding: 6px;
  }
  
  .photo_short_e40a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .old_2eac,
  .dirty_2071,
  .fresh_644b,
  .fluid-a4cc,
  .lite-df58,
  .lite_5d9e,
  .mask-29ed,
  .active_2d59,
  .media_e7a3,
  .hero_ef40,
  .progress-3721,
  .mask_thick_83bb {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .paper-d48c,
  .notice_61c9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .label-ded4,
  .shade-e847,
  .slider-4ba4,
  .alert-25bb,
  .overlay-df15,
  .narrow-f137,
  .button-medium-c2b1 {
    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 */
  .gradient_middle_e0c0,
  .wood_453e,
  .tiny_4f4b,
  .hero-east-8079,
  .article-fluid-2c73 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .border-ea82,
  .hero-cfd0,
  .shadow_red_9294,
  .tabs_586a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .white-253e,
  .bronze_ea9f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .grid-hovered-f216,
  .prev-64c7,
  .solid_a75c,
  .content_1075 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .glass_ba70,
  .fast-65ff,
  .first_4088,
  .media-d526,
  .search-4c6d,
  .current_1475 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gradient_middle_e0c0,
  .wood_453e,
  .hero-east-8079 {
    max-width: none !important;
  }
  
  .column-hovered-7ed0 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .border-ea82 {
    font-size: 1.5rem !important;
  }
  
  .hero-cfd0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .narrow_a139,
  .motion_fa56 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .shadow_red_9294 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .link-bed0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .container_green_02b4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gradient_middle_e0c0,
  .hero-east-8079 {
    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: f6a1 */
.shadow-element-m9 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
