/* LMS Field block pieces (Course Detail design). Section layout is in style.css [course-detail]. */

.sctv-lms-field > :first-child {
	margin-top: 0;
}

.sctv-lms-field > :last-child {
	margin-bottom: 0;
}

/* Hero badges: two columns of ticked facts. */
.sctv-badge-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sctv-badge-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #fff;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
}

.sctv-badge-list__check {
	display: flex;
	flex: 0 0 26px;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	background: var(--wp--preset--color--teal);
	border-radius: 999px;
	color: var(--wp--preset--color--navy);
}

.sctv-badge-list__check svg {
	width: 15px;
	height: 15px;
}

@media (max-width: 781px) {
	.sctv-badge-list {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.sctv-badge-list li {
		font-size: 15px;
	}
}

/* Bundle hero: the LMS badges plus the editor's extra badge (a paragraph bound to sctv_badge),
   laid out as one grid. */
.sctv-badge-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 28px;
}

.sctv-badge-grid.wp-block-group > * {
	margin-block: 0;
}

.sctv-badge-grid > .sctv-lms-field,
.sctv-badge-grid .sctv-badge-list {
	display: contents;
}

/* The design puts the extra badge fifth, before "Subtitles enabled" (always the LMS list's last). */
.sctv-badge-grid .sctv-badge-list li:last-child {
	order: 1;
}

.sctv-badge-extra {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #fff;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
}

.sctv-badge-extra::before {
	content: "";
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	background: var(--wp--preset--color--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F3354' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='M5 12 L10 17 L19 7'/%3E%3C/svg%3E") center / 15px no-repeat;
	border-radius: 999px;
}

body:not(.editor-styles-wrapper) .sctv-badge-extra:empty {
	display: none;
}

@media (max-width: 781px) {
	.sctv-badge-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.sctv-badge-extra {
		font-size: 15px;
	}
}

/* Trailer: the course image with a play button that swaps in the video. */
.sctv-trailer {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--wp--preset--color--dark-navy);
}

.sctv-trailer__button {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
}

.sctv-trailer__image,
.sctv-trailer__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sctv-trailer__button::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(7, 25, 41, 0) 40%, rgba(7, 25, 41, 0.55) 100%);
}

.sctv-trailer__play {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	transform: translate(-50%, -50%);
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(7, 25, 41, 0.35);
	color: var(--wp--preset--color--navy);
}

.sctv-trailer__play svg {
	width: 40%;
	height: 40%;
}

.sctv-trailer__chip {
	position: absolute;
	left: 24px;
	bottom: 24px;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 13px 24px;
	background: var(--wp--preset--color--orange);
	border-radius: 999px;
	color: var(--wp--preset--color--navy);
	font-size: 17px;
	font-weight: 600;
}

.sctv-trailer__chip svg {
	width: 16px;
	height: 16px;
}

/* Price card: "From £x per course" and the credit note. */
.sctv-price-card__price {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	margin: 0 0 14px;
}

.sctv-price-card__value {
	font-family: var(--wp--preset--font-family--dongle);
	font-size: 61px;
	font-weight: 700;
	line-height: 0.74;
	color: var(--wp--preset--color--navy);
}

.sctv-price-card__unit {
	padding-bottom: 6px;
	font-size: 15px;
	line-height: 1.4;
	color: var(--wp--preset--color--muted);
}

.sctv-price-card__note {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

.sctv-price-card__note a {
	color: var(--wp--preset--color--link-teal);
}

/* Square-bullet lists (audience points, syllabus topics). */
.sctv-square-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sctv-square-list li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 17px;
	line-height: 1.5;
}

.sctv-square-list li::before {
	content: "";
	flex: 0 0 7px;
	width: 7px;
	height: 7px;
	margin-top: 9px;
	background: var(--wp--preset--color--teal-dark);
}

.sctv-square-list--columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 32px;
	color: var(--wp--preset--color--navy);
}

/* At a glance rows. */
.sctv-glance {
	margin: 0;
}

.sctv-glance__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	padding: 22px 28px;
}

.sctv-glance__row + .sctv-glance__row {
	border-top: 1px solid var(--wp--preset--color--border-grey);
}

.sctv-glance dt {
	font-size: 16px;
	color: var(--wp--preset--color--muted);
}

.sctv-glance dd {
	margin: 0;
	font-size: 19px;
	font-weight: 600;
	text-align: right;
	color: var(--wp--preset--color--navy);
}

/* Expert review box. */
.sctv-expert {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 28px;
	background: #fff;
	border: 2px solid var(--wp--preset--color--teal);
	border-radius: 12px;
	box-shadow: var(--wp--preset--shadow--card);
	color: var(--wp--preset--color--navy);
}

.sctv-expert p,
.sctv-expert__details > * {
	margin: 0;
}

.sctv-expert__title {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: var(--wp--preset--font-family--dongle);
	font-size: 40px;
	font-weight: 700;
	line-height: 0.8;
}

.sctv-expert__title .sctv-badge-list__check {
	flex-basis: 32px;
	width: 32px;
	height: 32px;
}

.sctv-expert__lead {
	font-size: 17px;
	line-height: 1.55;
}

.sctv-expert__details {
	padding-top: 18px;
	border-top: 1px solid var(--wp--preset--color--border-grey);
	font-size: 15px;
	line-height: 1.45;
	color: var(--wp--preset--color--muted);
}

/* The box is built from blocks: the LMS heading and details, and the expert's name and
   qualifications as paragraphs bound to their fields. Hidden when it has neither. */
.sctv-expert.wp-block-group > *,
.sctv-expert .sctv-expert__who > *,
.sctv-expert .sctv-expert__person > * {
	margin-block: 0;
}

.sctv-lms-field--approval-head {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.sctv-expert__headshot .sctv-expert__photo {
	width: 100%;
	height: 100%;
	margin: 0;
}

.sctv-expert__headshot .sctv-expert__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

body:not(.editor-styles-wrapper) .sctv-expert:not(:has(.sctv-lms-field--approval-head)),
body:not(.editor-styles-wrapper) .sctv-expert__person:has(.sctv-expert__name:empty),
body:not(.editor-styles-wrapper) .sctv-expert__quals:empty {
	display: none;
}

/* The reviewing expert: photo, name and qualifications. */
.sctv-expert__person {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-top: 18px;
	border-top: 1px solid var(--wp--preset--color--border-grey);
}

.sctv-expert__headshot {
	display: flex;
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	overflow: hidden;
	background: var(--wp--preset--color--light-grey);
	border: 1px dashed var(--wp--preset--color--muted);
	border-radius: 999px;
}

.sctv-expert__headshot:has(img) {
	border: 0;
}

.sctv-expert__headshot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sctv-expert__who {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sctv-expert__name {
	font-size: 17px;
	font-weight: 600;
}

.sctv-expert__quals {
	font-size: 15px;
	line-height: 1.45;
	color: var(--wp--preset--color--muted);
}

/* What's included: topic and module count tag, and three columns of topics (two, then one). */
.sctv-included__tag {
	display: inline-block;
	margin: 0;
	padding: 10px 16px;
	background: linear-gradient(135deg, #6f018f 0%, #af0984 55%, #e71276 100%);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
}

.sctv-included__list {
	columns: 3;
	column-gap: 64px;
	color: #fff;
}

.sctv-included__list li {
	padding: 11px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
	break-inside: avoid;
}

@media (max-width: 1023px) {
	.sctv-included__list {
		columns: 2;
		column-gap: 40px;
	}
}

@media (max-width: 781px) {
	.sctv-included__list {
		columns: 1;
	}
}

/* The course's bundle: copy beside the bundle image. */
.sctv-course-bundle {
	display: grid;
	grid-template-columns: 5fr 7fr;
	gap: 88px;
	align-items: center;
}

/* Built from blocks: the standard and its summary are a heading and paragraph bound to their
   fields, beside the LMS bundle pieces. The section is hidden until a standard is set (the LMS
   pieces render nothing without one, which hides it; see style.css). */
.sctv-course-bundle > *,
.sctv-course-bundle .sctv-course-bundle__text > * {
	margin-block: 0;
}

.sctv-course-bundle__standard::before {
	content: "Contributes to Care Certificate ";
	-webkit-text-fill-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--navy);
}

.sctv-course-bundle__standard {
	background-image: linear-gradient(135deg, #6f018f 0%, #af0984 55%, #e71276 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	caret-color: #af0984;
}

/* The tag repeats the standard as "Care Certificate Standard 10", following the heading as it
   is typed; it is read-only, and hidden while the standard is empty. */
.sctv-course-bundle__standard-tag::before {
	content: "Care Certificate ";
}

.sctv-course-bundle__standard-tag:empty,
.sctv-course-bundle__standard-tag:has([data-rich-text-placeholder]) {
	display: none;
}

/* In the editor, an empty standard shows its placeholder in grey, then the gradient once typed. */
.sctv-course-bundle__standard:has([data-rich-text-placeholder]) {
	background-image: none;
}

.sctv-course-bundle__standard [data-rich-text-placeholder]::after {
	-webkit-text-fill-color: var(--wp--preset--color--muted);
	color: var(--wp--preset--color--muted);
}

body:not(.editor-styles-wrapper) .sctv-course-bundle__summary:empty {
	display: none;
}

.sctv-course-bundle__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
}

.sctv-course-bundle__text > * {
	margin: 0;
}

.sctv-course-bundle__tag,
.sctv-course-bundle__chip {
	padding: 10px 16px;
	background: linear-gradient(135deg, #6f018f 0%, #af0984 55%, #e71276 100%);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sctv-course-bundle__heading {
	font-size: clamp(41px, 4.58vw, 66px);
	line-height: 0.78;
}

.sctv-course-bundle__copy {
	font-size: clamp(17px, 1.32vw, 19px);
	line-height: 1.6;
	color: var(--wp--preset--color--navy);
}

.sctv-course-bundle__link {
	font-size: 17px;
	font-weight: 600;
	color: var(--wp--preset--color--link-teal);
	text-decoration: none;
}

.sctv-course-bundle__link:hover {
	color: var(--wp--preset--color--dark-navy);
}

.sctv-course-bundle__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #d9dde2;
	border-radius: 12px;
	box-shadow: var(--wp--preset--shadow--floating);
}

.sctv-course-bundle__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sctv-course-bundle__chip {
	position: absolute;
	right: 20px;
	bottom: 20px;
	z-index: 1;
	display: flex;
	align-items: baseline;
	border-radius: 4.8px;
}

/* The badge: an editable label (empty uses the featured bundle's name) and the featured
   bundle's course count from the LMS, over the bundle's picture. */
.sctv-course-bundle__figure {
	position: relative;
}

.sctv-course-bundle__chip,
.sctv-course-bundle__chip > *,
.sctv-course-bundle__chip p {
	line-height: normal;
}

/* Doubled class to beat core's flow-layout gap between the label and the count. */
.sctv-course-bundle__chip.sctv-course-bundle__chip > *,
.sctv-course-bundle__chip p {
	margin: 0;
	padding: 0;
	font-size: inherit;
	white-space: nowrap;
}

@media (max-width: 781px) {
	.sctv-course-bundle__chip {
		right: 16px;
		bottom: 16px;
		padding: 8px 13px;
		font-size: 12px;
	}
}

body:not(.editor-styles-wrapper) .sctv-course-bundle__figure:not(:has(.sctv-course-bundle__media)) {
	display: none;
}

/* In the editor every block is position: relative, which pulled the badge out of the corner and
   stretched it under the picture. Keep it in the corner, sized to its text. */
.editor-styles-wrapper .sctv-course-bundle__chip.sctv-course-bundle__chip {
	position: absolute;
	right: 20px;
	bottom: 20px;
	left: auto;
	width: auto;
	max-width: calc(100% - 40px);
	margin: 0;
}

@media (max-width: 781px) {
	.editor-styles-wrapper .sctv-course-bundle__chip.sctv-course-bundle__chip {
		right: 16px;
		bottom: 16px;
		max-width: calc(100% - 32px);
	}
}

@media (max-width: 781px) {
	.sctv-course-bundle {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}

/* FAQs on the purple ground: white text and rules, questions in Dongle. */
.sctv-course-faq__accordion {
	border-top: 1px solid rgba(255, 255, 255, 0.35);
	color: #fff;
}

.sctv-course-faq__accordion .wp-block-accordion-item {
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.sctv-course-faq__accordion .wp-block-accordion-heading__toggle {
	padding: 24px 0;
	color: #fff;
}

.sctv-course-faq__accordion .wp-block-accordion-heading__toggle-title {
	font-family: var(--wp--preset--font-family--dongle);
	font-size: 34px;
	font-weight: 700;
	line-height: 0.9;
	letter-spacing: -0.01em;
}

.sctv-course-faq__accordion.sctv-bundle-accordion .wp-block-accordion-heading__toggle-icon {
	background-color: #fff;
}

.sctv-course-faq__accordion .wp-block-accordion-panel {
	padding: 0 64px 28px 0;
	font-size: 17px;
	line-height: 1.6;
}

/* Bundle About: the LMS key points as the "Who is this bundle for?" list, one per line, and the
   video (or featured image) beside the text. */
.sctv-bundle-about .sctv-lms-field--key-points .sctv-square-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: var(--wp--preset--color--navy);
}

.sctv-lms-field--about-media {
	position: relative;
	height: 100%;
	min-height: 460px;
	background: #d9dde2;
}

.sctv-about-media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 781px) {
	.sctv-lms-field--about-media {
		min-height: 0;
		aspect-ratio: 16 / 10;
	}
}

/* FAQ headings: the short name, typed on the page (a heading bound to sctv_short_name, falling
   back to the title on the site), inside the design's sentence. */
.sctv-faq-heading--course::before {
	content: "Frequently asked questions about our ";
}

.sctv-faq-heading--course::after {
	content: " training";
}

.sctv-faq-heading--bundle {
	background-image: linear-gradient(135deg, #6f018f 0%, #af0984 55%, #e71276 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	caret-color: #af0984;
}

.sctv-faq-heading--bundle::before {
	content: "Frequently asked questions about the ";
	-webkit-text-fill-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--navy);
}

.sctv-faq-heading--bundle::after {
	content: " bundle";
}

/* On the site the heading arrives written out with its own gradient mark (inc/courses.php). */
.sctv-faq-heading--bundle:has(mark) {
	background-image: none;
	-webkit-text-fill-color: currentColor;
	color: var(--wp--preset--color--navy);
}

.sctv-faq-heading--bundle mark {
	background-color: transparent;
}

.sctv-faq-heading--bundle:has(mark)::before,
.sctv-faq-heading--bundle:has(mark)::after {
	content: none;
}

.sctv-faq-heading--bundle:has([data-rich-text-placeholder]) {
	background-image: none;
}

.sctv-faq-heading [data-rich-text-placeholder]::after {
	-webkit-text-fill-color: var(--wp--preset--color--muted);
	color: var(--wp--preset--color--muted);
}

.sctv-faq-heading--course [data-rich-text-placeholder]::after {
	-webkit-text-fill-color: rgba(255, 255, 255, 0.6);
	color: rgba(255, 255, 255, 0.6);
}
