/* ============================================
   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 (.row_eb41) is a descendant of
   .search_static_501b (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.
   Two site templates coexist: legacy obfuscated-class (header.north_53bb)
   and the redesigned template (header.item-1c12). Keep both selectors. */
header.north_53bb,
header.item-1c12 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".preview-6ea4" 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.lite-707e so it can't cause
   horizontal overflow anyway. */
.text-full-02cf,
.label-white-d0e3,
.active_new_5985,
.dim-3aab,
.stone-8508,
.photo_under_5761,
.border_fd81,
.green-befc,
.picture_down_05c5,
.module-medium-489c,
.accent_31d5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .dirty-d204 {
    padding: 8px 0;
  }
  
  .card_f433 img {
    height: 28px;
    width: auto;
  }
  
  .tiny_42a0 {
    display: none !important;
  }
  
  .notification-6a1c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .notification-6a1c svg {
    width: 14px;
    height: 14px;
  }
  
  .header_861a {
    padding: 6px;
  }
  
  .tabs_hard_b56e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .active_new_5985,
  .label-white-d0e3,
  .dim-3aab,
  .stone-8508,
  .preview-13c3,
  .media-512a,
  .silver_6243,
  .column_1f6e,
  .media_3fca,
  .static_750e,
  .breadcrumb-complex-981a,
  .mask_3be8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .accordion_basic_0234,
  .list-copper-58ae {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fluid_17f5,
  .image_silver_ac9e,
  .sidebar_e35f,
  .alert_dark_06b8,
  .basic-2a09,
  .footer-d003,
  .label-bfa5 {
    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 */
  .summary_smooth_195a,
  .summary-red-92da,
  .photo-761d,
  .notice_2d4b,
  .video_8bad {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sidebar_stale_2a4e,
  .smooth_680f,
  .accent_lite_16d8,
  .full-5b08 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .complex-0440,
  .stale-d038 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .outline_middle_7b55,
  .title-bottom-5562,
  .block-fixed-c0f8,
  .focused-69f4 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .layout_smooth_f731,
  .under-dfb8,
  .top-5243,
  .message-narrow-f999,
  .paper_684f,
  .button_hot_a82c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .summary_smooth_195a,
  .summary-red-92da,
  .notice_2d4b {
    max-width: none !important;
  }
  
  .preview-6ea4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sidebar_stale_2a4e {
    font-size: 1.5rem !important;
  }
  
  .smooth_680f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .sidebar_c704,
  .wrapper-advanced-514a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .accent_lite_16d8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .dark-3662 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .link_03e5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .summary_smooth_195a,
  .notice_2d4b {
    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: 94a5 */
.video_4ee5 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 0f63 */
.promo-block-a7 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.0;
}
