/* ============================================
   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 (.sort_first_7208) is a descendant of
   .left-183a (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.paragraph_24d9)
   and the redesigned template (header.image_cf99). Keep both selectors. */
header.paragraph_24d9,
header.image_cf99 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".sort_south_cf39" 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.table_gold_18a3 so it can't cause
   horizontal overflow anyway. */
.middle_8171,
.message-7859,
.block_bright_12ff,
.dynamic-dacb,
.tertiary-475c,
.huge-fa46,
.lite-0d1d,
.secondary-30d5,
.green_cb2a,
.bright-3d48,
.logo-gold-b7f8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .texture_e148 {
    padding: 8px 0;
  }
  
  .easy-e02c img {
    height: 28px;
    width: auto;
  }
  
  .hero-9d30 {
    display: none !important;
  }
  
  .tiny_bd96 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tiny_bd96 svg {
    width: 14px;
    height: 14px;
  }
  
  .caption_red_dadd {
    padding: 6px;
  }
  
  .highlight-beed {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .block_bright_12ff,
  .message-7859,
  .dynamic-dacb,
  .tertiary-475c,
  .overlay-5518,
  .pattern_f562,
  .popup_basic_983b,
  .banner-over-5c60,
  .media_faa6,
  .primary-d84d,
  .layout_paper_3a9f,
  .preview-e728 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tertiary-bca9,
  .copper_da84 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .list-a8e1,
  .link-5e5e,
  .progress-last-6598,
  .alert_center_fe7f,
  .dropdown-huge-2e93,
  .secondary_large_2e0b,
  .info_plasma_6b00 {
    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 */
  .border_out_71cb,
  .smooth-ea85,
  .old-f5e2,
  .pattern_d1da,
  .advanced-f3dd {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .picture_279d,
  .panel-6c59,
  .chip_8b10,
  .panel-small-22f3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .active-4a06,
  .border_focused_e5d9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .table-e8eb,
  .title_right_8d10,
  .backdrop_35bf,
  .grid_3900 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .focus_steel_fb17,
  .chip-narrow-4cc8,
  .tertiary_fresh_69df,
  .layout_first_ea37,
  .input-58bc,
  .layout_37e8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .border_out_71cb,
  .smooth-ea85,
  .pattern_d1da {
    max-width: none !important;
  }
  
  .sort_south_cf39 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .picture_279d {
    font-size: 1.5rem !important;
  }
  
  .panel-6c59 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .shade_16ed,
  .icon_medium_6c9b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .chip_8b10 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .title_steel_ecbb {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .media_42fd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .border_out_71cb,
  .pattern_d1da {
    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 */
.hidden_fd90 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: f170 */
.phantom-card-g8 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.3;
}
