/**
 * Argo Popup Notice — frontend (and admin preview) styles.
 * All rules scoped under .apn. Font inherited from the theme (Poppins).
 */

.apn {
	--apn-bg: #fff1e4;
	--apn-text: #29121c;
	--apn-accent: #ecaf92;
	--apn-accent-hover: #29121c;
	--apn-btn-text: #29121c;
	--apn-overlay: rgba(41, 18, 28, 0.6);
	--apn-radius: 24px;
	--apn-maxw: 520px;

	position: relative;
	isolation: isolate;
	font-family: inherit;
	box-sizing: border-box;
	z-index: 1000000;
	color: var(--apn-text);
	line-height: 1.5;
	text-align: left;
}

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

/* Beat theme globals for headings, paragraphs, links, and buttons. */
.apn h1,
.apn h2,
.apn h3,
.apn h4,
.apn h5,
.apn h6 {
	margin: 0;
	padding: 0;
	color: var(--apn-text) !important;
	font-family: inherit !important;
	font-weight: 600;
	line-height: 1.25 !important;
	text-transform: none;
	letter-spacing: normal;
}

.apn p {
	margin: 0 0 0.75em;
	padding: 0;
	color: var(--apn-text) !important;
	font-family: inherit !important;
	font-size: 1rem !important;
	font-weight: 400;
	line-height: 1.65 !important;
}

.apn a {
	color: var(--apn-text) !important;
	text-decoration: underline;
	background: transparent;
}

.apn a:hover,
.apn a:focus {
	color: var(--apn-accent-hover) !important;
	text-decoration: underline;
}

.apn button {
	font-family: inherit;
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	box-shadow: none;
	outline: none;
	text-transform: none;
	letter-spacing: normal;
}

.apn[hidden] {
	display: none !important;
}

.apn .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Overlay ---------- */

.apn__overlay {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	background: var(--apn-overlay);
	opacity: 0;
	transition: opacity 250ms ease;
	/* Soft blur when supported; solid overlay remains as fallback. */
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.apn.is-open .apn__overlay {
	opacity: 1;
}

/* ---------- Dialog / card ---------- */

.apn__dialog {
	position: fixed;
	z-index: 1000001;
	display: flex;
	flex-direction: column;
	width: calc(100% - 2.5rem);
	max-width: var(--apn-maxw);
	max-height: 85vh;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: var(--apn-bg);
	color: var(--apn-text);
	border-radius: var(--apn-radius);
	box-shadow: 0 8px 18px rgba(61, 28, 42, 0.16);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 250ms ease, transform 250ms ease;
}

/* Accent bar — top edge for center / bottom_right (clipped by radius). */
.apn__dialog::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 6px;
	z-index: 3;
	pointer-events: none;
	background: var(--apn-accent);
	border-radius: var(--apn-radius) var(--apn-radius) 0 0;
}

.apn.is-open .apn__dialog {
	opacity: 1;
	transform: translateY(0);
}

.apn__inner {
	padding: 36px 36px 32px;
	overflow: auto;
	flex: 1 1 auto;
	min-height: 0;
}

.apn__dialog:has(.apn__langswitch:not([hidden])) .apn__inner {
	padding-bottom: 56px;
}

.apn__langs {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.apn__lang[hidden],
.apn__lang-divider[hidden],
.apn__langswitch[hidden] {
	display: none !important;
}

.apn__lang-divider {
	display: block;
	width: 100%;
	height: 0;
	margin: 1rem 0;
	border: 0;
	border-top: 1px solid rgba(41, 18, 28, 0.12);
}

.apn__lang + .apn__lang {
	margin-top: 0.25rem;
}

.apn__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--apn-text);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	appearance: none;
}

.apn__close-label {
	display: block;
	font-size: 24px;
	line-height: 1;
}

.apn__close:hover,
.apn__close:focus-visible {
	background: rgba(41, 18, 28, 0.08);
}

.apn__close:focus,
.apn__close:focus-visible,
.apn__button:focus,
.apn__button:focus-visible,
.apn__langswitch button:focus,
.apn__langswitch button:focus-visible {
	outline: 2px solid var(--apn-text) !important;
	outline-offset: 2px;
	box-shadow: none;
}

/* ---------- In-popup language switch ---------- */

.apn__langswitch {
	position: absolute;
	bottom: 14px;
	left: 14px;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.apn__langswitch button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 4px 12px;
	border: 1px solid rgba(41, 18, 28, 0.2);
	border-radius: 999px;
	background: transparent;
	color: var(--apn-text);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.apn__langswitch button[aria-pressed="true"] {
	background: var(--apn-accent);
	border-color: var(--apn-accent);
	color: var(--apn-btn-text);
}

.apn__langswitch button:hover {
	background: rgba(41, 18, 28, 0.06);
}

.apn__langswitch button[aria-pressed="true"]:hover {
	background: var(--apn-accent);
}

.apn__media {
	margin: 0 0 18px;
}

.apn__image {
	display: block;
	width: 100%;
	max-height: 220px;
	height: auto;
	object-fit: cover;
	border-radius: 16px;
}

.apn__title {
	margin: 0 0 14px;
	padding: 0 40px 0 0;
	color: var(--apn-text) !important;
	font-family: inherit;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.25;
}

.apn__body {
	color: var(--apn-text) !important;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.65;
}

.apn__body p {
	margin: 0 0 0.75em;
	color: var(--apn-text) !important;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.65 !important;
}

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

.apn__body a {
	color: var(--apn-text) !important;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	font-weight: 500;
}

.apn__body a:hover,
.apn__body a:focus {
	color: var(--apn-accent-hover) !important;
}

.apn__body ul,
.apn__body ol {
	margin: 0 0 0.75em;
	padding-left: 1.25rem;
	color: var(--apn-text);
}

.apn__actions {
	margin-top: 24px;
}

.apn a.apn__button,
.apn__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 10px 35px;
	border: 0;
	border-radius: 30px;
	background: var(--apn-accent) !important;
	color: var(--apn-btn-text) !important;
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.apn__button:hover,
.apn__button:focus-visible {
	background: var(--apn-accent-hover);
	color: #fff1e4 !important;
}

/* ---------- Layout: center ---------- */

.apn--center .apn__dialog {
	top: 50%;
	left: 50%;
	transform: translate(-50%, calc(-50% + 12px));
}

.apn--center.is-open .apn__dialog {
	transform: translate(-50%, -50%);
}

body.apn-scroll-lock {
	overflow: hidden !important;
}

/* ---------- Layout: bottom_right ---------- */

.apn--bottom_right .apn__overlay {
	display: none;
}

.apn--bottom_right .apn__dialog {
	top: auto;
	left: auto;
	right: 20px;
	bottom: 20px;
	width: min(var(--apn-maxw), calc(100vw - 40px));
	transform: translateY(12px);
}

.apn--bottom_right.is-open .apn__dialog {
	transform: translateY(0);
}

/* ---------- Layout: top_bar ---------- */

.apn--top_bar .apn__overlay {
	display: none;
}

.apn--top_bar .apn__dialog {
	top: 0;
	left: 0;
	right: 0;
	bottom: auto;
	width: 100%;
	max-width: none;
	max-height: none;
	border-radius: 0;
	transform: translateY(-100%);
	box-shadow: 0 4px 14px rgba(61, 28, 42, 0.12);
}

/* Accent bar — bottom edge for top_bar. */
.apn--top_bar .apn__dialog::before {
	top: auto;
	bottom: 0;
	height: 4px;
	border-radius: 0;
}

.apn--top_bar.is-open .apn__dialog {
	transform: translateY(0);
}

.apn--top_bar .apn__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0.85rem 3.25rem 0.85rem 1.25rem;
	overflow: visible;
}

.apn--top_bar .apn__dialog:has(.apn__langswitch:not([hidden])) .apn__inner {
	padding-bottom: 0.85rem;
	padding-right: 7.5rem;
}

.apn--top_bar .apn__media {
	margin: 0;
	flex: 0 0 auto;
}

.apn--top_bar .apn__image {
	width: 48px;
	height: 48px;
	max-height: 48px;
	border-radius: 10px;
}

.apn--top_bar .apn__title {
	margin: 0;
	padding-right: 0;
	font-size: 1.05rem;
}

.apn--top_bar .apn__body {
	flex: 1 1 220px;
	font-size: 0.95rem;
}

.apn--top_bar .apn__body p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.4 !important;
}

.apn--top_bar .apn__actions {
	margin: 0;
	flex: 0 0 auto;
}

.apn--top_bar .apn__button {
	padding: 8px 22px;
	font-size: 14px;
}

.apn--top_bar .apn__close {
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
}

/* Language switch sits inline before the close button on top_bar. */
.apn--top_bar .apn__langswitch {
	top: 50%;
	right: 58px;
	bottom: auto;
	left: auto;
	transform: translateY(-50%);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.apn__overlay,
	.apn__dialog {
		transition: none !important;
	}

	.apn__dialog {
		transform: none;
	}

	.apn--center .apn__dialog {
		transform: translate(-50%, -50%);
	}

	.apn--bottom_right .apn__dialog,
	.apn--top_bar .apn__dialog {
		transform: none;
	}

	.apn--center.is-open .apn__dialog {
		transform: translate(-50%, -50%);
	}

	.apn--bottom_right.is-open .apn__dialog,
	.apn--top_bar.is-open .apn__dialog {
		transform: none;
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
	.apn--center .apn__dialog {
		width: calc(100% - 1.5rem);
		max-width: none;
	}

	.apn--center .apn__inner,
	.apn--bottom_right .apn__inner {
		padding: 28px 22px 24px;
	}

	.apn__dialog:has(.apn__langswitch:not([hidden])) .apn__inner {
		padding-bottom: 52px;
	}

	.apn--bottom_right .apn__dialog {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		border-radius: var(--apn-radius) var(--apn-radius) 0 0;
		transform: translateY(100%);
	}

	.apn--bottom_right .apn__dialog::before {
		border-radius: var(--apn-radius) var(--apn-radius) 0 0;
	}

	.apn--bottom_right.is-open .apn__dialog {
		transform: translateY(0);
	}

	.apn--top_bar .apn__inner {
		padding-right: 2.75rem;
	}

	.apn--top_bar .apn__dialog:has(.apn__langswitch:not([hidden])) .apn__inner {
		padding-right: 7rem;
	}
}

/* Admin preview: keep above WP admin UI chrome when needed */
body.wp-admin .apn {
	z-index: 1000000;
}
