/* ============================================
   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 (.search-cold-80cc) is a descendant of
   .avatar_top_de8c (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.sort_silver_6b7d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".prev_753a" 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.photo-blue-2843 so it can't cause
   horizontal overflow anyway. */
.media_copper_d68d,
.heading_bd73,
.header_88fd,
.next_7dc9,
.fluid_35d6,
.fluid-6b4d,
.shadow-64fd,
.label-2560,
.full_27f1,
.notification_f80f,
.button-west-710e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .new_42e6 {
    padding: 8px 0;
  }
  
  .warm-73d1 img {
    height: 28px;
    width: auto;
  }
  
  .video_blue_9b85 {
    display: none !important;
  }
  
  .mini_d243 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .mini_d243 svg {
    width: 14px;
    height: 14px;
  }
  
  .element_dark_1095 {
    padding: 6px;
  }
  
  .next-d6a8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .header_88fd,
  .heading_bd73,
  .next_7dc9,
  .fluid_35d6,
  .title-inner-31f1,
  .shade-tiny-bd82,
  .steel_7c9d,
  .hero_a692,
  .section_advanced_d359,
  .summary-13e9,
  .frame-b0f5 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .complex_fb33,
  .carousel-97b4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tabs_90a9,
  .popup-center-7204,
  .media_9f1c,
  .out_f52b,
  .frame-c73a,
  .last_eeb4,
  .rough_76ac {
    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 */
  .pagination-copper-8eef,
  .hot_aa45,
  .progress_out_6c8f,
  .highlight_3d28,
  .top-a7bd {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gallery_motion_ce9b,
  .avatar-3478,
  .soft_dd1b,
  .lite_d74d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .panel-purple-a9e9,
  .focused_c3bc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .easy-01da,
  .tag_47e6,
  .focus-66b4,
  .gallery-mini-affb {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .text_out_febb,
  .frame_6e8d,
  .slow-811b,
  .pro-a18d,
  .notification_ea68,
  .active-right-c87a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .pagination-copper-8eef,
  .hot_aa45,
  .highlight_3d28 {
    max-width: none !important;
  }
  
  .prev_753a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gallery_motion_ce9b {
    font-size: 1.5rem !important;
  }
  
  .avatar-3478 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .medium_e57c,
  .input_d2ff {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .soft_dd1b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .shade-upper-d903 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .carousel-770f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .pagination-copper-8eef,
  .highlight_3d28 {
    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: a09e */
.shadow-element-b8 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.3;
}
