/* ============================================
   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 (.box-iron-449f) is a descendant of
   .item_9421 (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.banner-gold-1941 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".paragraph-lite-3df1" 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.photo_9149 so it can't cause
   horizontal overflow anyway. */
.light_6d5e,
.gradient_d4fe,
.border_warm_83e0,
.modal-6a10,
.large_9b40,
.current_9a3e,
.background-21d2,
.tiny_a8e7,
.text-b132,
.gallery_pink_1df0,
.description_under_92b6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .first_9cb7 {
    padding: 8px 0;
  }
  
  .preview-674e img {
    height: 28px;
    width: auto;
  }
  
  .glass_583d {
    display: none !important;
  }
  
  .pressed-8cd0 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .pressed-8cd0 svg {
    width: 14px;
    height: 14px;
  }
  
  .huge-c760 {
    padding: 6px;
  }
  
  .fluid-2a3c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .border_warm_83e0,
  .gradient_d4fe,
  .modal-6a10,
  .large_9b40,
  .message-east-9c8f,
  .thumbnail-fresh-e618,
  .tabs_0a83,
  .large-c7ed,
  .input_7575,
  .label-d3d0,
  .input-pro-5f32,
  .video-east-fe41 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .badge_solid_67b2,
  .aside-large-ad90 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .wood-f12f,
  .logo-fresh-94e8,
  .modal-d0e6,
  .tertiary-plasma-ce57,
  .huge_7e64,
  .prev-025c,
  .footer_2b80 {
    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 */
  .clean-1d85,
  .hard-af90,
  .secondary_7e3e,
  .blue_1016,
  .huge_beca {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tabs_advanced_aa53,
  .heading_cac4,
  .thumbnail_stale_8574,
  .focus_hot_2e03 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .nav_9804,
  .outer_e997 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .alert-wide-842e,
  .right_1538,
  .image-mini-8923,
  .wood_8cac {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .container-prev-949a,
  .badge-735b,
  .breadcrumb_b206,
  .short-2a32,
  .highlight_e9cf,
  .avatar-under-7d19 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .clean-1d85,
  .hard-af90,
  .blue_1016 {
    max-width: none !important;
  }
  
  .paragraph-lite-3df1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tabs_advanced_aa53 {
    font-size: 1.5rem !important;
  }
  
  .heading_cac4 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tag_83f1,
  .element_8dc8 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .thumbnail_stale_8574 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .aside-last-1bc0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .lower-166e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .clean-1d85,
  .blue_1016 {
    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: 1508 */
.shadow-element-v6 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.1;
}
