/**
 * BOE Registration - Comparison Charts
 * [boe comparison_chart id="..."] (class-chart.php). Where the chart has room it is a table with a column per
 * pass type; where it doesn't, the pass types stack, one at a time. The chart's own width decides (container
 * queries), so the same chart works in a page column, in a popup and on a phone.
 *
 * Each column's colors come from its pass type, set per chart by class-chart.php, as on the Go Pricing tables:
 * --boe-pass-price (the pass type color itself, the darkest), the lighter --boe-pass-name and --boe-pass-btn,
 * --boe-pass-btn-text, and two light tints for the cells.
 *
 * Everything is scoped under .boe-cmp and resets what the theme sets on tables, headings, lists and links.
 */

.boe-cmp {
	--boe-cmp-text: #333;
	--boe-cmp-muted: #595959;
	--boe-cmp-yes: #3d9a35;
	--boe-cmp-no: #e1452a;
	--boe-cmp-label: #f3f4f5;
	--boe-cmp-label-2: #e9ebed;
	--boe-cmp-line: #fff;
	--boe-cmp-disabled: #767676;

	container-type: inline-size;
	container-name: boe-cmp;
	box-sizing: border-box;
	width: 100%;
	margin: 0 auto;
	color: var(--boe-cmp-text);
	font-size: 16px;
	line-height: 1.35;
	text-align: left;
}

.boe-cmp *,
.boe-cmp *::before,
.boe-cmp *::after {
	box-sizing: border-box;
}

.boe-cmp .boe-cmp__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Wide layout: the table */

.boe-cmp__wide {
	overflow-x: auto;
}

.boe-cmp .boe-cmp__table {
	/* The benefit names get 1.4 shares of the width, each pass type 1; a share is at most 200px, so a chart
	   with few columns stays compact and centered */
	width: 100%;
	max-width: calc((var(--boe-cmp-cols, 2) + 1.4) * 200px);
	margin: 0 auto;
	table-layout: fixed;
	border-collapse: separate;
	border-spacing: 0;
	border: 0;
	background: none;
	font-size: 16px;
	line-height: 1.3;
}

.boe-cmp .boe-cmp__table col.boe-cmp__labels {
	width: calc(100% * 1.4 / (var(--boe-cmp-cols, 2) + 1.4));
}

.boe-cmp .boe-cmp__table th,
.boe-cmp .boe-cmp__table td {
	padding: 10px 12px;
	border: 0;
	background: none;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
	text-align: center;
	vertical-align: middle;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Pass type columns (cells with a boe-cmp__c1, __c2, ... class) are separated by a thin white line, as on the
   Go Pricing tables */
.boe-cmp .boe-cmp__table th[class*="boe-cmp__c"],
.boe-cmp .boe-cmp__table td[class*="boe-cmp__c"] {
	border-left: 1px solid var(--boe-cmp-line);
}

.boe-cmp .boe-cmp__table .boe-cmp__corner {
	background: none;
	border: 0;
}

/* Name band (the table's cells and the stacked sections alike; two classes deep, so the cell reset above
   doesn't win) */
.boe-cmp .boe-cmp__table .boe-cmp__name,
.boe-cmp .boe-cmp__pass .boe-cmp__name {
	background: var(--boe-pass-name);
	color: #fff;
	font-family: inherit;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	-webkit-hyphens: auto;
	hyphens: auto;
}

.boe-cmp .boe-cmp__table .boe-cmp__name {
	padding: 14px 10px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

/* Price band */
.boe-cmp .boe-cmp__table .boe-cmp__price,
.boe-cmp .boe-cmp__pass .boe-cmp__price {
	background: var(--boe-pass-price);
	color: #fff;
}

.boe-cmp .boe-cmp__table .boe-cmp__price {
	padding: 18px 8px;
}

.boe-cmp .boe-cmp__amount {
	display: inline-block;
	max-width: 100%;
	font-size: 36px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

/* A price in words ("FREE Ticket", "Buy in Bulk"): smaller, and it wraps instead of leaving its band */
.boe-cmp .boe-cmp__amount--text {
	font-size: 26px;
	white-space: normal;
	overflow-wrap: anywhere;
}

.boe-cmp .boe-cmp__cur {
	margin-right: 1px;
	font-size: 0.5em;
	vertical-align: 0.72em;
}

.boe-cmp .boe-cmp__strike {
	display: block;
	margin-top: 2px;
	color: #fff;
	font-size: 19px;
	font-weight: 700;
	text-decoration: line-through;
	overflow-wrap: anywhere;
}

/* Note under the price, and the buy buttons, on the column's tint */
.boe-cmp .boe-cmp__table .boe-cmp__note,
.boe-cmp .boe-cmp__pass .boe-cmp__note {
	background: var(--boe-pass-tint);
	color: var(--boe-cmp-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.boe-cmp .boe-cmp__table .boe-cmp__note {
	padding: 10px 8px 0;
}

.boe-cmp .boe-cmp__table .boe-cmp__action,
.boe-cmp .boe-cmp__pass .boe-cmp__action {
	background: var(--boe-pass-tint);
}

.boe-cmp .boe-cmp__table .boe-cmp__action {
	padding: 16px 8px;
	border-bottom: 1px solid var(--boe-cmp-line);
}

.boe-cmp .boe-cmp__btn,
.boe-cmp a.boe-cmp__btn,
.boe-cmp a.boe-cmp__btn:visited {
	display: inline-block;
	max-width: 100%;
	margin: 0;
	padding: 11px 18px;
	border: 0;
	border-radius: 4px;
	background: var(--boe-pass-btn);
	color: var(--boe-pass-btn-text);
	font-size: 15px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	-webkit-hyphens: auto;
	hyphens: auto;
	box-shadow: none;
	transition: filter 0.2s, transform 0.2s;
}

.boe-cmp a.boe-cmp__btn:hover,
.boe-cmp a.boe-cmp__btn:focus {
	color: var(--boe-pass-btn-text);
	text-decoration: none;
	filter: brightness(1.08) saturate(1.05);
	transform: translateY(-1px);
}

/* The focus ring is a box shadow: the theme removes outlines on every link with !important */
.boe-cmp a.boe-cmp__btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--boe-cmp-text);
}

.boe-cmp .boe-cmp__btn--info,
.boe-cmp a.boe-cmp__btn--info,
.boe-cmp a.boe-cmp__btn--info:visited {
	text-transform: none;
	letter-spacing: 0;
	font-size: 16px;
}

/* Sold out, or a typed-in button with no link */
.boe-cmp .boe-cmp__btn.is-disabled {
	background: var(--boe-cmp-disabled);
	color: #fff;
	cursor: not-allowed;
}

/* Benefit rows */
.boe-cmp .boe-cmp__table .boe-cmp__benefit {
	background: var(--boe-cmp-label);
	color: var(--boe-cmp-text);
	font-weight: 500;
	text-align: left;
	border-bottom: 1px solid var(--boe-cmp-line);
}

.boe-cmp .boe-cmp__table tbody tr:nth-child(even) .boe-cmp__benefit {
	background: var(--boe-cmp-label-2);
}

.boe-cmp .boe-cmp__table .boe-cmp__cell {
	background: var(--boe-pass-tint);
	border-bottom: 1px solid var(--boe-cmp-line);
}

.boe-cmp .boe-cmp__table tbody tr:nth-child(even) .boe-cmp__cell {
	background: var(--boe-pass-tint-2);
}

.boe-cmp .boe-cmp__icon {
	display: inline-block;
	width: 22px;
	height: 22px;
	vertical-align: middle;
	flex: 0 0 auto;
}

.boe-cmp .boe-cmp__icon circle {
	fill: var(--boe-cmp-yes);
}

.boe-cmp .boe-cmp__icon--no circle {
	fill: var(--boe-cmp-no);
}

.boe-cmp .boe-cmp__icon path {
	fill: none;
	stroke: #fff;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Info buttons under the columns */
.boe-cmp .boe-cmp__table tfoot td {
	padding: 22px 8px 4px;
	background: none;
	border-left-color: transparent;
}

/* Narrow layout: one pass type at a time, stacked */

.boe-cmp__narrow {
	display: none;
	/* One track that never grows past the chart, whatever a section holds */
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	justify-items: center;
}

.boe-cmp .boe-cmp__pass {
	width: 100%;
	max-width: 440px;
	margin: 0;
	padding: 0;
	text-align: center;
}

.boe-cmp .boe-cmp__pass .boe-cmp__name {
	margin: 0;
	padding: 14px 12px 12px;
}

.boe-cmp .boe-cmp__pass .boe-cmp__price {
	padding: 18px 12px;
}

.boe-cmp .boe-cmp__pass .boe-cmp__note {
	padding: 10px 12px 0;
}

.boe-cmp .boe-cmp__pass .boe-cmp__action {
	padding: 14px 12px;
}

.boe-cmp .boe-cmp__list {
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: left;
}

.boe-cmp .boe-cmp__list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 10px 14px;
	border-top: 1px solid var(--boe-cmp-line);
	background: var(--boe-pass-tint);
	color: var(--boe-cmp-text);
	font-size: 16px;
	line-height: 1.35;
	list-style: none;
}

.boe-cmp .boe-cmp__list li::before {
	content: none;
}

.boe-cmp .boe-cmp__list li:nth-child(even) {
	background: var(--boe-pass-tint-2);
}

.boe-cmp .boe-cmp__list li.is-no .boe-cmp__label {
	color: var(--boe-cmp-muted);
}

.boe-cmp .boe-cmp__list .boe-cmp__icon {
	margin-top: 0;
}

.boe-cmp .boe-cmp__pass .boe-cmp__info {
	padding: 16px 0 0;
}

/*
 * Where the layouts switch: the narrowest width at which the table still fits its columns. More pass types
 * need more room.
 */
@container boe-cmp (max-width: 559px) {
	.boe-cmp--n1 .boe-cmp__wide,
	.boe-cmp--n2 .boe-cmp__wide { display: none; }
	.boe-cmp--n1 .boe-cmp__narrow,
	.boe-cmp--n2 .boe-cmp__narrow { display: grid; }
}

@container boe-cmp (max-width: 679px) {
	.boe-cmp--n3 .boe-cmp__wide { display: none; }
	.boe-cmp--n3 .boe-cmp__narrow { display: grid; }
}

@container boe-cmp (max-width: 799px) {
	.boe-cmp--n4 .boe-cmp__wide { display: none; }
	.boe-cmp--n4 .boe-cmp__narrow { display: grid; }
}

@container boe-cmp (max-width: 919px) {
	.boe-cmp--n5 .boe-cmp__wide { display: none; }
	.boe-cmp--n5 .boe-cmp__narrow { display: grid; }
}

@container boe-cmp (max-width: 1039px) {
	.boe-cmp--n6 .boe-cmp__wide { display: none; }
	.boe-cmp--n6 .boe-cmp__narrow { display: grid; }
}

/* Browsers without container queries: switch by the window's width instead */
@supports not (container-type: inline-size) {
	@media (max-width: 767px) {
		.boe-cmp__wide { display: none; }
		.boe-cmp__narrow { display: grid; }
	}
}

/* Smaller type where the table is tight */
@container boe-cmp (max-width: 899px) {
	.boe-cmp .boe-cmp__table { font-size: 15px; }
	.boe-cmp .boe-cmp__table .boe-cmp__name { font-size: 19px; }
	.boe-cmp .boe-cmp__table .boe-cmp__amount { font-size: 30px; }
	.boe-cmp .boe-cmp__table .boe-cmp__amount--text { font-size: 22px; }
	.boe-cmp .boe-cmp__table .boe-cmp__btn,
	.boe-cmp .boe-cmp__table a.boe-cmp__btn { padding: 10px 12px; font-size: 14px; }
}
