/*
 * Subscribe prompt. Colours come from the settings screen as custom properties
 * set inline on the root element, so a theme change needs no CSS edit.
 */

.pstpush-prompt {
	--pstpush-accent: #b4553f;
	--pstpush-bg: #fff;
	--pstpush-text: #1f2124;

	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
	max-width: 380px;
	padding: 18px 20px;
	border-radius: 10px;
	background: var(--pstpush-bg);
	color: var(--pstpush-text);
	box-shadow: 0 8px 30px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .1);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;

	opacity: 0;
	transform: translateY(12px);
	transition: opacity .22s ease, transform .22s ease;
}

.pstpush-prompt.pstpush-visible {
	opacity: 1;
	transform: translateY(0);
}

/* --- Placement --------------------------------------------------------- */

.pstpush-card-bottom-right {
	right: 20px;
	bottom: 20px;
}

.pstpush-card-bottom-left {
	left: 20px;
	bottom: 20px;
}

.pstpush-bar-bottom,
.pstpush-bar-top {
	left: 0;
	right: 0;
	max-width: none;
	border-radius: 0;
	padding: 14px 24px;
}

.pstpush-bar-bottom {
	bottom: 0;
}

.pstpush-bar-top {
	top: 0;
	transform: translateY(-12px);
}

.pstpush-bar-bottom .pstpush-prompt-inner,
.pstpush-bar-top .pstpush-prompt-inner {
	max-width: 1100px;
	margin: 0 auto;
	flex-wrap: nowrap;
	align-items: center;
}

.pstpush-bar-bottom .pstpush-prompt-actions,
.pstpush-bar-top .pstpush-prompt-actions {
	margin-left: auto;
	margin-top: 0;
	flex-shrink: 0;
}

.pstpush-modal {
	left: 50%;
	top: 50%;
	transform: translate(-50%, calc(-50% + 12px));
}

.pstpush-modal.pstpush-visible {
	transform: translate(-50%, -50%);
}

/* --- Contents ----------------------------------------------------------- */

.pstpush-prompt-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: flex-start;
}

.pstpush-prompt-icon {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}

.pstpush-prompt-text {
	flex: 1 1 200px;
	min-width: 0;
}

.pstpush-prompt-title {
	margin: 0 0 4px;
	font-weight: 700;
	font-size: 16px;
	color: inherit;
}

.pstpush-prompt-body {
	margin: 0;
	font-size: 14px;
	opacity: .82;
	color: inherit;
}

.pstpush-prompt-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	width: 100%;
	margin-top: 4px;
	justify-content: flex-end;
}

.pstpush-prompt button {
	font: inherit;
	font-size: 14px;
	line-height: 1;
	padding: 10px 16px;
	border-radius: 6px;
	cursor: pointer;
	border: 0;
	/* Some themes style every button on the page; be explicit. */
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	min-height: 0;
	width: auto;
}

.pstpush-prompt button[disabled] {
	opacity: .6;
	cursor: default;
}

.pstpush-prompt-allow {
	background: var(--pstpush-accent);
	color: #fff;
	font-weight: 600;
}

.pstpush-prompt-allow:hover:not([disabled]) {
	filter: brightness(1.08);
}

.pstpush-prompt-deny {
	background: transparent;
	color: inherit;
	opacity: .7;
	padding-left: 8px;
	padding-right: 8px;
}

.pstpush-prompt-deny:hover:not([disabled]) {
	opacity: 1;
}

.pstpush-prompt button:focus-visible {
	outline: 2px solid var(--pstpush-accent);
	outline-offset: 2px;
}

/* --- Small screens ------------------------------------------------------ */

@media (max-width: 520px) {
	.pstpush-card-bottom-right,
	.pstpush-card-bottom-left,
	.pstpush-modal {
		left: 10px;
		right: 10px;
		bottom: 10px;
		top: auto;
		max-width: none;
		transform: translateY(12px);
	}

	.pstpush-modal.pstpush-visible,
	.pstpush-card-bottom-right.pstpush-visible,
	.pstpush-card-bottom-left.pstpush-visible {
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pstpush-prompt {
		transition: opacity .01s;
		transform: none;
	}

	.pstpush-prompt.pstpush-visible,
	.pstpush-modal.pstpush-visible {
		transform: none;
	}

	.pstpush-modal,
	.pstpush-modal.pstpush-visible {
		transform: translate(-50%, -50%);
	}
}
