/* =========================================================
   PEEB News Filter Styles
   File: /assets/css/news-related.css
   ========================================================= */

.peeb-news-ajax-wrapper {
	width: 100%;
	margin: 0;
	padding: 0;
}

.peeb-news-filter-toolbar {
	margin: 0 0 28px;
	padding: 0;
}

.peeb-news-filter-form {
	width: 100%;
}

.peeb-news-filter-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
	gap: 16px;
	align-items: end;
}

.peeb-news-filter-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	position: relative;
}

.peeb-news-filter-label {
	display: block;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: #1f1f1f;
}

.peeb-news-filter-input,
.peeb-news-filter-select {
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid #d8d8d8;
	border-radius: 4px;
	background: #ffffff;
	font-size: 15px;
	line-height: 1.4;
	color: #1f1f1f;
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.peeb-news-filter-input:focus,
.peeb-news-filter-select:focus {
	outline: none;
	border-color: #9ac43c;
	box-shadow: 0 0 0 2px rgba(154, 196, 60, 0.12);
}

.peeb-news-filter-input::placeholder {
	color: #7a7a7a;
}

.peeb-news-filter-actions {
	display: flex;
	align-items: end;
	gap: 10px;
}

/* Temporary: keeps buttons visually clean */
.peeb-news-filter-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 18px;
	border-radius: 4px;
	border: 1px solid #e13c7a;
	background: #e13c7a;
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.peeb-news-filter-button:hover,
.peeb-news-filter-button:focus {
	background: #c92f68;
	border-color: #c92f68;
	color: #ffffff;
}

.peeb-news-filter-button-reset {
	background: #ffffff;
	color: #e13c7a;
}

.peeb-news-filter-button-reset:hover,
.peeb-news-filter-button-reset:focus {
	background: #fff5f8;
	color: #c92f68;
	border-color: #c92f68;
}

/* Loader / messages */
.peeb-news-results-area {
	position: relative;
	width: 100%;
}

.peeb-news-results-loader {
	margin: 0 0 18px;
	padding: 14px 16px;
	border-radius: 4px;
	background: #f5f7f2;
	border: 1px solid #e5eadc;
}

.peeb-news-results-loader-text {
	display: inline-block;
	font-size: 14px;
	font-weight: 600;
	color: #57751e;
}

.peeb-news-results-message {
	margin: 0 0 18px;
}

.peeb-news-empty-state {
	padding: 18px 20px;
	border: 1px solid #ececec;
	border-radius: 4px;
	background: #fafafa;
	font-size: 15px;
	color: #444444;
}

/* Results grid */
.peeb-news-results-grid {
	width: 100%;
}

.peeb-news-grid-inner {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px 28px;
	align-items: stretch;
}

/* Card */
.peeb-news-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #ffffff;
	border: 1px solid #ededed;
	border-radius: 0;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.peeb-news-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.peeb-news-card-image-wrap {
	position: relative;
	width: 100%;
	height: 280px;
	overflow: hidden;
	background: #f3f3f3;
	flex-shrink: 0;
}

.peeb-news-card-image-link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
}

.peeb-news-card-image {
	display: block;
	width: 100%;
	height: 100%!important;
	object-fit: cover;
}

.peeb-news-card-content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 22px 22px 18px;
}

.peeb-news-card-title {
	margin: 0 0 14px;
	font-size: 22px;
	line-height: 1.32;
	font-weight: 500;
	letter-spacing: 0;
	min-height: calc(1.32em * 2);

	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.peeb-news-card-title a {
	color: #121212;
	text-decoration: none;
}

.peeb-news-card-title a:hover,
.peeb-news-card-title a:focus {
	color: #88b300;
	text-decoration: none;
}

.peeb-news-card-date {
	margin: 0 0 14px;
	font-size: 15px;
	line-height: 1.4;
	color: #5f5f5f;
	min-height: calc(1.4em * 1);
}

.peeb-news-card-excerpt {
	margin: 0 0 18px;
	font-size: 16px;
	line-height: 1.6;
	color: #2f2f2f;
	min-height: calc(1.6em * 3);

	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.peeb-news-card-footer {
	margin-top: auto;
}

.peeb-news-card-button {
	display: inline-block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: #88b300;
	text-decoration: none;
}

.peeb-news-card-button:hover,
.peeb-news-card-button:focus {
	color: #6b8d00;
	text-decoration: none;
}

/* Pagination */
.peeb-news-results-pagination {
	margin-top: 30px;
}

.peeb-news-pagination-nav {
	width: 100%;
}

.peeb-news-pagination-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: flex-start;
	margin: 0;
	padding: 0;
	list-style: none;
}

.peeb-news-pagination-item {
	margin: 0;
	padding: 0;
}

.peeb-news-pagination-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	padding: 0 12px;
	border: 1px solid #d9d9d9;
	background: #ffffff;
	color: #1f1f1f;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.peeb-news-pagination-link:hover,
.peeb-news-pagination-link:focus {
	border-color: #88b300;
	color: #88b300;
}

.peeb-news-pagination-link.is-current {
	background: #88b300;
	border-color: #88b300;
	color: #ffffff;
}

/* Loading state */
.peeb-news-ajax-wrapper.is-loading .peeb-news-results-grid,
.peeb-news-ajax-wrapper.is-loading .peeb-news-results-pagination {
	opacity: 0.55;
	pointer-events: none;
}

/* NiceSelect compatibility */
.peeb-news-filter-field .nice-select {
	position: relative;
	display: block;
	float: none;
	width: 100%;
	margin: 0;
	min-height: 48px;
	line-height: 46px;
	border: 1px solid #d8d8d8;
	border-radius: 4px;
	font-size: 15px;
	color: #1f1f1f;
	padding-left: 14px;
	padding-right: 34px;
}

.peeb-news-filter-field .nice-select .current {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
}

.peeb-news-filter-field .nice-select .list {
	width: 100%;
	max-height: 260px;
	overflow-y: auto;
	border-radius: 4px;
}

.peeb-news-filter-field .nice-select .option.selected,
.peeb-news-filter-field .nice-select .option.focus,
.peeb-news-filter-field .nice-select .option:hover {
	background-color: #f5f9ea;
}

.peeb-news-filter-field .nice-select .nice-select-search {
	width: calc(100% - 16px);
	margin: 8px;
	min-height: 38px;
	padding: 8px 10px;
	border: 1px solid #d8d8d8;
	border-radius: 4px;
}

/* Tablet */
@media (max-width: 1024px) {
	.peeb-news-filter-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.peeb-news-filter-actions {
		grid-column: 1 / -1;
	}

	.peeb-news-grid-inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px;
	}

	.peeb-news-card-image-wrap {
		height: 240px;
	}

	.peeb-news-card-title {
		font-size: 21px;
	}
}

/* Mobile */
@media (max-width: 767px) {
	.peeb-news-filter-toolbar {
		margin-bottom: 22px;
	}

	.peeb-news-filter-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.peeb-news-filter-actions {
		grid-column: auto;
	}

	.peeb-news-filter-button {
		width: auto;
	}

	.peeb-news-grid-inner {
		grid-template-columns: 1fr;
		gap: 22px;
	}

	.peeb-news-card-image-wrap {
		height: 220px;
	}

	.peeb-news-card-content {
		padding: 18px 18px 16px;
	}

	.peeb-news-card-title {
		font-size: 20px;
	}
}

/* Optional quick mode:
   hide Apply / Reset visually if you switch JS to auto-apply
*/
.peeb-news-ajax-wrapper.peeb-news-auto-apply .peeb-news-filter-actions {
	display: none;
}

/* =========================================================
   Fix: searchable native select should not occupy layout space
   ========================================================= */

.peeb-news-filter-field select.hidden-select,
.peeb-news-filter-field select.peeb-news-filter-select-searchable.hidden-select,
.peeb-news-filter-field select[data-peeb-nice-select-bound="true"].hidden-select {
	position: absolute !important;
	left: 0 !important;
	top: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
	border: 0 !important;
	overflow: hidden !important;
	z-index: -1 !important;
}