/* Critical CSS - Above the fold styles only */
/* This file contains only the essential styles needed for initial render */

/* Reset critical elements */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: sans-serif;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* Geometric system fonts prioritizing SF Pro & Segoe UI (Campton-like) */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  /* Optimize rendering for geometric fonts */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Critical layout containers */
.body-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.body-container-wrapper {
  flex: 1;
}

/* Header critical styles */
header {
  position: relative;
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
}

.header__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Typography critical */
h1, h2, h3, h4, h5, h6 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em; /* Tighter tracking for geometric feel */
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

a {
  color: #007bff;
  text-decoration: none;
  background-color: transparent;
}

/* Hide elements until JS loads */
.no-js .requires-js {
  display: none;
}

/* Content container */
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Prevent layout shift */
img {
  max-width: 100%;
  height: auto;
}

/* Critical button styles */
button,
.button {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

/* Mobile navigation toggle - critical */
@media (max-width: 767px) {
  .header__navigation {
    display: none;
  }
  
  .header__navigation--toggle {
    display: block;
  }
}

/* Prevent FOUC */
.header--element {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Critical DnD Container Styles - Prevent Layout Shift */
/* These styles must be inline to prevent CLS when server is slow */
.row-fluid-wrapper {
  position: relative;
  min-height: 100px; /* Prevent collapse */
}

.row-fluid {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
}

.dnd-section {
  position: relative;
  padding: 2rem 0;
  contain: layout style; /* Isolate reflows */
  width: 100%;
}

.dnd-section > .row-fluid {
  max-width: var(--container-width, 1200px);
  margin: 0 auto;
  padding: 0 5px;
}

/* Full-width sections - no container constraint */
.dnd-section.dnd-section--full-width > .row-fluid {
  max-width: none;
  padding: 0;
}

/* Flush sections - zero padding on all sides (auto-applied to hero sections).
   The hero module owns its own spacing; the wrapping section must not add the
   default .dnd-section 2rem (32px) vertical rhythm or any side gutter. */
.dnd-section.dnd-section--flush {
  padding: 0;
}
.dnd-section.dnd-section--flush > .row-fluid {
  max-width: none;
  padding: 0;
}
.dnd-section.dnd-section--flush .dnd-column {
  padding: 0;
}

.dnd-column {
  position: relative;
  width: 100%;
  padding: 0 15px;
  min-height: 1px; /* Prevent collapse */
}

/* Skeleton loading dimensions for common content areas */
.dnd_area-row-0-background-layer,
.dnd_area-row-1-background-layer,
.dnd_area-row-2-background-layer {
  min-height: 300px; /* Reserve space for typical content */
  contain: layout; /* Isolate layout calculations */
}

/* Hero sections typically need more height */
.dnd_area-row-0-background-layer {
  min-height: 400px;
}

/* Stabilize row depths to prevent shifts */
.row-depth-1 {
  position: relative;
  z-index: 1;
}

.row-number-1,
.row-number-2,
.row-number-3 {
  display: block;
  width: 100%;
}

/* Span column widths for grid stability */
/* .span0 is the dnd-area root cell (w=0); without a width it shrinks to
   content under flex, collapsing single-module sections on desktop */
.span0 { width: 100%; }
.span1 { width: 8.33%; }
.span2 { width: 16.66%; }
.span3 { width: 25%; }
.span4 { width: 33.33%; }
.span5 { width: 41.66%; }
.span6 { width: 50%; }
.span7 { width: 58.33%; }
.span8 { width: 66.66%; }
.span9 { width: 75%; }
.span10 { width: 83.33%; }
.span11 { width: 91.66%; }
.span12 { width: 100%; }

@media (max-width: 767px) {
  /* Mobile: all columns full width */
  [class*="span"] {
    width: 100%;
  }
  
  .row-fluid {
    flex-direction: column;
  }
  
  .dnd_area-row-0-background-layer,
  .dnd_area-row-1-background-layer,
  .dnd_area-row-2-background-layer {
    min-height: 200px; /* Less height needed on mobile */
  }
}