/*
 * Not The Classipress Theme - responsive ads grid and mobile layout rules.
 * Loaded after the theme stylesheet.
 */

/* ---------- Ads grid ---------- */

.ntc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0 0 24px;
	padding: 0;
	clear: both;
}

@media (min-width: 640px) {
	.ntc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 1024px) {
	.ntc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Home template: three larger cards per row. */
@media (min-width: 1024px) {
	.ntc-grid.ntc-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
	.ntc-grid--3 .ntc-card__title { font-size: 17px; }
	.ntc-grid--3 .ntc-card__excerpt { font-size: 14px; }
	.ntc-grid--3 .ntc-card__body { padding: 12px 14px 14px; }
}

.ntc-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	background: #fff;
	border: 1px solid #e3e6ea;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ntc-card:hover,
.ntc-card:focus-within {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.ntc-card.featured {
	border-color: #f0b429;
	box-shadow: 0 0 0 1px #f0b429;
}

.ntc-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	background: #f1f3f5;
	overflow: hidden;
}

.ntc-card__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.ntc-card__img--placeholder {
	object-fit: contain;
	padding: 12%;
	opacity: 0.6;
}

.ntc-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px 12px 12px;
	min-width: 0;
}

.ntc-card__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}

.ntc-card__title a {
	color: inherit;
	text-decoration: none;
}

.ntc-card__title a:hover,
.ntc-card__title a:focus {
	text-decoration: underline;
}

.ntc-card__cats {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: #6b7280;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ntc-card__cats a {
	display: inline-block;
	padding: 3px 0;
}

.ntc-card__excerpt {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: #4b5563;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}

/* ---------- Home template ---------- */

.ntc-home {
	padding-top: 20px;
}

.ntc-home__intro {
	margin: 0 0 20px;
}

.ntc-home__title {
	margin: 0 0 10px;
	font-size: 26px;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.ntc-home__page {
	font-weight: 400;
	opacity: 0.7;
}

.ntc-home__text {
	font-size: 15px;
	line-height: 1.6;
}

.ntc-home__text > *:last-child {
	margin-bottom: 0;
}

.ntc-more {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin: 8px 0 32px;
}

.ntc-more__btn,
.ntc-more__btn:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 28px;
	border-radius: 8px;
	background: #1f2937;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
}

.ntc-more__btn:hover,
.ntc-more__btn:focus {
	background: #111827;
	color: #fff;
}

.ntc-more__btn--prev,
.ntc-more__btn--prev:visited {
	background: #fff;
	color: #1f2937;
	border: 1px solid #cbd0d6;
}

.ntc-more__btn--prev:hover,
.ntc-more__btn--prev:focus {
	background: #f3f4f6;
	color: #111827;
}

@media (max-width: 639px) {
	.ntc-home__title { font-size: 22px; }
	.ntc-more__btn { flex: 1 1 100%; }
	.ntc-card__body { padding: 8px 10px 10px; }
	.ntc-card__title { font-size: 14px; }
	.ntc-card__excerpt { font-size: 12.5px; }
}

@media (max-width: 339px) {
	.ntc-grid { grid-template-columns: minmax(0, 1fr); }
}
#listing-layout { display: none !important; }

/* ---------- Mobile-friendly rules for every page ---------- */

/* Media never wider than the screen. */
img,
video,
canvas,
svg,
iframe,
embed,
object {
	max-width: 100%;
}

.entry-content img,
.ntc-home__text img,
.widget img,
.comment-content img {
	height: auto;
}

/* Long words, URLs and phone numbers wrap instead of pushing the page sideways. */
.entry-title,
.entry-content,
.page-header,
.widget,
.comment-content,
.breadcrumbs,
.listing-meta,
.taxonomy-description {
	overflow-wrap: anywhere;
	word-wrap: break-word;
}

pre {
	max-width: 100%;
	overflow-x: auto;
	white-space: pre-wrap;
}

/* Wide tables scroll inside their own box. */
.entry-content table,
.comment-content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

@media (max-width: 639px) {

	/* 16px form text stops phones zooming in when a field is tapped. */
	input[type="text"],
	input[type="email"],
	input[type="password"],
	input[type="search"],
	input[type="tel"],
	input[type="url"],
	input[type="number"],
	input[type="date"],
	select,
	textarea {
		font-size: 16px;
	}

	/* Finger-sized tap targets. */
	.pagination li a,
	.pagination li.current a,
	.pagination li > span {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 44px;
		min-height: 44px;
	}

	.button,
	button.button,
	input[type="submit"],
	input[type="button"] {
		min-height: 44px;
	}

	.button.tiny,
	.button.small,
	.listing-actions a,
	.listing-actions .button {
		min-width: 40px;
		min-height: 40px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.breadcrumbs li a,
	.tagcloud a,
	.listing-tags a,
	.widget ul li a {
		display: inline-block;
		padding-top: 6px;
		padding-bottom: 6px;
	}

	/* A little more reading room at the screen edges. */
	.content-area.row {
		padding-left: 4px;
		padding-right: 4px;
	}
}

/* The theme colours every link; keep the button text readable. */
.ntc-more a.ntc-more__btn,
.ntc-more a.ntc-more__btn:visited,
.ntc-more a.ntc-more__btn:hover,
.ntc-more a.ntc-more__btn:focus {
	color: #fff !important;
}

.ntc-more a.ntc-more__btn--prev,
.ntc-more a.ntc-more__btn--prev:visited,
.ntc-more a.ntc-more__btn--prev:hover,
.ntc-more a.ntc-more__btn--prev:focus {
	color: #1f2937 !important;
}
