/* ── Design tokens ───────────────────────────────────────────── */
.vimeo-embed {
	--_radius: 32px;
	--_dur: 0.4s;
	--_ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
	--_overlay-idle: rgba(0, 0, 0, 0.4);
	--_overlay-hover: rgba(0, 0, 0, 0.1);
	--_overlay-active: rgba(0, 0, 0, 0.38);
	--_poster-scale: 1.07;
	position: relative;
	container-type: inline-size;
}

/* ── Consent notice overlay ──────────────────────────────────── */
.vimeo-embed__consent {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	border-radius: var(--_radius);
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.vimeo-embed__consent-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	text-align: center;
	color: #fff;
	max-width: 32ch;
}

.vimeo-embed__consent-icon {
	font-size: clamp(20px, 7cqi, 36px);
	opacity: 0.85;
}

.vimeo-embed__consent-text {
	margin: 0;
	font-size: clamp(12px, 3cqi, 15px);
	line-height: 1.45;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.vimeo-embed__consent-btn {
	all: unset;
	cursor: pointer;
	background: #fff;
	color: #000;
	font-size: clamp(11px, 2.8cqi, 14px);
	font-weight: 600;
	padding: 0.55em 1.4em;
	border-radius: 999px;
	margin-top: 0.25rem;
	transition: opacity 0.2s;
	white-space: nowrap;
}

.vimeo-embed__consent-btn:hover {
	opacity: 0.8;
}

.vimeo-embed__consent-btn:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.9);
	outline-offset: 3px;
}

/* Disable play button interaction while blocked */
.vimeo-embed[data-state="blocked"] .vimeo-embed__button {
	pointer-events: none;
}

/* ── Button wrapper ──────────────────────────────────────────── */
.vimeo-embed__button {
	all: unset;
	cursor: pointer;
	display: block;
	width: 100%;
	border-radius: var(--_radius);
	aspect-ratio: inherit;
	position: relative;
	container-type: inline-size;
	overflow: clip;
	background-size: cover;
}

/* Darkening overlay */
.vimeo-embed__button::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--_overlay-idle);
	z-index: 2;
	transition: background var(--_dur) var(--_ease);
}

/* Poster image — .vimeo-embed prefix raises specificity to (0,2,0),
   beating the global img[loading=lazy] rule at (0,1,1) */
.vimeo-embed .vimeo-embed__poster {
	display: block;
	position: relative;
	z-index: 1;
	width: 100%;
	height: auto;
	border-radius: var(--_radius);
	aspect-ratio: inherit;
	object-fit: cover;
	backface-visibility: hidden;
	transform: translateZ(0);
	transition:
		transform var(--_dur) var(--_ease),
		opacity 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* SVG play icon */
.vimeo-embed__button svg {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: block;
	fill: #fff;
	z-index: 4;
}

/* iframe (shown after click) */
.vimeo-embed iframe {
	display: block;
	width: 100%;
	border: none;
	border-radius: var(--_radius);
	aspect-ratio: inherit;
	overflow: clip;
}

/* Video title */
.vimeo-embed__label {
	position: absolute;
	top: 0;
	left: 0;
	padding: 16px;
	font-size: clamp(14px, 3cqi, 20px);
	text-align: left;
	color: #fff;
	z-index: 3;
	text-shadow: 0 0 1em #000;
	hyphens: auto;
	hyphenate-limit-chars: auto 5;
	transition: transform var(--_dur) var(--_ease);
}

/* Duration badge */
.vimeo-embed__duration {
	position: absolute;
	bottom: 16px;
	right: 16px;
	font-size: clamp(14px, 3cqi, 16px);
	text-align: right;
	color: #fff;
	background: rgba(0, 0, 0, 0.75);
	padding: 0.2em 0.5em;
	border-radius: 8px;
	z-index: 3;
	transition: transform var(--_dur) var(--_ease);
}

/* Centered play icon */
.vimeo-embed__icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(1);
	font-size: clamp(14px, 15cqi, 72px);
	z-index: 4;
	color: #fff;
	text-shadow: 0 0 1em #000;
	transition: transform var(--_dur) var(--_ease);
}

/* ── :hover + :focus-visible ─────────────────────────────────── */

.vimeo-embed__button:is(:hover, :focus-visible)::before {
	background: var(--_overlay-hover);
}

.vimeo-embed__button:is(:hover, :focus-visible) .vimeo-embed__poster {
	transform: scale(var(--_poster-scale)) translateZ(0);
}

.vimeo-embed__button:is(:hover, :focus-visible) .vimeo-embed__icon {
	transform: translate(-50%, -50%) scale(1.2);
}

.vimeo-embed__button:is(:hover, :focus-visible) .vimeo-embed__label {
	transform: translateY(calc(-100%));
}

.vimeo-embed__button:is(:hover, :focus-visible) .vimeo-embed__duration {
	transform: translateY(calc(100% + 18px));
}

/* Keyboard-only focus ring */
.vimeo-embed__button:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.9);
	outline-offset: 4px;
}

/* ── :active (press feedback) ────────────────────────────────── */
.vimeo-embed__button:active {
	transform: scale(0.97);
	transition-duration: 0.1s;
}

.vimeo-embed__button:active::before {
	background: var(--_overlay-active);
	transition-duration: 0.1s;
}

.vimeo-embed__button:active .vimeo-embed__icon {
	transform: translate(-50%, -50%) scale(1.05);
	transition-duration: 0.1s;
}

/* ── Lightbox ────────────────────────────────────────────────── */
.vimeo-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.vimeo-lightbox.is-open {
	opacity: 1;
}

.vimeo-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.vimeo-lightbox__container {
	position: relative;
	z-index: 1;
	width: min(92vw, 1280px);
	transform: scale(0.94);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vimeo-lightbox.is-open .vimeo-lightbox__container {
	transform: scale(1);
}

.vimeo-lightbox__close {
	all: unset;
	cursor: pointer;
	position: absolute;
	top: -2.75rem;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	color: #fff;
	font-size: 1.25rem;
	opacity: 0.75;
	transition: opacity 0.2s, transform 0.2s;
}

.vimeo-lightbox__close:hover {
	opacity: 1;
	transform: scale(1.15);
}

.vimeo-lightbox__close:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: 4px;
	border-radius: 4px;
}

.vimeo-lightbox__wrap {
	width: 100%;
	border-radius: 16px;
	overflow: hidden;
	position: relative;
}

.vimeo-lightbox__wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.vimeo-embed__button,
	.vimeo-embed__button::before,
	.vimeo-embed__poster,
	.vimeo-embed__label,
	.vimeo-embed__duration,
	.vimeo-embed__icon {
		transition: none;
	}

	.vimeo-embed__button:is(:hover, :focus-visible) .vimeo-embed__poster,
	.vimeo-embed__button:active {
		transform: none;
	}
}
