/* Al Makkah Popup v3 — front-end styles */

/* ---------- Floating overlay + positions ---------- */

.amkpop-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.amkpop-overlay.amkpop-open {
	opacity: 1;
}

/* Bars and corner popups: no dark layer, and the page stays clickable
   outside the popup itself. */
.amkpop-overlay.amkpop-nobg {
	background: transparent;
	pointer-events: none;
}

.amkpop-overlay.amkpop-nobg .amkpop-box {
	pointer-events: auto;
}

.amkpop-pos-bottom_right {
	align-items: flex-end;
	justify-content: flex-end;
	padding: 16px;
}

.amkpop-pos-bottom_left {
	align-items: flex-end;
	justify-content: flex-start;
	padding: 16px;
}

.amkpop-pos-top_bar {
	align-items: flex-start;
	padding: 0;
}

.amkpop-pos-bottom_bar {
	align-items: flex-end;
	padding: 0;
}

.amkpop-pos-top_bar .amkpop-box,
.amkpop-pos-bottom_bar .amkpop-box {
	width: 100%;
	max-width: 100%;
}

.amkpop-pos-top_bar .amkpop-img,
.amkpop-pos-bottom_bar .amkpop-img {
	width: 100%;
	max-height: 180px;
	object-fit: cover;
	border-radius: 0;
}

.amkpop-pos-top_bar .amkpop-embed,
.amkpop-pos-bottom_bar .amkpop-embed,
.amkpop-pos-top_bar .amkpop-message,
.amkpop-pos-bottom_bar .amkpop-message {
	border-radius: 0;
}

.amkpop-pos-fullscreen {
	padding: 0;
}

.amkpop-pos-fullscreen .amkpop-box {
	width: 100%;
	height: 100%;
	max-width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.amkpop-pos-fullscreen .amkpop-stage,
.amkpop-pos-fullscreen .amkpop-message {
	width: 100%;
	max-width: 900px;
}

.amkpop-pos-fullscreen .amkpop-img {
	max-height: 100vh;
}

/* The X normally hangs over the corner — inside the screen for bars
   and full screen, where there is no room outside the box. */
.amkpop-pos-top_bar .amkpop-close,
.amkpop-pos-bottom_bar .amkpop-close,
.amkpop-pos-fullscreen .amkpop-close {
	top: 8px;
	right: 8px;
}

.amkpop-box {
	position: relative;
	max-width: 92vw;
	line-height: 0;
}

/* Entry animations (transform/opacity on the box). */
.amkpop-anim-fade {
	opacity: 0;
	transition: opacity 0.3s ease;
}
.amkpop-open .amkpop-anim-fade,
.amkpop-inline.amkpop-anim-fade {
	opacity: 1;
}

.amkpop-anim-zoom {
	transform: scale(0.94);
	transition: transform 0.3s ease;
}
.amkpop-open .amkpop-anim-zoom {
	transform: scale(1);
}

.amkpop-anim-slide {
	transform: translateY(26px);
	transition: transform 0.3s ease;
}
.amkpop-open .amkpop-anim-slide {
	transform: translateY(0);
}

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

.amkpop-stage {
	position: relative;
}

.amkpop-img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 86vh;
	object-fit: contain;
	border-radius: var(--amk-radius, 10px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.amkpop-img.amkpop-img-in {
	opacity: 1;
}

/* Stack slideshow frames on top of each other for the crossfade. */
.amkpop-stage .amkpop-img + .amkpop-img {
	position: absolute;
	inset: 0;
}

.amkpop-embed {
	line-height: 1.4;
	max-height: 86vh;
	overflow: auto;
	background: #fff;
	border-radius: var(--amk-radius, 10px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.amkpop-embed iframe,
.amkpop-embed img,
.amkpop-embed video {
	max-width: 100%;
}

/* Message (text + buttons) content: a clean card. */
.amkpop-message {
	background: #fff;
	color: #2b2b2b;
	padding: 30px 28px;
	text-align: center;
	line-height: 1.5;
	border-radius: var(--amk-radius, 10px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	max-height: 88vh;
	overflow: auto;
}

.amkpop-msg-title {
	margin: 0 0 10px;
	font-size: 26px;
	line-height: 1.25;
	color: #5c0a14;
}

.amkpop-msg-text {
	margin: 0 0 18px;
	font-size: 16px;
	white-space: pre-line;
}

.amkpop-msg-btns {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

.amkpop-btn {
	display: inline-block;
	padding: 11px 22px;
	border-radius: 999px;
	background: #5c0a14;
	color: #f5e9cf !important;
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.3;
}

.amkpop-btn:hover,
.amkpop-btn:focus {
	background: #7d1020;
}

.amkpop-btn-2 {
	background: #c9a227;
	color: #2b2b2b !important;
}

.amkpop-btn-2:hover,
.amkpop-btn-2:focus {
	background: #dcb73a;
}

/* Optional shadow off. */
.amkpop-noshadow .amkpop-img,
.amkpop-noshadow .amkpop-embed,
.amkpop-noshadow .amkpop-message {
	box-shadow: none;
}

/* "Don't show this again" — a small dark pill so it stays readable
   over the dark backdrop, over bars, and on light pages (inline). */
.amkpop-dontwrap {
	text-align: center;
	margin-top: 10px;
	line-height: 1.4;
}

.amkpop-dontshow {
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12.5px;
	cursor: pointer;
	text-decoration: underline;
}

.amkpop-dontshow:hover,
.amkpop-dontshow:focus {
	background: rgba(0, 0, 0, 0.75);
}

/* ---------- Inline placement ---------- */

.amkpop-inline {
	position: relative;
	max-width: 100%;
	margin: 10px auto;
	line-height: 0;
}

.amkpop-inline .amkpop-img {
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

/* ---------- Auto size (Responsive mode) ----------
   The popup sizes itself to the image at its natural aspect ratio,
   constrained only by the visitor's screen. */

.amkpop-box.amk-auto {
	width: auto;
}

.amkpop-inline.amk-auto {
	width: 100%;
}

.amk-auto .amkpop-img {
	width: auto;
	max-width: 92vw;
	max-height: 88vh;
}

.amk-auto .amkpop-embed,
.amk-auto .amkpop-message {
	max-width: 92vw;
	max-height: 88vh;
}

@media (min-width: 768px) and (max-width: 1024px) {
	.amk-auto .amkpop-img,
	.amk-auto .amkpop-embed,
	.amk-auto .amkpop-message {
		max-width: min(86vw, 560px);
	}
}

@media (min-width: 1025px) {
	.amk-auto .amkpop-img,
	.amk-auto .amkpop-embed,
	.amk-auto .amkpop-message {
		max-width: 640px;
	}
}

/* In bars the content always spans the full width. */
.amkpop-pos-top_bar .amk-auto .amkpop-message,
.amkpop-pos-bottom_bar .amk-auto .amkpop-message,
.amkpop-pos-top_bar .amk-auto .amkpop-embed,
.amkpop-pos-bottom_bar .amk-auto .amkpop-embed {
	max-width: 100%;
}

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

.amkpop-close {
	position: absolute;
	top: -16px;
	right: -16px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 2px solid #f5e9cf;
	border-radius: 50%;
	background: #5c0a14;
	color: #f5e9cf;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.amkpop-close:hover,
.amkpop-close:focus {
	background: #7d1020;
	outline: none;
}

@media (max-width: 480px) {
	.amkpop-close {
		top: -12px;
		right: -8px;
		width: 34px;
		height: 34px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amkpop-overlay,
	.amkpop-anim-fade,
	.amkpop-anim-zoom,
	.amkpop-anim-slide,
	.amkpop-img {
		transition: none;
	}

	.amkpop-anim-zoom,
	.amkpop-anim-slide {
		transform: none;
	}
}
