/**
 * PF QR Share — the round trigger and the dialog it opens.
 *
 * Everything tunable arrives as a custom property set on the dialog by PHP, so
 * the values here are only the fallbacks and the parts of the layout a control
 * would never sensibly change.
 */

/* ---------- the trigger ------------------------------------------------- */

.kb-button.pf-qr-trigger {
	cursor: pointer;
}

/* Four classes, so this lands on top of Kadence's own per-button rule without
   reaching for !important. */
.wp-block-kadence-advancedbtn .kb-button.pf-qr-round.pf-qr-round,
.pf-qr-round-preview .kb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border-radius: 50%;
	line-height: 1;
}

.kb-button.pf-qr-round .kb-svg-icon-wrap {
	display: flex;
	margin: 0;
}

/* ---------- the dialog -------------------------------------------------- */

.pf-qr-modal[hidden] {
	display: none;
}

.pf-qr-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.pf-qr-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	-webkit-backdrop-filter: blur(var(--pf-qr-backdrop, 8px));
	backdrop-filter: blur(var(--pf-qr-backdrop, 8px));
	animation: pf-qr-fade 0.18s ease-out;
}

.pf-qr-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 100%;
	max-height: 100%;
	padding: 22px;
	overflow: auto;
	color: var(--pf-qr-dark, #111);
	background: var(--pf-qr-light, #fff);
	border-radius: var(--pf-qr-radius, 18px);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
	text-align: center;
	animation: pf-qr-rise 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.pf-qr-code {
	width: var(--pf-qr-size, 260px);
	max-width: 100%;
	margin: 0 auto;
}

.pf-qr-code .pf-qr-svg {
	display: block;
	width: 100%;
	height: auto;
	border-radius: calc(var(--pf-qr-radius, 18px) / 2);
}

.pf-qr-heading,
.pf-qr-url {
	margin: 0;
	line-height: 1.35;
}

.pf-qr-heading {
	padding-right: 24px;
	font-size: 1.05em;
	font-weight: 600;
}

.pf-qr-url {
	font-size: 0.85em;
	word-break: break-all;
	opacity: 0.65;
}

.pf-qr-close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0.55;
}

.pf-qr-close:hover,
.pf-qr-close:focus-visible {
	background: rgba(127, 127, 127, 0.18);
	opacity: 1;
}

.pf-qr-trigger:focus-visible,
.pf-qr-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* The scroll lock the script puts on while a dialog is open. */
.pf-qr-open {
	overflow: hidden;
}

@keyframes pf-qr-fade {
	from { opacity: 0; }
}

@keyframes pf-qr-rise {
	from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
	.pf-qr-panel,
	.pf-qr-backdrop {
		animation: none;
	}
}
