/* ==========================================================================
   Student testimonials (WO-55, 2026-09-30)
   Quote + round portrait per student, and a link strip for a video testimonial.
   Markup is core blocks with classes, so the coordinator can duplicate a
   testimonial in the editor:
     Group .clb-testimonials
       Heading .clb-testimonials__title
       Group .clb-testimonial            (repeat per student)
         Quote .clb-testimonial__quote
         Row   .clb-testimonial__person  > Image .clb-testimonial__photo + Paragraph .clb-testimonial__name
       Group .clb-video-strip            (a video testimonial)
         Image .clb-video-strip__thumb
         Group .clb-video-strip__text    > Paragraphs __eyebrow, __hook (holds the link), __who
   ========================================================================== */

.clb-testimonials {
	--clb-t-navy: var(--wp--preset--color--navy, #13294b);
	--clb-t-magenta: var(--wp--preset--color--magenta, #830065);
	--clb-t-ink: #181a1b;
	--clb-t-soft: #4a4f57;
	--clb-t-line: #dcdde2;
	--clb-t-on-dark: #ffffff;
	--clb-t-on-dark-soft: #b9d9f0;
	--clb-t-measure: 38rem;
}

/* Flow groups get an inner container on this classic theme (not in the editor),
   so each stacking rule targets the group and its inner container. */
.clb-testimonials,
.clb-testimonials > .wp-block-group__inner-container {
	display: flex;
	flex-direction: column;
	gap: 2.25rem;
}

:is(.clb-testimonials, .clb-testimonials > .wp-block-group__inner-container) > * {
	margin-block: 0;
	max-width: var(--clb-t-measure);
}

:is(.entry-content, .editor-styles-wrapper) .clb-testimonials__title {
	margin: 0;
	color: var(--clb-t-navy);
}

/* One testimonial */
.clb-testimonial,
.clb-testimonial > .wp-block-group__inner-container {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

:is(.clb-testimonial, .clb-testimonial > .wp-block-group__inner-container) > * {
	margin-block: 0;
}

.clb-testimonial + .clb-testimonial {
	padding-top: 2.25rem;
	border-top: 1px solid var(--clb-t-line);
}

:is(.entry-content, .editor-styles-wrapper) .clb-testimonial__quote {
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--clb-t-ink);
	font-style: normal;
}

:is(.entry-content, .editor-styles-wrapper) .clb-testimonial__quote p {
	margin: 0;
	font-family: var(--yak-secondary-font, "Bitter", Georgia, serif);
	font-size: clamp(1rem, 0.95rem + 0.3vw, 1.12rem);
	line-height: 1.65;
}

.clb-testimonial__person {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.85rem;
}

:is(.entry-content, .editor-styles-wrapper) .clb-testimonial__photo {
	flex: none;
	width: 64px;
	height: 64px;
	margin: 0;
	overflow: hidden;
	border-radius: 50%;
}

/* Beats core's .wp-block-image img { height: auto }, which prints after this sheet */
:is(.entry-content, .editor-styles-wrapper) .clb-testimonial__photo img {
	display: block;
	width: 64px;
	height: 64px;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	object-fit: cover;
	object-position: 50% 25%;
}

:is(.entry-content, .editor-styles-wrapper) .clb-testimonial__name {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--clb-t-soft);
}

.clb-testimonial__name strong {
	font-family: var(--yak-secondary-font, "Bitter", Georgia, serif);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--clb-t-navy);
}

/* Video strip: the whole card is one link (stretched from the hook line) */
.clb-video-strip {
	position: relative;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0;
	overflow: hidden;
	border-radius: 6px;
	background: var(--clb-t-navy);
	color: var(--clb-t-on-dark);
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__thumb {
	position: relative;
	flex: 0 0 124px;
	margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	object-position: 50% 15%;
	border-radius: 0;
}

/* Play button, drawn so the editor never has to manage it */
.clb-video-strip__thumb::after {
	content: "";
	position: absolute;
	left: 0.6rem;
	bottom: 0.6rem;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--clb-t-magenta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 5.5v13l10.5-6.5z' fill='%23fff'/%3E%3C/svg%3E") center / 1.1rem no-repeat;
}

.clb-video-strip__text,
.clb-video-strip__text > .wp-block-group__inner-container {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.35rem;
	min-width: 0;
}

.clb-video-strip__text {
	flex: 1;
	padding: 1.1rem 1.4rem;
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__text p {
	margin: 0;
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__eyebrow {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--clb-t-on-dark-soft);
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__hook {
	font-family: var(--yak-secondary-font, "Bitter", Georgia, serif);
	font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem);
	font-style: italic;
	font-weight: 500;
	line-height: 1.25;
	text-wrap: balance;
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__hook a,
:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__hook a:visited {
	color: var(--clb-t-on-dark);
	text-decoration: none;
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__hook a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__hook a:hover,
:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__hook a:focus-visible {
	color: var(--clb-t-on-dark);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 5px;
	outline: none;
}

.clb-video-strip:has(a:focus-visible) {
	outline: 3px solid var(--wp--preset--color--carolina-blue, #4b9cd3);
	outline-offset: 3px;
}

:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__who {
	font-size: 0.88rem;
	color: var(--clb-t-on-dark-soft);
}

.clb-video-strip__who strong {
	font-weight: 600;
	color: var(--clb-t-on-dark);
}

@media (max-width: 480px) {
	:is(.entry-content, .editor-styles-wrapper) .clb-video-strip__thumb {
		flex-basis: 96px;
	}

	.clb-video-strip__text {
		padding: 0.9rem 1rem;
	}
}

/* Lightbox opened by js/bsw-testimonials.js (without JS the link opens YouTube) */
.clb-video-dialog {
	width: min(420px, 92vw, calc(85vh * 9 / 16));
	max-width: none;
	margin: auto; /* the theme's reset zeroes the UA margin that centres a modal */
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.clb-video-dialog::backdrop {
	background: rgb(0 0 0 / 0.82);
}

.clb-video-dialog__frame {
	aspect-ratio: 9 / 16;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
}

.clb-video-dialog__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.clb-video-dialog__close {
	display: block;
	margin: 0 0 0.5rem auto;
	padding: 0.35rem 0.8rem;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: var(--wp--preset--color--navy, #13294b);
	font: 600 0.85rem/1.2 var(--yak-primary-font, sans-serif);
	cursor: pointer;
}

.clb-video-dialog__close:focus-visible {
	outline: 3px solid var(--wp--preset--color--carolina-blue, #4b9cd3);
	outline-offset: 2px;
}
