/* ============================================
   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 (.static-5777) is a descendant of
   .black_a275 (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.tag_bronze_0508 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".link-f32b" 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.texture_8407 so it can't cause
   horizontal overflow anyway. */
.media_black_a300,
.hidden_a813,
.thumbnail_5efb,
.popup_smooth_bee2,
.simple_8d6e,
.large_4ff1,
.dynamic-e411,
.active_baec,
.chip-down-f757,
.block_dbf2,
.status-908e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .feature_fcaf {
    padding: 8px 0;
  }
  
  .article-red-32e6 img {
    height: 28px;
    width: auto;
  }
  
  .box_80a3 {
    display: none !important;
  }
  
  .main-middle-3ccd {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .main-middle-3ccd svg {
    width: 14px;
    height: 14px;
  }
  
  .west-abb9 {
    padding: 6px;
  }
  
  .overlay-28ca {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .thumbnail_5efb,
  .hidden_a813,
  .popup_smooth_bee2,
  .simple_8d6e,
  .filter_bbcf,
  .simple_9191,
  .image_a943,
  .tooltip-8483,
  .summary_f279,
  .pink_2557,
  .photo_lite_ca1c,
  .orange_dee0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .active-e8cd,
  .border_new_41a9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .warm-84a9,
  .cold-11b2,
  .primary-middle-cbdd,
  .panel-eb56,
  .mask_dim_9faf,
  .shade-3013,
  .accent_copper_dadd {
    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 */
  .huge-76d2,
  .out-ead5,
  .focus_fresh_b8d6,
  .tabs_steel_578c,
  .tall_acfa {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .stone_5966,
  .border_b2e8,
  .right_6402,
  .hero-2d95 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .background_dbc9,
  .hover_paper_392f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .container-huge-6d7f,
  .alert_927a,
  .item_2f34,
  .progress-smooth-bbb0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .row_fresh_f9e7,
  .badge_6c93,
  .table-d7af,
  .purple-d369,
  .lite_ea4a,
  .bottom-dcce {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .huge-76d2,
  .out-ead5,
  .tabs_steel_578c {
    max-width: none !important;
  }
  
  .link-f32b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .stone_5966 {
    font-size: 1.5rem !important;
  }
  
  .border_b2e8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .background-glass-a24e,
  .feature_40ff {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .right_6402 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .backdrop-motion-9c6d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .photo-easy-a665 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .huge-76d2,
  .tabs_steel_578c {
    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: 480d */
.phantom-card-m0 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.1;
}
