@use "sass:math";

//*****************************************
// TABLE OF CONTENTS
//
// 1.  COLOR SYSTEM
// 2.  SPACING
// 3.  BODY
// 4.  BREAKPOINTS
// 5.  GRID & CONTAINER SETTINGS
// 6.  GENERAL SETTINGS
// 7.  HEADINGS AND TYPOGRAPHY
// 8.  TABLES
// 9.  SIZES
// 10. HR
// 11. BUTTONS
// 12. CARDS
// 13. BADGES
// 14. ALERTS
// 15. UTILITY FUNCTIONS
//*****************************************


//*****************************************
// 1. COLOR SYSTEM
//*****************************************

$white: #ffffff !default;
$gray-100: #f8f9fa !default;
$gray-200: #e9ecef !default;
$gray-300: #dee2e6 !default;
$gray-400: #ced4da !default;
$gray-500: #adb5bd !default;
$gray-600: #868e96 !default;
$gray-700: #495057 !default;
$gray-800: #343a40 !default;
$gray-900: #212529 !default;
$black: #000000 !default;

$grays: () !default;
$grays: map-merge(
		(
			100: $gray-100,
			200: $gray-200,
			300: $gray-300,
			400: $gray-400,
			500: $gray-500,
			600: $gray-600,
			700: $gray-700,
			800: $gray-800,
			900: $gray-900
		), $grays
);

$blue: #007bff !default;
$indigo: #6610f2 !default;
$purple: #6f42c1 !default;
$pink: #e83e8c !default;
$red: #dc3545 !default;
$orange: #fd7e14 !default;
$yellow: #ffc107 !default;
$green: #28a745 !default;
$teal: #20c997 !default;
$cyan: #17a2b8 !default;

$colors: () !default;
$colors: map-merge(
		(
			blue: $blue,
			indigo: $indigo,
			purple: $purple,
			pink: $pink,
			red: $red,
			orange: $orange,
			yellow: $yellow,
			green: $green,
			teal: $teal,
			cyan: $cyan,
			white: $white,
			gray: $gray-600,
			gray-dark: $gray-800
		), $colors
);

$primary: $blue !default;
$secondary: $gray-600 !default;
$success: $green !default;
$info: $cyan !default;
$warning: $yellow !default;
$danger: $red !default;
$light: $gray-100 !default;
$dark: $gray-800 !default;

$theme-colors: () !default;
$theme-colors: map-merge(
		(
			primary: $primary,
			secondary: $secondary,
			success: $success,
			danger: $danger,
			warning: $warning,
			info: $info,
			light: $light,
			dark: $dark
		), $theme-colors
);

$theme-color-interval: 8% !default;
$yiq-contrasted-threshold: 150 !default;
$yiq-text-dark: $gray-900 !default;
$yiq-text-light: $white !default;

//*****************************************
// 2. SPACING
//*****************************************

$spacer: 16px !default;
$spacers: () !default;
$spacers: map-merge(
		(
			0: 0,
			1: math.round($spacer * .25),
			2: math.round($spacer * .5),
			3: $spacer,
			4: math.round($spacer * 1.5),
			5: math.round($spacer * 3)
		), $spacers
);

//*****************************************
// 3. BODY
//*****************************************

$body-bg: $white !default;
$body-color: $gray-900 !default;

//*****************************************
// 4. BREAKPOINTS
//*****************************************

$breakpoint: 600px !default;

//*****************************************
// 5. GRID & CONTAINER SETTINGS
//*****************************************

$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;

$container-max-width: 600px !default;
$container-padding-x: math.round(math.div($grid-gutter-width, 2)) !default;

//*****************************************
// 6. GENERAL SETTINGS
//*****************************************

$font-family-sans-serif: Helvetica, Arial, sans-serif !default;
$font-family-monospace: "Courier New", Courier, monospace !default;
$font-family-base: $font-family-sans-serif !default;

$font-size-base: 16px !default;
$font-size-lg: math.round($font-size-base * 1.25) !default;
$font-size-sm: math.round($font-size-base * 0.875) !default;

$font-weight-lighter: lighter !default;
$font-weight-light: 300 !default;
$font-weight-normal: 400 !default;
$font-weight-bold: 700 !default;
$font-weight-bolder: bolder !default;
$font-weight-base: $font-weight-normal !default;

$line-height-base: 1.5 !default;
$line-height-sm: $line-height-base !default;
$line-height-lg: $line-height-base !default;

$border-width: 1px !default;
$border-color: $gray-500 !default;

$border-radius: math.round($font-size-base * 0.25) !default;
$border-radius-lg: math.round($font-size-base * 0.3) !default;
$border-radius-sm: math.round($font-size-base * 0.2) !default;

$component-active-color: $white !default;
$component-active-bg: $primary !default;

//*****************************************
// 7. HEADINGS AND TYPOGRAPHY
//*****************************************
$headings-sizes: () !default;
$headings-sizes: map-merge(
		(
			1: math.round(2.25 * $font-size-base),
			2: math.round(2 * $font-size-base),
			3: math.round(1.75 * $font-size-base),
			4: math.round(1.5 * $font-size-base),
			5: math.round(1.25 * $font-size-base),
			6: $font-size-base
		), $headings-sizes
);
$headings-line-height: 1.3 !default;
$headings-font-family: null !default;
$headings-font-weight: $font-weight-base !default;

$display-sizes: () !default;
$display-sizes: map-merge(
		(
			1: math.round(6 * $font-size-base),
			2: math.round(5.5 * $font-size-base),
			3: math.round(4.5 * $font-size-base),
			4: math.round(3.5 * $font-size-base)
		), $display-sizes
);
$display-weight: $font-weight-light !default;
$display-line-height: $headings-line-height !default;

$lead-font-size: math.round($font-size-base * 1.25) !default;
$lead-font-weight: math.round($font-weight-light) !default;

$small-font-size: math.round($font-size-base * 0.8) !default;
$small-font-weight: $font-weight-base !default;

$link-color: $primary !default;
$link-decoration: none !default;
$link-hover-color: darken($link-color, 15%) !default;
$link-hover-decoration: underline !default;

$hr-border-color: $border-color !default;
$hr-border-width: $border-width !default;

//*****************************************
// 8. TABLES
//*****************************************

$table-border-color: $border-color !default;
$table-border-width: $border-width !default;

//*****************************************
// 9. SIZES
//*****************************************

$sizes: () !default;
$sizes: map-merge(
		(
			25: 25%,
			50: 50%,
			75: 75%,
			100: 100%,
			auto: auto
		), $sizes
);

//*****************************************
// 10. HR
//*****************************************

$hr-padding-y: $font-size-base !default;
$hr-padding-x: 0 !default;
$hr-border-color: $border-color !default;
$hr-border-width: $border-width !default;
$hr-border-style: solid !default;

//*****************************************
// 11. BUTTONS
//*****************************************

$btn-padding-y: math.round($font-size-base * 0.375) !default;
$btn-padding-x: math.round($font-size-base * 0.75) !default;
$btn-font-size: $font-size-base !default;
$btn-line-height: $line-height-base !default;
$btn-white-space: null !default; // Set to `nowrap` to prevent text wrapping

$btn-padding-y-sm: math.round($font-size-base * 0.25) !default;
$btn-padding-x-sm: math.round($font-size-base * 0.5) !default;
$btn-font-size-sm: $font-size-sm !default;

$btn-padding-y-lg: math.round($font-size-base * 0.5) !default;
$btn-padding-x-lg: math.round($font-size-base * 1) !default;
$btn-font-size-lg: $font-size-lg !default;

$btn-border-width: $border-width !default;

$btn-font-weight: $font-weight-normal !default;
$btn-box-shadow: inset 0 1px 0 rgba($white, .15), 0 1px 1px rgba($black, .075) !default;
$btn-disabled-opacity: .65 !default;

$btn-border-radius: $border-radius !default;
$btn-border-radius-lg: $border-radius-lg !default;
$btn-border-radius-sm: $border-radius-sm !default;

$btn-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default;


//*****************************************
// 12. CARDS
//*****************************************

$card-spacer-y: math.round($font-size-base * 0.75) !default;
$card-spacer-x: math.round($font-size-base * 1.25) !default;
$card-border-width: $border-width !default;
$card-border-radius: $border-radius !default;
$card-border-color: $border-color !default;
$card-bg: $white;

//*****************************************
// 13. BADGES
//*****************************************

$badge-font-size: 75% !default;
$badge-font-weight: $font-weight-bold !default;
$badge-color: $white !default;
$badge-padding-y: math.round($font-size-base * 0.25) !default;
$badge-border-radius: $border-radius !default;
$badge-transition: $btn-transition !default;

//*****************************************
// 14. ALERTS
//*****************************************

$alert-padding-y: math.round($font-size-base * 0.75) !default;
$alert-padding-x: math.round($font-size-base * 1.25) !default;
$alert-border-radius: $border-radius !default;
$alert-link-font-weight: $font-weight-bold !default;
$alert-border-width: $border-width !default;

$alert-bg-level: -10 !default;
$alert-border-level: -9 !default;
$alert-color-level: 6 !default;

//*****************************************
// 15. UTILITY FUNCTIONS
//*****************************************

@function heading-size($n) {
	@return map-get($headings-sizes, $n);
}

@function heading-line-height($n) {
	@return math.round(heading-size($n) * $headings-line-height);
}
