/* =========================================================
   ZANCK — GLOBAL LAYOUT SYSTEM
   File: assets/css/layout.css

   Purpose:
   Shared containers, sections, grids, spacing, alignment,
   page structure, and utility layout classes.

   Load order:
   variables.css
   reset.css
   typography.css
   layout.css
   navigation.css
   components.css
   animations.css
   responsive.css
   page-specific CSS
   ========================================================= */


/* =========================================================
   ROOT PAGE STRUCTURE
   ========================================================= */

html {
    overflow-x: clip;   /* moved from body — clipping on body breaks position:sticky descendants */
}

body {
    margin: 0;
    padding: 0;
}

main {
    width: 100%;
    overflow: clip;
}

section {
    position: relative;
    width: 100%;
}


/* =========================================================
   CONTAINER
   ========================================================= */

.container {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        var(--container-width)
    );

    margin-inline: auto;
}

.container--wide {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        var(--container-width-wide)
    );

    margin-inline: auto;
}

.container--narrow {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        var(--container-width-narrow)
    );

    margin-inline: auto;
}


/* =========================================================
   FULL WIDTH
   ========================================================= */

.full-width {
    width: 100%;
}

.full-bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}


/* =========================================================
   SECTION SPACING
   ========================================================= */

.section {
    padding-top: clamp(80px, 9vw, 150px);
    padding-bottom: clamp(80px, 9vw, 150px);
}

.section--small {
    padding-top: clamp(55px, 6vw, 90px);
    padding-bottom: clamp(55px, 6vw, 90px);
}

.section--large {
    padding-top: clamp(110px, 12vw, 190px);
    padding-bottom: clamp(110px, 12vw, 190px);
}

.section--none {
    padding-top: 0;
    padding-bottom: 0;
}

.section--top-none {
    padding-top: 0;
}

.section--bottom-none {
    padding-bottom: 0;
}


/* =========================================================
   SECTION BACKGROUNDS
   ========================================================= */

.section--dark,
.section-dark {
    color: var(--color-text-inverse);
    background-color: var(--color-background-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6,
.section--dark p,
.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6,
.section-dark p {
    color: inherit;
}

.section--light,
.section-light {
    background-color: var(--color-background-soft);
}


/* =========================================================
   SECTION HEADER
   ========================================================= */

.section-header {
    position: relative;
    max-width: 1000px;
}

.section-header .eyebrow {
    margin-bottom: 20px;
}

.section-header h2 {
    max-width: 950px;
}

.section-header > p {
    max-width: 680px;
    margin-top: 24px;
    color: var(--color-text-secondary);
    font-size: 18px;
    line-height: 1.7;
}

.section-header--center {
    margin-inline: auto;
    text-align: center;
}

.section-header--center h2,
.section-header--center p {
    margin-inline: auto;
}

.section-header--split {
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}

.section-header--split > div {
    max-width: 850px;
}


/* =========================================================
   CONTENT WIDTHS
   ========================================================= */

.content-xs {
    width: min(100%, 520px);
}

.content-sm {
    width: min(100%, 640px);
}

.content-md {
    width: min(100%, 760px);
}

.content-lg {
    width: min(100%, 960px);
}

.content-xl {
    width: min(100%, 1200px);
}


/* =========================================================
   STACK LAYOUT
   ========================================================= */

.stack {
    display: flex;
    flex-direction: column;
}

.stack--xs {
    gap: var(--space-2);
}

.stack--sm {
    gap: var(--space-4);
}

.stack--md {
    gap: var(--space-6);
}

.stack--lg {
    gap: var(--space-10);
}

.stack--xl {
    gap: var(--space-16);
}

.stack--2xl {
    gap: var(--space-24);
}


/* =========================================================
   FLEX UTILITIES
   ========================================================= */

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.flex-row {
    flex-direction: row;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.items-stretch {
    align-items: stretch;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

.justify-evenly {
    justify-content: space-evenly;
}


/* =========================================================
   GRID UTILITIES
   ========================================================= */

.grid {
    display: grid;
}

.grid-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-auto {
    grid-template-columns: repeat(
        auto-fit,
        minmax(260px, 1fr)
    );
}

.grid-auto-sm {
    grid-template-columns: repeat(
        auto-fit,
        minmax(200px, 1fr)
    );
}

.grid-auto-lg {
    grid-template-columns: repeat(
        auto-fit,
        minmax(320px, 1fr)
    );
}


/* =========================================================
   GAP
   ========================================================= */

.gap-0 {
    gap: var(--space-0);
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-5 {
    gap: var(--space-5);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.gap-10 {
    gap: var(--space-10);
}

.gap-12 {
    gap: var(--space-12);
}

.gap-16 {
    gap: var(--space-16);
}

.gap-20 {
    gap: var(--space-20);
}


/* =========================================================
   ALIGNMENT
   ========================================================= */

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mx-auto {
    margin-inline: auto;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}


/* =========================================================
   POSITION
   ========================================================= */

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

.inset-0 {
    inset: 0;
}


/* =========================================================
   OVERFLOW
   ========================================================= */

.overflow-hidden {
    overflow: hidden;
}

.overflow-visible {
    overflow: visible;
}

.overflow-auto {
    overflow: auto;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}


/* =========================================================
   VISIBILITY
   ========================================================= */

.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}

.display-none {
    display: none !important;
}


/* =========================================================
   ASPECT RATIOS
   ========================================================= */

.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-wide {
    aspect-ratio: 21 / 9;
}


/* =========================================================
   OBJECT FIT
   ========================================================= */

.object-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.object-contain {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* =========================================================
   DIVIDERS
   ========================================================= */

.divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-border);
}

.divider--dark {
    background-color: var(--color-border-dark);
}

.divider--primary {
    background-color: var(--color-primary);
}


/* =========================================================
   TWO-COLUMN CONTENT
   ========================================================= */

.layout-two-column {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(320px, 0.7fr);
    gap: clamp(50px, 8vw, 120px);
    align-items: start;
}

.layout-two-column--equal {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.layout-two-column--wide {
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(280px, 0.8fr);
}


/* =========================================================
   THREE-COLUMN CONTENT
   ========================================================= */

.layout-three-column {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: clamp(24px, 3vw, 50px);
}


/* =========================================================
   ASYMMETRIC CONTENT
   ========================================================= */

.layout-asymmetric {
    display: grid;
    grid-template-columns:
        minmax(0, 1.3fr)
        minmax(280px, 0.7fr);
    gap: clamp(40px, 7vw, 110px);
}


/* =========================================================
   CENTERED CONTENT
   ========================================================= */

.center-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-content--vertical {
    min-height: 100%;
    display: flex;
    align-items: center;
}


/* =========================================================
   PAGE HERO LAYOUT
   ========================================================= */

.page-hero {
    min-height: clamp(520px, 70vh, 760px);
    display: flex;
    align-items: flex-end;
}

.page-hero__inner {
    width: 100%;
    padding-top: calc(
        var(--header-height) +
        var(--space-16)
    );
    padding-bottom: clamp(70px, 9vw, 130px);
}

.page-hero__content {
    max-width: 1050px;
}

.page-hero__content .eyebrow {
    margin-bottom: 24px;
}

.page-hero__content h1 {
    max-width: 1050px;
}

.page-hero__content p {
    max-width: 700px;
    margin-top: 30px;
    color: var(--color-text-secondary);
    font-size: clamp(18px, 1.5vw, 22px);
    line-height: 1.7;
}


/* =========================================================
   PAGE CONTENT
   ========================================================= */

.page-content {
    width: 100%;
}

.page-content__inner {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        var(--container-width)
    );
    margin-inline: auto;
}


/* =========================================================
   ARTICLE LAYOUT
   ========================================================= */

.article-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(220px, 300px);
    gap: clamp(50px, 8vw, 120px);
    align-items: start;
}

.article-main {
    min-width: 0;
}

.article-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 30px);
}


/* =========================================================
   MEDIA FRAME
   ========================================================= */

.media-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.media-frame img,
.media-frame video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* =========================================================
   FULL VIEWPORT SECTIONS
   ========================================================= */

.min-height-screen {
    min-height: 100vh;
}

.min-height-small-screen {
    min-height: 75vh;
}

.min-height-large-screen {
    min-height: 120vh;
}


/* =========================================================
   RESPONSIVE — LARGE TABLET
   ========================================================= */

@media (max-width: 1200px) {

    :root {
        --container-padding: 28px;
    }

    .layout-two-column,
    .layout-asymmetric {
        gap: 50px;
    }
}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1024px) {

    :root {
        --container-padding: 26px;
    }

    .section {
        padding-top: clamp(70px, 9vw, 120px);
        padding-bottom: clamp(70px, 9vw, 120px);
    }

    .section--large {
        padding-top: clamp(90px, 11vw, 150px);
        padding-bottom: clamp(90px, 11vw, 150px);
    }

    .section-header--split {
        align-items: flex-start;
        flex-direction: column;
    }

    .layout-two-column,
    .layout-two-column--equal,
    .layout-two-column--wide,
    .layout-asymmetric {
        grid-template-columns: 1fr;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
    }

    .layout-three-column {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 768px) {

    :root {
        --container-padding: 20px;
    }

    .section {
        padding-top: 70px;
        padding-bottom: 70px;
    }

    .section--small {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .section--large {
        padding-top: 90px;
        padding-bottom: 90px;
    }

    .section-header--split {
        gap: 28px;
    }

    .layout-three-column,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .grid-auto,
    .grid-auto-sm,
    .grid-auto-lg {
        grid-template-columns: 1fr;
    }

    .page-hero {
        min-height: 500px;
    }

    .page-hero__inner {
        padding-top: calc(
            var(--header-height-mobile) +
            40px
        );

        padding-bottom: 70px;
    }

    .page-hero__content p {
        margin-top: 24px;
    }
}


/* =========================================================
   RESPONSIVE — SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    :root {
        --container-padding: 18px;
    }

    .section {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .section--small {
        padding-top: 45px;
        padding-bottom: 45px;
    }

    .section--large {
        padding-top: 75px;
        padding-bottom: 75px;
    }

    .page-hero {
        min-height: 440px;
    }

    .page-hero__inner {
        padding-top: calc(
            var(--header-height-mobile) +
            30px
        );

        padding-bottom: 55px;
    }
}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

    .section {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .container,
    .container--wide,
    .container--narrow,
    .page-content__inner {
        width: 100%;
        max-width: none;
    }
}
