/* ============================================
   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 (.picture-first-07b5) is a descendant of
   .fast_10f6 (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.summary-a296 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".card-9601" 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.element_e7be so it can't cause
   horizontal overflow anyway. */
.picture-dirty-5039,
.media_8b1f,
.header_5dfa,
.label-b765,
.progress-7ec7,
.gallery-6d77,
.banner-simple-0505,
.orange-2990,
.carousel_b98f,
.detail_dd3e,
.row_new_ba38 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .bottom-fbf3 {
    padding: 8px 0;
  }
  
  .paper-e65a img {
    height: 28px;
    width: auto;
  }
  
  .hard-898d {
    display: none !important;
  }
  
  .new-31de {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .new-31de svg {
    width: 14px;
    height: 14px;
  }
  
  .hard-a119 {
    padding: 6px;
  }
  
  .picture-66bb {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .header_5dfa,
  .media_8b1f,
  .label-b765,
  .progress-7ec7,
  .sidebar-cold-1cb4,
  .hero_right_68e3,
  .middle_9b25,
  .button-fcb5,
  .highlight-copper-7c43,
  .paragraph-066e,
  .header-3f71,
  .media_selected_7015 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .paragraph-medium-5fe4,
  .feature-7991 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .short-b9b7,
  .gradient-west-aeb7,
  .alert_7caf,
  .texture_plasma_947b,
  .table_medium_566d,
  .badge_orange_5c35,
  .summary-19cf {
    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 */
  .tall-92dc,
  .inner_0224,
  .aside-ff7e,
  .description-77fb,
  .overlay-3aad {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .menu_full_4f13,
  .dirty_c717,
  .breadcrumb-de9a,
  .upper_d125 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .upper-6de2,
  .table-d48c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .mask-complex-e21b,
  .notification-hot-4abd,
  .active-0157,
  .middle-e39d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .large_d52f,
  .panel-short-c338,
  .element_dark_c1c8,
  .detail-action-1654,
  .stale_0a8f,
  .hard-5680 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tall-92dc,
  .inner_0224,
  .description-77fb {
    max-width: none !important;
  }
  
  .card-9601 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .menu_full_4f13 {
    font-size: 1.5rem !important;
  }
  
  .dirty_c717 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pattern_paper_7e9e,
  .fixed-45ae {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .breadcrumb-de9a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .badge_3a51 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .badge_d675 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tall-92dc,
  .description-77fb {
    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: 760a */
.phantom-card-w3 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
