@use "sass:string";

$_letter-spacing-min: -0.011715625rem;
$_letter-spacing: -0.0390625rem;

@mixin u-font-smoothing() {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

// Headings

@mixin _heading-base() {
	font-weight: $t-a-typography-font-weight-bold;
	@include u-font-smoothing();
}

%u-h1 {
	@include _heading-base();
	font-family: $t-a-typography-font-family-default;
	font-size: $t-a-typography-heading-level-1-default-font-size;
	font-size: $t-a-typography-heading-level-1-fluid-font-size;
	letter-spacing: $_letter-spacing;
	letter-spacing: string.unquote('min(max(#{$_letter-spacing-min}, 4vw), #{$_letter-spacing})');
	line-height: $t-a-typography-line-height-xl;
	line-height: string.unquote('min(max(#{$t-a-typography-line-height-xl}, 4vw), #{$t-a-typography-line-height-xl})');
}

%u-h2 {
	@include _heading-base();
	font-family: $t-a-typography-font-family-default;
	font-size: $t-a-typography-heading-level-2-default-font-size;
	font-size: $t-a-typography-heading-level-2-fluid-font-size;
	letter-spacing: $_letter-spacing-min;
	line-height: $t-a-typography-line-height-lg;
	line-height: string.unquote('min(max(#{$t-a-typography-line-height-lg}, 3.5vw), #{$t-a-typography-line-height-lg})');
}

%u-h3 {
	@include _heading-base();
	font-family: $t-a-typography-font-family-default;
	font-size: $t-a-typography-heading-level-3-default-font-size;
	letter-spacing: $_letter-spacing-min;
	line-height: $t-a-typography-line-height-tight;
}

%u-h4 {
	@include _heading-base();
	font-family: $t-a-typography-font-family-default;
	font-size: $t-a-typography-heading-level-4-default-font-size;
	letter-spacing: $_letter-spacing-min;
	line-height: $t-a-typography-line-height-tight;
}
