/**
 * Course copy-protection styles (Phase 1): image guard, toast, one-time notice,
 * and a print block. Loaded in Sensei learning mode only.
 */

/* Images: block native drag + the iOS long-press "save image" callout. Text stays
 * selectable so learners can still copy short snippets (the JS caps the length). */
.sensei-course-theme img,
.sensei-course-theme figure img,
.sensei-course-theme .wp-block-image img {
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	user-select: none;
	-webkit-touch-callout: none;
}

/* Toast notice */
.jak-cp-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 100000;
	max-width: min(420px, calc(100vw - 32px));
	padding: 12px 18px;
	border-radius: 999px;
	background: #091213;
	color: #fff;
	font: 600 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	text-align: center;
	box-shadow: 0 18px 44px rgba(9, 18, 19, 0.28);
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%) translateY(12px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.jak-cp-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* One-time "protected material" notice */
.jak-cp-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(9, 18, 19, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.jak-cp-modal__box {
	width: min(440px, 100%);
	box-sizing: border-box;
	padding: 28px 26px 24px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 30px 80px rgba(9, 18, 19, 0.4);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: #17242b;
}

.jak-cp-modal__title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.25;
	color: #0a4b78;
}

.jak-cp-modal__body {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.6;
	color: #3a4a55;
}

.jak-cp-modal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	padding: 0 20px;
	border: none;
	border-radius: 8px;
	background: #129ac4;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.jak-cp-modal__btn:hover {
	background: #0f86aa;
}

/* Print block: hide everything and show a notice instead. */
@media print {
	body * {
		visibility: hidden !important;
	}

	body::before {
		content: "Utskrift av detta utbildningsmaterial är inte tillåten. Innehållet är upphovsrättsskyddat och tillhör JA Kompetens.";
		visibility: visible !important;
		display: block;
		position: fixed;
		top: 38%;
		left: 0;
		right: 0;
		padding: 0 10%;
		text-align: center;
		font: 700 18px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
		color: #000;
	}
}
