/**
 * GCE Ecard Thumbnail Decorator
 *
 * Adds a "stack of pages" effect and a small "PDF" badge around ecard
 * featured-image thumbnails whose underlying template has more than
 * one page (i.e. PDF/multi-page templates).
 *
 * This stylesheet only applies when the .gce-thumb--pdf class is present
 * in the DOM, which is added exclusively by GCE_Thumbnail_Decorator when
 * the ecard's _gce_page_count post meta is > 1.
 *
 * Themes can override any rule below by specifying a more specific
 * selector or using !important — but the BEM-style namespacing
 * (gce-thumb__*) is unlikely to collide with theme classes.
 */

.gce-thumb {
	position: relative;
	display: inline-block;
	line-height: 0;
	max-width: 100%;
}

.gce-thumb__inner {
	display: block;
	position: relative;
	z-index: 3;
}

.gce-thumb img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* -------------------------------------------------------------------- */
/* PDF variant: stacked-page effect + badge                             */
/* -------------------------------------------------------------------- */

/*
 * Book-like stack: spacing between sheets + soft shadows. Behind pages:
 * white and a slightly reddish grey (warm “paper edge” grey, not saturated).
 */
.gce-thumb--pdf {
	padding: 0 14px 12px 0;
}

.gce-thumb--pdf .gce-thumb__stack {
	position: absolute;
	top: 0;
	left: 0;
	right: 14px;
	bottom: 12px;
	pointer-events: none;
}

.gce-thumb--pdf .gce-thumb__stack::before,
.gce-thumb--pdf .gce-thumb__stack::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Nearer sheet: white (like top paper). */
.gce-thumb--pdf .gce-thumb__stack::before {
	transform: translate(6px, 5px);
	z-index: 2;
	background-color: #ffffff;
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.05),
		1px 2px 0 rgba(62, 48, 52, 0.12),
		2px 4px 6px rgba(55, 42, 46, 0.1);
}

/* Farthest sheet: grey with a hint of red (warm greige). */
.gce-thumb--pdf .gce-thumb__stack::after {
	transform: translate(12px, 10px);
	z-index: 1;
	background-color: #ddd4d7;
	border-color: rgba(72, 58, 62, 0.14);
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.06),
		2px 3px 0 rgba(62, 48, 52, 0.14),
		3px 6px 10px rgba(55, 42, 46, 0.12);
}

/* Cover lifts slightly off the stack */
.gce-thumb--pdf .gce-thumb__inner {
	box-shadow: 0 1px 4px rgba(55, 42, 46, 0.14);
}

/* PDF badge: dark red pill, white label */
.gce-thumb--pdf .gce-thumb__badge {
	position: absolute;
	top: 5px;
	right: 14px;
	z-index: 5;
	background: #8b1a1a;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.45px;
	padding: 6px 9px;
	border-radius: 4px;
	text-transform: uppercase;
	pointer-events: none;
	box-shadow: 0 1px 4px rgba(43, 0, 6, 0.35);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* -------------------------------------------------------------------- */
/* Print: hide the decoration so printed pages show the clean image     */
/* -------------------------------------------------------------------- */

@media print {

	.gce-thumb__stack,
	.gce-thumb__badge {
		display: none !important;
	}

	.gce-thumb--pdf {
		padding: 0 !important;
	}
}
