/* JNews Advanced Archive — front-end styles */

.jaa-wrapper {
	direction: rtl;
	text-align: right;
	max-width: 1200px;
	margin: 0 auto;
}

/* ---------- Filter form ---------- */

.jaa-filter-form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	align-items: end;
	padding: 20px;
	margin-bottom: 28px;
	background: #f7f7f9;
	border-radius: 10px;
	border: 1px solid #eaeaec;
}

.jaa-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.jaa-field label,
.jaa-field legend {
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

.jaa-field input[type="text"],
.jaa-field select {
	padding: 8px 10px;
	border: 1px solid #dcdcdf;
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
}

.jaa-field-sort {
	border: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.jaa-field-sort label {
	font-weight: 400;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
}

.jaa-field-submit {
	flex-direction: row;
	gap: 8px;
}

.jaa-btn {
	cursor: pointer;
	border: none;
	border-radius: 6px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	transition: opacity .15s ease;
}

.jaa-btn:hover {
	opacity: .88;
}

.jaa-btn-primary {
	background: #d32f2f;
	color: #fff;
}

.jaa-btn-reset {
	background: #e2e2e5;
	color: #333;
}

/* ---------- Results grid ---------- */

.jaa-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 22px;
}

.jaa-card {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
	transition: transform .15s ease, box-shadow .15s ease;
}

.jaa-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

.jaa-card-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #eee;
}

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

.jaa-card-thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #eaeaea, #f5f5f5);
}

.jaa-card-cat {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #d32f2f;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 4px;
}

.jaa-card-body {
	padding: 14px 16px 18px;
}

.jaa-card-title {
	margin: 0 0 8px;
	font-size: 16px;
	line-height: 1.5;
}

.jaa-card-title a {
	color: #1a1a1a;
	text-decoration: none;
}

.jaa-card-title a:hover {
	color: #d32f2f;
}

.jaa-card-meta {
	font-size: 12px;
	color: #888;
	margin-bottom: 8px;
}

.jaa-card-excerpt {
	font-size: 13px;
	color: #555;
	line-height: 1.7;
	margin: 0;
}

.jaa-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 0;
	color: #777;
}

/* ---------- Pagination / Load more ---------- */

#jaa-pagination {
	display: flex;
	justify-content: center;
	margin-top: 30px;
}

.jaa-btn-loadmore {
	background: #1a1a1a;
	color: #fff;
	padding: 11px 30px;
}

.jaa-btn-loadmore.is-loading {
	opacity: .6;
	pointer-events: none;
}

/* ---------- Select2 RTL tweaks ---------- */

.jaa-wrapper .select2-container {
	width: 100% !important;
	direction: rtl;
}

.jaa-wrapper .select2-selection {
	min-height: 38px !important;
	border-radius: 6px !important;
}

/* ---------- Loading state ---------- */

.jaa-results-grid.is-loading {
	opacity: .5;
	pointer-events: none;
	transition: opacity .15s ease;
}

@media (max-width: 600px) {
	.jaa-filter-form {
		grid-template-columns: 1fr 1fr;
	}
}
