/* ============================================================
   BeijingMedAccess — shared-mobile.css  v2
   Mobile-first: image-on-top / text-below Hero structure
   Desktop: unchanged. Mobile (≤768px): split layout.
   ============================================================ */

/* ── GLOBAL MOBILE RESETS ──────────────────────────────────── */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  * { max-width: 100%; word-break: break-word; box-sizing: border-box; }

  img { max-width: 100%; height: auto; }

  /* ── NAV ──────────────────────────────────────────────────── */
  nav {
    padding: 12px 20px;
    min-height: 58px;
    height: auto;
  }

  .nl { font-size: 18px; }

  .nlinks { display: none !important; }

  .hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    cursor: pointer;
    padding: 10px 8px;
    background: none;
    border: none;
    flex-shrink: 0;
  }

  .hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--deep);
    border-radius: 2px;
  }

  /* ── MOBILE MENU ──────────────────────────────────────────── */
  .mobile-menu {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(250, 247, 242, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 500;
    padding: 72px 0 32px;
    overflow-y: auto;
    flex-direction: column;
  }

  .mobile-menu.open { display: flex; }

  .mobile-menu a {
    display: flex;
    align-items: center;
    padding: 16px 28px;
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ts);
    text-decoration: none;
    border-bottom: 1px solid var(--sand);
    min-height: 52px;
  }

  .mobile-menu a:last-child {
    border: none;
    margin: 20px 20px 4px;
    min-height: 52px;
    background: var(--accent);
    color: #fff !important;
    border-radius: 3px;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
  }

  .mobile-menu-close {
    position: absolute;
    top: 12px; right: 18px;
    width: 44px; height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--ts);
    background: none;
    border: none;
    cursor: pointer;
  }

  /* ═══════════════════════════════════════════════════════════
     HERO — IMAGE ON TOP / TEXT BELOW
     Applies to specialist pages using .hero with inline img div
     ═══════════════════════════════════════════════════════════ */

  .hero {
    /* Reset desktop overlay layout */
    display: flex !important;
    flex-direction: column !important;
    min-height: auto !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    overflow: visible !important;
    position: relative;
  }

  /* Image container: top block, fixed height, no overlay needed */
  .hero > div:first-child {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 52vw !important;       /* ~200px on 390px, ~224px on 430px */
    min-height: 200px !important;
    max-height: 340px !important;
    overflow: hidden !important;
    flex-shrink: 0;
    z-index: 0;
  }

  .hero > div:first-child img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Hide the gradient overlay on mobile — text is below the image now */
  .hero > div:first-child > div:last-child {
    display: none !important;
  }

  /* Text content: full-width solid block below image */
  .hero > div:last-child,
  .hero-content,
  .hero > div[style*="margin-right:auto"],
  .hero > div[style*="margin-left:auto"] {
    position: relative !important;
    z-index: 1 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    background: var(--deep) !important;
    padding: 36px 20px 44px !important;
    box-sizing: border-box;
  }

  /* Hero typography on dark background */
  .hero h1,
  .hero-content h1 {
    font-size: clamp(34px, 9vw, 44px) !important;
    line-height: 1.1 !important;
    color: #fff !important;
  }

  .hero h1 em,
  .hero-content h1 em { color: var(--accentl) !important; }

  .hero-sl,
  .hero-content .hero-sl {
    font-size: 10px !important;
    letter-spacing: 0.12em !important;
    color: var(--accentl) !important;
    margin-bottom: 12px !important;
  }

  .hero-sub,
  .hero-content .hero-sub {
    font-size: 16px !important;
    line-height: 1.65 !important;
    color: rgba(255,255,255,0.85) !important;
    margin-top: 12px !important;
  }

  /* CTA buttons */
  .cta-btn,
  a[class*="cta-btn"],
  .hero-content a {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 14px 20px !important;
    box-sizing: border-box;
    margin-top: 20px !important;
  }

  /* ═══════════════════════════════════════════════════════════
     INDEX HERO — uses .hbg + .hc class structure
     ═══════════════════════════════════════════════════════════ */

  /* Wrap hero in column flow */
  .hero.index-hero,
  section.index-hero,
  div.index-hero {
    flex-direction: column !important;
  }

  /* hbg: becomes the top image block */
  .hbg {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 52vw !important;
    min-height: 200px !important;
    max-height: 320px !important;
    overflow: hidden !important;
    flex-shrink: 0;
  }

  .hbg img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 30% center !important;
  }

  /* Remove desktop overlay gradient */
  .hbg::after { display: none !important; }

  /* hc: becomes the bottom text block */
  .hc {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    background: var(--deep) !important;
    padding: 36px 20px 44px !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .hc h1 {
    font-size: clamp(34px, 9vw, 44px) !important;
    line-height: 1.1 !important;
    color: #fff !important;
  }

  .hc h1 em { color: var(--accentl) !important; }

  .hbadge {
    font-size: 10px !important;
    letter-spacing: 0.1em !important;
    color: var(--accentl) !important;
    margin-bottom: 12px !important;
    white-space: normal !important;
  }

  .hsub {
    font-size: 16px !important;
    line-height: 1.65 !important;
    color: rgba(255,255,255,0.85) !important;
    margin-top: 10px !important;
  }

  .hsub2 { display: none !important; }

  /* Hero stat numbers */
  .hnums {
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    margin-top: 20px !important;
  }

  .hnc {
    border-left: none !important;
    border-top: 1px solid rgba(255,255,255,0.15) !important;
    padding: 14px 0 !important;
    margin: 0 !important;
  }

  .hnv { font-size: 36px !important; }

  .hnl { color: rgba(255,255,255,0.75) !important; }

  /* Hero buttons */
  .hbtns {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 20px !important;
  }

  .hbtns a {
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 14px 20px !important;
  }

  /* ── STAT BAR ─────────────────────────────────────────────── */
  .stat-bar {
    padding: 16px 20px !important;
    gap: 0 !important;
    flex-wrap: wrap !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  .stat-bar > div {
    padding: 12px 8px !important;
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .stat-bar > div:nth-child(2n) { border-right: none; }

  .stat-num { font-size: 22px !important; }
  .stat-label { font-size: 10px !important; }

  /* ── SECTIONS ─────────────────────────────────────────────── */
  section,
  .tiers-section,
  .faq-section,
  .suitability,
  .context-section,
  .cta-section,
  .tier-section {
    padding: 36px 20px !important;
  }

  .cta-section h2 { font-size: 28px !important; }
  .cta-section p { font-size: 15px !important; }

  /* ── ALL GRIDS → SINGLE COLUMN ────────────────────────────── */
  .svc-grid,
  .panels-grid,
  .hf-grid,
  .context-grid,
  .process-grid,
  .who-grid,
  .timeline-grid,
  .suit-grid,
  .tiers-grid,
  .hospital-grid,
  .hospital-grid.two-col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Inline grid styles */
  div[style*="grid-template-columns:repeat(5,1fr)"],
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns:repeat(2,1fr)"],
  div[style*="grid-template-columns:1fr 2fr"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── TABLE ─────────────────────────────────────────────────── */
  .compare-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px !important;
  }

  /* ── ANXIETY BAR ─────────────────────────────────────────── */
  .anxiety-bar {
    padding: 14px 20px !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  /* ── FOOTER ─────────────────────────────────────────────── */
  footer { padding: 24px 20px !important; }

  /* ── PAGE HERO (privacy / network) ──────────────────────── */
  .page-hero {
    padding: 90px 20px 40px !important;
  }

  .page-hero h1 {
    font-size: 30px !important;
    line-height: 1.15 !important;
  }

  .content { padding: 36px 20px !important; }

  /* ── WARNING BAR ─────────────────────────────────────────── */
  .warning-bar { padding: 16px 20px !important; }
  /* Ensure menu links are always clickable */
  .mobile-menu {
    pointer-events: auto !important;
  }

  .mobile-menu a {
    pointer-events: auto !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(184,136,90,0.15) !important;
    position: relative;
    z-index: 510 !important;
  }

  .mobile-menu-close {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 520 !important;
  }

  /* Prevent any overlay from blocking menu */
  .mobile-menu.open * {
    pointer-events: auto;
  }

}
