/* Maarif App Promo: mobile app cards, styled after shaheedeislam.com */

.map-apps {
	--map-accent: #8B1A1A;
	--map-cols: 3;
	clear: both;
	background: transparent;
	padding: 28px 16px 8px;
	margin: 0;
	box-sizing: border-box;
}
.map-apps.map-pos-bottom {
	padding: 40px 16px;
}
.map-apps *,
.map-apps *::before,
.map-apps *::after {
	box-sizing: border-box;
}

.map-head {
	text-align: center;
	margin: 0 auto 24px;
	max-width: 1100px;
}
.map-title {
	font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
	font-size: 30px;
	font-weight: 400;
	line-height: 1.9;
	color: var(--map-accent);
	margin: 0;
	padding: 0;
	border: 0;
	text-transform: none;
	letter-spacing: 0;
}
.map-subtitle {
	font-family: 'Noto Nastaliq Urdu', serif;
	font-size: 15px;
	line-height: 2;
	color: #777;
	margin: 6px 0 0;
}

.map-grid {
	display: grid;
	grid-template-columns: repeat(var(--map-cols), minmax(0, 1fr));
	gap: 24px;
	max-width: 1100px;
	margin: 0 auto;
}

.map-card {
	background: #fff;
	border: 1px solid #E8D5C0;
	border-radius: 16px;
	padding: 26px 22px 22px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 14px;
	box-shadow: 0 2px 12px rgba(139, 26, 26, .07);
	transition: transform .2s ease, box-shadow .2s ease;
}
.map-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 28px rgba(139, 26, 26, .14);
}

.map-icon {
	width: 80px;
	height: 80px;
	border-radius: 18px;
	overflow: hidden;
	flex-shrink: 0;
	background: #F5E8D5;
	box-shadow: 0 4px 14px rgba(139, 26, 26, .18);
}
.map-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border: 0;
	max-width: none;
}

.map-name {
	font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
	font-size: 18px;
	font-weight: 700;
	line-height: 2;
	color: var(--map-accent);
	margin: 0;
	padding: 0;
	border: 0;
	flex: 1;
}

.map-btns {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
}
.map-apps a.map-btn,
.map-apps a.map-btn:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 9px 16px;
	border-radius: 10px;
	background: #000;
	color: #fff;
	text-decoration: none;
	font-family: Arial, Helvetica, sans-serif;
	direction: ltr;
	transition: filter .2s ease, transform .15s ease;
}
.map-apps a.map-btn:hover,
.map-apps a.map-btn:focus {
	color: #fff;
	filter: brightness(1.25);
	transform: scale(1.02);
}
.map-apps a.map-btn:focus-visible {
	outline: 3px solid var(--map-accent);
	outline-offset: 2px;
}
.map-btn svg {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}
.map-btn span {
	display: flex;
	flex-direction: column;
	text-align: left;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}
.map-btn small {
	font-size: 9px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .5px;
	opacity: .85;
}

/* 5 per row gets narrow: tighten the cards a little. */
.map-apps[style*="--map-cols: 5"] .map-card {
	padding: 22px 14px 16px;
}
.map-apps[style*="--map-cols: 5"] .map-name {
	font-size: 16px;
}
.map-apps[style*="--map-cols: 5"] a.map-btn {
	padding: 8px 10px;
	gap: 8px;
}

@media (max-width: 1100px) {
	.map-apps[style*="--map-cols: 5"] .map-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
/* Tablets and phones: one swipeable row instead of a tall stack. */
@media (max-width: 900px) {
	.map-grid,
	.map-apps[style*="--map-cols: 5"] .map-grid {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 42%;
		gap: 14px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding: 4px 2px 12px;
		scrollbar-width: thin;
	}
	.map-card {
		scroll-snap-align: center;
	}
	.map-card:hover {
		transform: none;
	}
}
@media (max-width: 560px) {
	.map-apps,
	.map-apps.map-pos-bottom {
		padding: 24px 12px;
	}
	.map-title {
		font-size: 24px;
	}
	.map-grid,
	.map-apps[style*="--map-cols: 5"] .map-grid {
		grid-auto-columns: 72%;
		gap: 12px;
	}
}
