/* ============================================
   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 (.tabs_stale_01ce) is a descendant of
   .media-left-75d8 (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.gallery_dd6b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".hard-2fbe" 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.gas_ebb6 so it can't cause
   horizontal overflow anyway. */
.row-light-e794,
.mini_7890,
.hot_68c5,
.left-9566,
.video-smooth-7662,
.highlight_soft_312a,
.article_dirty_5e52,
.shade_fixed_7238,
.brown_cca1,
.panel-9248,
.stone_6524 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .column-9745 {
    padding: 8px 0;
  }
  
  .right_7a92 img {
    height: 28px;
    width: auto;
  }
  
  .label_in_3d25 {
    display: none !important;
  }
  
  .video_59ad {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .video_59ad svg {
    width: 14px;
    height: 14px;
  }
  
  .upper-f2f5 {
    padding: 6px;
  }
  
  .surface-static-3893 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hot_68c5,
  .mini_7890,
  .left-9566,
  .video-smooth-7662,
  .image_tiny_e818,
  .active_788a,
  .paragraph-b59a,
  .purple_dd4e,
  .widget-iron-dba8,
  .preview-pro-9ba5,
  .detail-green-26b5,
  .hidden-steel-4978 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .slider-37b2,
  .shadow-south-6f20 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tertiary-595f,
  .photo_pressed_7fee,
  .center_9333,
  .focused-6812,
  .north-913b,
  .backdrop_97ce,
  .surface_9c56 {
    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 */
  .notification_white_a305,
  .preview-f367,
  .tall-e9a1,
  .hot-731f,
  .info_fc63 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .breadcrumb-complex-7d27,
  .article-fbab,
  .item-new-1e36,
  .widget_8ec2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .block_dirty_868e,
  .form-bottom-aaa1 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .notification_plasma_df27,
  .brown_5685,
  .secondary_selected_8489,
  .logo-3691 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .caption_403b,
  .breadcrumb-1e4f,
  .stone-2a90,
  .status_liquid_9ef0,
  .backdrop_d43c,
  .paper_0eb2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .notification_white_a305,
  .preview-f367,
  .hot-731f {
    max-width: none !important;
  }
  
  .hard-2fbe {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .breadcrumb-complex-7d27 {
    font-size: 1.5rem !important;
  }
  
  .article-fbab {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .progress-e080,
  .red_4245 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .item-new-1e36 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .fixed_0936 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .logo_4789 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .notification_white_a305,
  .hot-731f {
    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: 0f83 */
.widget-item-y9 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.1;
}
