/* PRICE-1: packages. A centred head, then package cards of equal height. The card frame comes from .wprk-card in base.css. */

/*
 * Phones and tablets: one package under another, kept to a comfortable width.
 * The layout rules in this file step aside when the row is turned into a carousel.
 */
.wprk-section.wprk-price-1 .wprk-cards:not([class*="is-style-wprk-carousel"]) {
	grid-template-columns: minmax(0, 1fr);
	max-width: 30rem;
}

/* A column, so the button can rest at the foot of the card. */
.wprk-price-1 .wprk-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* ---------- Head of a card: name, who it is for, price ---------- */

.wprk-price-1 .wprk-price-1__head {
	border-block-end: 1px solid var(--wprk-border);
	display: flex;
	flex-direction: column;
	padding-block-end: var(--wp--preset--spacing--30);
}

.wprk-price-1 .wprk-price-1__head > * {
	margin-block: 0;
}

.wprk-price-1 .wprk-price-1__head > * + * {
	margin-block-start: var(--wp--preset--spacing--10);
}

.wprk-price-1 .wprk-card :where(h3) {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
	overflow-wrap: break-word;
}

.wprk-price-1 .wprk-price-1__head > .wprk-muted {
	line-height: 1.5;
}

/*
 * The price rests on the hairline under the head. The amount is the part set
 * in bold; it takes the heading typeface at a larger size.
 */
.wprk-price-1 .wprk-price-1__head > .wprk-price-1__price {
	color: var(--wprk-muted);
	line-height: 1.3;
	margin-block-start: auto;
	padding-block-start: var(--wp--preset--spacing--30);
}

.wprk-price-1 .wprk-price-1__price :where(strong) {
	color: var(--wprk-heading);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-variant-numeric: lining-nums;
	font-weight: var(--wp--custom--heading--weight);
	letter-spacing: var(--wp--custom--heading--tracking);
}

/* ---------- What is included: a list with ticks, as in TEXT-1 ---------- */

.wprk-price-1 .wprk-card > .wp-block-list {
	list-style: none;
	margin-block-start: var(--wp--preset--spacing--30);
	padding: 0;
}

.wprk-price-1 .wprk-card > .wp-block-list > li {
	margin: 0;
	padding-block: var(--wp--preset--spacing--10);
	padding-inline-start: 1.75rem;
	position: relative;
}

/* The tick is two borders of a turned box, so it follows the colour style. */
.wprk-price-1 .wprk-card > .wp-block-list > li::before {
	border-bottom: 2px solid var(--wprk-accent-text);
	border-right: 2px solid var(--wprk-accent-text);
	box-sizing: content-box;
	content: "";
	height: 0.52em;
	inset-block-start: calc(var(--wp--preset--spacing--10) + 0.4em);
	inset-inline-start: 0.3rem;
	position: absolute;
	transform: rotate(45deg);
	width: 0.26em;
}

/* ---------- Button at the foot, as wide as the card ---------- */

.wprk-price-1 .wprk-card > .wp-block-buttons {
	margin-block-start: auto;
	padding-block-start: var(--wp--preset--spacing--40);
}

.wprk-price-1 .wprk-card > .wp-block-buttons > .wp-block-button {
	width: 100%;
}

/* ---------- The usual choice ---------- */

/* An accent line on top. The padding gives its extra thickness back, so the names stay level. */
.wprk-price-1 .wprk-card.wprk-price-1__featured {
	border-block-start: 3px solid var(--wprk-accent);
	padding-block-start: calc(var(--wp--preset--spacing--40) - 2px);
}

/* The name and the small label share one line: name on one side, label on the other. */
.wprk-price-1 .wprk-price-1__title {
	align-items: baseline;
	gap: var(--wp--preset--spacing--20);
}

.wprk-price-1 .wprk-price-1__flag {
	border: 1px solid var(--wprk-accent);
	border-radius: var(--wp--custom--radius--sm);
	color: var(--wprk-accent-text);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.3;
	padding: 0.15em 0.6em;
	text-transform: uppercase;
}

/* The label never makes its line taller than the name beside it. */
.wprk-price-1 .wprk-price-1__title > .wprk-price-1__flag {
	margin-block: -0.25rem;
}

/* ---------- Wide screens ---------- */

/* One row of equal columns, however many packages there are. */
@media (min-width: 1024px) {
	.wprk-section.wprk-price-1 .wprk-cards:not([class*="is-style-wprk-carousel"]) {
		grid-auto-columns: minmax(0, 1fr);
		grid-auto-flow: column;
		grid-template-columns: none;
		max-width: var(--wp--style--global--wide-size);
	}

	/*
	 * Where the browser can, the three parts of a card (head, list, button)
	 * take their heights from three rows shared by the whole row of cards.
	 * Prices, hairlines and lists then sit level from card to card, even when
	 * the texts differ in length. A card that has been given more or fewer
	 * parts keeps the simple column layout from above.
	 */
	@supports (grid-template-rows: subgrid) {
		.wprk-section.wprk-price-1 .wprk-cards:not([class*="is-style-wprk-carousel"]) {
			grid-template-rows: repeat(3, auto);
			row-gap: 0;
		}

		.wprk-price-1 .wprk-cards:not([class*="is-style-wprk-carousel"]) > .wprk-card {
			grid-row: span 3;
		}

		.wprk-price-1 .wprk-cards:not([class*="is-style-wprk-carousel"]) > .wprk-card:has(> :nth-child(3)):not(:has(> :nth-child(4):not(.block-list-appender))) {
			display: grid;
			grid-template-columns: minmax(0, 1fr);
			grid-template-rows: subgrid;
		}
	}
}

/*
 * With "Items per row" set, the packages wrap. Every line of cards keeps its
 * three shared rows, and those rows stay closed up, so the room between two
 * lines comes from the cards themselves. The row gives back what the last
 * line adds.
 */
@media (min-width: 1024px) {
	@supports (grid-template-rows: subgrid) {
		.wprk-section.wprk-price-1 .wprk-cards.has-columns:not([class*="is-style-wprk-carousel"]) {
			margin-block-end: calc(var(--wprk-row-gap) * -1);
		}

		.wprk-price-1 .wprk-cards.has-columns:not([class*="is-style-wprk-carousel"]) > .wprk-card {
			margin-block-end: var(--wprk-row-gap);
		}
	}
}
