/* POPUP-V1 — HanoPalais promotional pop-up. Loaded only on pages that show it (and in the admin preview).
   Centred card on a soft ink veil; image left on wide screens, on top on phones; never wider or taller than the viewport
   (the text scrolls inside the card); no animation with Reduce Motion; no layout shift (fixed layer, hidden until shown). */

.hnp-popup[hidden] { display: none !important; }
.hnp-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	font-family: var(--hnp-font-body, inherit);
	color: var(--hnp-color-ink, #0e1a26);
}
.hnp-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(14, 26, 38, 0.55);
	opacity: 0;
	transition: opacity .25s ease;
}
.hnp-popup__dialog {
	position: relative;
	display: grid;
	grid-template-columns: 1fr;
	width: min(440px, 100%);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: hidden;
	border-radius: var(--hnp-radius-lg, 16px);
	background: #fff;
	box-shadow: 0 30px 80px -24px rgba(14, 26, 38, 0.55);
	opacity: 0;
	transform: translateY(12px) scale(.98);
	transition: opacity .25s ease, transform .25s ease;
	outline: none;
}
.hnp-popup.is-open .hnp-popup__backdrop { opacity: 1; }
.hnp-popup.is-open .hnp-popup__dialog { opacity: 1; transform: none; }

.hnp-popup--image .hnp-popup__dialog { grid-template-rows: auto minmax(0, 1fr); }
.hnp-popup__media { position: relative; background: var(--hnp-color-sand, #f1e9df); min-height: 0; }
.hnp-popup__img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 38vh;
	max-height: 38dvh;
	object-fit: contain; /* the whole picture, never cropped or stretched (portrait or landscape) */
}
.hnp-popup__body {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 24px 24px 26px;
}
.hnp-popup__badge {
	display: inline-block;
	margin: 0 0 10px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #fff4d6;
	color: #6b4e00;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .02em;
}
.hnp-popup__title {
	margin: 0 32px 10px 0;
	font-family: var(--hnp-font-display, inherit);
	font-size: clamp(1.25rem, 1.05rem + .8vw, 1.625rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	color: var(--hnp-color-ink, #0e1a26);
	overflow-wrap: anywhere;
	text-wrap: balance;
}
.hnp-popup--image .hnp-popup__title { margin-right: 0; }
.hnp-popup__text {
	font-size: .9688rem;
	line-height: 1.6;
	color: var(--hnp-color-ink-2, #4f5b66);
	overflow-wrap: anywhere;
}
.hnp-popup__text p { margin: 0 0 .75em; }
.hnp-popup__text p:last-child { margin-bottom: 0; }
.hnp-popup__text ul, .hnp-popup__text ol { margin: 0 0 .75em; padding-left: 1.25em; }
.hnp-popup__text a { color: var(--hnp-color-accent-text, #7d5636); text-decoration: underline; text-underline-offset: 3px; }
.hnp-popup__actions { margin: 20px 0 0; }
.hnp-popup__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	text-align: center;
}
.hnp-popup__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--hnp-color-ink, #0e1a26);
	box-shadow: 0 2px 10px rgba(14, 26, 38, 0.18);
	cursor: pointer;
}
.hnp-popup__close:hover { background: #fff; }
.hnp-popup__close:focus-visible,
.hnp-popup__cta:focus-visible { outline: 2px solid var(--hnp-color-accent, #b08968); outline-offset: 3px; }

/* Wide screens: picture beside the text. */
@media (min-width: 768px) {
	.hnp-popup--image .hnp-popup__dialog {
		width: min(820px, 100%);
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr);
		max-height: min(560px, calc(100vh - 48px));
		max-height: min(560px, calc(100dvh - 48px));
	}
	.hnp-popup--image .hnp-popup__media { display: flex; align-items: center; justify-content: center; }
	.hnp-popup--image .hnp-popup__img { max-height: min(560px, calc(100vh - 48px)); max-height: min(560px, calc(100dvh - 48px)); }
	.hnp-popup--image .hnp-popup__body { display: flex; flex-direction: column; justify-content: center; padding: 40px 36px; }
	.hnp-popup--noimage .hnp-popup__dialog { width: min(520px, 100%); }
	.hnp-popup--noimage .hnp-popup__body { padding: 36px 36px 32px; }
}

/* The page behind stays put while the pop-up is open. */
html.hnp-popup-lock,
html.hnp-popup-lock body { overflow: hidden !important; }
html.hnp-popup-lock body { padding-right: var(--hnp-popup-gap, 0); }

@media (prefers-reduced-motion: reduce) {
	.hnp-popup__backdrop,
	.hnp-popup__dialog { transition: none; transform: none; }
}

/* The CTA carries its own look (same as the site's primary button) so the admin preview — where the site stylesheet is not
   loaded — looks exactly like the front end. */
.hnp-popup .hnp-popup__cta {
	padding: 12px 22px;
	border: 1px solid var(--hnp-color-ink, #0e1a26);
	border-radius: var(--hnp-radius-control, 10px);
	background: var(--hnp-color-ink, #0e1a26);
	color: #fff;
	font-family: var(--hnp-font-body, inherit);
	font-size: .9375rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color .2s ease, border-color .2s ease;
}
.hnp-popup .hnp-popup__cta:hover,
.hnp-popup .hnp-popup__cta:focus-visible { background: var(--hnp-color-accent, #b08968); border-color: var(--hnp-color-accent, #b08968); color: #fff; }
.hnp-popup .screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .hnp-popup .hnp-popup__cta { transition: none; } }
/* The theme / site give every focused <button> a filled background; the close button keeps its own look (ring only). */
.hnp-popup .hnp-popup__close:focus,
.hnp-popup .hnp-popup__close:active { background: rgba(255, 255, 255, 0.92); color: var(--hnp-color-ink, #0e1a26); border: 0; }
.hnp-popup .hnp-popup__close:hover { background: #fff; color: var(--hnp-color-ink, #0e1a26); }

/* Long text without an image: the text area is the only thing that scrolls — the dialog itself never scrolls (focus moving to
   the CTA used to scroll the whole card and carried the × out of sight). */
.hnp-popup--noimage .hnp-popup__dialog { grid-template-rows: minmax(0, 1fr); }
.hnp-popup__dialog { overflow: hidden; overflow: clip; }

/* V1.1 (04/11): the admin preview matches the front end. WP-Admin keeps content-box sizing and a 13px system font (the CTA
   overflowed the card and the text read smaller), and the Elementor kit squares every <button> (the × lost its circle). */
.hnp-popup,
.hnp-popup *,
.hnp-popup *::before,
.hnp-popup *::after { box-sizing: border-box; }
.hnp-popup { font-family: var(--hnp-font-body, 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif); font-size: 16px; line-height: 1.5; }
.hnp-popup .hnp-popup__title { font-family: var(--hnp-font-display, 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif); }
.hnp-popup .hnp-popup__cta { font-family: var(--hnp-font-body, 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif); line-height: 1.3; }
.hnp-popup .hnp-popup__close { border-radius: 50%; }
.hnp-popup .hnp-popup__text p,
.hnp-popup .hnp-popup__text li { font-size: inherit; line-height: inherit; color: inherit; }
