/*
 * NPH Homepage Advertisement — 9-slot grid (4 + 5).
 * Scoped entirely to .nph-advertisement and its children; does not
 * redeclare or override any parent theme selector, so header, footer,
 * hero, search, categories, hotels, shops, map, floating button, and
 * bottom navigation are all unaffected.
 */

.nph-advertisement {
	width: 100%;
	max-width: 100%;
	margin: 32px auto;
	box-sizing: border-box;
}

.nph-ad-grid-top {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin-bottom: 18px;
}

.nph-ad-grid-bottom {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 18px;
}

.nph-ad-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 22px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
	transition: transform 0.28s ease, box-shadow 0.28s ease;
	box-sizing: border-box;
}

.nph-ad-card:hover,
.nph-ad-card:focus-within {
	transform: translateY(-5px);
	box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.nph-ad-image {
	display: block;
	width: 100%;
}

.nph-ad-image img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.nph-ad-content {
	padding: 14px;
	min-width: 0;
}

.nph-ad-title {
	margin: 0 0 6px;
	font-size: 17px;
	line-height: 1.4;
	color: #1f2937;
	overflow-wrap: break-word;
	word-break: break-word;
}

.nph-ad-description {
	margin: 0;
	color: #6b7280;
	font-size: 14px;
	line-height: 1.6;
	overflow-wrap: break-word;
	word-break: break-word;
}

.nph-ad-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 12px;
	padding: 9px 14px;
	min-height: 44px;
	border-radius: 12px;
	background: #159447;
	color: #ffffff;
	font-weight: 700;
	text-decoration: none;
	box-sizing: border-box;
}

.nph-ad-button:hover,
.nph-ad-button:focus-visible {
	background: #0f7a3a;
	color: #ffffff;
}

/* Tablet: 768px–1199px — both rows become 2 columns, extra cards wrap automatically (native CSS Grid behavior, no JS needed). */
@media (max-width: 1199px) {
	.nph-ad-grid-top,
	.nph-ad-grid-bottom {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile: below 768px — 2 columns, tighter spacing, no horizontal scroll. */
@media (max-width: 767px) {
	.nph-advertisement {
		margin: 22px auto;
		overflow-x: hidden;
	}

	.nph-ad-grid-top,
	.nph-ad-grid-bottom {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.nph-ad-grid-top {
		margin-bottom: 12px;
	}

	.nph-ad-card {
		border-radius: 17px;
	}

	.nph-ad-content {
		padding: 10px;
	}

	.nph-ad-title {
		font-size: 14px;
	}

	.nph-ad-description {
		font-size: 12px;
	}

	.nph-ad-button {
		width: 100%;
		padding: 8px 10px;
		font-size: 12px;
	}
}
