/* ============================================
   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 (.smooth_4e1c) is a descendant of
   .large-653d (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.white-0024 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".module-silver-7b40" 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.focused-0483 so it can't cause
   horizontal overflow anyway. */
.gallery_advanced_65fb,
.item_narrow_564d,
.hard_d0af,
.warm_1ae2,
.footer_cc03,
.over_83ba,
.banner-18c0,
.tag_hovered_f1ad,
.breadcrumb_under_ec89,
.nav_iron_83c3,
.silver_2bae {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .input_complex_f06a {
    padding: 8px 0;
  }
  
  .cold_9be9 img {
    height: 28px;
    width: auto;
  }
  
  .secondary-49ad {
    display: none !important;
  }
  
  .icon-f471 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .icon-f471 svg {
    width: 14px;
    height: 14px;
  }
  
  .hero-left-ce6d {
    padding: 6px;
  }
  
  .footer_4548 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hard_d0af,
  .item_narrow_564d,
  .warm_1ae2,
  .footer_cc03,
  .article_3593,
  .shadow-inner-9c4f,
  .focused_5389,
  .hover-c898,
  .out_4ccd,
  .stone-0524,
  .filter_6646 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .block_liquid_b33e,
  .pattern-9314 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .row-72cc,
  .easy_a6e0,
  .table_dark_1f78,
  .description-middle-9a1a,
  .secondary-8421,
  .chip-large-6716,
  .texture-copper-b790 {
    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 */
  .north_9a53,
  .highlight-9a45,
  .brown-323f,
  .gold-5cc9,
  .badge_c6c4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hero_paper_0c92,
  .search_steel_78ab,
  .north_74dd,
  .modal_dc66 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .bottom-13e1,
  .gallery_clean_40ea {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tooltip_9907,
  .shadow-cb1d,
  .smooth_5dc2,
  .input-5555 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .medium-b7b3,
  .surface_focused_9e02,
  .search_33a4,
  .layout-a5be,
  .heading-west-521b,
  .short_7af5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .north_9a53,
  .highlight-9a45,
  .gold-5cc9 {
    max-width: none !important;
  }
  
  .module-silver-7b40 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hero_paper_0c92 {
    font-size: 1.5rem !important;
  }
  
  .search_steel_78ab {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .media-1668,
  .box-ddc3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .north_74dd {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .dropdown_static_1aff {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .breadcrumb_c6d4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .north_9a53,
  .gold-5cc9 {
    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: cb47 */
.promo-block-b6 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
