/* KA Video – public styles. Scoped under .kav-video. Values follow the KA Photo Gallery 1.0.4 concert
   viewer (.kapg-viewer): translucent rgba(127,127,127,.08) wash, no outer rule, 3px radius, 14px padding,
   a 2px frame in the text colour around the media, and the theme's own text colour (Noisa skin-type
   rules below), so the video and photo elements read as one system on light and dark pages. */
.kav-video {
	--kav-rule: rgba(127,127,127,.28);
	--kav-accent: #e82561;
	--kav-ratio: 16 / 9;
	box-sizing: border-box;
	container-type: inline-size;
	margin: 0 0 32px;
	max-width: 100%;
	padding: 14px;
	color: inherit;
	background: rgba(127,127,127,.08);
	border: 0;
	border-radius: 3px;
	line-height: 1.5;
	font-family: inherit;
	letter-spacing: inherit;
}
.kav-video *, .kav-video *::before, .kav-video *::after { box-sizing: border-box; }

/* Responsive 16:9 stage; the player fills it and never overflows the column. */
.kav-video .kav-stage {
	position: relative;
	width: 100%;
	aspect-ratio: var(--kav-ratio);
	overflow: hidden;
	margin: 0;
	background: #000;
	border: 2px solid currentColor;
	border-radius: 3px;
}
@supports not (aspect-ratio: 1 / 1) {
	.kav-video .kav-stage { height: 0; padding-bottom: 56.25%; }
}
.kav-video .kav-embed {
	position: absolute;
	top: 0; left: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #000;
}
.kav-video video.kav-embed { object-fit: contain; }
.kav-video .kav-linkbox {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	text-align: center;
	color: #fff;
}
#ajax-content .kav-video .kav-link,
.kav-video .kav-link { color: #fff !important; text-decoration: underline; text-underline-offset: 2px; font-size: 15px; }
.kav-video .kav-link:hover { color: var(--kav-accent) !important; }

/* Source buttons: compact, centred, as wide as their label (never stretched), styled like the
   Photo Gallery's Details button. They wrap only when they cannot fit on one line. */
.kav-video .kav-sources {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 10px 0 0;
}
.kav-video .kav-src {
	flex: 0 0 auto;
	display: inline-block;
	width: auto;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	padding: 4px 12px;
	font: inherit;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: .08em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: inherit;
	background: transparent;
	border: 1px solid var(--kav-rule);
	border-radius: 3px;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .15s linear, background-color .15s linear;
}
.kav-video .kav-src:hover { color: inherit; background: transparent; border-color: var(--kav-accent); }
/* Selected: accent border plus heavier weight and an underline bar, so it is not shown by colour alone. */
.kav-video .kav-src[aria-pressed="true"],
.kav-video .kav-src[aria-pressed="true"]:hover {
	color: inherit;
	background: rgba(127,127,127,.12);
	border-color: var(--kav-accent);
	font-weight: 700;
	box-shadow: inset 0 -2px 0 var(--kav-accent);
	cursor: default;
}
.kav-video .kav-src:disabled { opacity: .45; cursor: not-allowed; border-color: var(--kav-rule); }
.kav-video :focus-visible { outline: 2px solid var(--kav-accent); outline-offset: 2px; }
.kav-video .kav-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Narrow columns: tighter padding and smaller labels keep the buttons on one line where possible. */
@container (max-width: 480px) {
	.kav-video .kav-sources { gap: 4px; padding-top: 8px; }
	.kav-video .kav-src { padding: 3px 8px; font-size: 12px; letter-spacing: .05em; }
}
@container (max-width: 360px) {
	.kav-video .kav-sources { gap: 3px; }
	.kav-video .kav-src { padding: 2px 5px; font-size: 11px; letter-spacing: 0; }
}
@media (max-width: 767px) {
	.kav-video { padding: 8px; }
}

/* ---------- Noisa skin text colour (same rules as KA Photo Gallery) ----------
   Noisa marks each page's text treatment on div.skin-type[skin-type="light-fonts|dark-fonts"] inside
   #ajax-content. It is part of the content the AJAX loader swaps, so colours follow each page. */
.skin-type[skin-type="light-fonts"] .kav-video { color: #fff; --kav-rule: rgba(255,255,255,.35); }
.skin-type[skin-type="dark-fonts"] .kav-video { color: #000; --kav-rule: rgba(0,0,0,.3); }
#ajax-content .skin-type[skin-type] .kav-video .kav-src,
.skin-type[skin-type] .kav-video .kav-src { color: inherit; }
.skin-type[skin-type] .kav-video :focus-visible { outline: 2px solid var(--kav-accent); outline-offset: 2px; box-shadow: 0 0 0 4px currentColor; }

@media (prefers-reduced-motion: reduce) {
	.kav-video * { transition: none !important; }
}
