/* ============================================
   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 (.tiny_08cd) is a descendant of
   .border-fast-250f (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.large_3cc2)
   and the redesigned template (header.in_ed92). Keep both selectors. */
header.large_3cc2,
header.in_ed92 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".accordion-d9f6" 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.breadcrumb_dynamic_6baa so it can't cause
   horizontal overflow anyway. */
.row-c06c,
.media_middle_5d28,
.image-be28,
.south-50b3,
.block_blue_21f9,
.component-thick-e9fe,
.feature_b519,
.icon_first_0f38,
.banner-2544,
.purple-7aa3,
.left-c98e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .cool-611e {
    padding: 8px 0;
  }
  
  .old-caff img {
    height: 28px;
    width: auto;
  }
  
  .dropdown-tiny-0f8d {
    display: none !important;
  }
  
  .nav-781d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .nav-781d svg {
    width: 14px;
    height: 14px;
  }
  
  .table-f02c {
    padding: 6px;
  }
  
  .aside_pressed_5803 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .image-be28,
  .media_middle_5d28,
  .south-50b3,
  .block_blue_21f9,
  .notification_full_414b,
  .chip-out-905c,
  .media-c5fd,
  .box-middle-731c,
  .static-ad36,
  .input_new_fb29,
  .module-bd19,
  .image_clean_b0a8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pink_0c69,
  .aside-a863 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .out_9c9b,
  .tabs_stale_c659,
  .background-glass-2451,
  .table_brown_638b,
  .panel-in-2aac,
  .preview-38bc,
  .shadow-7aa1 {
    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 */
  .over_83da,
  .bronze-d2f2,
  .bronze-5c33,
  .hidden-down-dd25,
  .nav-copper-3bc1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .last-d69f,
  .static_5bdc,
  .title-fb4d,
  .preview-light-8b9f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .popup_e46f,
  .iron_7bf5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .column-d8c1,
  .disabled-65cc,
  .column_375a,
  .lower-3dbf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .aside-b962,
  .focus-complex-6a58,
  .overlay-38f4,
  .block_in_7d9d,
  .pressed_9d01,
  .content-solid-883a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .over_83da,
  .bronze-d2f2,
  .hidden-down-dd25 {
    max-width: none !important;
  }
  
  .accordion-d9f6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .last-d69f {
    font-size: 1.5rem !important;
  }
  
  .static_5bdc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .icon-55ce,
  .disabled-8c39 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .title-fb4d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .caption_stale_6875 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hot-4ed9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .over_83da,
  .hidden-down-dd25 {
    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 */
.card_b5b1 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 5358 */
.ghost-box-l1 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.3;
}
