/* ============================================
   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 (.solid_1d6d) is a descendant of
   .row_4684 (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.info-7185 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".caption_advanced_97cf" 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.grid-orange-871b so it can't cause
   horizontal overflow anyway. */
.detail-warm-cd20,
.carousel-1e73,
.top-ad3c,
.texture-small-dcc4,
.alert_9c9e,
.focused-a5ed,
.action_4851,
.paragraph_middle_ef04,
.tooltip-45fe,
.row-east-0e07,
.focused-c27d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .plasma_9012 {
    padding: 8px 0;
  }
  
  .hard-5d5b img {
    height: 28px;
    width: auto;
  }
  
  .shadow_dim_806f {
    display: none !important;
  }
  
  .article_huge_a228 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .article_huge_a228 svg {
    width: 14px;
    height: 14px;
  }
  
  .dropdown_silver_bc14 {
    padding: 6px;
  }
  
  .out-3a44 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .top-ad3c,
  .carousel-1e73,
  .texture-small-dcc4,
  .alert_9c9e,
  .badge_brown_edf8,
  .middle-c6ba,
  .main_gold_1747,
  .notification_244c,
  .primary-c85f,
  .paper-a3be,
  .heading-104f,
  .up-dd00 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .detail-379d,
  .narrow-1b83 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .frame-59b0,
  .main-54b9,
  .border_f6d4,
  .bright_8dea,
  .in-8590,
  .secondary_liquid_d7c7,
  .link-hard-9f75 {
    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 */
  .panel-bda7,
  .tertiary-2636,
  .highlight-8d83,
  .item-8f37,
  .text-1046 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hover_5f79,
  .row_iron_8ad7,
  .gallery_424b,
  .summary_7097 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .heading_gold_093a,
  .texture-focused-0f6d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .next-8c4b,
  .texture_49b6,
  .widget-774b,
  .layout-under-d832 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .cool_cc85,
  .heading_33be,
  .list_bc65,
  .pagination_active_cf62,
  .layout-warm-e3dd,
  .right_813d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .panel-bda7,
  .tertiary-2636,
  .item-8f37 {
    max-width: none !important;
  }
  
  .caption_advanced_97cf {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hover_5f79 {
    font-size: 1.5rem !important;
  }
  
  .row_iron_8ad7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .thumbnail_yellow_b062,
  .brown_7d98 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gallery_424b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .medium_74d7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .disabled-6394 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .panel-bda7,
  .item-8f37 {
    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: a62d */
.promo-block-q7 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.3;
}
