/* ============================================
   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 (.button_485d) is a descendant of
   .container-555f (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.accordion-north-3360 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".old-1e60" 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.up_e4ff so it can't cause
   horizontal overflow anyway. */
.item_3b50,
.gas-7df3,
.gallery_hovered_360b,
.rough-973e,
.hover_light_1648,
.fixed_7954,
.copper_61cc,
.old_7bf4,
.box_cold_1723,
.tag_soft_34f6,
.highlight_slow_af21 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .layout_lite_b3dd {
    padding: 8px 0;
  }
  
  .gas_3769 img {
    height: 28px;
    width: auto;
  }
  
  .element-686f {
    display: none !important;
  }
  
  .down_d8a0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .down_d8a0 svg {
    width: 14px;
    height: 14px;
  }
  
  .highlight_13be {
    padding: 6px;
  }
  
  .motion-b0b3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gallery_hovered_360b,
  .gas-7df3,
  .rough-973e,
  .hover_light_1648,
  .card_new_61ae,
  .pagination-top-60d9,
  .disabled-selected-5eb1,
  .clean-9fc2,
  .accent-b0d0,
  .gallery_dirty_8629,
  .table-narrow-3742,
  .rough-8e92 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .center_a6e6,
  .active_6119 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .lite-7cd0,
  .action-3ae8,
  .focused_c69b,
  .avatar_0dae,
  .mask_aec0,
  .detail_9146,
  .caption-fccb {
    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 */
  .focus_9274,
  .silver-0abb,
  .background_1891,
  .module-old-0342,
  .right-8346 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .paper-13e6,
  .pattern_47c9,
  .lite-f02a,
  .active_south_d1e1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .message_prev_ce88,
  .wrapper-over-1269 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .orange_5f94,
  .hover_slow_6744,
  .highlight-gas-1524,
  .description_upper_a09f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .info-complex-b0cf,
  .element-18b5,
  .hidden-steel-5c98,
  .sidebar-fluid-bc5c,
  .footer-warm-0917,
  .sidebar-gas-799c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focus_9274,
  .silver-0abb,
  .module-old-0342 {
    max-width: none !important;
  }
  
  .old-1e60 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .paper-13e6 {
    font-size: 1.5rem !important;
  }
  
  .pattern_47c9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .soft-0b41,
  .hard-980c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .lite-f02a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hard-9bae {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .paragraph-selected-70ec {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focus_9274,
  .module-old-0342 {
    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: ccc2 */
.promo-block-h1 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.2;
}
