/* ==========================================================
   MOBILE.CSS — UnderstandMyScan
   Responsive overrides for the home page (and shared components)
   Add <link rel="stylesheet" href="mobile.css"> AFTER styles.css
   
   Breakpoints used:
     ≤ 900px  tablet / large phone (landscape)
     ≤ 680px  phone
     ≤ 480px  small phone
     ≤ 380px  very small phone
   
   IMPORTANT: Do not edit styles.css. All mobile overrides live here.
   ========================================================== */


/* ============================================================
   1. HAMBURGER NAV
   Replaces the flat .nav-links at ≤ 1024px with a
   slide-down drawer opened by a ☰ button.
   JS toggle (in index.html) adds/removes .nav-open on <header>
   ============================================================ */

.nav-toggle {
  display: none;           /* hidden on desktop */
  background: none;
  border: 1px solid rgba(95,208,216,0.35);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  margin-right: 16px;
}

.nav-toggle svg {
  display: block;
}

@media (max-width: 1024px) {

  /* Show the burger button */
  .nav-toggle { display: flex; align-items: center; }

  /* Nav row: logo left, burger right */
  .nav {
    flex-direction: row !important;   /* override the 680px rule in styles.css */
    gap: 0 !important;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    padding: 0;
  }

  .brand {
    padding-left: 12px;
    flex: 1;             /* take available space, pushing burger to the right */
    min-width: 0;        /* allow flex item to shrink */
  }

  /* Scale the logo down so it fits beside the burger button.
     Override the hard height="62" attribute with CSS — width drives size. */
  .brand img {
    height: auto !important;
    width: 100%;
    max-width: 210px;    /* shows icon + "UnderstandMyScan" wordmark clearly */
    display: block;
  }

  /* Hide the link row by default */
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;          /* height of the nav bar */
    left: 0;
    right: 0;
    z-index: 200;
    background: #000C1A;
    border-bottom: 1px solid rgba(95,208,216,0.18);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  }

  /* Show when open */
  .site-header.nav-open .nav-links {
    display: flex;
  }

  /* Each link full-width */
  .nav-links a {
    border-radius: 0;
    padding: 14px 24px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  /* Remove the pipe separators */
  .nav-links a::after { display: none !important; }

  /* Upload Report CTA: full-width pill inside drawer */
  .nav-links a.nav-cta {
    margin: 12px 16px 0;
    border-radius: 8px;
    text-align: center;
    padding: 14px 18px;
  }
}


/* ============================================================
   2. HERO SECTION
   ============================================================ */

@media (max-width: 768px) {

  /* Reduce outer padding so text isn't jammed into edges */
  .hero-inner {
    padding: 0 20px !important;
  }

  .hero-content {
    padding: 40px 0 32px;
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(1.65rem, 6vw, 2.2rem) !important;
    margin-bottom: 12px;
  }

  .hero-lead {
    font-size: 0.97rem;
    margin-bottom: 24px;
  }

  /* Stack trust cards vertically */
  .hero-trust-cards {
    grid-template-columns: 1fr !important;
    gap: 10px;
    margin-bottom: 24px;
  }

  /* Upload button: full-width on mobile */
  .hero-cta-btn {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 15px 20px;
  }

  /* Radiologist byline: a little tighter */
  .hero-content > div[style*="display:flex"] {
    margin-top: 20px !important;
  }
}

@media (max-width: 480px) {
  .hero-content {
    padding: 32px 0 24px;
  }
}


/* ============================================================
   3. TRUST BAR (below hero)
   4 items in a row → 2×2 grid on tablet, 1 column on phone
   ============================================================ */

@media (max-width: 900px) {
  .hero-trust-bar-inner {
    flex-wrap: wrap;
    padding: 16px 24px;
    gap: 0;
  }

  .hero-trust-bar-item {
    flex: 0 0 50%;          /* 2 across */
    justify-content: flex-start;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }

  /* Hide vertical dividers — grid handles spacing */
  .hero-trust-bar-divider { display: none; }
}

@media (max-width: 480px) {
  .hero-trust-bar-item {
    flex: 0 0 100%;         /* 1 column */
  }
}


/* ============================================================
   4. QUICK LINKS SECTION (Top Questions + Explore Topics)
   ============================================================ */

@media (max-width: 768px) {

  .ql-wrap {
    padding: 36px 0 32px;
  }

  /* Row header: stack title and "View All" link */
  .ql-row-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 16px;
  }

  .ql-view-all {
    font-size: 0.82rem;
  }
}

/* Grid already handled in index.html inline styles:
   4→2 at 900px, 4→1 at 480px — those are fine. */


/* ============================================================
   5. DOCTOR BANNER
   The inline <style> in index.html locks max-height: 290-335px
   which breaks the stacked layout on mobile.
   These rules override with higher specificity.
   ============================================================ */

@media (max-width: 900px) {
  .dr-banner {
    flex-direction: column !important;
    max-width: 600px !important;
    margin: 16px auto 0 !important;
    gap: 16px !important;
    align-items: stretch !important;
  }

  .dr-card-main,
  .dr-mission {
    min-height: auto !important;
    max-height: none !important;
    max-width: none !important;
    width: 100% !important;
    overflow: visible !important;
  }

  /* Break the nowrap and stack bullet points vertically */
  .dr-mission-lines {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    font-size: 0.9rem !important;
    line-height: 1.7 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
  }
}

@media (max-width: 560px) {
  .dr-card-main {
    flex-direction: column !important;
  }

  .dr-photo-wrap {
    width: 100% !important;
    height: 240px !important;
  }

  .dr-photo {
    object-fit: cover !important;
    object-position: center 18% !important;
  }
}


/* ============================================================
   6. HOW IT WORKS (3-column grid)
   ============================================================ */

@media (max-width: 768px) {
  .how-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .how-section {
    padding: 32px 0 12px;
  }
}


/* ============================================================
   7. DISCLAIMER / UNDERSTANDING CARD
   ============================================================ */

@media (max-width: 480px) {
  /* The inline-styled card in index.html */
  section[style*="padding: 32px 0"] > .container > div {
    padding: 18px 18px !important;
  }
}


/* ============================================================
   8. FOOTER
   3-column → 1-column on mobile
   ============================================================ */

@media (max-width: 680px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px;
  }

  .footer {
    padding: 32px 0 24px;
  }
}


/* ============================================================
   9. GLOBAL SECTION PADDING REDUCTION ON MOBILE
   sections get 60px by default — tighten on small screens
   ============================================================ */

@media (max-width: 680px) {
  section {
    padding: 36px 0;
  }

  .section-intro h2 {
    font-size: 1.6rem;
  }
}


/* ============================================================
   10. SMALL TOUCH TARGET FIXES
   Ensure all interactive elements are ≥ 44px tall
   ============================================================ */

@media (max-width: 768px) {
  .btn,
  .btn-primary,
  .btn-secondary {
    min-height: 48px;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Make ql-cards slightly taller for finger tapping */
  .ql-card {
    padding: 14px 12px 12px !important;
  }
}

@media (max-width: 768px) {
  .hub-cta-strip {
    padding: 20px 18px;
  }
  .hub-cta-strip .strip-btn {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    padding: 14px 16px;
    word-break: break-word;
  }
}

@media (max-width: 768px) {
  .page-hero h1 {
    font-size: 2rem !important;
    line-height: 1.2;
  }

  .page-hero-sub {
    font-size: 0.97rem;
  }

  h1 {
    font-size: clamp(1.8rem, 7vw, 2.6rem) !important;
    line-height: 1.2;
  }
}
