/*
 * Pippin Segment Explorer: a segment's property types as a list (a column on desktop, a swipeable row on tablets and
 * phones) and one card at a time; "What we check" opens a side panel (a bottom sheet on phones). The widget has no
 * background of its own: the section around it gives the colour. --pt-sx-accent is the segment's Type- colour.
 */
.pt-sx {
	--pt-sx-accent: var(--e-global-color-e38965e, #dc5455);
	--pt-sx-text: var(--e-global-color-text, #22294e);
	--pt-sx-muted: var(--e-global-color-e4427e8, #757575);
	--pt-sx-line: var(--e-global-color-0b10200, #d4d8ea);
	--pt-sx-soft: var(--e-global-color-0b10050, #f5f6fc);
	--pt-sx-ink: var(--e-global-color-a1ec0de, #22294e);
	--pt-sx-surface: var(--e-global-color-5f0ace0, #fff);
	--pt-sx-cta: var(--e-global-color-accent, #d83040);
	--pt-sx-cta-hover: var(--e-global-color-acc0h01, #a82d35);
	--pt-sx-focus: var(--e-global-color-primary, #37aada);
	display: grid;
	grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
	gap: var(--pt-columns, 40px);
	align-items: start;
	color: var(--pt-sx-text);
}

/* Property types */
.pt-sx__nav {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}
.pt-sx .pt-sx__label {
	margin: 0;
	color: var(--pt-sx-muted);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}
.pt-sx__total {
	display: inline-block;
	min-width: 1.9em;
	margin-left: 4px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--pt-sx-soft);
	color: var(--pt-sx-text);
	letter-spacing: 0;
	text-align: center;
}
.pt-sx__types {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.pt-sx .pt-sx__type,
.pt-sx .pt-sx__type:is(:hover, :focus, :active) {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 14px 10px 18px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	box-shadow: none;
	color: var(--pt-sx-text);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.006em;
	text-align: left;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.pt-sx .pt-sx__type::before {
	content: "";
	position: absolute;
	top: 10px;
	bottom: 10px;
	left: 6px;
	width: 4px;
	border-radius: 4px;
	background: transparent;
	transition: background-color 0.15s ease;
}
.pt-sx .pt-sx__type:hover {
	background: var(--pt-sx-soft);
}
.pt-sx .pt-sx__type.is-active {
	background: var(--pt-sx-surface);
	box-shadow: 0 1px 2px rgba(15, 19, 40, 0.06), 0 4px 14px rgba(15, 19, 40, 0.06);
	font-weight: 700;
}
.pt-sx .pt-sx__type.is-active::before {
	background: var(--pt-sx-accent);
}
.pt-sx .pt-sx__type:focus-visible,
.pt-sx :is(.pt-sx__prev, .pt-sx__next, .pt-sx__details, .pt-sx__cta, .pt-sx__cta2, .pt-sx__full):focus-visible {
	outline: 2px solid var(--pt-sx-focus);
	outline-offset: 2px;
}

/* Card */
.pt-sx__cards {
	min-width: 0;
}
.pt-sx__card {
	overflow: hidden;
	border: 1px solid var(--pt-sx-line);
	border-radius: 24px;
	background: var(--pt-sx-surface);
	box-shadow: 0 10px 30px rgba(15, 19, 40, 0.06);
}
.pt-sx__card[hidden] {
	display: none;
}
.pt-sx__card.is-entering {
	animation: pt-sx-in 0.35s ease;
}
@keyframes pt-sx-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}
.pt-sx__media {
	position: relative;
	aspect-ratio: 16 / 8;
	background: var(--pt-sx-soft);
}
.pt-sx .pt-sx__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 0;
	object-fit: cover;
}
.pt-sx__step {
	position: absolute;
	right: 16px;
	bottom: 16px;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 4px 4px 14px;
	border-radius: 999px;
	background: rgba(15, 19, 40, 0.72);
	backdrop-filter: blur(6px);
	color: #fff;
}
.pt-sx__count {
	margin-right: 4px;
	font-size: 0.8125rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}
.pt-sx .pt-sx__prev,
.pt-sx .pt-sx__next,
.pt-sx .pt-sx__prev:is(:hover, :focus, :active),
.pt-sx .pt-sx__next:is(:hover, :focus, :active) {
	position: relative;
	width: 36px;
	height: 36px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.pt-sx .pt-sx__prev:hover,
.pt-sx .pt-sx__next:hover {
	background: rgba(255, 255, 255, 0.28);
}
.pt-sx__prev::before,
.pt-sx__next::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: translate(-65%, -50%) rotate(45deg);
}
.pt-sx__prev::before {
	transform: translate(-35%, -50%) rotate(-135deg);
}

.pt-sx__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: clamp(24px, 3vw, 36px);
}
.pt-sx .pt-sx__name {
	margin: 0;
	color: var(--pt-sx-text);
	font-size: clamp(1.5rem, 2.2vw, 1.875rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}
.pt-sx .pt-sx__summary {
	max-width: 62ch;
	margin: 0;
	color: var(--pt-sx-text);
	font-size: 1.0625rem;
	line-height: 1.55;
}
.pt-sx__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pt-sx__tags li {
	margin: 0;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--pt-sx-soft);
	color: var(--pt-sx-text);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
}
.pt-sx__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	margin-top: 8px;
}

/* Actions */
.pt-sx .pt-sx__cta,
.pt-sx .pt-sx__cta2 {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 28px;
	border: 2px solid var(--pt-sx-cta);
	border-radius: 999px;
	background: var(--pt-sx-cta);
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pt-sx .pt-sx__cta:hover {
	border-color: var(--pt-sx-cta-hover);
	background: var(--pt-sx-cta-hover);
	color: #fff;
}
.pt-sx .pt-sx__cta2 {
	border-color: var(--pt-sx-ink);
	background: transparent;
	color: var(--pt-sx-ink);
}
.pt-sx .pt-sx__cta2:hover {
	background: var(--pt-sx-ink);
	color: #fff;
}
.pt-sx .pt-sx__details,
.pt-sx .pt-sx__details:is(:hover, :focus, :active),
.pt-sx .pt-sx__full {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--pt-sx-ink);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
}
.pt-sx .pt-sx__details:hover,
.pt-sx .pt-sx__full:hover {
	color: var(--pt-sx-cta);
}
.pt-sx__arrow {
	width: 18px;
	height: 2px;
	background: currentColor;
	position: relative;
	transition: transform 0.15s ease;
}
.pt-sx__arrow::after {
	content: "";
	position: absolute;
	top: -4px;
	right: 0;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
}
.pt-sx :is(.pt-sx__details, .pt-sx__full):hover .pt-sx__arrow {
	transform: translateX(3px);
}

/* Panel: a side sheet on desktop, a bottom sheet on phones. */
.pt-sx__panel {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(500px, 100vw);
	max-width: 100vw;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--pt-sx-text);
	overflow: visible;
}
.pt-sx__panel::backdrop {
	background: rgba(15, 19, 40, 0.55);
	backdrop-filter: blur(2px);
}
.pt-sx__panel[open] .pt-sx__sheet {
	animation: pt-sx-side 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pt-sx-side {
	from {
		transform: translateX(40px);
		opacity: 0;
	}
}
.pt-sx__sheet {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--pt-sx-surface);
	box-shadow: -20px 0 50px rgba(15, 19, 40, 0.18);
}
.pt-sx__panel-head {
	position: relative;
	padding: 28px 72px 20px 32px;
	border-top: 4px solid var(--pt-sx-accent);
	border-bottom: 1px solid var(--pt-sx-line);
}
.pt-sx .pt-sx__panel-kicker {
	margin: 0 0 4px;
	color: var(--pt-sx-muted);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.pt-sx .pt-sx__panel-title {
	margin: 0;
	color: var(--pt-sx-text);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
}
.pt-sx .pt-sx__close,
.pt-sx .pt-sx__close:is(:hover, :focus, :active) {
	position: absolute;
	top: 22px;
	right: 20px;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pt-sx-soft);
	box-shadow: none;
	color: var(--pt-sx-text);
	cursor: pointer;
}
.pt-sx .pt-sx__close:hover {
	background: var(--pt-sx-line);
}
.pt-sx .pt-sx__close:focus-visible {
	outline: 2px solid var(--pt-sx-focus);
	outline-offset: 2px;
}
.pt-sx__close::before,
.pt-sx__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transform: translate(-50%, -50%) rotate(45deg);
}
.pt-sx__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}
.pt-sx__panel-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	padding: 24px 32px 32px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.pt-sx .pt-sx__overview {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
}
.pt-sx .pt-sx__checks-title {
	margin: 8px 0 0;
	color: var(--pt-sx-text);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}
.pt-sx .pt-sx__checks {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pt-sx .pt-sx__checks li {
	position: relative;
	margin: 0;
	padding-left: 30px;
	font-size: 0.9375rem;
	line-height: 1.5;
}
.pt-sx .pt-sx__checks li::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 0;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--pt-sx-soft);
}
.pt-sx .pt-sx__checks li::after {
	content: "";
	position: absolute;
	top: 7px;
	left: 6px;
	width: 8px;
	height: 5px;
	border-bottom: 2px solid var(--pt-sx-ink);
	border-left: 2px solid var(--pt-sx-ink);
	transform: rotate(-45deg);
}
.pt-sx .pt-sx__full {
	margin-top: 4px;
	font-size: 0.9375rem;
}
.pt-sx__panel-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding: 20px 32px calc(20px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--pt-sx-line);
	background: var(--pt-sx-surface);
}
.pt-sx__panel-foot > a {
	flex: 1 1 140px;
	white-space: nowrap;
}
body.pt-sx-locked {
	overflow: hidden;
}

/* Tablet and phone: the types become a swipeable row of chips above the card. */
@media (max-width: 1024px) {
	.pt-sx {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}
	.pt-sx__types {
		flex-direction: row;
		gap: 8px;
		padding: 2px 32px 6px 0;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
		mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
	}
	.pt-sx__types::-webkit-scrollbar {
		display: none;
	}
	.pt-sx .pt-sx__type,
	.pt-sx .pt-sx__type:is(:hover, :focus, :active) {
		flex: none;
		padding: 10px 18px;
		border: 1px solid var(--pt-sx-line);
		border-radius: 999px;
		background: var(--pt-sx-surface);
		white-space: nowrap;
		scroll-snap-align: start;
	}
	.pt-sx .pt-sx__type::before {
		display: none;
	}
	.pt-sx .pt-sx__type.is-active {
		gap: 8px;
		border-color: var(--pt-sx-ink);
		background: var(--pt-sx-ink);
		box-shadow: none;
		color: #fff;
	}
	/* The segment colour as a dot on the open chip. */
	.pt-sx .pt-sx__type.is-active::before {
		position: static;
		display: block;
		flex: none;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: var(--pt-sx-accent);
	}
}

@media (max-width: 767px) {
	.pt-sx__media {
		aspect-ratio: 16 / 10;
	}
	.pt-sx__step {
		right: 12px;
		bottom: 12px;
	}
	.pt-sx__card {
		border-radius: 20px;
	}
	.pt-sx .pt-sx__summary {
		font-size: 1rem;
	}
	.pt-sx__actions {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
	}
	.pt-sx__actions .pt-sx__details {
		justify-content: center;
	}
	.pt-sx__panel {
		inset: auto 0 0 0;
		width: 100vw;
		height: auto;
		max-height: 88dvh;
	}
	.pt-sx__panel[open] .pt-sx__sheet {
		animation-name: pt-sx-up;
	}
	@keyframes pt-sx-up {
		from {
			transform: translateY(60px);
			opacity: 0;
		}
	}
	.pt-sx__sheet {
		max-height: 88dvh;
		border-radius: 24px 24px 0 0;
		overflow: hidden;
		box-shadow: 0 -20px 50px rgba(15, 19, 40, 0.18);
	}
	.pt-sx__panel-head {
		padding: 24px 68px 16px 20px;
		border-top: 0;
	}
	.pt-sx__panel-head::before {
		content: "";
		position: absolute;
		top: 8px;
		left: 50%;
		width: 40px;
		height: 4px;
		border-radius: 4px;
		background: var(--pt-sx-line);
		transform: translateX(-50%);
	}
	.pt-sx .pt-sx__close {
		top: 18px;
		right: 14px;
	}
	.pt-sx__panel-body {
		padding: 20px;
	}
	.pt-sx__panel-foot {
		padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
	}
	.pt-sx .pt-sx__panel-foot > a {
		padding-inline: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pt-sx__card.is-entering,
	.pt-sx__panel[open] .pt-sx__sheet {
		animation: none;
	}
}
