/*
 * DMF Media Frontend
 */

.dmf-media-single{

	width:100%;

}

.dmf-media-grid{

	display:grid;

	grid-template-columns:
		repeat(auto-fit,minmax(320px,1fr));

	gap:1.5rem;

}

.dmf-video-card {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	background: #000;
}

.dmf-video-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.dmf-video-thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.dmf-video-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}

.dmf-video-link:hover img {

	transform: scale(1.02);

}

.dmf-video-overlay {
	position: absolute;
	inset: 0;
	padding: 1rem;
	transition: background .3s ease;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, .72) 0%,
		rgba(0, 0, 0, .38) 32%,
		transparent 68%
	);
}

.dmf-video-link:hover .dmf-video-overlay {

	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, .78) 0%,
		rgba(0, 0, 0, .42) 32%,
		transparent 68%
	);
}

.dmf-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .38);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, .36);
	color: #fff;
	transition: transform .25s ease, background .25s ease, border-color .25s ease;
}

.dmf-video-play svg {
	width: 20px;
	height: 20px;
	display: block;
}

.dmf-video-link:hover .dmf-video-play {
	transform:
		translate(-50%, -50%)
		scale(1.04);
	background: rgba(0, 0, 0, .5);
	border-color: rgba(255, 255, 255, .5);
}

.dmf-video-title {
	margin: 0;
	color: #fff;
	font-size: 1rem;
	line-height: 1.35;
	font-weight: 600;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

/* ===========================
   MODAL
=========================== */

.dmf-video-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dmf-video-modal[hidden] {
	display: none;
}

.dmf-video-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.85);
}

.dmf-video-modal__dialog {

	position: relative;

	z-index: 2;

	width: min(1100px, 90vw);

	aspect-ratio: 16 / 9;

	background: #000;

	border-radius: 12px;

	overflow: visible;

	box-shadow: 0 20px 80px rgba(0,0,0,.45);

}

.dmf-video-player {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: #fff;
}

.dmf-video-player iframe {
	width: 100%;
	height: 100%;
	border: 0;
	transition: opacity .2s ease;
}

.dmf-video-player--loading iframe {
	opacity: 0;
}

.dmf-video-player__status,
.dmf-video-player--error {
	font-size: .95rem;
	text-align: center;
}

.dmf-video-player__status {
	position: absolute;
	display: grid;
	justify-items: center;
	gap: .75rem;
}

.dmf-video-player__spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(255, 255, 255, .28);
	border-top-color: #fff;
	border-radius: 50%;
	animation: dmf-video-spinner .8s linear infinite;
}

.dmf-video-player--error {
	align-content: center;
	gap: 1rem;
	padding: 1.5rem;
}

.dmf-video-player--error p {
	margin: 0;
}

.dmf-video-player__close-error {
	padding: .6rem 1rem;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 4px;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

@keyframes dmf-video-spinner {
	to {
		transform: rotate(360deg);
	}
}

.dmf-video-modal__close {

	position: absolute;

	top: -38px;

	right: 0;

	padding: 0;

	margin: 0;

	background: transparent;

	border: none;

	color: #fff;

	font-size: 2rem;

	font-weight: 700;

	line-height: 1;

	cursor: pointer;

	transition: opacity .2s ease,
				transform .2s ease;

}

.dmf-video-modal__close:hover {

	opacity: .75;

	transform: scale(1.1);

}

body.dmf-modal-open {
	overflow:hidden;
}

@media (max-width:768px){
	.dmf-video-modal__dialog{
		width:95vw;
	}

}
