/**
 * ODP Embeds — video and document frames.
 *
 * Ratio and frame size are custom properties set on the wrapper by the markup,
 * so supporting another ratio never means adding a rule here. The old plugin
 * printed a whole generated stylesheet in the head; this file replaces it.
 */

/* ----- Shared ----- */

.odp-embed,
.odp-doc {
	box-sizing: border-box;
	max-width: 100%;
}

/* ----- Videos ----- */

.odp-embed--video {
	position: relative;
	display: block;
	width: 100%;
	max-width: var(--odp-embed-max-width, 100%);
	aspect-ratio: var(--odp-embed-ratio, 16 / 9);
	margin: 1.25em 0;
	overflow: hidden;
	background-color: #000;
}

.odp-embed--video > iframe,
.odp-embed--video > object,
.odp-embed--video > embed,
.odp-embed--video > video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	border: 0;
}

/* Engines without aspect-ratio fall back to the padding box. */
@supports not (aspect-ratio: 1 / 1) {
	.odp-embed--video {
		height: 0;
		padding-bottom: var(--odp-embed-ratio-pct, 56.25%);
	}
}

/* ----- Documents ----- */

.odp-doc {
	display: block;
	margin: 1.5em 0;
}

.odp-doc__frame {
	display: block;
	width: var(--odp-doc-width, 100%);
	max-width: 100%;
	height: var(--odp-doc-height, 500px);
	max-height: 78vh;
	border: 1px solid rgba(0, 0, 0, 0.16);
	border-radius: 4px;
	background-color: #f6f6f6;
}

.odp-doc__caption {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em 1.25em;
	margin-top: 0.6em;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.odp-doc__caption a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.odp-doc__fallback {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: from-font;
	text-underline-offset: 0.2em;
}

.odp-doc__download {
	padding: 0.5em 1em;
	border: 1px solid transparent;
	border-radius: 3px;
	background-color: #c09;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.odp-doc__download:hover,
.odp-doc__download:focus,
.odp-doc__download:active {
	background-color: #806;
	color: #fff;
	text-decoration: none;
}

.odp-doc__download:focus-visible,
.odp-doc__fallback:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.odp-doc__error {
	padding: 0.75em 1em;
	border-left: 4px solid #c09;
	background-color: rgba(204, 0, 153, 0.06);
}

@media (prefers-color-scheme: dark) {
	.odp-doc__frame {
		border-color: rgba(255, 255, 255, 0.18);
		background-color: #1f1f1f;
	}
}

@media (max-width: 782px) {
	.odp-doc__frame {
		max-height: 70vh;
	}
}
