@import "@wordpress/base-styles/breakpoints";
@import "@wordpress/base-styles/mixins";

.task {
	display: flex;
	flex-direction: column;
	position: relative;
	margin-top: 0;
	margin-bottom: 30px;

	@include break-small {
		flex-direction: row;
		box-shadow: 0 0 0 1px var(--color-border-subtle);
		margin-bottom: 16px;
		border-radius: 3px;
	}

	.task__text,
	.task__illustration {
		padding: 24px 16px;
		box-sizing: border-box;

		@include break-xlarge {
			padding: 32px 24px;
		}
	}

	.task__text {
		display: flex;
		flex-direction: column;
		align-items: flex-start;

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

	.task__illustration {
		width: 100%;
		align-self: center;
		flex-shrink: 0;
		margin-left: auto;
		text-align: center;
		margin-top: 32px;

		@include break-small {
			width: 33.33%;
			margin-top: 0;
		}
	}

	.task__timing {
		margin-bottom: 10px;
		align-items: center;
		font-size: $font-body-small;

		.gridicon {
			margin-right: 8px;
			vertical-align: text-bottom;
			color: var(--color-text-subtle);
		}
	}

	.task__badge {
		background-color: var(--studio-gray-80);
		color: var(--color-text-inverted);
		margin-bottom: 8px;
	}

	.task__title {
		@extend .wp-brand-font;
		font-size: $font-title-large;
		line-height: 36px;
		margin-bottom: 16px;

		@include break-medium {
			line-height: 40px;
		}
	}

	.task__description {
		margin-bottom: 24px;
		font-size: $font-body;
		line-height: 24px;
		color: var(--color-text-subtle);

		@include break-medium {
			line-height: 28px;
			margin-bottom: 32px;
		}
	}

	.task__actions {
		display: flex;
		flex-wrap: wrap;
		gap: 16px;
		padding-top: 0;
		margin-top: auto;
		font-size: $font-body-small;

		.is-link {
			&:focus-visible {
				box-shadow: 0 0 0 2px var(--color-primary);
			}
		}
	}

	.spinner {
		position: absolute;
		left: 50%;
		top: 50%;
		margin-left: -10px;
		margin-top: -10px;
	}

	&.is-loading > *:not(.spinner) {
		visibility: hidden;
	}

	&.is-urgent {
		background: var(--color-neutral-80);
		color: var(--color-neutral-0);

		.task__badge {
			background: var(--color-neutral-0);
			color: var(--color-text);
		}

		.task__description,
		.task__skip {
			color: var(--color-neutral-0);
		}

		.task__description a {
			color: var(--color-neutral-0);
			text-decoration: underline;
		}
		.task__skip:hover {
			color: var(--color-neutral-20);
		}
	}
}

.task__skip-popover .popover__menu {
	min-width: 130px;
}
