/* ═══════════════════════════════════════════════════════════
   AstroKamya™ · MOBILE LAYOUT FIXES v1.0
   ───────────────────────────────────────────────────────────
   PURPOSE:  Fix all mobile layout regressions.
   COVERS:
   - Footer: proper 2×2 grid, centered brand, breathing room
   - SoulSync Hero: stacking, card scaling, overflow fix
   - SoulSync Demo/Couple Match: vertical stacking
   - Blog: navbar isolation
   ═══════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════
   §1  FOOTER MOBILE FIX  (≤ 768px)
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  footer {
    padding: 40px 0 20px !important;
  }

  .foot-grid {
    flex-direction: column !important;
    gap: 32px !important;
    padding: 0 20px !important;
  }

  /* Center the brand section on mobile */
  .foot-brand {
    max-width: 100% !important;
    align-items: center !important;
    text-align: center !important;
  }
  .foot-brand .foot-mandala {
    width: 40px !important;
    height: 40px !important;
  }
  .foot-brand .logo-text {
    font-size: 20px !important;
  }
  .foot-tagline {
    text-align: center !important;
    max-width: 100% !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
  .foot-brand p {
    text-align: center !important;
    font-size: 12px !important;
  }

  /* 2×2 Grid for link columns */
  .foot-cols {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 28px 20px !important;
    width: 100% !important;
  }
  .foot-cols div {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .foot-cols h4 {
    font-size: 10px !important;
    margin-bottom: 4px !important;
  }
  .foot-cols a {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  /* Trust badges — wrap to 2 per row */
  .foot-trust {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 16px 0 !important;
    justify-items: center !important;
  }
  .foot-trust-item {
    font-size: 10px !important;
    gap: 4px !important;
  }

  /* Bottom bar */
  .foot-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
    margin-top: 24px !important;
    padding-top: 16px !important;
  }
  .foot-bottom p {
    font-size: 10px !important;
    text-align: center !important;
  }

  /* Disclaimer */
  .foot-disclaimer {
    padding: 14px 16px !important;
    margin-top: 16px !important;
  }
  .foot-disclaimer p {
    font-size: 9px !important;
  }
}

/* ════════════════════════════════════════════════════════
   §2  SOULSYNC HERO MOBILE FIX  (≤ 768px)
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Force single-column stack */
  .ss-hero-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 32px !important;
    padding: 0 16px !important;
  }

  /* Hero left (text) */
  .ss-hero-left {
    max-width: 100% !important;
    text-align: center !important;
    order: 1 !important;
  }
  .ss-hero-left h1 {
    font-size: clamp(26px, 7vw, 36px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
  }
  .ss-hero-badge {
    justify-content: center !important;
  }
  .ss-hero-desc {
    font-size: 14px !important;
    line-height: 1.6 !important;
    max-width: 100% !important;
    margin: 0 auto 20px !important;
  }
  .ss-hero-actions {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .ss-hero-actions a,
  .ss-hero-actions button {
    width: 100% !important;
    max-width: 320px !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Hero right (cards) — container stays flex */
  .ss-hero-right {
    order: 2 !important;
    max-width: 100% !important;
    overflow: visible !important;
    display: block !important;
    width: 100% !important;
  }

  /* ── HIDE the old overlapping desktop card stack on mobile ── */
  /* Replaced by .ss-mobile-match-reveal (Cosmic Match Reveal) */
  .ss-match-scene {
    display: none !important;
    visibility: hidden !important;
  }

  /* Also hide all children of the old match scene to be safe */
  .ss-profile-card,
  .ss-synergy-badge,
  .ss-orbit-ring,
  .ss-match-particles,
  .ss-match-threads {
    display: none !important;
    visibility: hidden !important;
  }

  /* ── SHOW the new Cosmic Match Reveal on mobile ── */
  .ss-mobile-match-reveal {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
  }

  /* Hero stats row */
  .ss-hero-stats {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  .ss-stat-item {
    min-width: unset !important;
    flex: 0 0 auto !important;
    padding: 8px 12px !important;
    font-size: 11px !important;
  }
}

/* ════════════════════════════════════════════════════════
   §3  SOULSYNC DEMO / COUPLE MATCH MOBILE FIX  (≤ 768px)
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Demo hero row — stack vertically */
  .ss-demo-hero-row {
    flex-direction: column !important;
    align-items: center !important;
    gap: 24px !important;
  }

  /* Demo avatars — scale */
  .ss-demo-avatar-block {
    transform: scale(0.85) !important;
  }

  /* Destiny Ring — shrink to fit */
  .ss-destiny-ring-wrap,
  .ss-demo-ring-wrap {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto !important;
  }
  .ss-destiny-ring-wrap svg,
  .ss-demo-ring-wrap svg,
  .ss-demo-ring-svg {
    width: 200px !important;
    height: 200px !important;
  }

  /* Compatibility bars — full width */
  .ss-demo-compat-grid,
  .ss-compat-grid {
    max-width: 100% !important;
    padding: 0 16px !important;
  }
  .ss-compat-bar {
    width: 100% !important;
  }

  /* Demo section padding */
  #ss-demo,
  .ss-demo-section {
    padding: 40px 16px !important;
    overflow-x: hidden !important;
  }

  /* Fix beam SVGs absolute positioning overflow */
  .ss-beam,
  .ss-demo-beam,
  .ss-beam-container {
    display: none !important;
  }
}

/* ════════════════════════════════════════════════════════
   §4  SOULSYNC BENTO / HOW-IT-WORKS MOBILE FIX
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  .ss-bento-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 16px !important;
  }
  .ss-bento-card {
    padding: 24px !important;
  }

  /* How-it-works steps */
  .ss-steps-row {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .ss-step-connector {
    display: none !important;
  }

  /* Plans */
  .ss-plan-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 16px !important;
  }
  .ss-plan-card {
    max-width: 100% !important;
  }
}

/* ════════════════════════════════════════════════════════
   §5  BLOG PAGE — NAVBAR ISOLATION FIX
   ════════════════════════════════════════════════════════ */
/* Blog uses AppNavbar component — hide any injected landing navbar */
.ak-blog-page .nav-wrap,
.ak-blog-page #ak-landing-nav,
.ak-blog-page .nav-inner-main {
  display: none !important;
}

/* Blog grid — responsive */
@media (max-width: 768px) {
  .ak-blog-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 0 16px !important;
  }
  .ak-wrap {
    padding: 100px 16px 60px !important;
  }
  .ak-wrap header h1 {
    font-size: 2rem !important;
  }
}

/* ════════════════════════════════════════════════════════
   §6  GLOBAL MOBILE OVERFLOW PROTECTION
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  /* Prevent any section from causing horizontal scroll */
  section,
  .wrap,
  .ss-wrap,
  .ak-wrap {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
}

/* ════════════════════════════════════════════════════════
   §7  TABLET ADJUSTMENTS (769px – 1024px)
   ════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {

  /* SoulSync hero — 2-column but with smaller cards */
  .ss-hero-grid {
    gap: 24px !important;
  }
  /* Note: .ss-match-scene desktop layout is fine on tablet — no transform override needed */

  /* Footer — 4-column on tablet */
  .foot-cols {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px 16px !important;
  }
}
