/* Click-to-load videos (inc/video-facade.php, assets/video-facade.js): a paper tile with the poster and an ink play
   circle (the homepage's circle controls, larger), red on hover where a pointer can hover, a short note on where the
   video plays from. The player replaces the circle in the same box, so nothing moves when it loads. */
.gsf-video {
	min-width: 0;
	max-width: 100%;
}

.gsf-video__frame {
	position: relative;
	width: 100%;
	aspect-ratio: var(--gsf-video-ratio, 16 / 9);
	overflow: hidden;
	background: var(--wp--preset--color--surface, #f3f4f4);
}

/* Page styles size figure images by their own ratio (editorial-pages.css); the poster always fills the box.
   !important keeps it so whatever page (and its figure rules) the video is placed on. */
.gsf-video__frame > .gsf-video__poster,
.gsf-video__frame > .gsf-video__player {
	position: absolute !important;
	inset: 0;
	display: block;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	max-height: none !important;
	margin: 0;
	aspect-ratio: auto !important;
	border: 0;
	object-fit: cover;
}

.gsf-video__frame > .gsf-video__player {
	z-index: 1;
	background: #000;
}

.gsf-video__play {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--ink, #111);
	font: inherit;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.gsf-video__disc {
	display: grid;
	width: 72px;
	height: 72px;
	place-items: center;
	border: 1px solid var(--wp--preset--color--ink, #111);
	border-radius: 50%;
	background: var(--wp--preset--color--paper, #fff);
	color: var(--wp--preset--color--ink, #111);
	box-shadow: 0 0 0 4px rgb(255 255 255 / .55);
	transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.gsf-video__disc svg {
	width: 26px;
	height: 26px;
	margin-left: 3px; /* Optical centre of the triangle. */
	fill: currentColor;
}

/* The accessible name ("Play video: <title>"), read out but not shown. */
.gsf-video__label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Without JavaScript the control is a link to YouTube/Vimeo: say so visibly. */
.gsf-video__external {
	padding: 4px 10px;
	background: var(--wp--preset--color--paper, #fff);
	color: var(--wp--preset--color--ink, #111);
	font-size: 14px;
	line-height: 1.3;
}

@media (hover: hover) {
	.gsf-video__play:hover .gsf-video__disc {
		border-color: var(--gsf-accent, #D90912);
		background: var(--gsf-accent, #D90912);
		color: var(--wp--preset--color--paper, #fff);
		transform: scale(1.04);
	}
}

.gsf-video__play:active .gsf-video__disc {
	border-color: var(--gsf-accent, #D90912);
	background: var(--gsf-accent, #D90912);
	color: var(--wp--preset--color--paper, #fff);
}

/* The site's 2px ink keyboard ring, drawn inside the tile (the frame clips anything outside); the circle fills
   black. Specific enough to override the site-wide ring in components.css. */
:is(body.gsf-theme, .editor-styles-wrapper) .gsf-video .gsf-video__play:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink, #111);
	outline-offset: -2px;
	box-shadow: inset 0 0 0 4px var(--wp--preset--color--paper, #fff);
}

.gsf-video__play:focus-visible .gsf-video__disc {
	background: var(--wp--preset--color--ink, #111);
	color: var(--wp--preset--color--paper, #fff);
}

:is(body.gsf-theme, .editor-styles-wrapper) .gsf-video .gsf-video__note {
	max-width: none;
	margin: 8px 0 0;
	color: var(--wp--preset--color--muted, #595959);
	font-size: 13px;
	line-height: 1.45;
}

.gsf-video .gsf-video__note a {
	color: inherit;
}

@media (max-width: 600px) {
	.gsf-video__disc {
		width: 60px;
		height: 60px;
	}

	.gsf-video__disc svg {
		width: 22px;
		height: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gsf-video__disc {
		transition: none;
	}

	.gsf-video__play:hover .gsf-video__disc {
		transform: none;
	}
}
