/**
 * CSS-only modal (:target) — `.haam-popup` + `.haam-popup-inner`.
 */

.haam-popup-open {
	box-sizing: border-box;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: none;
	display: inline-block;
	border-radius: 1.5rem;
	background-color: #fff;
	color: #1a1532;
	border: 1px solid #1a1532;
	padding: 0.85rem 1.75rem;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.haam-popup-open:hover {
	background-color: #ebd11a;
	border-color: #c4b016;
	color: #1a1532;
}

.haam-popup {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(26, 21, 50, 0.82);
	z-index: 99999;
	visibility: hidden;
	opacity: 0;
	overflow: hidden;
	transition: 0.64s ease-in-out;
	padding: 1.25rem;
}

.haam-popup-inner {
	box-sizing: border-box;
	position: relative;
	bottom: -100vw;
	right: -100vh;
	display: flex;
	align-items: stretch;
	max-width: 800px;
	max-height: min(600px, 90vh);
	width: min(60%, 100%);
	height: auto;
	min-height: 320px;
	background-color: #fff;
	transform: rotate(32deg);
	transition: 0.64s ease-in-out;
	overflow: hidden;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 24px 64px rgba(26, 21, 50, 0.28);
}

.haam-popup__photo {
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
	width: 40%;
	min-height: 280px;
	overflow: hidden;
	background: #f3f4f6;
}

.haam-popup__photo img {
	width: auto;
	height: 100%;
	min-height: 100%;
	object-fit: cover;
	display: block;
}

.haam-popup__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 60%;
	height: 100%;
	padding: clamp(1.5rem, 4vw, 4rem);
	text-align: right;
}

.haam-popup__text h2,
.haam-popup__text h3 {
	font-size: clamp(1.25rem, 2.2vw, 2rem);
	font-weight: 800;
	margin: 0 0 1.25rem;
	text-transform: none;
	color: #1a1532;
	line-height: 1.35;
}

.haam-popup__text p {
	font-size: 0.92rem;
	color: #4b5563;
	line-height: 1.75;
	margin: 0;
}

.haam-popup:target {
	visibility: visible;
	opacity: 1;
}

.haam-popup:target .haam-popup-inner {
	bottom: 0;
	right: 0;
	transform: rotate(0);
}

.haam-popup__close {
	position: absolute;
	inset-inline-end: -1rem;
	top: -1rem;
	width: 3rem;
	height: 3rem;
	font-size: 1.1rem;
	font-weight: 400;
	border-radius: 100%;
	background-color: #1a1532;
	z-index: 4;
	color: #fff;
	line-height: 3rem;
	text-align: center;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.haam-popup__close:hover {
	background-color: #c4161c;
	color: #fff;
}

[dir="rtl"] .haam-popup-inner,
:is(.haam-article, .haam-mag-single__content) .haam-popup-inner {
	flex-direction: row-reverse;
}

@media screen and (max-width: 768px) {
	.haam-popup-inner {
		flex-direction: column;
		width: 100%;
		min-height: 0;
		max-height: 92vh;
		overflow-y: auto;
	}

	.haam-popup__photo,
	.haam-popup__text {
		width: 100%;
	}

	.haam-popup__photo {
		min-height: 180px;
		max-height: 220px;
	}

	.haam-popup__text {
		padding: 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.haam-popup,
	.haam-popup-inner {
		transition: none;
	}

	.haam-popup-inner {
		bottom: 0;
		right: 0;
		transform: none;
	}
}
