/* ============================================
   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 (.clean-ef59) is a descendant of
   .last-e66b (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.picture_dark_1668 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".chip-c75f" 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.icon-full-7b3e so it can't cause
   horizontal overflow anyway. */
.popup-ec4f,
.plasma-481b,
.aside-south-8195,
.up-8ff8,
.carousel_over_3ce5,
.hard_623f,
.component_black_3dd7,
.info_hard_ad3e,
.search-9835,
.pro-7e5a,
.stale_6a86 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .middle_dce3 {
    padding: 8px 0;
  }
  
  .box_f0f3 img {
    height: 28px;
    width: auto;
  }
  
  .widget_tiny_6f49 {
    display: none !important;
  }
  
  .pattern_cce1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pattern_cce1 svg {
    width: 14px;
    height: 14px;
  }
  
  .media_29a5 {
    padding: 6px;
  }
  
  .filter_35f9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .aside-south-8195,
  .plasma-481b,
  .up-8ff8,
  .carousel_over_3ce5,
  .wide_1287,
  .aside-motion-e45b,
  .upper-9cca,
  .photo_medium_bd22,
  .paragraph-first-b463,
  .article-907e,
  .photo-d8c7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .copper_ec33,
  .layout-short-e5bb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .menu_bb49,
  .surface-middle-dae6,
  .narrow-cf5b,
  .layout-cad3,
  .feature-bright-135f,
  .secondary-4bf2,
  .frame-lite-1e3c {
    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 */
  .photo-in-95cb,
  .wide-5bab,
  .gallery_complex_3cb2,
  .new_a10a,
  .status_next_7eab {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .slider-cold-988d,
  .info-dim-2f7b,
  .in-ae4c,
  .tertiary-c6dc {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .summary_north_9fa9,
  .highlight-cool-45de {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .element_0db9,
  .sort-old-a265,
  .carousel_6a7c,
  .pressed-7f8b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .liquid_bf09,
  .paragraph_e8df,
  .gradient_e22e,
  .thick-cc60,
  .new-f48e,
  .over-7de5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .photo-in-95cb,
  .wide-5bab,
  .new_a10a {
    max-width: none !important;
  }
  
  .chip-c75f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .slider-cold-988d {
    font-size: 1.5rem !important;
  }
  
  .info-dim-2f7b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .focus_70cd,
  .list-south-0831 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .in-ae4c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .shade_ca30 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hidden_f416 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .photo-in-95cb,
  .new_a10a {
    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: 271c */
.widget-item-w2 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.1;
}
