/**
 * {CODICTS} Video Player - frontend styles.
 *
 * Modern, responsive, no library dependency. The player lives in an
 * aspect-ratio frame so embeds and self-hosted files scale cleanly on every
 * screen without padding-hack markup.
 */

.codicts-vp {
	display: block;
	width: 100%;
	margin: 0;
	max-width: 100%;
}

/* The responsive frame: keeps a fixed ratio for iframes and self-hosted video. */
.codicts-vp .cvp-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
	line-height: 0;
}

.codicts-vp .cvp-frame > iframe,
.codicts-vp .cvp-frame > .cvp-embed,
.codicts-vp .cvp-frame > .cvp-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Self-hosted video: keep the whole frame, don't distort. */
.codicts-vp .cvp-frame > .cvp-video {
	object-fit: contain;
	background: #000;
}

/* Legacy template="fill" - crop to cover the frame instead of letterboxing. */
.codicts-vp.cvp--cover .cvp-frame > .cvp-video {
	object-fit: cover;
}

/* Alignment helpers (shortcode). Elementor drives these via selectors too. */
.codicts-vp.cvp--align-center {
	margin-left: auto;
	margin-right: auto;
}
.codicts-vp.cvp--align-left {
	margin-left: 0;
	margin-right: auto;
}
.codicts-vp.cvp--align-right {
	margin-left: auto;
	margin-right: 0;
}

/* Native platform embeds (TikTok / Instagram / generic oEmbed) size themselves. */
.codicts-vp.cvp--tiktok .cvp-frame,
.codicts-vp.cvp--instagram .cvp-frame,
.codicts-vp.cvp--oembed .cvp-frame {
	position: static;
	aspect-ratio: auto;
	height: auto;
	background: transparent;
	line-height: normal;
	display: flex;
	justify-content: center;
}
.codicts-vp.cvp--tiktok .cvp-frame > *,
.codicts-vp.cvp--instagram .cvp-frame > *,
.codicts-vp.cvp--oembed .cvp-frame > * {
	position: static;
	width: 100%;
	height: auto;
}

/* Editor / fallback notices. */
.codicts-vp--notice {
	padding: 16px;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 6px;
	color: #50575e;
	background: rgba(0, 0, 0, 0.02);
	font-size: 14px;
}
.codicts-vp--link a {
	word-break: break-all;
}
