/* ============================================================================
   FLEXBOX UTILITIES - Responsive Layout Control
   ============================================================================

   Comprehensive flexbox utility classes with responsive modifiers.
   Uses CSS custom properties for flexibility and modern range media queries.

   Usage:
   1. Direct utility classes: <div className="flex gap-md justify-between">
   2. React Flex component: <Flex gap="md" justify="between">
      - Flex component automatically generates these utility classes from props
      - Supports responsive props: <Flex md={{ direction: "row" }}>
      - Sub-components: Flex.Item, Flex.Spacer

   Breakpoints:
   - sm: 30rem (480px)
   - md: 48rem (768px)
   - lg: 62rem (992px)
   - xl: 80rem (1280px)

   All spacing uses rem units (base: 1rem = 16px)
   ============================================================================ */
/* CSS Custom Properties
   ========================================================================== */
:root {
  /* Gap spacing - fluid typography with clamp() */
  --flex-gap-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem); /* 4-8px */
  --flex-gap-sm: clamp(0.5rem, 0.45rem + 0.35vw, 0.75rem); /* 8-12px */
  --flex-gap-md: clamp(0.75rem, 0.65rem + 0.45vw, 1.125rem); /* 12-18px */
  --flex-gap-lg: clamp(1rem, 0.85rem + 0.6vw, 1.5rem); /* 16-24px */
  --flex-gap-xl: clamp(1.5rem, 1.25rem + 0.75vw, 2rem); /* 24-32px */
  /* Default gap for flex containers */
  --flex-gap: var(--flex-gap-sm);
}

/* Base Flex Containers
   ========================================================================== */
/* Standard flex container */
.flex {
  display: flex;
  gap: var(--flex-gap);
}

/* Inline flex container */
.flex-inline {
  display: inline-flex;
  gap: var(--flex-gap);
}

/* Flex Direction
   ========================================================================== */
.flex-row {
  flex-direction: row;
}

.flex-row-reverse {
  flex-direction: row-reverse;
}

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

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

/* Flex Wrap
   ========================================================================== */
.flex-wrap {
  flex-wrap: wrap;
}

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

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

/* Justify Content (Main Axis)
   ========================================================================== */
.justify-start {
  justify-content: flex-start;
}

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

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

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

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

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

/* Align Items (Cross Axis)
   ========================================================================== */
.items-start {
  align-items: flex-start;
}

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

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

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

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

/* Align Content (Multi-line)
   ========================================================================== */
.content-start {
  align-content: flex-start;
}

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

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

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

.content-around {
  align-content: space-around;
}

.content-evenly {
  align-content: space-evenly;
}

.content-stretch {
  align-content: stretch;
}

/* Align Self (Individual Items)
   ========================================================================== */
.self-auto {
  align-self: auto;
}

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

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

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

.self-baseline {
  align-self: baseline;
}

.self-stretch {
  align-self: stretch;
}

/* Flex Item Sizing
   ========================================================================== */
/* Flex grow */
.flex-grow-0 {
  flex-grow: 0;
}

.flex-grow-1 {
  flex-grow: 1;
}

/* Flex shrink */
.flex-shrink-0 {
  flex-shrink: 0;
}

.flex-shrink-1 {
  flex-shrink: 1;
}

/* Flex basis */
.flex-basis-auto {
  flex-basis: auto;
}

.flex-basis-0 {
  flex-basis: 0;
}

.flex-basis-full {
  flex-basis: 100%;
}

/* Flex shorthand utilities */
.flex-1 {
  flex: 1 1 0%;
}

.flex-auto {
  flex: 1 1 auto;
}

.flex-initial {
  flex: 0 1 auto;
}

.flex-none {
  flex: none;
}

/* Gap Utilities
   ========================================================================== */
.gap-0 {
  gap: 0;
}

.gap-xs {
  gap: var(--flex-gap-xs);
}

.gap-sm {
  gap: var(--flex-gap-sm);
}

.gap-md {
  gap: var(--flex-gap-md);
}

.gap-lg {
  gap: var(--flex-gap-lg);
}

.gap-xl {
  gap: var(--flex-gap-xl);
}

/* Row gap */
.row-gap-0 {
  row-gap: 0;
}

.row-gap-xs {
  row-gap: var(--flex-gap-xs);
}

.row-gap-sm {
  row-gap: var(--flex-gap-sm);
}

.row-gap-md {
  row-gap: var(--flex-gap-md);
}

.row-gap-lg {
  row-gap: var(--flex-gap-lg);
}

.row-gap-xl {
  row-gap: var(--flex-gap-xl);
}

/* Column gap */
.col-gap-0 {
  column-gap: 0;
}

.col-gap-xs {
  column-gap: var(--flex-gap-xs);
}

.col-gap-sm {
  column-gap: var(--flex-gap-sm);
}

.col-gap-md {
  column-gap: var(--flex-gap-md);
}

.col-gap-lg {
  column-gap: var(--flex-gap-lg);
}

.col-gap-xl {
  column-gap: var(--flex-gap-xl);
}

/* Common Flex Patterns
   ========================================================================== */
/* Center content both axes */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Space between with center alignment */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Space around with center alignment */
.flex-around {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

/* Stack - column layout with gap */
.flex-stack {
  display: flex;
  flex-direction: column;
  gap: var(--flex-gap-sm);
}

/* Spread - equal width children */
.flex-spread > * {
  flex: 1 1 0%;
}

/* Order utilities
   ========================================================================== */
.order-first {
  order: -1;
}

.order-last {
  order: 999;
}

.order-none {
  order: 0;
}

/* Responsive Utilities - Small (sm: 30rem / 480px)
   ========================================================================== */
@media (width >= 30rem) {
  /* Direction */
  .sm\:flex-row {
    flex-direction: row;
  }
  .sm\:flex-row-reverse {
    flex-direction: row-reverse;
  }
  .sm\:flex-col {
    flex-direction: column;
  }
  .sm\:flex-col-reverse {
    flex-direction: column-reverse;
  }
  /* Wrap */
  .sm\:flex-wrap {
    flex-wrap: wrap;
  }
  .sm\:flex-nowrap {
    flex-wrap: nowrap;
  }
  /* Justify */
  .sm\:justify-start {
    justify-content: flex-start;
  }
  .sm\:justify-end {
    justify-content: flex-end;
  }
  .sm\:justify-center {
    justify-content: center;
  }
  .sm\:justify-between {
    justify-content: space-between;
  }
  .sm\:justify-around {
    justify-content: space-around;
  }
  .sm\:justify-evenly {
    justify-content: space-evenly;
  }
  /* Align Items */
  .sm\:items-start {
    align-items: flex-start;
  }
  .sm\:items-end {
    align-items: flex-end;
  }
  .sm\:items-center {
    align-items: center;
  }
  .sm\:items-baseline {
    align-items: baseline;
  }
  .sm\:items-stretch {
    align-items: stretch;
  }
  /* Gaps */
  .sm\:gap-0 {
    gap: 0;
  }
  .sm\:gap-xs {
    gap: var(--flex-gap-xs);
  }
  .sm\:gap-sm {
    gap: var(--flex-gap-sm);
  }
  .sm\:gap-md {
    gap: var(--flex-gap-md);
  }
  .sm\:gap-lg {
    gap: var(--flex-gap-lg);
  }
  .sm\:gap-xl {
    gap: var(--flex-gap-xl);
  }
  /* Flex sizing */
  .sm\:flex-1 {
    flex: 1 1 0%;
  }
  .sm\:flex-auto {
    flex: 1 1 auto;
  }
  .sm\:flex-none {
    flex: none;
  }
}
/* Responsive Utilities - Medium (md: 48rem / 768px)
   ========================================================================== */
@media (width >= 48rem) {
  /* Direction */
  .md\:flex-row {
    flex-direction: row;
  }
  .md\:flex-row-reverse {
    flex-direction: row-reverse;
  }
  .md\:flex-col {
    flex-direction: column;
  }
  .md\:flex-col-reverse {
    flex-direction: column-reverse;
  }
  /* Wrap */
  .md\:flex-wrap {
    flex-wrap: wrap;
  }
  .md\:flex-nowrap {
    flex-wrap: nowrap;
  }
  /* Justify */
  .md\:justify-start {
    justify-content: flex-start;
  }
  .md\:justify-end {
    justify-content: flex-end;
  }
  .md\:justify-center {
    justify-content: center;
  }
  .md\:justify-between {
    justify-content: space-between;
  }
  .md\:justify-around {
    justify-content: space-around;
  }
  .md\:justify-evenly {
    justify-content: space-evenly;
  }
  /* Align Items */
  .md\:items-start {
    align-items: flex-start;
  }
  .md\:items-end {
    align-items: flex-end;
  }
  .md\:items-center {
    align-items: center;
  }
  .md\:items-baseline {
    align-items: baseline;
  }
  .md\:items-stretch {
    align-items: stretch;
  }
  /* Gaps */
  .md\:gap-0 {
    gap: 0;
  }
  .md\:gap-xs {
    gap: var(--flex-gap-xs);
  }
  .md\:gap-sm {
    gap: var(--flex-gap-sm);
  }
  .md\:gap-md {
    gap: var(--flex-gap-md);
  }
  .md\:gap-lg {
    gap: var(--flex-gap-lg);
  }
  .md\:gap-xl {
    gap: var(--flex-gap-xl);
  }
  /* Flex sizing */
  .md\:flex-1 {
    flex: 1 1 0%;
  }
  .md\:flex-auto {
    flex: 1 1 auto;
  }
  .md\:flex-none {
    flex: none;
  }
  /* Common patterns at medium breakpoint */
  .flex-stack {
    flex-direction: row;
    align-items: center;
    gap: var(--flex-gap-md);
  }
}
/* Responsive Utilities - Large (lg: 62rem / 992px)
   ========================================================================== */
@media (width >= 62rem) {
  /* Direction */
  .lg\:flex-row {
    flex-direction: row;
  }
  .lg\:flex-row-reverse {
    flex-direction: row-reverse;
  }
  .lg\:flex-col {
    flex-direction: column;
  }
  .lg\:flex-col-reverse {
    flex-direction: column-reverse;
  }
  /* Wrap */
  .lg\:flex-wrap {
    flex-wrap: wrap;
  }
  .lg\:flex-nowrap {
    flex-wrap: nowrap;
  }
  /* Justify */
  .lg\:justify-start {
    justify-content: flex-start;
  }
  .lg\:justify-end {
    justify-content: flex-end;
  }
  .lg\:justify-center {
    justify-content: center;
  }
  .lg\:justify-between {
    justify-content: space-between;
  }
  .lg\:justify-around {
    justify-content: space-around;
  }
  .lg\:justify-evenly {
    justify-content: space-evenly;
  }
  /* Align Items */
  .lg\:items-start {
    align-items: flex-start;
  }
  .lg\:items-end {
    align-items: flex-end;
  }
  .lg\:items-center {
    align-items: center;
  }
  .lg\:items-baseline {
    align-items: baseline;
  }
  .lg\:items-stretch {
    align-items: stretch;
  }
  /* Gaps */
  .lg\:gap-0 {
    gap: 0;
  }
  .lg\:gap-xs {
    gap: var(--flex-gap-xs);
  }
  .lg\:gap-sm {
    gap: var(--flex-gap-sm);
  }
  .lg\:gap-md {
    gap: var(--flex-gap-md);
  }
  .lg\:gap-lg {
    gap: var(--flex-gap-lg);
  }
  .lg\:gap-xl {
    gap: var(--flex-gap-xl);
  }
  /* Flex sizing */
  .lg\:flex-1 {
    flex: 1 1 0%;
  }
  .lg\:flex-auto {
    flex: 1 1 auto;
  }
  .lg\:flex-none {
    flex: none;
  }
  /* Increase gaps at large screens */
  .flex,
  .flex-inline {
    gap: var(--flex-gap-md);
  }
  .flex-stack {
    gap: var(--flex-gap-lg);
  }
}
/* Responsive Utilities - Extra Large (xl: 80rem / 1280px)
   ========================================================================== */
@media (width >= 80rem) {
  /* Direction */
  .xl\:flex-row {
    flex-direction: row;
  }
  .xl\:flex-row-reverse {
    flex-direction: row-reverse;
  }
  .xl\:flex-col {
    flex-direction: column;
  }
  .xl\:flex-col-reverse {
    flex-direction: column-reverse;
  }
  /* Wrap */
  .xl\:flex-wrap {
    flex-wrap: wrap;
  }
  .xl\:flex-nowrap {
    flex-wrap: nowrap;
  }
  /* Justify */
  .xl\:justify-start {
    justify-content: flex-start;
  }
  .xl\:justify-end {
    justify-content: flex-end;
  }
  .xl\:justify-center {
    justify-content: center;
  }
  .xl\:justify-between {
    justify-content: space-between;
  }
  .xl\:justify-around {
    justify-content: space-around;
  }
  .xl\:justify-evenly {
    justify-content: space-evenly;
  }
  /* Align Items */
  .xl\:items-start {
    align-items: flex-start;
  }
  .xl\:items-end {
    align-items: flex-end;
  }
  .xl\:items-center {
    align-items: center;
  }
  .xl\:items-baseline {
    align-items: baseline;
  }
  .xl\:items-stretch {
    align-items: stretch;
  }
  /* Gaps */
  .xl\:gap-0 {
    gap: 0;
  }
  .xl\:gap-xs {
    gap: var(--flex-gap-xs);
  }
  .xl\:gap-sm {
    gap: var(--flex-gap-sm);
  }
  .xl\:gap-md {
    gap: var(--flex-gap-md);
  }
  .xl\:gap-lg {
    gap: var(--flex-gap-lg);
  }
  .xl\:gap-xl {
    gap: var(--flex-gap-xl);
  }
  /* Flex sizing */
  .xl\:flex-1 {
    flex: 1 1 0%;
  }
  .xl\:flex-auto {
    flex: 1 1 auto;
  }
  .xl\:flex-none {
    flex: none;
  }
  /* Maximum gaps at extra large screens */
  .flex,
  .flex-inline {
    gap: var(--flex-gap-lg);
  }
  .flex-stack {
    gap: var(--flex-gap-xl);
  }
}

/*# sourceMappingURL=flex.css.map */
