/**
 * Care that helps — homepage video section
 * Bright Horizons Psychiatry
 */

.bhp-care {
	position: relative;
	padding-top: var(--bhp-section-y);
	padding-bottom: var(--bhp-section-y);
	background:
		radial-gradient(ellipse 70% 80% at 100% 0%, rgba(75, 190, 221, 0.08), transparent 55%),
		linear-gradient(180deg, var(--bhp-surface) 0%, var(--bhp-surface-soft) 100%);
}

.bhp-care__inner {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: clamp(1.75rem, 4vw, 2.75rem);
}

.bhp-care__copy {
	max-width: 40rem;
	margin-inline: auto;
	text-align: center;
}

.bhp-care__title {
	margin: 0 0 var(--bhp-space-5);
	font-size: clamp(1.85rem, 3.4vw, 2.65rem);
	font-weight: var(--bhp-fw-bold);
	line-height: var(--bhp-lh-tight);
	letter-spacing: var(--bhp-ls-tight);
	color: var(--bhp-ink);
	text-wrap: balance;
}

.bhp-care__text {
	margin: 0 auto var(--bhp-space-8);
	max-width: 36rem;
	font-size: var(--bhp-fs-body-lg);
	font-weight: var(--bhp-fw-medium);
	line-height: var(--bhp-lh-relaxed);
	letter-spacing: var(--bhp-ls-tight);
	color: var(--bhp-ink-muted);
}

.bhp-care__cta {
	border-radius: var(--bhp-btn-radius);
}

/* ——— Video container ——— */
.bhp-care__media {
	width: 100%;
	min-width: 0;
}

.bhp-care__video-btn {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--bhp-btn-radius);
	overflow: hidden;
	cursor: pointer;
	background: var(--bhp-midnight);
	box-shadow: var(--bhp-shadow-lg);
	aspect-ratio: 16 / 10;
	isolation: isolate;
	transition: transform var(--bhp-transition), box-shadow var(--bhp-transition);
}

.bhp-care__video-btn:hover,
.bhp-care__video-btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 20px 48px rgba(0, 17, 30, 0.18);
}

.bhp-care__video-btn:focus-visible {
	outline: 2px solid var(--bhp-primary);
	outline-offset: 3px;
}

.bhp-care__video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.bhp-care__video-btn::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 45%, rgba(0, 17, 30, 0.45) 100%);
	pointer-events: none;
	z-index: 1;
}

.bhp-care__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4.25rem;
	height: 4.25rem;
	border-radius: var(--bhp-radius-full);
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 0;
	color: var(--bhp-white);
	font-size: 1.15rem;
	transform: translate(-50%, -50%);
	box-shadow: 0 10px 28px rgba(0, 17, 30, 0.18);
	transition:
		transform var(--bhp-transition),
		background-color var(--bhp-transition);
}

.bhp-care__play i {
	margin-left: 0.15rem;
}

.bhp-care__video-btn:hover .bhp-care__play,
.bhp-care__video-btn:focus-visible .bhp-care__play {
	transform: translate(-50%, -50%) scale(1.06);
	background: rgba(255, 255, 255, 0.18);
}

/* ——— Fullscreen overlay ——— */
.bhp-video-overlay {
	position: fixed;
	inset: 0;
	z-index: var(--bhp-z-modal);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(1rem, 4vw, 2.5rem);
	background: rgba(0, 17, 30, 0.72);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity var(--bhp-duration-slow) var(--bhp-ease-out),
		visibility var(--bhp-duration-slow) var(--bhp-ease-out);
}

.bhp-video-overlay.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.bhp-video-overlay[hidden] {
	display: none !important;
}

.bhp-video-overlay.is-open:not([hidden]) {
	display: flex;
}

.bhp-video-overlay__frame {
	width: min(100%, 72rem);
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: var(--bhp-btn-radius);
	overflow: hidden;
	isolation: isolate;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
	transform: scale(0.96);
	transition: transform var(--bhp-duration-slow) var(--bhp-ease-out);
}

.bhp-video-overlay.is-open .bhp-video-overlay__frame {
	transform: scale(1);
}

/* video-player must keep display:contents (Video.js provider). */
.bhp-video-overlay__frame video-skin {
	/* Override Video.js default 32px skin radius */
	--media-border-radius: var(--bhp-btn-radius);
	--media-video-border-radius: var(--bhp-btn-radius);
	display: block;
	width: 100%;
	height: 100%;
	min-height: 0;
	border-radius: inherit;
	overflow: hidden;
	background: #000;
}

.bhp-video-overlay__frame video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: inherit;
	background: #000;
}

.bhp-video-overlay__close {
	position: absolute;
	top: clamp(0.85rem, 3vw, 1.5rem);
	right: clamp(0.85rem, 3vw, 1.5rem);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: var(--bhp-radius-full);
	background: rgba(255, 255, 255, 0.12);
	color: var(--bhp-white);
	font-size: 1.15rem;
	cursor: pointer;
	transition: background-color var(--bhp-transition);
}

.bhp-video-overlay__close:hover,
.bhp-video-overlay__close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	outline: none;
}

.bhp-video-overlay__close:focus-visible {
	outline: 2px solid var(--bhp-white);
	outline-offset: 2px;
}

body.bhp-video-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.bhp-care__video-btn,
	.bhp-care__play,
	.bhp-video-overlay,
	.bhp-video-overlay__frame {
		transition: none;
	}

	.bhp-care__video-btn:hover,
	.bhp-care__video-btn:focus-visible {
		transform: none;
	}

	.bhp-care__video-btn:hover .bhp-care__play,
	.bhp-care__video-btn:focus-visible .bhp-care__play {
		transform: translate(-50%, -50%);
	}

	.bhp-video-overlay.is-open .bhp-video-overlay__frame {
		transform: none;
	}
}
