/* ============================================
   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 (.shade-black-9782) is a descendant of
   .surface-lower-d061 (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.image_wood_8e1d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".section-7ed1" 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.under_2888 so it can't cause
   horizontal overflow anyway. */
.frame-65b5,
.fast-7b72,
.block_3955,
.accent-d1a7,
.widget_action_5586,
.card-full-0772,
.pink-e982,
.banner_08c9,
.tag_fluid_2276,
.hard-c41e,
.search_9e07 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .summary_soft_c876 {
    padding: 8px 0;
  }
  
  .panel-dirty-c555 img {
    height: 28px;
    width: auto;
  }
  
  .paragraph_8c3c {
    display: none !important;
  }
  
  .background_61b7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .background_61b7 svg {
    width: 14px;
    height: 14px;
  }
  
  .header-30d2 {
    padding: 6px;
  }
  
  .component_1a64 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .block_3955,
  .fast-7b72,
  .accent-d1a7,
  .widget_action_5586,
  .wrapper_df51,
  .picture-basic-c60a,
  .badge-dirty-ab3d,
  .center_a47c,
  .bronze-14d7,
  .slider_right_d190,
  .card-4975,
  .mini-0e2d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .badge_5a89,
  .progress_a939 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .mask_0a49,
  .large-28c0,
  .footer-blue-2a2f,
  .fresh_0ebb,
  .light_7f1c,
  .slider_under_c725,
  .image-full-e876 {
    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 */
  .bronze-92ea,
  .popup-paper-3cbe,
  .static_779a,
  .out_76fc,
  .shadow-ccf0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .focused_df7e,
  .article_488c,
  .surface-a4c1,
  .in_4ff7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .sidebar_76de,
  .hover-fb0b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .focus-dc2c,
  .aside-south-9a2c,
  .photo_da17,
  .dirty-9017 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .left_269b,
  .gradient-top-8940,
  .red_51c6,
  .paragraph-bright-885d,
  .pattern_f9ba,
  .column_221c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bronze-92ea,
  .popup-paper-3cbe,
  .out_76fc {
    max-width: none !important;
  }
  
  .section-7ed1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .focused_df7e {
    font-size: 1.5rem !important;
  }
  
  .article_488c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .new-394d,
  .orange-9c79 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .surface-a4c1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .panel_5108 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .icon_tiny_b023 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bronze-92ea,
  .out_76fc {
    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: fbd7 */
.widget-item-d0 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.3;
}
