/*!
 * Camerce Popup Campaigns Pro — front-end styles for the formats and elements the add-on
 * contributes: the full-screen mat, the inline embed, the countdown wrapper,
 * the badge and the row.
 *
 * These rules were part of the free plugin until the paid features moved out
 * of it, so they are byte-for-byte what a campaign built earlier expects. They
 * load only on a page where Camerce Popup Campaigns has already enqueued its own front-end
 * stylesheet — on a page with no campaign Camerce Popup Campaigns emits nothing at all, and the
 * add-on must not be the thing that breaks that.
 */

/* Mat: takes the whole viewport. */
.camerce-popups-campaign--mat {
	--camerce-popups-gutter: 0px;

	align-items: stretch;
	justify-content: stretch;
}

.camerce-popups-campaign--mat .camerce-popups-campaign__panel {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
	max-width: none;
	max-height: none;
	border-radius: 0;
	text-align: center;
}

.camerce-popups-campaign--mat .camerce-popups-campaign__content {
	width: 100%;
	max-width: var(--camerce-popups-width);
	margin: 0 auto;
}

/*
 * The base close button is `position: sticky; float: right`, which lands in the
 * top corner of a panel whose content starts at the top. A mat's panel is a
 * centred flex column, and floats do not apply to flex items -- so the button
 * became an ordinary item at the head of the centred stack and sat halfway down
 * the left edge, with the `top`/`right` here doing nothing to move it.
 *
 * Taking it out of the flow puts it back in the corner. The panel is already
 * `position: relative`, so this anchors to the panel and not to the viewport.
 */
.camerce-popups-campaign--mat .camerce-popups-campaign__close {
	position: absolute;
	top: 12px;
	right: 12px;
	float: none;
	margin: 0;
}

/* Inline embed: rendered where the shortcode stands, always visible. */
.camerce-popups-embed {
	display: block;
}

.camerce-popups-campaign--inline,
.camerce-popups-campaign.is-inline {
	position: relative;
	inset: auto;
	z-index: auto;
	display: block;
	visibility: visible;
	padding: 0;
	pointer-events: auto;
}

.camerce-popups-campaign--inline .camerce-popups-campaign__panel,
.camerce-popups-campaign.is-inline .camerce-popups-campaign__panel {
	max-width: min(var(--camerce-popups-width), 100%);
	max-height: none;
	margin: 0 auto;
	overflow: visible;
	opacity: 1;
	transform: none;
	transition: none;
}

@media (max-width: 640px) {
	.camerce-popups-campaign--mat .camerce-popups-campaign__panel {
		max-width: none;
	}
}

/* Countdown and custom HTML wrappers: the block styles do the work, this
   only carries alignment and spacing, matching Camerce Popup Campaigns's own element wrappers. */
.camerce-popups-el--countdown,
.camerce-popups-el--html { font-size: var(--camerce-popups-el-size, 1em); }

.camerce-popups-el--countdown .camerce-popups-countdown { justify-content: var(--camerce-popups-el-flex, center); }

/* Row — a horizontal group. Children stay ordinary elements, so each keeps its
   own wrapper, style bag and hide-on class; the row only lays them out. */
.camerce-popups-el__row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--camerce-popups-el-row-gap, 12px);
	justify-content: var(--camerce-popups-el-flex, flex-start);
}

.camerce-popups-el__row--top { align-items: flex-start; }

.camerce-popups-el__row--center { align-items: center; }

.camerce-popups-el__row--bottom { align-items: flex-end; }

/* auto: every child sizes to its content and the first one absorbs the slack,
   so "message | Accept | Essential only" puts the message on the long side. */
.camerce-popups-el__row--auto > .camerce-popups-el { flex: 0 1 auto; min-width: 0; }

.camerce-popups-el__row--auto > .camerce-popups-el:first-child { flex: 1 1 auto; }

.camerce-popups-el__row--equal > .camerce-popups-el { flex: 1 1 0; min-width: 0; }

/* Badge — a boxed focal treatment. --camerce-popups-el-color drives the fill or the
   border; solid text borrows --camerce-popups-bg because CSS cannot compute contrast, the
   same way .camerce-popups-btn--primary does. */
.camerce-popups-el--badge { display: flex; justify-content: var(--camerce-popups-el-flex, center); }

.camerce-popups-el__badge {
	--camerce-popups-fill: var(--camerce-popups-el-color, var(--camerce-popups-ink));
	display: inline-block;
	max-width: 100%;
	/* A badge is a single token — a code, a short label. Inside a narrow row
	   column it would otherwise wrap one character per line. */
	white-space: nowrap;
	padding: var(--camerce-popups-badge-py, .45em) var(--camerce-popups-badge-px, 1em);
	border: 1px solid transparent;
	border-radius: var(--camerce-popups-badge-r, 8px);
	font-size: var(--camerce-popups-el-size, var(--camerce-popups-badge-fs, 1em));
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: var(--camerce-popups-badge-ls, .02em);
	text-align: center;
	overflow-wrap: break-word;
}

.camerce-popups-el__badge--small {
	--camerce-popups-badge-fs: .78em;
	--camerce-popups-badge-py: .3em;
	--camerce-popups-badge-px: .7em;
	--camerce-popups-badge-r: 999px;
	--camerce-popups-badge-ls: .06em;
	text-transform: uppercase;
}

.camerce-popups-el__badge--large {
	--camerce-popups-badge-fs: 1.9em;
	--camerce-popups-badge-py: .4em;
	--camerce-popups-badge-px: .8em;
	--camerce-popups-badge-r: 10px;
	--camerce-popups-badge-ls: .1em;
}

.camerce-popups-el__badge--solid {
	background: var(--camerce-popups-fill);
	border-color: var(--camerce-popups-fill);
	color: var(--camerce-popups-bg, #fff);
}

.camerce-popups-el__badge--outline,
.camerce-popups-el__badge--dashed,
.camerce-popups-el__badge--soft {
	background: transparent;
	border-color: var(--camerce-popups-fill);
	color: var(--camerce-popups-fill);
}

.camerce-popups-el__badge--dashed { border-style: dashed; border-width: 2px; }

.camerce-popups-el__badge--soft {
	background: color-mix(in srgb, var(--camerce-popups-fill) 14%, transparent);
	border-color: transparent;
}

/* The whole point of the row: three controls side by side on a laptop must
	   not squash into slivers on a phone. */
	.camerce-popups-el__row--stack { flex-direction: column; align-items: stretch; }

.camerce-popups-el__row--stack > .camerce-popups-el { flex: 0 0 auto; }