/* ============================================
   FOLIOBLOX — Layout System
   ============================================ */

/* ── Page Container ── */
.page-wrapper {
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* ── Constrained Container ── */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: var(--page-margin);
  padding-right: var(--page-margin);
}

.container--narrow {
  max-width: 1000px;
}

.container--wide {
  max-width: 1600px;
}

/* ── Section ── */
.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
  position: relative;
}

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

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

/* ── Section Divider ── */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-on-surface-faint) 20%, var(--color-on-surface-faint) 80%, transparent);
  border: none;
  margin: 0;
}

/* ── 12-Column Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--bento-gutter);
}

.grid--lg-gap {
  gap: var(--container-gap);
}

/* Grid span utilities */
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* ── Bento Box Grid ── */
.bento-grid {
  display: grid;
  gap: var(--bento-gutter);
}

.bento-grid--2x2 {
  grid-template-columns: repeat(2, 1fr);
}

.bento-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

.bento-grid--projects {
  grid-template-columns: 3fr 2fr;
  grid-auto-rows: auto;
}

.bento-grid--competencies {
  display: grid;
  gap: var(--bento-gutter);
  grid-template-columns: 1fr 1fr 1fr;
}

.bento-card--core {
  grid-row: span 2;
}

.bento-card--tools {
  grid-column: 2 / -1;
}

/* ── Flex Utilities ── */
.flex {
  display: flex;
}

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

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

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

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

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-xs { gap: var(--space-xs); }
.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); }
.gap-3xl { gap: var(--space-3xl); }

/* ── Spacing Utilities ── */
.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); }
.mt-4xl { margin-top: var(--space-4xl); }

.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); }

/* ── Text Utilities ── */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ── Responsive Breakpoints ── */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .col-lg-4 { grid-column: span 4; }
  .col-lg-8 { grid-column: span 8; }
  
  .bento-grid--3col {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bento-grid--competencies {
    grid-template-columns: 1fr 1fr;
  }
  
  .bento-grid--projects {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --page-margin: 1.25rem;
    --bento-gutter: 0.75rem;
    --section-padding: clamp(3rem, 6vw, 5rem);
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
  .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    grid-column: span 1;
  }
  
  .bento-grid--2x2,
  .bento-grid--3col,
  .bento-grid--projects,
  .bento-grid--competencies {
    grid-template-columns: 1fr;
  }
  
  .bento-card--core,
  .bento-card--tools {
    grid-row: auto;
    grid-column: span 1;
  }
  
  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 480px) {
  :root {
    --page-margin: 1rem;
  }
}

/* ── Visibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.show-mobile {
  display: none !important;
}

@media (max-width: 768px) {
  .show-mobile {
    display: flex !important;
  }
}
