@use "../scss/functions/rem";
@use "../scss/calypso-colors";
@use "../scss/typography";
@use "../scss/mixins/breakpoints";
@use "../scss/variables/colors";

.jp-landing__plans {
	margin-top: 48px;
	margin-bottom: 24px;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);

	.dops-button {
		margin-right: 10px;
	}

	.dops-card.is-compact {
		margin-bottom: 0;
		border-bottom: 1px solid var(--jp-gray);

		@include breakpoints.breakpoint( "<960px" ) {
			border-bottom: 0;
		}
	}

	.dops-card:first-child {
		border-radius: 4px 4px 0 0;
	}

	.dops-card:last-child {
		border-radius: 0 0 4px 4px;

		@include breakpoints.breakpoint( "<960px" ) {
			padding-top: 0;
		}
	}

	.dops-card:nth-last-child(2) {

		@include breakpoints.breakpoint( "<960px" ) {
			border-bottom: 0;
		}
	}

	.my-plan-card__tag-line a,
	a.jp-landing__licensing-actions-link {
		color: colors.$black;
		text-decoration-line: underline;

		&:hover {
			text-decoration-thickness: 3px;
		}

		&:focus {
			text-decoration-line: none;
			border-radius: 2px;
			box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #000;
			outline: 3px solid transparent;
		}
	}
}

.jp-landing__card-header {
	margin-top: 0;
	margin-bottom: 8px;
	font-size: 20px;
	font-weight: 500;
	color: colors.$black;
}

.jp-landing__licensing-actions {
	display: flex;
	align-items: center;
	justify-content: center;

	span {

		@include breakpoints.breakpoint( "<660px" ) {
			display: none;
		}
	}

	@include breakpoints.breakpoint( ">480px" ) {
		justify-content: space-between;
	}

	.jp-landing__licensing-actions-item {
		display: flex;
		flex-direction: column;
		align-items: center;


		text-align: center;

		@include breakpoints.breakpoint( ">480px" ) {
			flex-direction: row;
		}

		@include breakpoints.breakpoint( "<660px" ) {
			flex-direction: unset;
			flex: 1;
		}

		.dops-button {
			margin-right: 0;
			margin-left: 16px;
		}
	}

	.jp-landing__licensing-actions-item.no-licenses {
		flex: 1;
		justify-content: flex-end;

		@include breakpoints.breakpoint( "<660px" ) {
			justify-content: space-around;

			a {
				margin: 0;

				&.is-compact {
					width: 48%;
				}
			}
		}
	}
}

.all-purchases__link {
	display: inline-block;
	box-sizing: border-box;
	padding: 7px 20px 9px 0;

	@include breakpoints.breakpoint( "<480px" ) {
		padding: 0;
		margin-bottom: 15px;
	}
}

.jp-landing__plan-features-header-recommendations-cta-container {
	order: 30;
	align-self: center;
	display: flex;
	justify-content: flex-end;

	.dops-button {
		margin-right: 0;
	}
}

.jp-landing__plan-features-card {
	display: flex;
	flex-basis: 32%;
	flex-wrap: nowrap;
	flex-grow: 1;
	box-sizing: border-box;
	margin: 0 rem.convert(8px);
	background-color: colors.$white;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
	border-radius: 4px;

	&:last-child {
		max-width: 100%;
	}

	.is-loading & {
		width: 49.5%;
	}

	@include breakpoints.breakpoint( "<660px" ) {
		max-width: 100%;
		margin-bottom: rem.convert(8px);
	}

	@include breakpoints.breakpoint( ">480px" ) {
		padding: rem.convert(24px);
	}

	@include breakpoints.breakpoint( "<480px" ) {
		padding: rem.convert(16px);
	}
}

.jp-landing__plan-features-list {
	list-style: initial;
	margin-left: rem.convert(16px);
}

.jp-landing__plan-features-img {
	width: rem.convert(48px);
	padding: 24px 24px 24px 0;
	line-height: 1;
	display: flex;

	@include breakpoints.breakpoint( ">960px" ) {
		width: rem.convert(48px);
	}
}

.jp-landing__plan-features-icon {
	display: block;
	width: 48px;
}

.jp-landing__plan-features-text,
.jp-landing__licensing-actions {
	flex: 1;
	font-size: typography.$font-body-small;
	color: var(--jp-gray-80);

	a,
	button {
		font-weight: 500;
		font-size: var(--font-body-extra-small);

		.components-external-link__contents {
			text-decoration: none;
		}
	}
}

.jp-landing__plan-features-title {
	margin: 0;
	font-size: 20px;
}

.jp-landing__plan-features {
	display: flex;
	flex-wrap: wrap;
	flex-direction: row;
	align-items: stretch;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: rem.convert(32px);
	margin-left: rem.convert(-8px);
	margin-right: rem.convert(-8px);

	@include breakpoints.breakpoint( "<660px" ) {
		display: block;
	}
}

.jp-landing__plan-features-card:nth-child(odd) {

	@include breakpoints.breakpoint( "<660px" ) {
		margin-right: 8px;
	}
}

.jp-landing__plan-features-card:nth-child(even) {
	margin-left: 0;

	@include breakpoints.breakpoint( "<660px" ) {
		margin-left: 8px;
	}
}

.jp-landing__plan-features-title.is-placeholder {
	height: rem.convert(24px);
	max-width: 50%;
}

.jp-landing__plan-features-text.is-placeholder {
	height: rem.convert(44px);
	max-width: 75%;
}

.jp-landing__plan-features-link {
	width: 100%;

	@include breakpoints.breakpoint( ">660px" ) {
		text-align: center;
	}
}

.jp-landing__plan-features-header-jetpack-license {

	.dops-button {
		margin-top: 16px;
		margin-right: 0;
		float: right;
	}
}

