/* Ram Katha site-load popup — desktop / tablet / mobile */
.svnm-ramkatha-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
	box-sizing: border-box;
	background: rgba(20, 12, 8, 0.72);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.svnm-ramkatha-popup.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.svnm-ramkatha-popup__dialog {
	position: relative;
	width: min(800px, 100%);
	max-height: min(450px, calc(100dvh - 64px), calc(100vh - 64px));
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.svnm-ramkatha-popup__close {
	position: absolute !important;
	top: -14px !important;
	right: -14px !important;
	left: auto !important;
	bottom: auto !important;
	z-index: 5 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 36px !important;
	min-width: 36px !important;
	max-width: 36px !important;
	height: 36px !important;
	min-height: 36px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 2px solid #ffffff !important;
	border-radius: 50% !important;
	background: #8f2d2d !important;
	background-color: #8f2d2d !important;
	background-image: none !important;
	color: #ffffff !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-size: 24px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
	cursor: pointer !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.svnm-ramkatha-popup__close:hover,
.svnm-ramkatha-popup__close:focus-visible {
	background: #732323 !important;
	background-color: #732323 !important;
	color: #ffffff !important;
}

.svnm-ramkatha-popup__img {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(450px, calc(100dvh - 64px), calc(100vh - 64px));
	object-fit: contain;
	border-radius: 4px;
}

/* Tablet */
@media (max-width: 1024px) {
	.svnm-ramkatha-popup {
		padding: 28px;
	}

	.svnm-ramkatha-popup__dialog {
		width: min(720px, 100%);
	}

	.svnm-ramkatha-popup__close {
		top: -12px !important;
		right: -12px !important;
	}
}

/* Phone — close stays inside the banner so it never clips off-screen */
@media (max-width: 767px) {
	.svnm-ramkatha-popup {
		padding: 20px 16px;
		align-items: center;
	}

	.svnm-ramkatha-popup__dialog {
		width: 100%;
		max-height: min(420px, calc(100dvh - 56px), calc(100vh - 56px));
	}

	.svnm-ramkatha-popup__img {
		max-height: min(420px, calc(100dvh - 56px), calc(100vh - 56px));
	}

	.svnm-ramkatha-popup__close {
		top: 8px !important;
		right: 8px !important;
		width: 40px !important;
		min-width: 40px !important;
		max-width: 40px !important;
		height: 40px !important;
		min-height: 40px !important;
		font-size: 24px !important;
	}
}

/* Small phones / landscape height */
@media (max-width: 480px) {
	.svnm-ramkatha-popup {
		padding: 16px 12px;
	}

	.svnm-ramkatha-popup__dialog,
	.svnm-ramkatha-popup__img {
		max-height: min(360px, calc(100dvh - 48px), calc(100vh - 48px));
	}

	.svnm-ramkatha-popup__close {
		top: 6px !important;
		right: 6px !important;
		width: 38px !important;
		min-width: 38px !important;
		max-width: 38px !important;
		height: 38px !important;
		min-height: 38px !important;
	}
}

@media (max-height: 500px) and (orientation: landscape) {
	.svnm-ramkatha-popup {
		padding: 12px;
	}

	.svnm-ramkatha-popup__dialog,
	.svnm-ramkatha-popup__img {
		max-height: calc(100dvh - 32px);
		max-height: calc(100vh - 32px);
	}

	.svnm-ramkatha-popup__close {
		top: 6px !important;
		right: 6px !important;
		width: 34px !important;
		min-width: 34px !important;
		max-width: 34px !important;
		height: 34px !important;
		min-height: 34px !important;
		font-size: 20px !important;
	}
}
