/**
 * The programme picker.
 *
 * Fixed to the viewport, not placed after the field. Opening under the thing
 * that opened it is the mistake this site kept making, and a list this long
 * would push the rest of the form off the bottom of a phone.
 */

.pcsr-program-open {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid #d9d9e0;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	text-align: start;
	cursor: pointer;
	color: #8a8a93;
}

.pcsr-program-field.is-chosen .pcsr-program-open {
	color: inherit;
	border-color: #b48a3f;
}

.pcsr-program-open:hover {
	border-color: #b48a3f;
}

.pcsr-program-chosen {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pcsr-program-caret {
	flex: none;
	opacity: 0.55;
}

.pcsr-program-error {
	margin: 6px 0 0;
	font-size: 12px;
	color: #b3261e;
}

/* ---- The popup ---- */

body.pcsr-program-locked {
	overflow: hidden;
}

.pcsr-program-modal {
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.pcsr-program-modal[hidden] {
	display: none;
}

.pcsr-program-scrim {
	position: absolute;
	inset: 0;
	background: rgba(16, 16, 22, 0.55);
}

.pcsr-program-box {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(560px, 100%);
	max-height: min(80vh, 640px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	direction: rtl;
	text-align: right;
}

.pcsr-program-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px 12px;
	border-bottom: 1px solid #eee;
}

.pcsr-program-head h3 {
	margin: 0;
	font-size: 15px;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pcsr-program-close {
	flex: none;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: #f2f2f6;
	font-size: 19px;
	line-height: 1;
	cursor: pointer;
}

.pcsr-program-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	padding: 10px 20px;
	font-size: 12px;
	color: #77777f;
	background: #fafafc;
	border-bottom: 1px solid #eee;
}

.pcsr-program-crumb {
	border: 0;
	background: none;
	font: inherit;
	color: #b48a3f;
	cursor: pointer;
	padding: 2px 4px;
	border-radius: 5px;
}

.pcsr-program-crumb:hover {
	background: #f3e9d6;
}

.pcsr-program-body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.pcsr-program-list {
	list-style: none;
	margin: 0;
	padding: 8px;
}

.pcsr-program-item {
	display: block;
	width: 100%;
	text-align: start;
	border: 1px solid transparent;
	border-radius: 10px;
	background: none;
	font: inherit;
	padding: 11px 14px;
	cursor: pointer;
}

.pcsr-program-item:hover,
.pcsr-program-item:focus-visible {
	background: #fbf7ef;
	border-color: #e8d3a4;
}

.pcsr-program-item b {
	display: block;
	font-size: 14px;
}

.pcsr-program-more {
	display: inline-block;
	margin-top: 3px;
	font-size: 11.5px;
	color: #8a8a93;
}

.pcsr-program-desc {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	line-height: 1.9;
	color: #77777f;
}

/* A type the studio holds in no space. Shown, dimmed, with the reason —
   removing it from the list would read as something having gone wrong. */
.pcsr-program-item.is-unavailable {
	cursor: default;
	opacity: 0.55;
}

.pcsr-program-item.is-unavailable:hover,
.pcsr-program-item.is-unavailable:focus-visible {
	background: none;
	border-color: transparent;
}

.pcsr-program-nospace {
	color: #b3261e;
}

.pcsr-program-note {
	margin: 0;
	padding: 10px 20px 16px;
	font-size: 12.5px;
	color: #8a8a93;
}

.pcsr-program-foot {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	border-top: 1px solid #eee;
	background: #fafafc;
}

.pcsr-program-back {
	border: 1px solid #d9d9e0;
	border-radius: 9px;
	background: #fff;
	font: inherit;
	padding: 9px 16px;
	cursor: pointer;
}

.pcsr-program-pick {
	flex: 1;
	border: 0;
	border-radius: 9px;
	background: #b48a3f;
	color: #fff;
	font: inherit;
	font-weight: 700;
	padding: 10px 16px;
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pcsr-program-pick:hover {
	background: #a17a34;
}

@media (max-width: 600px) {
	.pcsr-program-modal {
		padding: 0;
		align-items: flex-end;
	}

	.pcsr-program-box {
		width: 100%;
		max-height: 88vh;
		border-radius: 16px 16px 0 0;
	}
}
