/**
 * Website Content Copy Protection & Watermark - front end.
 * All rules are scoped to ccpw- classes added by the plugin, so theme styles are not affected.
 */

/* Text selection (class added by frontend.js to the protected area or <body>). */
.ccpw-ns {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.ccpw-ns input,
.ccpw-ns textarea,
.ccpw-ns select,
.ccpw-ns option,
.ccpw-ns [contenteditable]:not([contenteditable="false"]),
.ccpw-ns [contenteditable]:not([contenteditable="false"]) *,
.ccpw-ns .ccpw-allow-copy,
.ccpw-ns .ccpw-allow-copy *,
#wpadminbar,
#wpadminbar * {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
}

/* Image dragging and the iOS long-press "Save image" callout. */
.ccpw-nodrag img {
	-webkit-user-drag: none;
	user-drag: none;
}

.ccpw-nocallout img {
	-webkit-touch-callout: none;
}

/* Image overlay wrapper (post content images only). */
.ccpw-img-wrap {
	position: relative;
	display: inline-block;
	max-width: 100%;
	vertical-align: top;
	line-height: 0;
}

.ccpw-img-wrap > img {
	max-width: 100%;
}

.ccpw-img-wrap > img.alignleft,
.ccpw-img-wrap > img.alignright,
.ccpw-img-wrap > img.aligncenter {
	float: none;
	margin: 0;
}

.ccpw-img-wrap.aligncenter {
	display: table;
	margin-left: auto;
	margin-right: auto;
}

/* Wide/full images and galleries keep their width and cropping. */
.alignwide > .ccpw-img-wrap,
.alignfull > .ccpw-img-wrap,
.alignwide > a > .ccpw-img-wrap,
.alignfull > a > .ccpw-img-wrap {
	display: block;
}

.wp-block-gallery .ccpw-img-wrap {
	display: flex;
	flex: 1 1 auto;
	width: 100%;
	height: 100%;
}

.ccpw-img-mark {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	display: flex;
	box-sizing: border-box;
	padding: 3%;
	overflow: hidden;
	pointer-events: none;
	line-height: 1.2;
	-webkit-user-select: none;
	user-select: none;
}

.ccpw-img-mark::after {
	content: attr(data-ccpw-text);
	display: block;
	max-width: 100%;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.ccpw-pos-top-left      { align-items: flex-start; justify-content: flex-start; }
.ccpw-pos-top-center    { align-items: flex-start; justify-content: center; }
.ccpw-pos-top-right     { align-items: flex-start; justify-content: flex-end; }
.ccpw-pos-center        { align-items: center;     justify-content: center; }
.ccpw-pos-bottom-left   { align-items: flex-end;   justify-content: flex-start; }
.ccpw-pos-bottom-center { align-items: flex-end;   justify-content: center; }
.ccpw-pos-bottom-right  { align-items: flex-end;   justify-content: flex-end; }

/* Stronger image protection: transparent layer above the image. */
.ccpw-img-shield {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	background: transparent;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

/* Toast notification. */
.ccpw-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	z-index: 2147483000;
	box-sizing: border-box;
	max-width: calc(100vw - 32px);
	padding: 10px 16px;
	border-radius: 6px;
	background: rgba(24, 24, 27, 0.94);
	color: #fff;
	font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	text-align: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transform: translate(-50%, 8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.ccpw-toast:empty {
	padding: 0;
}

.ccpw-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
	.ccpw-toast {
		transition: none;
	}
}

@media print {
	.ccpw-img-shield,
	.ccpw-toast {
		display: none !important;
	}
}
