@use "@gloria/layout/_mixins.scss" as *;

:root {
	--banner-bg-color: hsl(270, 100%, 19%);
	--banner-button-bg-color: hsl(77, 84%, 52%);
	--banner-button-bg-color-hover: hsl(270, 100%, 28%);
	--banner-button-border-color-hover: var(--banner-button-bg-color);
	--banner-button-text-color-hover: var(--banner-button-bg-color);
}

.c-banner {
	position: relative;
	z-index: 1;
	overflow: hidden;
	background-color: var(--banner-bg-color);
	margin: var(--spacing-9) 0;
	padding: var(--spacing-8);
	border-radius: var(--radius-1);
	color: var(--color-common-white);

	&--light {
		background-color: var(--color-common-white);
		color: var(--color-text-primary);
		border: 1px solid transparent;
		background-clip: padding-box, border-box;
		background-origin: border-box;
		background-image: linear-gradient(90deg, white, white),
			linear-gradient(283.29deg, hsl(264, 100%, 55%) 3.84%, hsl(162, 70%, 49%) 47.87%, hsl(77, 76%, 52%) 98.54%);
	}

	&__headline {
		display: inline-block;
		margin-top: 0;
		color: var(--color-common-white);
		font-weight: var(--font-weight-bolder);
		font-family: var(--font-family-heading);
		font-size: var(--font-size-2xl);
		line-height: var(--line-height-sm);

		.c-banner--light & {
			color: var(--color-common-black);
		}

		span {
			background: linear-gradient(90deg, hsl(77, 84%, 52%) 60.96%, hsl(162, 72%, 50%) 106.5%);
			background-clip: text;
			-webkit-background-clip: text;
			-webkit-text-fill-color: transparent;

			.c-banner--light & {
				background: none;
				color: var(--color-primary);
				-webkit-text-fill-color: unset;
			}
		}
	}

	&__paragraph {
		margin: 0;
		color: var(--color-common-white);
		font-size: var(--font-size-sm);

		.c-banner--light & {
			color: var(--color-common-black);

			@include min-width($breakpoint-md) {
				max-width: 70%;
			}
		}
	}

	&__buttons {
		display: flex;
		flex-wrap: wrap;
		gap: var(--spacing-6);
		margin-top: var(--spacing-8);
		margin-bottom: 0;

		.c-banner:not(.c-banner--light) & {
			.c-button {
				color: var(--banner-bg-color);
				background-color: var(--banner-button-bg-color);
				font-weight: var(--font-weight-bold);
				border-color: var(--banner-button-bg-color);

				&:hover {
					color: var(--banner-button-text-color-hover);
					background-color: transparent;
					border-color: var(--banner-button-border-color-hover);
				}
			}
		}
	}

	&__list {
		margin: var(--spacing-2) 0;

		&-item {
			color: var(--color-common-white);
			font-size: var(--font-size-sm);

			&::marker {
				color: var(--color-common-white);
			}

			&:not(:first-child) {
				margin-top: var(--spacing-2);
			}
		}
	}

	.c-banner__background-image {
		position: absolute;
		bottom: 0;
		right: 0;
		z-index: -1;
		pointer-events: none;
	}

	&:not(.c-banner--light) > * {
		&:not(.hex-bg-wrapper) {
			max-width: calc(100% + var(--spacing-8) - 312px); /* 312px is the width of the hexagon SVG. */

			@include breakpoint-only($breakpoint-sm, $breakpoint-lg) {
				max-width: calc(100% + var(--spacing-8) - 200px);
			}

			@include max-width($breakpoint-sm) {
				max-width: 100%;
			}
		}
	}
}
