/* --------------------

TABLE OF CONTENTS 

# GLOBALS
    # DEFINE GLOBAL VARIABLES (CUSTOM PROPERTIES)
    # SET GLOBAL COLORS
    # SET GLOBAL TYPOGRAPHY
    # GLOBAL MEDIA (images, video, svg)
    # GLOBAL HELPERS
    # GLOBAL RESETS
        # ENABLE SMOOTH SCROLLING

# LAYOUT
    # CONTAINER
    # GRID SYSTEM (12 column)

# SITE STRUCTURE
    # HEADER
    # MAIN
        # SECTIONS
    # FOOTER

# UI COMPONENTS
    # CARDS
    # HR (HORIZONTAL RULE)
    # CODE BLOCKS

    (WE WILL ADD MORE HERE)

# CUSTOM SITE STYLING (OPINIONATED)
    # BODY GRID LAYOUT SYSTEM (header, main, and footer)

----------------------- */

/* ------------------
        GLOBALS 
--------------------- */

/* DEFINE GLOBAL VARIABLES */
:root {

    /* DEFINE BASE COLORS */
    --color-white: #fff;
    --color-black: #000;
    --color-black-80: rgb(0 0 0 / .8);

    --color-grey-200: rgb(0 0 0 / .2);

    --color-blue-100: #dbeafe;
    --color-blue-400: #3b82f6;
    --color-blue-900: #1e40af;

    --color-green-100: #d1fae5;
    --color-green-400: #22c55e;
    --color-green-900: #166534;

    /* DEFINE SEMANTIC COLORS */
    --color-body-background: var(--color-white);
    --color-body-text: var(--color-black-80);
    --color-body-text-dark: var(--color-black);

    --color-primary: var(--color-blue-400);
    --color-primary-dark: var(--color-blue-900);
    --color-secondary: var(--color-green-400);

    --color-siteheader-background: var(--color-green-100);
    --color-sitefooter-background: var(--color-green-100);
    --color-hero-background: var(--color-blue-100);

    /* BORDERS */
    --color-border: var(--color-grey-200);
    --border-radius: 5px;
    --border-thickness: .5px;

    /* SIZING UNITS */
    --unit-2xs: 0.25em;
    --unit-xs: 0.5em;
    --unit-s: 1em;
    --unit-m: 1.5em;
    --unit-l: 2em;
    --unit-xl: 3em;
    --unit-2xl: 4em;
    --unit-3xl: 6em;
    --container-width: 1100px;

    /* GLOBAL FONTS */
    --font-body: system-ui, Helvetica, arial, sans-serif;
    --font-headings: Georgia, Times, "Times New Roman", serif;

}

/* SET GLOBAL COLORS */
body {
    background-color: var(--color-body-background);
    color: var(--color-body-text);
}

h1,
h2,
h3 {
    color: var(--color-body-text-dark);
}

/* LINKS */
a {
    color: var(--color-primary);

    /* STYLE THE UNDERLINE */
    text-decoration-color: var(--color-primary-dark);
    text-underline-offset: .135em;
    text-decoration-thickness: .05em;
}

a:hover {
    color: var(--color-primary-dark);
}

/* GLOBAL TYPOHRAPHY */
body {
    font-family: var(--font-body);
    font-size: 100%;
    line-height: 1.4;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-headings);
}

/* GLOBAL MEDIA */

/* IMAGES (Responsive)
   Responsive on small screens
   Do not stretch too large (beyond the orignal)
   on large screens */
img {
    max-width: 100%;
    height: auto;
}

/* GLOBAL HELPERS */

.text-centered {
    text-align: center;
}

/* GLOBAL RESETS */

/* Remove the default 8pm margin on body */
body {
    margin: 0;
}

/* Set all elements to box sizing border box */
* {
    box-sizing: border-box;
}

/* SMOOTH SCROLLING */
html {
    scroll-behavior: smooth;
}


/* ------------------
        LAYOUT 
--------------------- */

/* CONTAINER */

.container {
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: var(--unit-s);
}


/* GRID SYSTEM (12 column) */

.row {
    --grid-gap: var(--unit-s);
}

.row>* {
    margin-block-end: var(--grid-gap);
}

@media (min-width: 768px) {

    .row {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: var(--grid-gap);
    }

    /* COMMONLY USED SEMANTIC COLUMNS */
    .one-whole {
        grid-column: auto / span 12;
    }

    .one-half {
        grid-column: auto / span 6;
    }

    .one-third {
        grid-column: auto / span 4;
    }

    .two-thirds {
        grid-column: auto / span 8;
    }

    .one-fourth {
        grid-column: auto / span 3;
    }

    .three-fourths {
        grid-column: auto / span 9;
    }

    /* SWAP (REVERSE COLUMNS) - WORKS ONLY w/ 2 COLUMNS */
    .row.swapped>*:first-child {
        order: 2;
    }

    .row.swapped>*:last-child {
        order: 1;
    }

    /* CENTERED COLUMNS */
    .one-half.centered {
        grid-column-start: 4;
    }

    .two-thirds.centered {
        grid-column-start: 3;
    }

    /* 12 COLUMN CLASS-BASED GRID SYSTEM */
    .col-1 {
        grid-column: auto / span 1;
    }

    .col-2 {
        grid-column: auto / span 2;
    }

    .col-3 {
        grid-column: auto / span 3;
    }

    .col-4 {
        grid-column: auto / span 4;
    }

    .col-5 {
        grid-column: auto / span 5;
    }

    .col-6 {
        grid-column: auto / span 6;
    }

    .col-7 {
        grid-column: auto / span 7;
    }

    .col-8 {
        grid-column: auto / span 8;
    }

    .col-9 {
        grid-column: auto / span 9;
    }

    .col-10 {
        grid-column: auto / span 10;
    }

    .col-11 {
        grid-column: auto / span 11;
    }

    .col-12 {
        grid-column: auto / span 12;
    }

    /* PUSHES */
    .push-1 {
        grid-column-start: 2;
    }

    .push-2 {
        grid-column-start: 3;
    }

    .push-3 {
        grid-column-start: 4;
    }

    .push-4 {
        grid-column-start: 5;
    }

    .push-5 {
        grid-column-start: 6;
    }

    .push-6 {
        grid-column-start: 7;
    }

    .push-7 {
        grid-column-start: 8;
    }

    .push-8 {
        grid-column-start: 9;
    }

    .push-9 {
        grid-column-start: 10;
    }

    .push-10 {
        grid-column-start: 11;
    }

    .push-11 {
        grid-column-start: 12;
    }
}


/* FOR DEMO PURPOSES ONLY */
.row.demo>* {
    background-color: #eee;
    text-align: center;
    padding: var(--unit-s);
}

/* ------------------
    SITE STRUCTURE 
--------------------- */

/* SITE HEADER */
.site-header {
    background-color: var(--color-siteheader-background);
    padding: var(--unit-s);
}

/* SITE MAIN */
.site-main {
    background-color: transparent;
}

/* STYLING FOR ALL SECTIONS */
section {
    padding-block: var(--unit-xl);
}

.hero {
    background-color: var(--color-hero-background);
}

/* SITE FOOTER */
.site-footer {
    background-color: var(--color-sitefooter-background);
    padding: var(--unit-s);
}

/* ------------------
    UI COMPONENTS 
--------------------- */

/* CARDS */

.card {
    border: var(--border-thickness) solid var(--color-border);
    display: inline-block;
    padding: var(--unit-s);
    border-radius: var(--border-radius);
}

.color-swatch {
    --_swatch-color: grey;
    background-color: var(--_swatch-color);
    width: 150px;
    height: 150px;
}

/* HR */
hr {
    border: none;
    border-bottom: var(--border-thickness) solid var(--color-border);
    margin: var(--unit-xl) 0;
}

/* Code Blocks */
pre:has(code) {
    background-color: var(--color-black);
    color: var(--color-white);
    padding-inline: var(--unit-m);
    border-radius: var(--border-radius);
    white-space: pre-wrap;
}


/* ------------------
    CUSTOM SITE STYLING 
--------------------- */

/* PUSH THE FOOTER TO THE BOTTOM BY DEFAULT */
body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100svh;
}