/* ==========================================================================
   layout.css — Structural / layout styles only
   No colors, fonts, or component-specific decoration.
   All token references use the new design-token variables (--bg, --bg-muted,
   --border, --space-*, --text-*, etc.) introduced in the Scope B overhaul.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Site Structure
   -------------------------------------------------------------------------- */

.site-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  padding: var(--space-lg) 0;
}

/* --------------------------------------------------------------------------
   2. Section Spacing
   -------------------------------------------------------------------------- */

section,
.services-overview,
.latest-insights,
.security-stats,
.contact-section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

/* --------------------------------------------------------------------------
   3. Header Layout
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(30, 26, 28, 0.85); /* dark-mode default */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
}

.light-mode .site-header {
  background-color: rgba(255, 255, 255, 0.85);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --------------------------------------------------------------------------
   4. Hero Layout
   -------------------------------------------------------------------------- */

.hero {
  padding: var(--space-xl) 0;
  background-color: var(--bg-muted);
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   5. Page Header
   -------------------------------------------------------------------------- */

.page-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.page-description {
  font-size: var(--text-xl);
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   6. Grid Systems
   All grids use auto-fit with minmax(min(100%, Xpx), 1fr) for robustness.
   -------------------------------------------------------------------------- */

/* Services + methodology grids — 320 px minimum column */
.services-grid,
.service-cards-grid,
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}

/* Stats grid — 220 px minimum column */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--space-md);
}

/* Blog grid — 320 px minimum column */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-xl);
}

/* About grid — 300 px minimum column */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 2rem;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

/* Values grid — 250 px minimum column */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 2.5rem;
  margin-top: 3.5rem;
}

/* Team grid — 280 px minimum column */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

/* Related posts grid — 280 px minimum column */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-md);
}

/* Services list / band — stacked column layout */
.services-list,
.services-band {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* --------------------------------------------------------------------------
   7. Footer Layout
   -------------------------------------------------------------------------- */

.site-footer {
  background-color: var(--bg-muted);
  padding: var(--space-xl) 0 var(--space-md);
  border-top: 1px solid var(--border);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   8. Contact Layout
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-xl);
  align-items: start;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-group.full-width,
.form-actions {
  grid-column: span 2;
}

/* --------------------------------------------------------------------------
   9. Legal Layout
   -------------------------------------------------------------------------- */

.legal-content-section {
  padding: 4rem 0;
}

.legal-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  width: 100%;
}

.legal-section {
  margin-bottom: 4rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   10. Responsive — Tablet (max-width: 1024px)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  /* Footer collapses to single column */
  .footer-content {
    grid-template-columns: 1fr;
  }

  /* Footer nav reduces to 2 columns */
  .footer-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer logo centered */
  .footer-logo-container {
    justify-content: center;
  }

  /* Hero stacks vertically and centers */
  .hero .container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    margin-bottom: var(--space-lg);
  }

  .hero-actions {
    justify-content: center;
  }

  /* Hero image hidden at tablet */
  .hero-image {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   11. Responsive — Mobile (max-width: 640px)
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  /* Header padding reduced */
  .site-header {
    padding: var(--space-xs) 0;
  }

  /* Contact grid: single column */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* Contact form: single column, reset span overrides */
  .contact-form {
    grid-template-columns: 1fr;
  }

  .form-group.full-width,
  .form-actions {
    grid-column: span 1;
  }

  /* Footer: everything single column */
  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }

  /* Footer bottom: stacked and centered */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* reCAPTCHA scaled down for narrow viewports */
  .g-recaptcha {
    transform: scale(0.77);
    transform-origin: center;
    width: 100%;
  }
}
