/*
 * Play passes section (sections/pass-cards.php).
 *
 *   --full   big ticket cards: a coloured top half, a tear line with a notch at each
 *            end, and a pale bottom half with the price and a Buy button.
 *   --strip  one small row of passes (a teaser for other pages).
 *
 * The 60 / 120 minute switch sets data-minutes on the section (assets/js/play.js);
 * the rules under "Switch" show the matching price.
 */
.pe-pass-cards .pe-container {
	position: relative;
}

.pe-pass-cards__header {
	max-width: 52rem;
	margin-inline: auto;
	text-align: center;
}

.pe-pass-cards__eyebrow {
	color: var(--pe-teal);
}

.pe-pass-cards__heading {
	margin: 0;
}

.pe-pass-cards__intro {
	margin: 0.75rem 0 0;
	font-size: var(--pe-text-lead);
	line-height: 1.4;
}

/* ---------- Switch: 60 minutes | 120 minutes ---------- */

/* Hidden until play.js adds .has-switch; without JavaScript both prices show. */
.pe-pass-cards__switch {
	display: none;
	width: fit-content;
	margin: 2rem auto 0;
	padding: 0.3rem;
	border: 1.5px solid var(--pe-ink);
	border-radius: var(--pe-radius-pill);
	background: #fffaf0;
	gap: 0.25rem;
}

.has-switch .pe-pass-cards__switch {
	display: flex;
}

.pe-pass-cards__switch-button {
	min-height: 2.75rem;
	padding: 0.4rem 1.4rem;
	border: 0;
	border-radius: var(--pe-radius-pill);
	background: none;
	color: var(--pe-ink);
	font: 700 1.0625rem / 1.2 var(--pe-font-body);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.pe-pass-cards__switch-button[aria-pressed="true"] {
	background: var(--pe-ink);
	color: var(--pe-cream);
}

.has-switch[data-minutes="60"] .pe-pass__price[data-for="120"],
.has-switch[data-minutes="120"] .pe-pass__price[data-for="60"] {
	display: none;
}

/* ---------- The bear, top right of the tickets (desktop only) ---------- */
.pe-pass-cards__mascot {
	position: absolute;
	top: -1.5rem;
	right: var(--pe-gutter);
	width: clamp(7rem, 11vw, 10rem);
}

/* ---------- Tickets ---------- */
.pe-pass-cards__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1.25rem, 2.6vw, 2.25rem);
	align-items: end;
	margin: 3.25rem 0 0;
	padding: 0;
	list-style: none;
}

.pe-pass {
	/* Each ticket has its own top colour; "best value" is the sunny one. */
	--pe-pass-colour: var(--pe-aqua);
	--pe-notch: 0.9rem; /* radius of the bite out of each side at the tear line */

	position: relative;
	display: flex;
	flex-direction: column;
	text-align: center;
	/* drop-shadow follows the ticket's shape, bites included (box-shadow would not). */
	filter: drop-shadow(0 1.1rem 1rem rgb(32 61 54 / 0.2));
	transition: translate 0.25s ease, rotate 0.25s ease;
}

.pe-pass:nth-child(3n + 2) { --pe-pass-colour: var(--pe-peach); }
.pe-pass:nth-child(3n) { --pe-pass-colour: var(--pe-lilac); }
.pe-pass.pe-pass--best { --pe-pass-colour: var(--pe-sunny); }

@media (hover: hover) {
	.pe-pass:hover {
		translate: 0 -0.5rem;
		rotate: -1deg;
	}

	.pe-pass:nth-child(even):hover {
		rotate: 1deg;
	}
}

.pe-pass__top,
.pe-pass__bottom {
	padding: 1.75rem 1.5rem;
}

/* Top half. The mask bites a quarter circle out of each bottom corner; together with
   the bottom half's top corners that makes the round notches of a ticket. */
.pe-pass__top {
	border-radius: var(--pe-radius-card) var(--pe-radius-card) 0 0;
	background: var(--pe-pass-colour);
	-webkit-mask:
		radial-gradient(circle var(--pe-notch) at 0 100%, #0000 98%, #000) 0 0 / 51% 100% no-repeat,
		radial-gradient(circle var(--pe-notch) at 100% 100%, #0000 98%, #000) 100% 0 / 51% 100% no-repeat;
	mask:
		radial-gradient(circle var(--pe-notch) at 0 100%, #0000 98%, #000) 0 0 / 51% 100% no-repeat,
		radial-gradient(circle var(--pe-notch) at 100% 100%, #0000 98%, #000) 100% 0 / 51% 100% no-repeat;
}

.pe-pass--best .pe-pass__top {
	padding-top: 2.75rem; /* room for the "Best value" flag */
}

.pe-pass__bottom {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	gap: 1.1rem;
	border-radius: 0 0 var(--pe-radius-card) var(--pe-radius-card);
	/* The dashed tear line along the top, between the two notches. */
	background:
		repeating-linear-gradient(90deg, rgb(32 61 54 / 0.35) 0 0.5rem, #0000 0.5rem 1rem) calc(var(--pe-notch) + 0.4rem) 0 / calc(100% - var(--pe-notch) * 2 - 0.8rem) 2px no-repeat,
		#fffaf0;
	-webkit-mask:
		radial-gradient(circle var(--pe-notch) at 0 0, #0000 98%, #000) 0 0 / 51% 100% no-repeat,
		radial-gradient(circle var(--pe-notch) at 100% 0, #0000 98%, #000) 100% 0 / 51% 100% no-repeat;
	mask:
		radial-gradient(circle var(--pe-notch) at 0 0, #0000 98%, #000) 0 0 / 51% 100% no-repeat,
		radial-gradient(circle var(--pe-notch) at 100% 0, #0000 98%, #000) 100% 0 / 51% 100% no-repeat;
}

/* "Best value": a coral flag hanging over the top edge. */
.pe-pass__flag {
	position: absolute;
	top: -1.1rem;
	left: 50%;
	z-index: 1;
	margin: 0;
	padding: 0.45rem 1.25rem;
	border: 0.15rem solid #fffaf0;
	border-radius: var(--pe-radius-pill);
	background: var(--pe-coral-deep);
	color: #fff;
	font: 600 1.0625rem / 1.2 var(--pe-font-display);
	letter-spacing: 0.03em;
	white-space: nowrap;
	translate: -50% 0;
	rotate: -3deg;
}

/* The offer: "Buy 4 & get 1 free". */
.pe-pass__deal {
	display: inline-block;
	margin: 0 0 0.9rem;
	padding: 0.3rem 0.9rem;
	border-radius: var(--pe-radius-pill);
	background: var(--pe-ink);
	color: var(--pe-cream);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

.pe-pass__name {
	margin: 0;
	font-size: clamp(1.75rem, 2.7vw, 2.5rem);
	line-height: 1.1;
}

.pe-pass__sessions {
	margin: 0.6rem 0 0;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.2;
}

/* The big number of sessions. */
.pe-pass__count {
	display: block;
	font: 600 clamp(3.5rem, 6vw, 5.25rem) / 1 var(--pe-font-display);
}

.pe-pass__price {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	margin: 0;
}

.pe-pass__amount {
	color: var(--pe-coral-deep);
	font: 600 clamp(2.5rem, 4.2vw, 3.75rem) / 1 var(--pe-font-display);
}

.pe-pass__minutes {
	font-size: 1.0625rem;
	line-height: 1.3;
}

.pe-pass__save {
	margin-top: 0.35rem;
	padding: 0.2rem 0.85rem;
	border-radius: var(--pe-radius-pill);
	background: var(--pe-sunny);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	rotate: -2deg;
}

.pe-pass__button {
	width: 100%;
	margin-top: auto;
	font-size: 1.1875rem;
}

.pe-pass-cards__note {
	max-width: 46rem;
	margin: 2.25rem auto 0;
	font-size: 1.0625rem;
	line-height: 1.5;
	text-align: center;
}

.pe-pass-cards__buttons {
	justify-content: center;
	margin-top: 2rem;
}

/* The best value ticket stands a little taller than its neighbours. */
@media (min-width: 900px) {
	.pe-pass--best .pe-pass__bottom {
		padding-bottom: 2.5rem;
	}
}

/* ---------- Strip: a teaser row ---------- */
.pe-pass-cards--strip .pe-pass-cards__header {
	max-width: none;
}

.pe-pass-cards__chips {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem;
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
}

.pe-pass-chip__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	height: 100%;
	padding: 1.25rem 1rem;
	border: 2px dashed rgb(32 61 54 / 0.45);
	border-radius: var(--pe-radius-card);
	background: #fffaf0;
	box-shadow: var(--pe-shadow-soft);
	color: var(--pe-ink);
	text-align: center;
	text-decoration: none;
	transition: translate 0.2s ease, background-color 0.2s ease;
}

.pe-pass-chip--best .pe-pass-chip__link {
	background: var(--pe-sunny);
}

@media (hover: hover) {
	a.pe-pass-chip__link:hover {
		translate: 0 -0.3rem;
	}
}

.pe-pass-chip__name {
	font: 600 1.625rem / 1.15 var(--pe-font-display);
}

.pe-pass-chip__detail {
	font-size: 1.0625rem;
	line-height: 1.35;
}

.pe-pass-chip__deal {
	margin-top: 0.35rem;
	padding: 0.2rem 0.8rem;
	border-radius: var(--pe-radius-pill);
	background: var(--pe-ink);
	color: var(--pe-cream);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.35;
}

/* ---------- Tablets: no room for the bear ---------- */
@media (max-width: 1023px) {
	.pe-pass-cards__mascot {
		display: none;
	}
}

/* ---------- Phones: one ticket per row ---------- */
@media (max-width: 767px) {
	.pe-pass-cards__list,
	.pe-pass-cards__chips {
		grid-template-columns: minmax(0, 1fr);
	}

	.pe-pass-cards__list {
		max-width: 24rem;
		margin-inline: auto;
		row-gap: 2.25rem;
	}

	.pe-pass-cards__chips {
		gap: 0.875rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pe-pass,
	.pe-pass-chip__link,
	.pe-pass-cards__switch-button {
		transition: none;
	}

	.pe-pass:hover,
	a.pe-pass-chip__link:hover {
		translate: none;
		rotate: none;
	}
}
