/*
 * ╔══════════════════════════════════════════════════════════════╗
 * ║                  NUDGE — LAYOUT SYSTEM                      ║
 * ║                                                              ║
 * ║  Grid system, section spacing, section header pattern,      ║
 * ║  and responsive utilities used across all pages.            ║
 * ╚══════════════════════════════════════════════════════════════╝
 */

/* ─────────────────────────────────────────────
   RESET
   ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}


/* ─────────────────────────────────────────────
   3-COLUMN GRID SYSTEM
   ─────────────────────────────────────────────
   .gc        → standard content width (1376px)
   .gc-ext    → extended content width  (1440px, nav)
   .gc-inner  → direct child of .gc or .gc-ext
   ───────────────────────────────────────────── */
.gc {
  display: grid;
  grid-template-columns: 1fr minmax(0, var(--content-max-width)) 1fr;
  width: 100%;
}

.gc-ext {
  display: grid;
  grid-template-columns: 1fr minmax(0, var(--content-max-width-ext, calc(var(--content-max-width) + 4rem))) 1fr;
  width: 100%;
}

.gc-inner {
  grid-column: 2;
  padding-inline: var(--gutter);          /* 64px desktop */
}

.gc-ext-inner {
  grid-column: 2;
  padding-inline: calc(var(--gutter) / 2); /* 32px desktop */
}

/* ─────────────────────────────────────────────
   RESPONSIVE GUTTERS
   64px → 32px → 16px
   ───────────────────────────────────────────── */
@media (max-width: 1279px) {
  .gc-inner { padding-inline: 2rem; }
}

@media (max-width: 767px) {
  .gc-inner,
  .gc-ext-inner { padding-inline: 1rem; }
}


/* ─────────────────────────────────────────────
   SECTION HEADER PATTERN
   ─────────────────────────────────────────────
   The standard centered intro used at the top of
   almost every content section:

   <div class="section-header">
     <p class="section-overline">Optional label</p>
     <h2 class="section-heading">Section title</h2>
     <p class="section-description">Supporting copy.</p>
   </div>

   Use .section-header-sm for a narrower max-width.
   ───────────────────────────────────────────── */
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-14);          /* 56px bottom */
}

.section-header-sm {
  text-align: center;
  max-width: 520px;
  margin: 0 auto var(--space-14);
}

.section-header-lg {
  text-align: center;
  max-width: 760px;
  margin: 0 auto var(--space-14);
}

.section-header .section-heading {
  margin-bottom: 16px;
}

.section-header-sm .section-heading {
  margin-bottom: 12px;
}


/* ─────────────────────────────────────────────
   PAGE RAILS
   ───────────────────────────────────────────── */
.rails-wrap {
  position: relative;
}


/* ─────────────────────────────────────────────
   GRID UTILITIES
   ─────────────────────────────────────────────
   Common multi-column grids used across sections.
   ───────────────────────────────────────────── */

/* 3 equal columns — Why switch cards, pricing */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-lg);                      /* 20px */
}

/* 2 equal columns — image + text */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-xl);                      /* 24px */
}

/* 2 columns with sidebar (narrow left, wide right) */
.grid-sidebar {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--gap-2xl);                     /* 32px */
}

/* Auto-fill cards (e.g., feature grid) */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-lg);
}

/* Responsive collapse — stack on mobile */
@media (max-width: 767px) {
  .grid-3,
  .grid-2,
  .grid-sidebar {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
  }
}


/* ─────────────────────────────────────────────
   SECTION SPACING UTILITIES
   ─────────────────────────────────────────────
   Apply to <section> elements for consistent padding.
   ───────────────────────────────────────────── */
.section-pad {
  padding: var(--section-padding) 0;       /* 100px 0 — standard */
}

.section-pad-md {
  padding: var(--section-padding-md) 0;    /* 80px 0 */
}

.section-pad-sm {
  padding: var(--section-padding-sm) 0;    /* 64px 0 */
}

/* Mobile section padding override */
@media (max-width: 767px) {
  .section-pad,
  .section-pad-md { padding: 72px 0; }
  .section-pad-sm { padding: 56px 0; }
}


/* ─────────────────────────────────────────────
   CENTERED CTA ROW
   ─────────────────────────────────────────────
   Container for a centered button below section content.
   Usage: <div class="section-cta">...</div>
   ───────────────────────────────────────────── */
.section-cta {
  text-align: center;
  margin-top: var(--space-12);             /* 48px */
}


/* ─────────────────────────────────────────────
   MARQUEE CONTAINER
   ─────────────────────────────────────────────
   Wrapper that adds left/right gradient fade masks.
   Usage: <div class="marquee-container">...</div>
   ───────────────────────────────────────────── */
.marquee-container {
  position: relative;
  overflow: hidden;
}

.marquee-container::before,
.marquee-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 140px;
  z-index: 4;
  pointer-events: none;
}
.marquee-container::before {
  left: 0;
  background: linear-gradient(to right, var(--app-background) 20%, transparent 100%);
}
.marquee-container::after {
  right: 0;
  background: linear-gradient(to left, var(--app-background) 20%, transparent 100%);
}


/* ─────────────────────────────────────────────
   RESPONSIVE LAYOUT HELPERS
   ───────────────────────────────────────────── */
.mob-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap-2xl);
}

@media (max-width: 767px) {
  .mob-stack { grid-template-columns: 1fr; gap: var(--gap-xl); }
  .mob-hide  { display: none !important; }
  .mob-stack-2 { grid-template-columns: 1fr 1fr; }
}
