/**
 * AI Image Marking - visual label only. Original image files are never modified.
 *
 * .ai-generated / .ai-edited sit on the element that holds the image;
 * .ai-label is an empty element inside it, pinned to the bottom-right corner.
 */

/* Zero specificity: any position the theme already sets (absolute, fixed, ...) wins. */
:where(.ai-generated, .ai-edited) {
	position: relative;
}

.ai-label {
	position: absolute;
	right: 8px;
	bottom: 8px;
	z-index: 3;
	display: block;
	height: auto;
	margin: 0;
	padding: 0;
	background: transparent no-repeat center / contain;
	pointer-events: none;
	user-select: none;
}

/* Full labels: about CTA-button height on desktop, compact on mobile. */
.ai-label--generated {
	width: clamp(110px, 12vw, 200px);
	max-width: 45%;
	aspect-ratio: 600 / 182;
}

.ai-label--edited {
	width: clamp(98px, 10.6vw, 178px);
	max-width: 40%;
	aspect-ratio: 532 / 182;
}

/* Small label: "AI" only. */
.ai-label--small {
	width: clamp(34px, 3.6vw, 60px);
	max-width: 20%;
	aspect-ratio: 191 / 182;
}

.ai-label--generated.ai-label--white { background-image: url("labels/generated-white.png"); }
.ai-label--generated.ai-label--green { background-image: url("labels/generated-green.png"); }
.ai-label--generated.ai-label--black { background-image: url("labels/generated-black.png"); }
.ai-label--generated.ai-label--blue  { background-image: url("labels/generated-blue.png"); }

.ai-label--edited.ai-label--white { background-image: url("labels/edited-white.png"); }
.ai-label--edited.ai-label--green { background-image: url("labels/edited-green.png"); }
.ai-label--edited.ai-label--black { background-image: url("labels/edited-black.png"); }
.ai-label--edited.ai-label--blue  { background-image: url("labels/edited-blue.png"); }

.ai-label--small.ai-label--white { background-image: url("labels/small-white.png"); }
.ai-label--small.ai-label--green { background-image: url("labels/small-green.png"); }
.ai-label--small.ai-label--black { background-image: url("labels/small-black.png"); }
.ai-label--small.ai-label--blue  { background-image: url("labels/small-blue.png"); }

/* Core Image block: wrapper hugs the image so the label sits on the picture, not the caption. */
.ai-image-inline {
	display: inline-block;
	max-width: 100%;
	vertical-align: top;
	line-height: 0;
}

.alignwide > .ai-image-inline,
.alignfull > .ai-image-inline,
.is-resized > .ai-image-inline {
	display: block;
}

@media (max-width: 767px) {
	.ai-label {
		right: 4px;
		bottom: 4px;
	}
}

@media print {
	.ai-label {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}

/* Classic editor centered images: keep the wrapper centered. */
.ai-image-inline.aligncenter {
	display: table;
	margin-left: auto;
	margin-right: auto;
}
