/* Festive Prize Draw Pop-up
 * Styled to sit with the site: inherits the theme font (Libre Franklin),
 * black / white / grey palette, square edges.
 */

.hkfp-root {
	--hkfp-ink: #222;
	--hkfp-text: #616161;
	--hkfp-muted: #6b6b6b;
	--hkfp-line: #e3e3e3;
	--hkfp-accent: #000;
	font-family: inherit;
}

.hkfp-root [hidden] {
	display: none !important;
}

html.hkfp-lock,
html.hkfp-lock body {
	overflow: hidden !important;
}

html.hkfp-lock {
	scrollbar-gutter: stable;
}

/* ---------- Modal ---------- */

.hkfp-root .hkfp-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.hkfp-root .hkfp-overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.62);
	opacity: 0;
	transition: opacity 0.35s ease;
	cursor: pointer;
}

.hkfp-root .hkfp-modal.is-open .hkfp-overlay {
	opacity: 1;
}

.hkfp-root .hkfp-dialog {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 540px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	padding: 54px 48px 36px;
	background: #fff;
	color: var(--hkfp-text);
	text-align: center;
	font-family: inherit;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	outline: none;
	opacity: 0;
	transform: translateY(14px) scale(0.985);
	transition: opacity 0.4s ease-in, transform 0.42s cubic-bezier(0.55, 0, 0.6, 1);
	will-change: transform, opacity;
}

.hkfp-root .hkfp-modal.is-open .hkfp-dialog {
	opacity: 1;
	transform: none;
	transition: opacity 0.35s ease-out, transform 0.45s cubic-bezier(0.2, 0.75, 0.2, 1);
}

/* Fine inset frame, like a printed card */
.hkfp-root .hkfp-dialog::before {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1px solid var(--hkfp-line);
	pointer-events: none;
}

/* ---------- Close button ---------- */

.hkfp-root .hkfp-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--hkfp-ink);
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.hkfp-root .hkfp-close:hover {
	background: #f2f2f2;
	color: var(--hkfp-ink);
}

.hkfp-root .hkfp-close svg {
	display: block;
	width: 20px;
	height: 20px;
}

/* ---------- Content ---------- */

.hkfp-root .hkfp-ornament {
	margin: 0 auto 18px;
	width: 120px;
	color: var(--hkfp-ink);
}

.hkfp-root .hkfp-ornament svg {
	display: block;
	width: 120px;
	height: 16px;
}

.hkfp-root .hkfp-title {
	margin: 0 0 16px;
	padding: 0;
	font-family: inherit;
	font-size: 30px;
	font-weight: 300;
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-transform: none;
	color: var(--hkfp-ink);
}

.hkfp-root .hkfp-body p {
	margin: 0 0 10px;
	padding: 0;
	font-family: inherit;
	font-size: 17px;
	line-height: 1.6;
	color: var(--hkfp-text);
}

.hkfp-root .hkfp-body p:last-child {
	margin-bottom: 0;
}

.hkfp-root .hkfp-body a {
	color: var(--hkfp-ink);
	text-decoration: underline;
}

/* ---------- Countdown ---------- */

.hkfp-root .hkfp-countdown {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	margin: 28px 0;
	border-top: 1px solid var(--hkfp-line);
	border-bottom: 1px solid var(--hkfp-line);
}

.hkfp-root .hkfp-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 16px 4px 14px;
}

.hkfp-root .hkfp-unit + .hkfp-unit {
	border-left: 1px solid var(--hkfp-line);
}

.hkfp-root .hkfp-num {
	font-size: 36px;
	font-weight: 300;
	line-height: 1;
	color: var(--hkfp-ink);
	font-variant-numeric: tabular-nums;
}

.hkfp-root .hkfp-label {
	font-size: 11px;
	line-height: 1.2;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hkfp-muted);
}

/* ---------- Button ---------- */

.hkfp-root .hkfp-button,
.hkfp-root .hkfp-button:visited {
	display: inline-block;
	box-sizing: border-box;
	margin: 0;
	padding: 16px 36px;
	border: 1px solid var(--hkfp-accent);
	border-radius: 0;
	background: var(--hkfp-accent);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hkfp-root .hkfp-button:hover,
.hkfp-root .hkfp-button:focus-visible {
	background: #fff;
	color: var(--hkfp-accent);
	text-decoration: none;
}

/* ---------- Small print ---------- */

.hkfp-root .hkfp-small {
	margin: 22px 0 0;
}

.hkfp-root .hkfp-small p {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.5;
	color: var(--hkfp-muted);
}

.hkfp-root .hkfp-small a {
	color: inherit;
	text-decoration: underline;
}

/* ---------- "No, thank you" ---------- */

.hkfp-root .hkfp-decline {
	display: inline-block;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	margin: 14px 0 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--hkfp-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.02em;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.hkfp-root .hkfp-decline:hover {
	background: transparent;
	color: var(--hkfp-text);
	text-decoration: underline;
}

.hkfp-root .hkfp-decline:focus-visible {
	outline: 2px solid var(--hkfp-accent);
	outline-offset: 2px;
}

/* ---------- Bubble ---------- */

.hkfp-root .hkfp-bubble {
	position: fixed;
	right: 24px;
	bottom: 24px;
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	z-index: 2147482999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--hkfp-accent);
	color: #fff;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 0 0 2px #fff, 0 10px 26px rgba(0, 0, 0, 0.28);
	transition: transform 0.3s cubic-bezier(0.3, 1.45, 0.5, 1), opacity 0.25s ease, box-shadow 0.2s ease;
}

.hkfp-root .hkfp-bubble:hover {
	background: var(--hkfp-accent);
	color: #fff;
	transform: scale(1.07);
	box-shadow: 0 0 0 2px #fff, 0 14px 32px rgba(0, 0, 0, 0.34);
}

.hkfp-root .hkfp-bubble svg {
	display: block;
	width: 28px;
	height: 28px;
}

.hkfp-root .hkfp-bubble.is-entering,
.hkfp-root .hkfp-bubble.is-hiding {
	opacity: 0;
	transform: scale(0.4);
}

/* Two soft rings after minimising, to show where the pop-up went */
.hkfp-root .hkfp-bubble.is-pulsing::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--hkfp-accent);
	pointer-events: none;
	animation: hkfp-pulse 1.6s ease-out 2;
	opacity: 0;
}

@keyframes hkfp-pulse {
	from { transform: scale(1); opacity: 0.55; }
	to   { transform: scale(1.75); opacity: 0; }
}

/* ---------- Focus ---------- */

.hkfp-root .hkfp-close:focus-visible,
.hkfp-root .hkfp-button:focus-visible,
.hkfp-root .hkfp-bubble:focus-visible {
	outline: 2px solid var(--hkfp-accent);
	outline-offset: 3px;
}

.hkfp-root .hkfp-bubble:focus-visible {
	outline-color: #000;
	outline-offset: 4px;
}

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

@media (max-width: 600px) {
	.hkfp-root .hkfp-modal {
		padding: 12px;
	}

	.hkfp-root .hkfp-dialog {
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
		padding: 50px 22px 26px;
	}

	.hkfp-root .hkfp-dialog::before {
		inset: 8px;
	}

	.hkfp-root .hkfp-close {
		top: 12px;
		right: 12px;
	}

	.hkfp-root .hkfp-ornament {
		margin-bottom: 14px;
	}

	.hkfp-root .hkfp-title {
		font-size: 24px;
		margin-bottom: 12px;
	}

	.hkfp-root .hkfp-body p {
		font-size: 16px;
		line-height: 1.55;
	}

	.hkfp-root .hkfp-countdown {
		margin: 22px 0;
	}

	.hkfp-root .hkfp-unit {
		padding: 12px 2px 10px;
	}

	.hkfp-root .hkfp-num {
		font-size: 27px;
	}

	.hkfp-root .hkfp-label {
		font-size: 10px;
		letter-spacing: 0.08em;
	}

	.hkfp-root .hkfp-button,
	.hkfp-root .hkfp-button:visited {
		display: block;
		width: 100%;
		padding: 15px 18px;
		font-size: 14px;
	}

	.hkfp-root .hkfp-small {
		margin-top: 18px;
	}

	.hkfp-root .hkfp-small p {
		font-size: 12px;
	}

	.hkfp-root .hkfp-bubble {
		right: 16px;
		bottom: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		width: 56px;
		height: 56px;
	}

	.hkfp-root .hkfp-bubble svg {
		width: 26px;
		height: 26px;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.hkfp-root .hkfp-overlay,
	.hkfp-root .hkfp-dialog,
	.hkfp-root .hkfp-modal.is-open .hkfp-dialog,
	.hkfp-root .hkfp-bubble {
		transition: opacity 0.15s linear;
		transform: none;
	}

	.hkfp-root .hkfp-bubble.is-pulsing::after {
		animation: none;
	}
}
