/**
 * Front-end styles for the notice bar and popup.
 * All selectors are prefixed with .pp- to avoid theme collisions.
 */

/* -------------------------------------------------------------------------
 * Notice bar
 * ---------------------------------------------------------------------- */

.pp-bar {
	--pp-bar-bg: #111827;
	--pp-bar-color: #ffffff;
	--pp-bar-accent: #2563eb;
	--pp-bar-size: 15px;
	--pp-bar-pad: 12px;
	--pp-bar-justify: center;

	position: relative;
	z-index: 99998;
	box-sizing: border-box;
	width: 100%;
	background: var(--pp-bar-bg);
	color: var(--pp-bar-color);
	font-family: var(--pp-bar-font, inherit);
	font-size: var(--pp-bar-size);
	line-height: 1.4;
}

.pp-bar *,
.pp-bar *::before,
.pp-bar *::after {
	box-sizing: border-box;
}

.pp-bar--push,
.pp-bar--overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
}

.pp-bar--static {
	position: relative;
}

/* Reserves the bar's height in the page flow so push mode never covers content. */
.pp-bar-spacer {
	display: block;
	width: 100%;
	height: 0;
}

body.admin-bar .pp-bar--push,
body.admin-bar .pp-bar--overlay {
	top: 32px;
}

.pp-bar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: var(--pp-bar-justify);
	gap: 8px 16px;
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--pp-bar-pad) 44px;
}

.pp-bar__text {
	margin: 0;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
	font-weight: var(--pp-bar-weight, 400);
	font-style: var(--pp-bar-style, normal);
	letter-spacing: var(--pp-bar-spacing, 0);
	text-transform: var(--pp-bar-transform, none);
}

.pp-bar__cta {
	display: inline-block;
	padding: 7px 16px;
	border-radius: 999px;
	background: var(--pp-bar-accent);
	color: #ffffff;
	font-size: 0.92em;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

.pp-bar__cta:hover,
.pp-bar__cta:focus {
	color: #ffffff;
	text-decoration: none;
	filter: brightness(1.08);
}

.pp-bar__close {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.75;
}

.pp-bar__close:hover,
.pp-bar__close:focus-visible {
	opacity: 1;
	background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 782px) {
	body.admin-bar .pp-bar--push,
	body.admin-bar .pp-bar--overlay {
		top: 46px;
	}
}

@media (max-width: 600px) {
	.pp-bar__inner {
		padding: calc(var(--pp-bar-pad) - 2px) 40px;
	}

	.pp-bar__text {
		font-size: 0.95em;
	}
}

/* -------------------------------------------------------------------------
 * Popup dialog
 * ---------------------------------------------------------------------- */

.pp-popup {
	--pp-accent: #4f46e5;
	--pp-bg: #ffffff;
	--pp-color: #1f2937;
	--pp-max: 480px;

	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: min(var(--pp-max, 480px), 80vw);
	max-width: none;
	height: -moz-fit-content;
	height: fit-content;
	max-height: 80vh;
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--pp-color);
	font-family: var(--pp-popup-font, inherit);
	font-size: 16px;
	line-height: 1.5;
	text-align: center;
	overflow: visible;
}

.pp-popup::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

.pp-popup[open] .pp-popup__card {
	animation: pp-popup-in 0.25s ease-out;
}

@keyframes pp-popup-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.pp-popup__card {
	position: relative;
	max-height: 80vh;
	overflow: auto;
	background: var(--pp-bg);
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
	-webkit-overflow-scrolling: touch;
}

.pp-popup__media {
	display: block;
	line-height: 0;
}

.pp-popup__media img {
	display: block;
	width: 100%;
	height: auto;
	vertical-align: bottom;
}

.pp-popup__body {
	padding: 24px 24px 28px;
}

.pp-popup__title {
	margin: 0 0 8px;
	color: inherit;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}

.pp-popup__text {
	color: inherit;
	font-size: var(--pp-popup-size, 16px);
	font-weight: var(--pp-popup-weight, 400);
	font-style: var(--pp-popup-style, normal);
	letter-spacing: var(--pp-popup-spacing, 0);
	text-transform: var(--pp-popup-transform, none);
	line-height: 1.55;
}

.pp-popup__text p {
	margin: 0 0 0.75em;
}

.pp-popup__text p:last-child {
	margin-bottom: 0;
}

.pp-popup__text a {
	color: var(--pp-accent);
}

.pp-popup__cta {
	display: inline-block;
	margin-top: 18px;
	padding: 12px 26px;
	border-radius: 999px;
	background: var(--pp-accent);
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.pp-popup__cta:hover,
.pp-popup__cta:focus {
	color: #ffffff;
	text-decoration: none;
	filter: brightness(1.08);
}

.pp-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #111827;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.pp-popup__cta:focus-visible,
.pp-popup__close:focus-visible {
	outline: 2px solid var(--pp-accent);
	outline-offset: 3px;
}

body.pp-modal-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.pp-popup {
		font-size: 15px;
	}

	.pp-popup__body {
		padding: 18px 18px 22px;
	}

	.pp-popup__title {
		font-size: 19px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pp-popup[open] .pp-popup__card {
		animation: none;
	}
}
