  Let $p \in (1,\infty)$, $\alpha\in \mathbb{R}$, and $\Omega\subsetneq
\mathbb{R}^N$ be a $C^{1,\gamma}$-domain with a compact boundary $\partial
\Omega$, where $\gamma\in (0,1]$. Denote by $\delta_{\Omega}(x)$ the distance
of $x\in \Omega$ to $\partial \Omega$. Let
$\widetilde{W}^{1,p;\alpha}_0(\Omega)$ be the completion of
$C_c^{\infty}(\Omega)$ with respect to the norm
$$\|\varphi\|_{\widetilde{W}^{1,p;\alpha}_0(\Omega)}:= \left( \| \, |\nabla
\varphi| \, \|_{L^p(\Omega,\delta_{\Omega}^{-\alpha})}^p
+\|\varphi\|_{L^p(\Omega,\delta_{\Omega}^{-(\alpha+p)})}^p\right)^{{1}/{p}} .$$
  Consider the following two variational constants: $$
  H_{\alpha,p}(\Omega) :=\!\inf \left\{\int_{\Omega} |\nabla \varphi|^p
\delta_{\Omega}^{-\alpha} \mathrm{d}x \biggm| \int_{\Omega} |\varphi|^p
\delta_{\Omega}^{-(\alpha+p)} \mathrm{d}x\!=\!1, \varphi \in
\widetilde{W}^{1,p;\alpha}_0(\Omega) \right\} \,, $$ $$
\lambda_{\alpha,p}^{\infty}(\Omega) :=\sup_{K\Subset \Omega}\,
  \inf_{W^{1,p}_{c}(\Omega\setminus K)} \left\{\int_{\Omega\setminus K} |\nabla
\varphi|^p \delta_{\Omega}^{-\alpha} \mathrm{d}x \biggm| \int_{\Omega\setminus
K} |\varphi|^p \delta_{\Omega}^{-(\alpha+p)} \mathrm{d}x=1 \right\}. $$ We show
that $H_{\alpha,p}(\Omega)$ is attained if and only if the spectral gap
$\Gamma_{\alpha,p}(\Omega):=
\lambda_{\alpha,p}^{\infty}(\Omega)-H_{\alpha,p}(\Omega)$ is strictly positive.
Moreover, we obtain tight decay estimates for the corresponding minimizers.
Furthermore, when $\Omega$ is bounded and $\alpha+p=1$, then
$\Gamma_{1-p,p}^{\infty}(\Omega)=0$ and $-\Delta_{1-p,p}$ is null-critical in
$\Omega$ with respect to the weight $\delta_{\Omega}^{-1}$, whereas, if $\alpha
+p < 1$, then
$\Gamma_{\alpha,p}^{\infty}(\Omega)=\left|\frac{\alpha+p-1}{p}\right|^{p}>0$
and $-\Delta_{\alpha,p}$ is positive-critical in $\Omega$ with respect to the
weight $\delta_\Omega^{-(\alpha+p)}$.
