/**
 * The course preview dialog.
 *
 * Markup: inc/nvn-course-dialog.php. Enqueued only for the institute courses
 * template - see nvn_child_scripts().
 *
 * Two columns: a sticky panel that answers "should I take this?" - price,
 * length, level, who teaches it, and the enrol button - beside a scrolling
 * column that answers "what is this?".
 */

.nvn-cdlg .modal-dialog {
	max-width: min(1040px, calc(100vw - 32px));
}

.nvn-cdlg__card {
	border: 0;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 30px 70px -30px rgba(3, 54, 82, .45);
}

/* The title stays put while the description scrolls under it. */
.nvn-cdlg__bar {
	display: flex;
	align-items: center;
	gap: 16px;
	flex: 0 0 auto;
	padding: 18px 24px;
	border-bottom: 1px solid rgba(0, 113, 169, .12);
	background: linear-gradient(135deg, #eff8fd, #dceffa);
}

.nvn-cdlg__title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--primary-color, #0071A9);
}

.nvn-cdlg__close {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	margin-inline-start: auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .8);
	color: var(--primary-color, #0071A9);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .16s ease, color .16s ease;
}

.nvn-cdlg__close:hover,
.nvn-cdlg__close:focus-visible {
	background: #fff;
	color: var(--secondary-color, #2EAE49);
}

.nvn-cdlg__body {
	display: grid;
	grid-template-columns: 310px minmax(0, 1fr);
	gap: 0;
	padding: 0;
}

/* ========================================================================== *
 * Decision column
 * ========================================================================== */

.nvn-cdlg__aside {
	align-self: start;
	position: sticky;
	top: 0;
	padding: 22px 22px 26px;
	border-inline-end: 1px solid #eef3f7;
	background: #fbfdfe;
}

.nvn-cdlg__poster {
	aspect-ratio: 4 / 3;
	min-height: 0;
	margin-bottom: 18px;
	border-radius: 12px;
	overflow: hidden;
	background: #eef6fb;
}

.nvn-cdlg__poster img {
	width: 100%;
	height: 100%;
	/* `contain`: these thumbnails are designed posters, not photographs, so a
	   crop cuts through their own typography. */
	object-fit: contain;
	display: block;
}

.nvn-cdlg__price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
}

.nvn-cdlg__now {
	font-size: 26px;
	font-weight: 700;
	color: var(--primary-color, #0071A9);
}

.nvn-cdlg__now--free { color: var(--secondary-color, #2EAE49); }

.nvn-cdlg__was {
	color: #90a8b9;
	text-decoration: line-through;
}

.nvn-cdlg__off {
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(46, 174, 73, .14);
	color: var(--secondary-color, #2EAE49);
	font-size: 12px;
	font-weight: 700;
}

.nvn-cdlg__facts {
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	border-block: 1px solid #eef3f7;
}

.nvn-cdlg__fact {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 0;
	font-size: 14px;
	color: #46637a;
}

.nvn-cdlg__fact + .nvn-cdlg__fact { border-top: 1px solid #f2f7fa; }

.nvn-cdlg__fact i {
	width: 16px;
	color: var(--primary-color, #0071A9);
	text-align: center;
}

.nvn-cdlg__fact-value {
	margin-inline-start: auto;
	font-weight: 600;
	color: #22384a;
}

.nvn-cdlg__tutor { margin-bottom: 18px; }

.nvn-cdlg__tutor-label {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #8aa5b8;
}

.nvn-cdlg__tutor-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.nvn-cdlg__tutor-row img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}

.nvn-cdlg__tutor-row strong {
	display: block;
	font-size: 14px;
	color: #22384a;
}

.nvn-cdlg__tutor-row small {
	display: block;
	font-size: 12.5px;
	color: #7691a5;
}

.nvn-cdlg__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.nvn-cdlg__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 46px;
	padding-inline: 20px;
	border: 0;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: background-color .16s ease, color .16s ease;
}

.nvn-cdlg__btn--primary { background: var(--primary-color, #0071A9); color: #fff; }
.nvn-cdlg__btn--primary:hover,
.nvn-cdlg__btn--primary:focus-visible { background: #005e8d; color: #fff; }

.nvn-cdlg__btn--ghost {
	background: #fff;
	color: var(--primary-color, #0071A9);
	box-shadow: inset 0 0 0 1.5px rgba(0, 113, 169, .35);
}

.nvn-cdlg__btn--ghost:hover,
.nvn-cdlg__btn--ghost:focus-visible { background: var(--primary-color, #0071A9); color: #fff; }

.nvn-cdlg__btn:focus-visible,
.nvn-cdlg__close:focus-visible {
	outline: 2px solid var(--secondary-color, #2EAE49);
	outline-offset: 2px;
}

.nvn-cdlg__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.nvn-cdlg__tags li {
	padding: 4px 11px;
	border-radius: 999px;
	background: #eef6fb;
	color: #5b7a90;
	font-size: 12px;
}

/* ========================================================================== *
 * Reading column
 * ========================================================================== */

.nvn-cdlg__main { padding: 24px 26px 28px; }

.nvn-cdlg__section + .nvn-cdlg__section { margin-top: 26px; }

.nvn-cdlg__h {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #6b8ba1;
}

.nvn-cdlg__prose {
	color: #33475b;
	font-size: 15.5px;
	line-height: 1.8;
}

.nvn-cdlg__prose > *:first-child { margin-top: 0; }
.nvn-cdlg__prose > *:last-child { margin-bottom: 0; }
.nvn-cdlg__prose img { max-width: 100%; height: auto; border-radius: 10px; }

.nvn-cdlg__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 9px;
}

.nvn-cdlg__list li {
	position: relative;
	padding-inline-start: 26px;
	color: #33475b;
	font-size: 15px;
	line-height: 1.65;
}

.nvn-cdlg__list--check li::before {
	content: "✓";
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	font-weight: 700;
	color: var(--secondary-color, #2EAE49);
}

.nvn-cdlg__list--bullet li::before {
	content: "";
	position: absolute;
	inset-inline-start: 6px;
	top: 10px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #c3dced;
}

/* ========================================================================== *
 * One column below a tablet: decide first, then read.
 * ========================================================================== */

@media (max-width: 767.98px) {
	.nvn-cdlg__body { grid-template-columns: minmax(0, 1fr); }

	.nvn-cdlg__aside {
		position: static;
		border-inline-end: 0;
		border-bottom: 1px solid #eef3f7;
		padding: 18px 18px 22px;
	}

	.nvn-cdlg__poster { aspect-ratio: 16 / 9; }
	.nvn-cdlg__main { padding: 20px 18px 24px; }
	.nvn-cdlg__title { font-size: 17px; }
	.nvn-cdlg__bar { padding: 14px 16px; }
}
