/*
Theme Name: GeneratePress Child
Template: generatepress
Version: 1.0.0
Description: Child theme for GeneratePress on the DIRTcar network. Custom page templates and overrides live here.
Author: DIRTcar
Text Domain: generatepress-child
*/

/* Elementor post-info (terms): show only the first term, hide the hardcoded
   ", " separator by zeroing font-size on the wrapper. */
.elementor-post-info__terms-list {
	font-size: 0;
}
.elementor-post-info__terms-list .elementor-post-info__terms-list-item {
	display: none;
	font-size: 14px;
}
.elementor-post-info__terms-list .elementor-post-info__terms-list-item:first-child {
	display: inline;
}

/* ---- News page template (page-news.php) ---- */

.news-page {
	font-family: 'Titillium Web', Arial, sans-serif;
	color: #171717;
}

.news-page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 4px solid #F15A22;
	flex-wrap: wrap;
}

.news-page-title {
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	font-weight: 800;
	margin: 0;
	line-height: 1.1;
}

.news-category-filter {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.news-category-filter select {
	padding: 0.35rem 0.75rem;
	font-size: 0.85rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
}

.news-meta {
	display: block;
	font-size: 0.8rem;
	font-weight: 400;
	color: #777;
	margin-bottom: 0.35rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Featured (1 post) */
.news-featured {
	margin-bottom: 2rem;
}

.news-featured-card {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 1.5rem;
	align-items: center;
	padding: 1rem;
	border: 1px solid #f0f0f0;
	box-shadow: -2px 0 10px rgba(0, 0, 0, 0.13);
}

.news-featured-thumb {
	display: block;
	line-height: 0;
}

.news-featured-thumb img {
	width: 100%;
	height: auto;
	display: block;
}

.news-featured-title {
	font-size: clamp(1.5rem, 2.5vw, 2rem);
	font-weight: 800;
	line-height: 1.1;
	margin: 0 0 0.75rem 0;
}

.news-featured-title a {
	color: #171717;
	text-decoration: none;
}

.news-featured-title a:hover {
	color: #F15A22;
}

.news-featured-excerpt {
	font-size: 1rem;
	line-height: 1.5;
}

/* Grid (9 posts) */
.news-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 2rem;
}

.news-grid-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #f0f0f0;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.13);
	overflow: hidden;
}

.news-grid-thumb {
	display: block;
	line-height: 0;
	aspect-ratio: 16 / 9;
}

.news-grid-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.news-grid-body {
	padding: 0.75rem 1rem;
}

.news-grid-title {
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.2;
	margin: 0;
}

.news-grid-title a {
	color: #171717;
	text-decoration: none;
}

.news-grid-title a:hover {
	color: #F15A22;
}

/* List (paginated) */
.news-list {
	margin-top: 2rem;
}

.news-list-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #ececec;
}

.news-list-heading {
	font-size: 1.5rem;
	font-weight: 800;
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.news-list-items {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.news-list-card {
	display: grid;
	grid-template-columns: 180px minmax(0, 1fr);
	gap: 1rem;
	align-items: center;
	padding: 0.75rem 1rem;
	border: 1px solid #f0f0f0;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.13);
}

.news-list-thumb {
	display: block;
	line-height: 0;
	aspect-ratio: 16 / 10;
}

.news-list-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.news-list-title {
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 0.35rem 0;
}

.news-list-title a {
	color: #171717;
	text-decoration: none;
}

.news-list-title a:hover {
	color: #F15A22;
}

.news-list-excerpt {
	font-size: 0.9rem;
	color: #555;
	line-height: 1.4;
}

/* Pagination */
.news-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
}

.news-pagination-bottom {
	justify-content: center;
	margin-top: 1.5rem;
}

.news-pagination .page-numbers {
	display: inline-block;
	min-width: 2.25rem;
	padding: 0.35rem 0.6rem;
	font-size: 0.9rem;
	font-weight: 600;
	text-align: center;
	color: #171717;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
}

.news-pagination .page-numbers:hover {
	background: #f5f5f5;
}

.news-pagination .page-numbers.current {
	background: #F15A22;
	border-color: #F15A22;
	color: #fff;
}

.news-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

.news-empty {
	padding: 2rem;
	text-align: center;
	color: #777;
}

/* Responsive */
@media (max-width: 900px) {
	.news-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.news-featured-card {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.news-grid {
		grid-template-columns: 1fr;
	}
	.news-list-card {
		grid-template-columns: 120px minmax(0, 1fr);
	}
	.news-page-header {
		flex-direction: column;
		align-items: flex-start;
	}
}
