// Header Styling
$header-font-weight:            $base-font-weight-semi-bold !default;
$header-font-weight-light:      $base-font-weight-default !default;
$header-vertical-margin:        0.5rem;
$header-text-color:             $color-black !default;
$body-text-color:               $color-black !default;

$h1-font-size: 2.25rem;
$h2-font-size: 2rem;
$h3-font-size: 1.75rem;
$h4-font-size: 1.5rem;
$h5-font-size: 1.25rem;
$h6-font-size: 1rem;

// Header, Font Size, Line-Height
$font-sizing-spacing-list: (h1, $h1-font-size, 1),
                           (h2, $h2-font-size, 1),
                           (h3, $h3-font-size, 1),
                           (h4, $h4-font-size, 1),
                           (h5, $h5-font-size, 1),
                           (h6, $h6-font-size, 1);

// Set default font-family + Styling
body {
	font-family: $base-font-family-default;
    color: $body-text-color;
}

// Set defaults
h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
    color: $header-text-color;
    font-weight: $header-font-weight;
    margin: 0 0 $header-vertical-margin;
    word-break: break-word;

    &.header {
        margin-bottom: 0;

        + .subheader {
            margin-top: 0.25rem;
            margin-bottom: 0.75rem;

            &:last-child {
                margin-bottom: 0;
            }
        }
    }

    &.thin {
        font-weight: $header-font-weight-light;
    }

    &.less-margin {
        margin-bottom: $header-vertical-margin/2 !important;
    }

    &.no-margin {
        margin-bottom: 0 !important;
    }

}

// Sizing
@each $header, $size, $spacing in $font-sizing-spacing-list {
    #{$header}, .#{$header} {
        font-size: $size;
        line-height: $spacing;
    }
}

// Generic Dividers 
.text-divider {
    display: flex;
    color: $color-black;
    margin: 0.5rem 0px;
    flex-basis: 100%;
    align-items: center;

    &:before, &:after {
        background: $color-dark;
        content: "";
        height: 1px;
        line-height: 0px;
        font-size: 0px;
        flex-grow: 1;
    }
    
    &:before {
        margin: 0 1rem 0 0;
    }

    &:after {
        margin: 0 0 0 1rem;
    }

    // Workaround to make headings work
    h1, .h1,
    h2, .h2,
    h3, .h3,
    h4, .h4,
    h5, .h5,
    h6, .h6 {
        margin-bottom: 0px;
    }

}

// Text Transforms
.capitalize {
    text-transform: capitalize;
}

.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

.bold {
    font-weight: $base-font-weight-bold;
}

.normal {
    font-weight: $base-font-weight-default;
}

.thin {
    font-weight: $base-font-weight-light;
}

.italic {
    font-style: italic;
}

$alignment-list:
(left),
(center),
(right),
(justify);

@each $alignment in $alignment-list {
    .text-#{$alignment} {
        text-align: $alignment;
    }
}
