/* ============================================================
   1. CORE RESET & SCROLL FIXES
   ============================================================ */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navH);
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevents horizontal scroll on mobile */
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   2. THE MASTER CONTAINERS (Mobile-Safe)
   ============================================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  /* FIX: Guaranteed mobile gutters so text never touches screen edges */
  padding-left: clamp(20px, 5vw, 40px);
  padding-right: clamp(20px, 5vw, 40px);
}

/* For full-width editorial sections */
.container-fluid {
  max-width: 100%;
  padding-left: clamp(20px, 5vw, 40px);
  padding-right: clamp(20px, 5vw, 40px);
}

/* ============================================================
   3. THE LAYOUT ENGINES (Unified)
   ============================================================ */

/* The Gateway Grid: Used for Home Squares, Learning Hub, & Pricing */
.mvo-grid-gateway {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  width: 100%;
}

/* The Discovery Split: Used for Directory & Community */
.mvo-layout-split {
  display: grid;
  grid-template-columns: 1fr 480px;
  min-height: calc(100vh - var(--navH));
  gap: 0;
}

/* The Feed Engine: For vertical lists (Community/Directory) */
.mvo-feed-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================================
   4. GLOBAL UTILITIES
   ============================================================ */

.section-padding {
  /* Fluid vertical breathing room */
  padding-top: clamp(60px, 10vw, 100px);
  padding-bottom: clamp(60px, 10vw, 100px);
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

/* Vertical Spacer Utility */
.mvo-spacer {
  height: clamp(24px, 5vw, 48px);
}

/* ============================================================
   5. RESPONSIVE ENGINE
   ============================================================ */

@media (max-width: 1024px) {
  .mvo-layout-split {
    grid-template-columns: 1fr 400px;
  }
}

@media (max-width: 900px) {
  .mvo-layout-split {
    grid-template-columns: 1fr; /* Stack Sidebar on Mobile */
  }
  
  /* Remove split-pane min-height on mobile to prevent empty voids */
  .mvo-layout-split {
    min-height: auto;
  }

  .mvo-grid-gateway {
    grid-template-columns: 1fr; /* Force single column on smaller phones */
    gap: 24px;
  }
}

/* Helper to hide elements on mobile (like maps or large graphics) */
@media (max-width: 768px) {
  .mvo-mobile-hide {
    display: none !important;
  }
}