/**
 * Government Jobs Auto Importer — front-end styles.
 *
 * Scoped under plugin wrappers (.gjai-board, .gjai-single) to avoid clashing
 * with the active theme. Colours are driven by CSS variables so they can be
 * overridden in a child theme if desired.
 */

.gjai-board,
.gjai-single,
.gjai-related {
	--gjai-accent: #1a56db;
	--gjai-accent-dark: #1e429f;
	--gjai-ink: #1f2933;
	--gjai-muted: #6b7280;
	--gjai-line: #e5e7eb;
	--gjai-bg-soft: #f8fafc;
	--gjai-radius: 12px;
	--gjai-shadow: 0 1px 3px rgba( 17, 24, 39, 0.08 ), 0 1px 2px rgba( 17, 24, 39, 0.04 );
	color: var( --gjai-ink );
	box-sizing: border-box;
}

.gjai-board *,
.gjai-single *,
.gjai-related * {
	box-sizing: border-box;
}

/* Filters ------------------------------------------------------------- */
.gjai-filters {
	background: var( --gjai-bg-soft );
	border: 1px solid var( --gjai-line );
	border-radius: var( --gjai-radius );
	padding: 16px;
	margin-bottom: 24px;
}

.gjai-filters__row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.gjai-filters__row + .gjai-filters__row {
	margin-top: 12px;
}

.gjai-filters__row--selects {
	gap: 10px;
}

.gjai-input,
.gjai-select {
	flex: 1 1 180px;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var( --gjai-line );
	border-radius: 8px;
	font-size: 15px;
	background: #fff;
	color: var( --gjai-ink );
	line-height: 1.3;
}

.gjai-input:focus,
.gjai-select:focus {
	outline: none;
	border-color: var( --gjai-accent );
	box-shadow: 0 0 0 3px rgba( 26, 86, 219, 0.15 );
}

.gjai-filters__row .gjai-input {
	flex: 1 1 auto;
}

/* Buttons ------------------------------------------------------------- */
.gjai-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.gjai-btn--primary {
	background: var( --gjai-accent );
	color: #fff;
}

.gjai-btn--primary:hover,
.gjai-btn--primary:focus {
	background: var( --gjai-accent-dark );
	color: #fff;
}

.gjai-btn--ghost {
	background: #fff;
	color: var( --gjai-accent );
	border-color: var( --gjai-line );
}

.gjai-btn--ghost:hover,
.gjai-btn--ghost:focus {
	border-color: var( --gjai-accent );
	color: var( --gjai-accent-dark );
}

.gjai-btn--block {
	display: flex;
	width: 100%;
}

/* Grid + cards -------------------------------------------------------- */
.gjai-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 270px, 1fr ) );
	gap: 20px;
}

.gjai-board--compact .gjai-grid {
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
}

.gjai-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var( --gjai-line );
	border-radius: var( --gjai-radius );
	overflow: hidden;
	box-shadow: var( --gjai-shadow );
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gjai-card:hover {
	transform: translateY( -2px );
	box-shadow: 0 8px 20px rgba( 17, 24, 39, 0.1 );
}

.gjai-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: linear-gradient( 135deg, #e9effb, #dbe5fa );
	overflow: hidden;
}

.gjai-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gjai-card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 44px;
	font-weight: 800;
	color: var( --gjai-accent );
	opacity: 0.55;
}

.gjai-card__badge {
	position: absolute;
	left: 10px;
	top: 10px;
	background: rgba( 31, 41, 51, 0.82 );
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 9px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.gjai-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	flex: 1;
}

.gjai-card__title {
	margin: 0;
	font-size: 17px;
	line-height: 1.35;
}

.gjai-card__title a {
	color: var( --gjai-ink );
	text-decoration: none;
}

.gjai-card__title a:hover {
	color: var( --gjai-accent );
}

.gjai-card__org {
	margin: 0;
	color: var( --gjai-muted );
	font-size: 14px;
}

.gjai-card__meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	color: var( --gjai-muted );
}

.gjai-card__meta li {
	display: flex;
	align-items: center;
	gap: 6px;
}

.gjai-card__body .gjai-btn {
	margin-top: auto;
}

.gjai-ico {
	font-size: 14px;
	line-height: 1;
}

/* Empty + loading states --------------------------------------------- */
.gjai-empty {
	padding: 40px 16px;
	text-align: center;
	color: var( --gjai-muted );
	font-size: 16px;
	background: var( --gjai-bg-soft );
	border-radius: var( --gjai-radius );
}

.gjai-results.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Pagination ---------------------------------------------------------- */
.gjai-pagination {
	display: flex;
	justify-content: center;
	margin-top: 28px;
}

.gjai-pagination--links {
	gap: 6px;
	flex-wrap: wrap;
}

.gjai-pagination--links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var( --gjai-line );
	border-radius: 8px;
	text-decoration: none;
	color: var( --gjai-ink );
	background: #fff;
}

.gjai-pagination--links .page-numbers.current {
	background: var( --gjai-accent );
	border-color: var( --gjai-accent );
	color: #fff;
}

.gjai-loadmore[hidden] {
	display: none;
}

/* Single page --------------------------------------------------------- */
.gjai-single {
	max-width: 1080px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

.gjai-single__inner {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) 320px;
	gap: 32px;
	align-items: start;
}

.gjai-single__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}

.gjai-chip {
	background: #eef2ff;
	color: var( --gjai-accent-dark );
	font-size: 12px;
	font-weight: 600;
	padding: 4px 11px;
	border-radius: 999px;
	text-decoration: none;
}

.gjai-chip:hover {
	background: #e0e7ff;
}

.gjai-single__title {
	margin: 0 0 18px;
	font-size: 30px;
	line-height: 1.2;
}

.gjai-single__ad {
	margin: 0 0 24px;
	border: 1px solid var( --gjai-line );
	border-radius: var( --gjai-radius );
	overflow: hidden;
}

.gjai-single__ad img {
	width: 100%;
	height: auto;
	display: block;
}

.gjai-single__ad figcaption {
	font-size: 12px;
	color: var( --gjai-muted );
	padding: 8px 12px;
	background: var( --gjai-bg-soft );
	text-align: center;
}

.gjai-single section {
	margin-bottom: 28px;
}

.gjai-single h2 {
	font-size: 20px;
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid var( --gjai-line );
}

.gjai-details-table {
	width: 100%;
	border-collapse: collapse;
}

.gjai-details-table th,
.gjai-details-table td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var( --gjai-line );
	vertical-align: top;
	font-size: 15px;
}

.gjai-details-table th {
	width: 38%;
	color: var( --gjai-muted );
	font-weight: 600;
}

.gjai-prose {
	font-size: 15px;
	line-height: 1.7;
}

.gjai-prose img {
	max-width: 100%;
	height: auto;
}

/* Apply box (sidebar) ------------------------------------------------- */
.gjai-single__side {
	position: sticky;
	top: 24px;
}

.gjai-apply-box {
	background: #fff;
	border: 1px solid var( --gjai-line );
	border-radius: var( --gjai-radius );
	padding: 20px;
	box-shadow: var( --gjai-shadow );
}

.gjai-apply-box__deadline {
	margin: 0 0 14px;
	font-size: 14px;
	color: var( --gjai-ink );
	display: flex;
	align-items: center;
	gap: 6px;
}

.gjai-apply-box__note {
	margin: 12px 0 0;
	font-size: 12px;
	color: var( --gjai-muted );
	text-align: center;
}

.gjai-link {
	display: inline-block;
	margin-top: 14px;
	font-size: 14px;
	color: var( --gjai-accent );
}

/* Related ------------------------------------------------------------- */
.gjai-related {
	margin-top: 12px;
}

.gjai-related h2 {
	font-size: 20px;
	margin: 0 0 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid var( --gjai-line );
}

/* Archive header ------------------------------------------------------ */
.gjai-archive {
	max-width: 1080px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

.gjai-archive__title {
	font-size: 28px;
	margin: 0 0 8px;
}

.gjai-archive__desc {
	color: var( --gjai-muted );
	margin-bottom: 20px;
}

/* Responsive ---------------------------------------------------------- */
@media ( max-width: 900px ) {
	.gjai-single__inner {
		grid-template-columns: 1fr;
	}

	.gjai-single__side {
		position: static;
		order: -1;
	}
}

@media ( max-width: 600px ) {
	.gjai-filters__row {
		flex-direction: column;
	}

	.gjai-input,
	.gjai-select,
	.gjai-filters__row .gjai-btn {
		width: 100%;
		flex: 1 1 auto;
	}

	.gjai-single__title {
		font-size: 24px;
	}

	.gjai-details-table th {
		width: 45%;
	}
}
