/**
 * Lovecraft Modernized Komoot Optimizer
 *
 * Provider-hosted preview facade and interactive iframe styles.
 */

.lmko-embed {
	position: relative;
	width: 100%;
	height: min(var(--lmko-embed-height, 580px), 72vh);
	min-height: 360px;
	overflow: hidden;
	background: #e8ece7;
	color: #fff;
	isolation: isolate;
}

.lmko-embed__preview,
.lmko-embed__iframe {
	display: block;
	width: 100% !important;
	height: 100% !important;
	margin: 0;
	border: 0;
}

.lmko-embed__preview {
	position: relative;
}

.lmko-embed__image {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.lmko-embed__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgb(0 0 0 / 28%) 0%,
		rgb(0 0 0 / 4%) 38%,
		rgb(0 0 0 / 58%) 100%
	);
	pointer-events: none;
}

.lmko-embed__content {
	position: absolute;
	inset: 50% auto auto 50%;
	display: flex;
	width: min(88%, 36rem);
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	text-align: center;
	transform: translate(-50%, -50%);
}

.lmko-embed__title {
	color: #fff;
	font-size: clamp(1.1rem, 2.6vw, 1.65rem);
	font-weight: 700;
	line-height: 1.3;
	text-shadow: 0 2px 10px rgb(0 0 0 / 72%);
}

button.lmko-embed__activate {
	display: inline-flex;
	min-height: 3rem;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0.75rem 1.25rem;
	border: 2px solid #fff;
	border-radius: 0.25rem;
	background: #54822e;
	box-shadow: 0 4px 18px rgb(0 0 0 / 30%);
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	transition:
		background-color 160ms ease,
		border-color 160ms ease,
		transform 160ms ease;
}

button.lmko-embed__activate[hidden] {
	display: none;
}

button.lmko-embed__activate:hover {
	border-color: #fff;
	background: #416d21;
	transform: translateY(-1px);
}

button.lmko-embed__activate:focus-visible,
.lmko-embed__link:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

button.lmko-embed__activate:disabled {
	cursor: wait;
	opacity: 0.82;
}

.lmko-embed__link {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	padding: 0.45rem 0.7rem;
	border-radius: 0.2rem;
	background: rgb(0 0 0 / 72%);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.lmko-embed__link:hover {
	background: #000;
	color: #fff;
	text-decoration: underline;
}

.lmko-embed[aria-busy="true"] {
	cursor: progress;
}

@media (max-width: 600px) {
	.lmko-embed {
		min-height: 320px;
	}

	.lmko-embed__content {
		gap: 0.75rem;
	}

	button.lmko-embed__activate {
		max-width: 90%;
	}
}

@media (prefers-reduced-motion: reduce) {
	button.lmko-embed__activate {
		transition: none;
	}
}
