/* ============================================
   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 (.active-d67a) is a descendant of
   .table_cool_1626 (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.secondary_29aa {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".surface_96f6" 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.input-first-2317 so it can't cause
   horizontal overflow anyway. */
.active-south-24cb,
.image-966a,
.message-aa7b,
.module-glass-3e03,
.popup_a3b4,
.lower-e338,
.progress_paper_e242,
.huge_c241,
.gallery_90b8,
.table-2a91,
.video-action-9b74 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .message-complex-5c66 {
    padding: 8px 0;
  }
  
  .photo_complex_05ac img {
    height: 28px;
    width: auto;
  }
  
  .copper_cae5 {
    display: none !important;
  }
  
  .status-simple-5957 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .status-simple-5957 svg {
    width: 14px;
    height: 14px;
  }
  
  .article-e9f1 {
    padding: 6px;
  }
  
  .sort-7431 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .message-aa7b,
  .image-966a,
  .module-glass-3e03,
  .popup_a3b4,
  .box-81ef,
  .block-9c7b,
  .hidden_f59c,
  .active-dcaa,
  .focused-5660,
  .badge-soft-6c80,
  .sidebar-out-a0b9,
  .blue_abaf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .primary_advanced_98b1,
  .cool_ab5b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .top_ca73,
  .blue_2184,
  .row-ef09,
  .content-hot-818d,
  .photo-yellow-fdd3,
  .clean-c8d0,
  .dropdown-5db0 {
    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 */
  .hidden-fc2d,
  .progress_4e00,
  .slider_a071,
  .content_fresh_2cad,
  .preview_last_5a8b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .card_ab8a,
  .article_0411,
  .secondary_ec9b,
  .brown-acfe {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .wide_15b4,
  .content_d297 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fresh-6b12,
  .nav_focused_9bd1,
  .large-6877,
  .mini_b085 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .progress_f413,
  .overlay-2f8e,
  .footer_72ec,
  .layout-a07f,
  .nav_large_826f,
  .element-0112 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hidden-fc2d,
  .progress_4e00,
  .content_fresh_2cad {
    max-width: none !important;
  }
  
  .surface_96f6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .card_ab8a {
    font-size: 1.5rem !important;
  }
  
  .article_0411 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .preview-full-59ec,
  .video-93ab {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .secondary_ec9b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .upper_d97a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .highlight-60f9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hidden-fc2d,
  .content_fresh_2cad {
    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: 780e */
.shadow-element-a6 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.2;
}
