/*
 * Jobs listing — responsive card grid
 * Enqueued by cjdng_job_render_list() (the [cjdng_jobs_list] shortcode).
 */

.cjdng-jobs-list {
	--cjdng-job-accent: var(--e-global-color-primary, #2563eb);
	--cjdng-job-accent-soft: color-mix(in srgb, var(--cjdng-job-accent) 9%, transparent);
	--cjdng-job-text: var(--e-global-color-text, #1f2937);
	--cjdng-job-muted: color-mix(in srgb, var(--cjdng-job-text) 60%, transparent);
	--cjdng-job-border: #e5e7eb;

	font-family: var(--e-global-typography-text-font-family, inherit);
	color: var(--cjdng-job-text);
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1rem;
	margin: 1.5rem 0;
}

.cjdng-job-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	gap: 0.55rem;
	padding: 1.25rem 1.35rem 1.35rem;
	background: #fff;
	border: 1px solid var(--cjdng-job-border);
	border-radius: 12px;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cjdng-job-card:hover {
	border-color: var(--cjdng-job-accent);
	box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--cjdng-job-accent) 45%, transparent);
	transform: translateY(-1px);
}

/* Full-bleed featured image: cancels the card padding so it spans edge-to-edge
 * at the top. The card's own overflow:hidden clips it to the rounded corners. */
.cjdng-job-card-media {
	margin: -1.25rem -1.35rem 0;
	aspect-ratio: 16 / 9;
	background: color-mix(in srgb, var(--cjdng-job-text) 8%, transparent);
	overflow: hidden;
}

.cjdng-job-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.2s ease;
}

.cjdng-job-card:hover .cjdng-job-card-img {
	transform: scale(1.03);
}

.cjdng-job-card-meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.3rem;
	font-size: 0.9rem;
	color: var(--cjdng-job-muted);
}

/* Employment type: quiet meta text, not a pill. */
.cjdng-job-card-type {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.72rem;
	color: var(--cjdng-job-muted);
}

/* Sits above the stretched title overlay so the centre link stays clickable. */
.cjdng-job-card-location {
	position: relative;
	z-index: 1;
}

.cjdng-job-card-location a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cjdng-job-card-salary {
	font-weight: 600;
	color: var(--cjdng-job-text);
}

/* Scoped with the list class so it out-specifies the theme's `.entry-content h2`
 * rule, which would otherwise blow the card title up to article-heading size. */
.cjdng-jobs-list .cjdng-job-card-title {
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-weight: var(--e-global-typography-primary-font-weight, 600);
	font-size: 1.15rem;
	margin: 0;
	line-height: 1.3;
}

.cjdng-job-card-title a {
	color: var(--cjdng-job-text);
	text-decoration: none;
}

.cjdng-job-card-title a:hover {
	color: var(--cjdng-job-accent);
}

/* Stretched link: a click anywhere on the card opens the position. */
.cjdng-job-card-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
}

.cjdng-job-card-cta {
	margin-top: auto;
	padding-top: 0.55rem;
	color: var(--cjdng-job-accent);
	font-weight: 600;
	font-size: 0.92rem;
}

.cjdng-job-card:hover .cjdng-job-card-cta {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cjdng-jobs-empty {
	color: color-mix(in srgb, var(--e-global-color-text, #1f2937) 60%, transparent);
	font-size: 1rem;
	margin: 1.5rem 0;
}
