@use '@lucca-front/scss/src/commons/config';
@use 'exports' as *;

.titleSection {
	@layer components {
		@include vars;
		@include component;
	}
}

%titleXXXL {
	@layer components {
		@include XXXL('!important');
	}
}

%titleImportant {
	@layer components {
		@include title('!important');
	}
}

.titleSection-sub {
	@layer components {
		:is(h1, h1.mod-XXXL) ~ & {
			@include XXXL;
		}

		:is(.pr-u-h1, .pr-u-h1.mod-XXXL) ~ & {
			@extend %titleXXXL;
		}

		:is(h2, h3, h4, h5, h6) ~ & {
			@include title;
		}

		:is(.pr-u-h2, .pr-u-h3, .pr-u-h4, .pr-u-h5, .pr-u-h6) ~ & {
			@extend %titleImportant;
		}

		// Deprecated .u- utilities
		@if config.$deprecatedUtilityPrefix {
			:is(.u-h1, .u-h1.mod-XXXL) ~ & {
				@extend %titleXXXL;
			}

			:is(.u-h2, .u-h3, .u-h4, .u-h5, .u-h6) ~ & {
				@extend %titleImportant;
			}
		}
	}
}
