/* Programme options table (cost box) and "From $X" (booking rail).
 * 22 Oct 2026, programme variant merge (PR #107). Loaded after programme.css. */

.cost-box--options {
	max-width: 640px;
	box-sizing: border-box;
	/* Overflow fix (Ben, 24 Oct 2026, building-bridges-101): the stacked layout
	 * below keys off the box's own width, not the viewport. */
	container: cost-options / inline-size;
	/* Last-resort guard (browsers without container queries): scroll inside
	 * the box rather than spill past its border. */
	overflow-x: auto;
}

/* Long words and strings wrap instead of pushing past the box (single-price
 * box, options table and rail alike). */
.cost-box {
	min-width: 0;
	overflow-wrap: break-word;
}

.programme-options {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--step--1);
	margin: 0 0 var(--s-2);
}

.programme-options__caption {
	text-align: left;
	font-weight: 700;
	color: var(--ink);
	margin-bottom: var(--s-2);
}

.programme-options th,
.programme-options td {
	padding: var(--s-2) var(--s-2);
	border-bottom: 1px solid #e4e2ea;
	text-align: left;
	vertical-align: top;
}

.programme-options thead th {
	color: var(--ink-soft);
	font-weight: 600;
}

.programme-options tbody th {
	font-weight: 600;
	color: var(--ink);
	overflow-wrap: anywhere;
}

/* Column headings may wrap ("Per student" on two lines); body numbers stay on
 * one line. */
.programme-options thead th.programme-options__num {
	white-space: normal;
}

.programme-options__num {
	text-align: right;
	white-space: nowrap;
}

.programme-options th.programme-options__num {
	text-align: right;
}

.programme-options__price {
	font-weight: 800;
	color: var(--ink);
}

/* Per-student column: the same green as the single-price box's per-student
 * highlight (Ben, 25 Oct 2026), as a small pill so it reads at a glance. */
.programme-options__per-student {
	font-weight: 700;
	color: var(--green-900);
}

.programme-options__ps {
	display: inline-block;
	padding: 0.1em 0.45em;
	background: var(--green-050);
	border: 1px solid var(--green);
	border-radius: 0.375rem;
	line-height: 1.4;
}

/* "(90 min total)" under the per-student pill on the 90-minute add-on row and
 * 90-minute option rows (Ben, 25 Oct 2026): on its own line so the column
 * stays narrow; in the phone card it stacks under the pill the same way. */
.programme-options__ps-note {
	display: block;
	margin-top: 0.15em;
	font-size: var(--step--2);
	font-weight: 600;
	color: var(--ink-soft);
}

.programme-options__add-on {
	font-weight: 400;
	color: var(--ink-soft);
}

.programme-options__badge {
	display: inline-block;
	margin-left: var(--s-1);
	padding: 0.1em 0.5em;
	border-radius: 999px;
	background: var(--orange-050);
	color: var(--orange-700);
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.4;
	vertical-align: middle;
	white-space: nowrap;
}

.programme-options__note {
	font-size: var(--step--2);
	color: var(--ink-soft);
	margin: 0 0 var(--s-2);
}

.programme-options__note p {
	margin: 0 0 var(--s-1);
}

.programme-options__note a {
	color: inherit;
	text-decoration: underline;
}

.cost-box__from {
	font-size: 0.5em;
	font-weight: 600;
	color: var(--ink-soft);
	vertical-align: middle;
}

/* ==========================================================================
 * Options box in the single-price box's design language (Ben, 25 Oct 2026:
 * "Some of the programmes don't look as good. Can we make them all look
 * good?"). The headline "From $X", GST line, green per-student highlight and
 * bracketed capacity line reuse the .cost-box__* rules in programme.css; the
 * rules below bring the table into the same type scale, colours and spacing.
 * ======================================================================== */

.cost-box--options .cost-box__per-student {
	margin-bottom: var(--s-4);
}

.cost-box--options .programme-options {
	margin: 0 0 var(--s-3);
}

/* Caption: a small section label under the highlight, like the old site's
 * "Options" heading, with a rule to separate it from the summary above. */
.cost-box--options .programme-options__caption {
	padding-top: var(--s-3);
	border-top: 1px solid #e4e2ea;
	font-size: var(--step--1);
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink);
}

.cost-box--options .programme-options thead th {
	font-size: var(--step--2);
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--ink-soft);
	border-bottom: 2px solid #e4e2ea;
}

.cost-box--options .programme-options tbody th {
	font-size: var(--step-0);
	font-weight: 700;
	color: var(--ink);
}

.cost-box--options .programme-options tbody tr:last-child th,
.cost-box--options .programme-options tbody tr:last-child td {
	border-bottom: 0;
}

/* Price: the headline treatment scaled to a table cell (bold black). */
.cost-box--options .programme-options__price {
	font-size: var(--step-0);
	font-weight: 800;
	color: var(--ink);
}

/* Most popular row: a light tint so the badge's row stands out. */
.cost-box--options .programme-options__row--popular th,
.cost-box--options .programme-options__row--popular td {
	background: var(--orange-050);
}

/* Add-ons and extra days: quieter than the options they extend. */
.cost-box--options .programme-options__row--add-on th,
.cost-box--options .programme-options__row--add-on .programme-options__price {
	font-weight: 600;
	color: var(--ink-soft);
}

.cost-box--options .programme-options__note {
	margin-bottom: var(--s-2);
}

@media (width <= 480px) {
	.programme-options th,
	.programme-options td {
		padding: var(--s-1);
	}
}

/* Narrow box (under 480px of box width: phones and small tablets; Ben, 24 Oct
 * 2026). Up to five columns (option, students, minutes, price, per student)
 * do not fit in ~250px, so each option becomes a small card: the option name
 * on its own line, then the figures side by side, each with its heading from
 * data-label. ARIA roles in the markup keep it a table for screen readers. */
@container cost-options (width < 30rem) {
	.programme-options,
	.programme-options tbody {
		display: block;
		width: 100%;
	}

	.programme-options__caption {
		display: block;
	}

	.programme-options thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.programme-options tbody tr {
		display: flex;
		flex-wrap: wrap;
		gap: var(--s-1) var(--s-4);
		padding: var(--s-2) 0;
		border-bottom: 1px solid #e4e2ea;
	}

	.programme-options tbody th,
	.programme-options tbody td {
		padding: 0;
		border: 0;
	}

	.programme-options tbody th {
		flex: 1 0 100%;
	}

	.programme-options tbody td {
		display: flex;
		flex-direction: column;
		text-align: left;
	}

	.programme-options tbody td:empty {
		display: none;
	}

	.cost-box--options .programme-options__row--popular {
		margin-inline: calc(var(--s-2) * -1);
		padding-inline: var(--s-2);
		background: var(--orange-050);
	}

	.cost-box--options .programme-options__row--popular th,
	.cost-box--options .programme-options__row--popular td {
		background: none;
	}

	.cost-box--options .programme-options tbody tr:last-child {
		border-bottom: 0;
	}

	.programme-options__ps {
		align-self: flex-start;
	}

	.programme-options tbody td::before {
		content: attr(data-label);
		font-size: var(--step--2);
		font-weight: 600;
		color: var(--ink-soft);
	}
}
