/* =========================================================================
   CyberLetics — Mobile & Tablet Responsive Polish
   -------------------------------------------------------------------------
   Drop-in stylesheet. Include AFTER the page's own styles so these rules win
   on small viewports. Targets ≤ 1024px (Tailwind `lg` breakpoint and below).

   What this file fixes
     • Hero sections that stayed two-column on tablets/phones
     • Pricing & comparison tables overflowing the viewport
     • Form inputs that were too small for thumbs
     • Hamburger/drawer themed correctly per page background
     • Long text wrapping with no min-width safety
   ========================================================================= */

/* ── Universal: never let anything cause horizontal scroll on the body ──── */
html, body { max-width: 100vw; overflow-x: hidden; }

/* Tap-target hygiene: every clickable element ≥ 44×44px on mobile,
   per WCAG 2.5.5 / iOS HIG. */
@media (max-width: 767px) {
  a[href],
  button:not([aria-hidden="true"]),
  input[type="submit"],
  input[type="button"],
  .cta-btn-primary,
  .cta-btn-secondary {
    min-height: 44px;
  }
}

/* ── Mobile drawer theme variables ──────────────────────────────────────── */
/* Light pages override this to a near-white backdrop. */
:root { --cl-mobile-drawer-bg: #07080a; }

/* Theme-light pages (every marketing page except home/blog-post which are
   dark) explicitly set a near-white backdrop via this body class hook. */
body.cl-light-bg { --cl-mobile-drawer-bg: #ffffff; }

/* When the drawer is open, hide its visible-but-empty pre-translate state */
#cl-mobile-drawer.invisible { visibility: hidden !important; }

/* ── Hero sections ──────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  /* Any grid hero with `lg:grid-cols-2` already stacks below `lg` — good.
     The fix below catches hero sections that used MD instead of LG. */
  section.hero, .hero-section {
    text-align: left;
  }
  /* Headlines: tighten the scale so they don't overflow on 360px screens */
  h1.text-5xl,
  h1.text-6xl,
  h1.text-7xl {
    font-size: clamp(2rem, 6vw + 0.5rem, 3.25rem) !important;
    line-height: 1.1 !important;
  }
  h2.text-5xl,
  h2.text-6xl,
  h2.text-7xl {
    font-size: clamp(1.75rem, 5vw + 0.5rem, 2.75rem) !important;
    line-height: 1.15 !important;
  }
}

/* About-page hero visual: it's `h-[400px]` which crowds the headline on tablets.
   Below `md` we shrink it to give the headline breathing room. */
@media (max-width: 767px) {
  .about-hero-visual { height: 260px !important; }
  .about-hero-shield { width: 150px !important; height: 150px !important; }
  .about-hero-shield .material-symbols-outlined { font-size: 60px !important; }
}

/* ── Tables: enable horizontal scroll instead of overflow ───────────────── */
@media (max-width: 1023px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table thead, table tbody { display: table; width: 100%; min-width: 720px; }
  /* The pricing comparison table — large cell padding adds up to 1000+px. */
  .compare-table table { min-width: 760px; }
}

/* ── Pricing tier grid: 4 cards in a row never works on mobile ──────────── */
@media (max-width: 767px) {
  /* The pricing page uses `grid-cols-1 md:grid-cols-4` so 1-col on mobile is
     correct, BUT the SHIELD card has `transform scale-105` which makes it
     overflow on small screens. Cancel the scale on mobile. */
  .scale-105 { transform: none !important; }
}

/* ── Form layouts (login, signup, contact, forgot/reset password) ───────── */
/* Cover mobile AND tablet — touch input is fingers, not mice, at both sizes. */
@media (max-width: 1023px) {
  form { width: 100%; }
  /* Inputs: full-width, 16px font (prevents iOS auto-zoom on focus),
     thumb-sized vertical padding */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
  }
}
@media (max-width: 767px) {
  /* Two-column field groups stack vertically below sm */
  .grid.md\:grid-cols-2 > * { width: 100% !important; }
}

/* ── Navigation: extra padding on bar so links don't crowd hamburger ────── */
@media (max-width: 767px) {
  nav .cta-btn-primary,
  nav a[class*="bg-blue-600"] {
    font-size: 13px !important;
    padding: 8px 14px !important;
  }
  /* Some nav rows are `gap-7` — too wide on mobile when the menu is gone */
  nav > div > div:last-child { gap: 0.5rem !important; }
}

/* ── Cards that stretch too narrow on tablets ───────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Feature cards using `md:grid-cols-2` should stay 2-col on tablet — good.
     But `md:grid-cols-3` should fall back to 2 on narrow tablets. */
  .grid.md\:grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ── Long inline content: prevent overflow from inline-flex / no-wrap ───── */
@media (max-width: 767px) {
  p, li, h1, h2, h3, h4, h5 { overflow-wrap: anywhere; word-break: break-word; }
}

/* ── Footer: 4-column → 2-column on tablet, 1-column on mobile ──────────── */
@media (min-width: 640px) and (max-width: 1023px) {
  footer .grid.md\:grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 639px) {
  footer .grid.md\:grid-cols-4 { grid-template-columns: 1fr !important; gap: 2rem !important; }
}

/* ── Trust strip on home hero: wrap nicely instead of squeezing ────────── */
@media (max-width: 639px) {
  .stat-number { font-size: 1.5rem !important; }
  .stat-label  { font-size: 11px !important; }
}

/* ── Home hero: platform preview (browser-mockup) on mobile/tablet ───────
   At mobile width the desktop dashboard screenshot inside a full-width
   browser mockup looks crammed and the inner UI is illegible. Frame it as
   an intentional, centered preview card with breathing room and bigger
   touch-friendly slider dots. */
@media (max-width: 1023px) {
  .browser-mockup {
    max-width: 520px;
    margin: 2rem auto 0;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45),
                0 4px 12px rgba(0, 0, 0, 0.25);
  }
  /* Round the bottom corners of the image so it doesn't poke past the frame */
  .browser-mockup__content,
  .browser-mockup__content .hero-slider {
    border-bottom-left-radius: var(--radius-xl, 16px);
    border-bottom-right-radius: var(--radius-xl, 16px);
  }
  /* Slider dots: bigger and clearly tappable on touch screens */
  .hero-dots {
    margin-top: 1rem !important;
    gap: 10px !important;
  }
  .hero-dot {
    width: 10px !important;
    height: 10px !important;
    border-radius: 5px !important;
    min-width: 10px !important;
    min-height: 10px !important;
  }
  .hero-dot.active {
    width: 28px !important;
  }
}

/* Phone-only: lock the browser mockup to a comfortable phone-card width and
   inflate the macOS-style chrome dots so they read at small sizes. */
@media (max-width: 639px) {
  .browser-mockup {
    max-width: calc(100vw - 32px);
    margin-top: 1.25rem;
  }
  .browser-mockup__bar {
    padding: 8px 10px !important;
  }
  .browser-mockup__dot {
    width: 9px !important;
    height: 9px !important;
  }
  .browser-mockup__url {
    height: 18px !important;
    margin-left: 6px !important;
  }
  /* Tighter line-height for the framework trust strip so the heading doesn't
     visually merge with the preview underneath. */
  .text-\[11px\].uppercase {
    margin-bottom: 0.75rem !important;
    opacity: 1 !important;
  }
}

/* Tablet: give the preview proper presence by anchoring it center-stage */
@media (min-width: 640px) and (max-width: 1023px) {
  .browser-mockup {
    max-width: 560px;
  }
}
