/* ============================================================
   layout.css — Grid, Container & Section Utilities
   Pinion & Adams Fabricators
   ============================================================ */

/* ----------------------------------------
   Containers
   ---------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-lg);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
}

.container--wide {
  max-width: var(--container-xl);
}

.container--narrow {
  max-width: var(--container-sm);
}

.container--md {
  max-width: var(--container-md);
}

/* ----------------------------------------
   Sections
   ---------------------------------------- */

.section {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
  position: relative;
}

.section--dark {
  background: var(--color-surface);
}

.section--darker {
  background: var(--color-primary);
}

.section--red {
  background: var(--color-secondary);
}

.section--slim {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.section--flush-bottom {
  padding-bottom: 0;
}

.section--flush-top {
  padding-top: 0;
}

/* ----------------------------------------
   Grid Utilities
   ---------------------------------------- */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.grid-2--top {
  align-items: start;
}

.grid-2--stretch {
  align-items: stretch;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ----------------------------------------
   Flex Utilities
   ---------------------------------------- */

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

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

.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* ----------------------------------------
   Diagonal Section Clip-Paths
   ---------------------------------------- */

.clip-bottom {
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
  padding-bottom: calc(var(--section-pad) + 4rem);
}

.clip-top {
  clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 100%);
  padding-top: calc(var(--section-pad) + 4rem);
  margin-top: -4rem;
}

.clip-both {
  clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
  padding-top: calc(var(--section-pad) + 4rem);
  padding-bottom: calc(var(--section-pad) + 4rem);
  margin-top: -3rem;
}

/* ----------------------------------------
   Steel Texture Overlay
   ---------------------------------------- */

.steel-overlay {
  position: relative;
}

.steel-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 8px
    );
  pointer-events: none;
  z-index: 0;
}

.steel-overlay > * {
  position: relative;
  z-index: 1;
}

/* ----------------------------------------
   Spacing Utilities
   ---------------------------------------- */

.mt-0  { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-0  { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

.pt-0  { padding-top: 0; }
.pt-sm { padding-top: var(--space-sm); }
.pt-md { padding-top: var(--space-md); }
.pt-lg { padding-top: var(--space-lg); }
.pt-xl { padding-top: var(--space-xl); }

.pb-0  { padding-bottom: 0; }
.pb-sm { padding-bottom: var(--space-sm); }
.pb-md { padding-bottom: var(--space-md); }
.pb-lg { padding-bottom: var(--space-lg); }
.pb-xl { padding-bottom: var(--space-xl); }

/* ----------------------------------------
   Display Utilities
   ---------------------------------------- */

.d-none    { display: none; }
.d-block   { display: block; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-inline  { display: inline; }
.d-inline-flex { display: inline-flex; }

/* ----------------------------------------
   Position Utilities
   ---------------------------------------- */

.pos-relative { position: relative; }
.pos-absolute { position: absolute; }
.pos-fixed    { position: fixed; }
.pos-sticky   { position: sticky; top: 0; }

/* ----------------------------------------
   Width / Height Utilities
   ---------------------------------------- */

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.w-auto  { width: auto; }
.h-auto  { height: auto; }

/* ----------------------------------------
   Overflow
   ---------------------------------------- */

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
