/* =============================================================================
   lib/styles/components/layout.css — Total Solutions Layout Styles
   BEM blocks:
     .container
     .two-col-layout
     .three-col-layout
     .responsive-grid
     .full-width-section
     .section-spacing

   Uses tokens.css and global.css
   ========================================================================== */


/* =============================================================================
   1. CONTAINER
   ========================================================================== */

.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--space-4);
  box-sizing: border-box;
}

.container--narrow {
  max-width: var(--container-xs);
}

.container--standard {
  max-width: var(--container-xl);
}

.container--wide {
  max-width: var(--container-2xl);
}

@media screen and (min-width: 40rem) {
  .container {
    padding-inline: var(--space-8);
  }
}

@media screen and (min-width: 64rem) {
  .container {
    padding-inline: var(--space-12);
  }
}


/* =============================================================================
   2. TWO-COLUMN LAYOUT
   ========================================================================== */

.two-col-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  width: 100%;
}

.two-col-layout__left,
.two-col-layout__right {
  min-width: 0;
}

.two-col-layout--staggered-entry > .two-col-layout__left,
.two-col-layout--staggered-entry > .two-col-layout__right {
  backface-visibility: hidden;
  transform: translateZ(0);
}

.two-col-layout--no-gap {
  gap: 0;
}

.two-col-layout--align-start {
  align-items: start;
}

.two-col-layout--align-center {
  align-items: center;
}

.two-col-layout--align-stretch {
  align-items: stretch;
}

@media screen and (min-width: 40rem) {
  .two-col-layout--tablet-two-col {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .two-col-layout--tablet-two-col.two-col-layout--sixty-forty {
    grid-template-columns: 3fr 2fr;
  }

  .two-col-layout--tablet-two-col.two-col-layout--forty-sixty {
    grid-template-columns: 2fr 3fr;
  }
}

@media screen and (min-width: 64rem) {
  .two-col-layout--equal {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }

  .two-col-layout--sixty-forty {
    grid-template-columns: 3fr 2fr;
    gap: var(--space-12);
  }

  .two-col-layout--forty-sixty {
    grid-template-columns: 2fr 3fr;
    gap: var(--space-12);
  }

  .two-col-layout--reverse .two-col-layout__left {
    order: 2;
  }

  .two-col-layout--reverse .two-col-layout__right {
    order: 1;
  }
}


/* =============================================================================
   3. THREE-COLUMN LAYOUT
   ========================================================================== */

.three-col-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  width: 100%;
}

.three-col-layout__cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.three-col-layout--staggered-entry > .three-col-layout__cell {
  backface-visibility: hidden;
  transform: translateZ(0);
}

.three-col-layout--no-gap {
  gap: 0;
}

.three-col-layout--align-start {
  align-items: start;
}

.three-col-layout--align-center {
  align-items: center;
}

.three-col-layout--align-stretch {
  align-items: stretch;
}

@media screen and (min-width: 40rem) {
  .three-col-layout--tablet-two-desktop-three {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

@media screen and (min-width: 64rem) {
  .three-col-layout--tablet-two-desktop-three,
  .three-col-layout--desktop-only {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
}

@media screen and (min-width: 30rem) {
  .three-col-layout--mobile-two {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

@media screen and (min-width: 64rem) {
  .three-col-layout--mobile-two {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
}


/* =============================================================================
   4. RESPONSIVE GRID
   ========================================================================== */

.responsive-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  width: 100%;
}

.responsive-grid__cell {
  min-width: 0;
}

.responsive-grid__cell--stretch,
.responsive-grid--align-stretch .responsive-grid__cell {
  display: flex;
  flex-direction: column;
}

.responsive-grid--stagger-children > .responsive-grid__cell {
  backface-visibility: hidden;
  transform: translateZ(0);
}

.responsive-grid--gap-none {
  gap: 0;
}

.responsive-grid--gap-small {
  gap: var(--space-4);
}

.responsive-grid--gap-medium {
  gap: var(--space-6);
}

.responsive-grid--gap-large {
  gap: var(--space-8);
}

/* Mobile */
.responsive-grid--cols-1-1-1,
.responsive-grid--cols-1-1-2,
.responsive-grid--cols-1-1-3,
.responsive-grid--cols-1-1-4,
.responsive-grid--cols-1-2-2,
.responsive-grid--cols-1-2-3,
.responsive-grid--cols-1-2-4,
.responsive-grid--cols-1-3-3,
.responsive-grid--cols-1-3-4 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.responsive-grid--cols-2-2-2,
.responsive-grid--cols-2-2-3,
.responsive-grid--cols-2-2-4,
.responsive-grid--cols-2-3-3,
.responsive-grid--cols-2-3-4,
.responsive-grid--cols-2-4-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.responsive-grid--cols-3-3-3,
.responsive-grid--cols-3-3-4,
.responsive-grid--cols-3-4-4 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Tablet */
@media screen and (min-width: 40rem) {
  .responsive-grid--cols-1-1-1,
  .responsive-grid--cols-1-1-2,
  .responsive-grid--cols-1-1-3,
  .responsive-grid--cols-1-1-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .responsive-grid--cols-1-2-2,
  .responsive-grid--cols-1-2-3,
  .responsive-grid--cols-1-2-4,
  .responsive-grid--cols-2-2-2,
  .responsive-grid--cols-2-2-3,
  .responsive-grid--cols-2-2-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .responsive-grid--cols-1-3-3,
  .responsive-grid--cols-1-3-4,
  .responsive-grid--cols-2-3-3,
  .responsive-grid--cols-2-3-4,
  .responsive-grid--cols-3-3-3,
  .responsive-grid--cols-3-3-4,
  .responsive-grid--cols-3-4-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Desktop */
@media screen and (min-width: 64rem) {
  .responsive-grid--cols-1-1-1,
  .responsive-grid--cols-1-2-1,
  .responsive-grid--cols-2-2-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .responsive-grid--cols-1-1-2,
  .responsive-grid--cols-1-2-2,
  .responsive-grid--cols-2-2-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .responsive-grid--cols-1-1-3,
  .responsive-grid--cols-1-2-3,
  .responsive-grid--cols-2-2-3,
  .responsive-grid--cols-1-3-3,
  .responsive-grid--cols-2-3-3,
  .responsive-grid--cols-3-3-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .responsive-grid--cols-1-1-4,
  .responsive-grid--cols-1-2-4,
  .responsive-grid--cols-2-2-4,
  .responsive-grid--cols-1-3-4,
  .responsive-grid--cols-2-3-4,
  .responsive-grid--cols-3-3-4,
  .responsive-grid--cols-2-4-4,
  .responsive-grid--cols-3-4-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* =============================================================================
   5. FULL-WIDTH SECTION
   ========================================================================== */

.full-width-section {
  width: 100%;
  position: relative;
  box-sizing: border-box;
  overflow: visible;
}

.full-width-section--overflow-clipped {
  overflow: hidden;
}

.full-width-section--reveal,
.full-width-section--reveal-fade-in,
.full-width-section--reveal-slide-up,
.full-width-section--background-parallax-subtle {
  will-change: transform, opacity;
}

.full-width-section--white {
  background-color: var(--color-surface-primary);
}

.full-width-section--light {
  background-color: var(--color-background-alt);
}

.full-width-section--dark {
  background-color: var(--color-brand-trust-navy);
  color: var(--color-text-inverse);
}

.full-width-section--accent {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.full-width-section--transparent {
  background-color: transparent;
}

.full-width-section--dark h1,
.full-width-section--dark h2,
.full-width-section--dark h3,
.full-width-section--dark h4,
.full-width-section--dark h5,
.full-width-section--dark h6,
.full-width-section--accent h1,
.full-width-section--accent h2,
.full-width-section--accent h3,
.full-width-section--accent h4,
.full-width-section--accent h5,
.full-width-section--accent h6 {
  color: var(--color-text-inverse);
}

.full-width-section--dark p,
.full-width-section--dark li,
.full-width-section--accent p,
.full-width-section--accent li {
  color: color-mix(in srgb, var(--color-text-inverse) 88%, transparent);
}

/* Padding modifiers */
.full-width-section--pad-none {
  padding-top: 0;
  padding-bottom: 0;
}

.full-width-section--pad-small {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.full-width-section--pad-medium {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.full-width-section--pad-large {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.full-width-section--pad-hero {
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
}

.full-width-section--pad-xl {
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

.full-width-section--background-parallax-subtle {
  transform: translateZ(0);
  backface-visibility: hidden;
}

@media screen and (max-width: 63.9375rem) {
  .full-width-section--pad-large {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }

  .full-width-section--pad-hero {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }

  .full-width-section--pad-xl {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

@media screen and (max-width: 39.9375rem) {
  .full-width-section--pad-small {
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
  }

  .full-width-section--pad-medium {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }

  .full-width-section--pad-large,
  .full-width-section--pad-hero {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }

  .full-width-section--pad-xl {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }

  .full-width-section--background-parallax-subtle {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .full-width-section--reveal,
  .full-width-section--reveal-fade-in,
  .full-width-section--reveal-slide-up,
  .full-width-section--background-parallax-subtle {
    transform: none;
    opacity: 1;
    will-change: auto;
  }
}


/* =============================================================================
   6. SECTION SPACING
   ========================================================================== */

.section-spacing {
  display: block;
  width: 100%;
  flex: 0 0 auto;
  pointer-events: none;
}

.section-spacing--xs {
  height: var(--space-1);
}

.section-spacing--sm {
  height: var(--space-2);
}

.section-spacing--md {
  height: var(--space-4);
}

.section-spacing--lg {
  height: var(--space-6);
}

.section-spacing--xl {
  height: var(--space-8);
}

.section-spacing--xxl {
  height: var(--space-12);
}

.section-spacing--xxxl {
  height: var(--space-16);
}

.section-spacing--hero {
  height: var(--space-20);
}

.section-spacing--max {
  height: var(--space-24);
}

.section-spacing--reveal,
.section-spacing--reveal-fade-in,
.section-spacing--reveal-slide-up {
  will-change: opacity, transform;
}

.section-spacing--reveal-fade-in {
  opacity: 1;
}

.section-spacing--reveal-slide-up {
  opacity: 1;
  transform: none;
}

@media screen and (max-width: 63.9375rem) {
  .section-spacing--responsive.section-spacing--xxxl {
    height: var(--space-12);
  }

  .section-spacing--responsive.section-spacing--hero {
    height: var(--space-16);
  }

  .section-spacing--responsive.section-spacing--max {
    height: var(--space-20);
  }
}

@media screen and (max-width: 39.9375rem) {
  .section-spacing--responsive.section-spacing--xl {
    height: var(--space-6);
  }

  .section-spacing--responsive.section-spacing--xxl {
    height: var(--space-8);
  }

  .section-spacing--responsive.section-spacing--xxxl {
    height: var(--space-12);
  }

  .section-spacing--responsive.section-spacing--hero {
    height: var(--space-16);
  }

  .section-spacing--responsive.section-spacing--max {
    height: var(--space-20);
  }
}


/* =============================================================================
   7. DETAIL PAGE LAYOUT
   ========================================================================== */

.detail-page-layout {
  width: 100%;
  padding-top: var(--space-10, 2.5rem);
  padding-bottom: var(--space-16, 4rem);
}

.detail-page-layout__header {
  border: 1px solid var(--color-border-subtle, var(--color-border));
  border-radius: var(--radius-xl, 1rem);
  padding: var(--space-8, 2rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.75rem);
}

.detail-page-layout__header--standard {
  background-color: var(--color-surface-primary);
}

.detail-page-layout__header--light {
  background-color: var(--color-background-alt);
}

.detail-page-layout__header--dark {
  background: linear-gradient(135deg, var(--color-brand-trust-navy, #0F294A) 0%, #0a1b33 100%);
  color: var(--color-text-inverse, #ffffff);
  border: none;
  border-radius: var(--radius-2xl, 1.5rem);
  padding: var(--space-10, 2.5rem);
  box-shadow: 0 10px 25px -5px rgba(15, 41, 74, 0.2);
  overflow: hidden;
}

.detail-page-layout__header--dark .detail-page-layout__eyebrow {
  color: #00E5FF;
}

.detail-page-layout__header--dark .detail-page-layout__title,
.detail-page-layout__header--dark .detail-page-layout__summary,
.detail-page-layout__header--dark .detail-page-layout__meta {
  color: var(--color-text-inverse, #ffffff);
}

.detail-page-layout__header--dark .detail-page-layout__summary {
  opacity: 0.85;
}

.detail-page-layout__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.detail-page-layout__title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.detail-page-layout__summary {
  margin: 0;
  margin-top: var(--space-2, 0.5rem);
  max-width: 65ch;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.detail-page-layout__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4, 1rem);
}

.detail-page-layout__body {
  display: grid;
  width: 100%;
}

.detail-page-layout__body--single-column {
  grid-template-columns: minmax(0, 1fr);
}

.detail-page-layout__body--with-sidebar {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8, 2rem);
}

.detail-page-layout__content {
  min-width: 0;
}

.detail-page-layout__sidebar {
  min-width: 0;
}

.detail-page-layout__sidebar--sticky {
  position: static;
}

.detail-page-layout--spacing-compact {
  display: grid;
  gap: var(--space-6, 1.5rem);
}

.detail-page-layout--spacing-standard {
  display: grid;
  gap: var(--space-8, 2rem);
}

.detail-page-layout--spacing-spacious {
  display: grid;
  gap: var(--space-10, 2.5rem);
}

@media screen and (min-width: 64rem) {
  .detail-page-layout__body--with-sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    gap: var(--space-12, 3rem);
    align-items: start;
  }

  .detail-page-layout__sidebar--sticky {
    position: sticky;
    top: calc(var(--space-12) + var(--space-8));
  }
}

@media screen and (max-width: 39.9375rem) {
  .detail-page-layout__header {
    padding: var(--space-6, 1.5rem);
  }
}