/*
=================================================================
OSG Layout System
=================================================================

Breakpoints:
  --bp-sm  640px
  --bp-md  768px
  --bp-lg  1024px
  --bp-xl  1280px

Containers:
  .osg-wrap          Standard content  max 1280px
  .osg-wrap--wide    Wide content      max 1440px
  .osg-wrap--narrow  Narrow content    max 800px
  .osg-wrap--text    Reading width     max 680px

Grids:
  .osg-grid          Auto responsive grid (min 280px columns)
  .osg-grid--2       2-column (stacks below 640px)
  .osg-grid--3       3-column (stacks below 768px, 2-col below 1024px)
  .osg-grid--4       4-column (2-col below 1024px, stacks below 640px)
  .osg-grid--sidebar 2/3 + 1/3 sidebar layout

Sections:
  .osg-section       Vertical breathing room (clamp padding)
  .osg-section--sm   Compact section
  .osg-section--lg   Hero-scale section

Utilities:
  .osg-stack         Vertical flex stack
  .osg-cluster       Horizontal flex wrap (inline groups)
  .osg-split         Space-between flex row
=================================================================
*/

/* ---------------------------------------------------------------
   Global reset
   Must be first - applies to every page via layout.css load order.
   --------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent text overflow in grid and flex children */
img, video, svg { max-width: 100%; height: auto; }


/* ---------------------------------------------------------------
   Breakpoint custom media (reference only - use in media queries)
   --------------------------------------------------------------- */
:root {
    --bp-sm: 640px;
    --bp-md: 768px;
    --bp-lg: 1024px;
    --bp-xl: 1280px;
}


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

.osg-wrap {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 5vw, 5rem);
}

.osg-wrap--wide {
    max-width: 1440px;
}

.osg-wrap--narrow {
    max-width: 800px;
}

.osg-wrap--text {
    max-width: 680px;
}


/* ---------------------------------------------------------------
   Sections (vertical rhythm)
   --------------------------------------------------------------- */

.osg-section {
    padding-block: clamp(3rem, 8vw, 6rem);
}

.osg-section--sm {
    padding-block: clamp(1.5rem, 4vw, 3rem);
}

.osg-section--lg {
    padding-block: clamp(5rem, 12vw, 10rem);
}


/* ---------------------------------------------------------------
   Grids
   --------------------------------------------------------------- */

.osg-grid {
    display: grid;
    gap: clamp(1rem, 3vw, 2rem);
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

/* 2-col: stacks below 640px */
.osg-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
    .osg-grid--2 {
        grid-template-columns: 1fr;
    }
}

/* 3-col: 2-col below 1024px, 1-col below 640px */
.osg-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .osg-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .osg-grid--3 {
        grid-template-columns: 1fr;
    }
}

/* 4-col: 2-col below 1024px, 1-col below 640px */
.osg-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .osg-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .osg-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* Sidebar: 2/3 main + 1/3 aside, stacks below 768px */
.osg-grid--sidebar {
    grid-template-columns: 1fr 320px;
}

@media (max-width: 768px) {
    .osg-grid--sidebar {
        grid-template-columns: 1fr;
    }
}


/* ---------------------------------------------------------------
   Flex utilities
   --------------------------------------------------------------- */

/* Vertical stack with consistent gap */
.osg-stack {
    display: flex;
    flex-direction: column;
    gap: var(--stack-gap, 1rem);
}

/* Horizontal wrapping cluster (tags, buttons, inline groups) */
.osg-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cluster-gap, 0.75rem);
    align-items: center;
}

/* Space-between row that collapses below 640px */
.osg-split {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}


/* ---------------------------------------------------------------
   Card base
   --------------------------------------------------------------- */

.osg-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--grey-100);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.osg-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}


/* ---------------------------------------------------------------
   Typography helpers
   --------------------------------------------------------------- */

.osg-eyebrow {
    font-family: var(--font-m);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--navy-500);
}

.osg-lead {
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    line-height: 1.65;
    color: var(--grey-600);
}

.osg-label {
    font-family: var(--font-m);
    font-size: 0.8125rem;
    color: var(--grey-500);
}


/* ---------------------------------------------------------------
   Dividers
   --------------------------------------------------------------- */

.osg-divider {
    border: none;
    border-top: 1px solid var(--grey-100);
    margin-block: 0;
}


/* ---------------------------------------------------------------
   Visually hidden (accessible)
   --------------------------------------------------------------- */

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