/* ============================================
   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 (.middle-dd52) is a descendant of
   .old_6b0b (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.surface_center_8c0a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".gold_27c6" 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.over-d38a so it can't cause
   horizontal overflow anyway. */
.dropdown-pink-164c,
.menu-dark-9dba,
.feature-narrow-0bc7,
.accordion-6bdb,
.link-a4d0,
.outline-fd77,
.sidebar_e5dd,
.out-434b,
.photo_e8a3,
.status-steel-7285,
.warm_8478 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .center-af1c {
    padding: 8px 0;
  }
  
  .over-1378 img {
    height: 28px;
    width: auto;
  }
  
  .hidden-purple-2fc1 {
    display: none !important;
  }
  
  .hard_e126 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hard_e126 svg {
    width: 14px;
    height: 14px;
  }
  
  .wood-e842 {
    padding: 6px;
  }
  
  .form-1cca {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .feature-narrow-0bc7,
  .menu-dark-9dba,
  .accordion-6bdb,
  .link-a4d0,
  .hard-eefe,
  .article_motion_c48c,
  .popup-new-0697,
  .border_e0e6,
  .secondary-5c4e,
  .short_0c60,
  .out_b280,
  .stale_618f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .notice_8ddf,
  .form-stone-de8e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .light-ae0c,
  .tiny-1239,
  .action-7c90,
  .center_4143,
  .gallery_cool_ae23,
  .middle_530c,
  .content_red_0032 {
    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 */
  .list-prev-d5e4,
  .complex-acb5,
  .tooltip-aa38,
  .outer-aad0,
  .description-short-6869 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gas_cd66,
  .card-motion-5353,
  .under_ee7e,
  .active_hot_4562 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .feature_b1ca,
  .yellow_8bef {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .content-hard-d920,
  .new-eae9,
  .prev-163f,
  .header_2255 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hidden_large_b25e,
  .large-a8a1,
  .motion_31a0,
  .element-dim-d6ae,
  .gas_325d,
  .sidebar-white-894d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .list-prev-d5e4,
  .complex-acb5,
  .outer-aad0 {
    max-width: none !important;
  }
  
  .gold_27c6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gas_cd66 {
    font-size: 1.5rem !important;
  }
  
  .card-motion-5353 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .accordion_0723,
  .pagination-pro-1e46 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .under_ee7e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .white-949c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .box-west-11f6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .list-prev-d5e4,
  .outer-aad0 {
    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: 25aa */
.widget-item-t9 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.3;
}
