/* ==========================================================================
   workfromanywhere.co — job cards (v1.0.0)
   Upload to: /wp-content/themes/wfa-theme/wfa/wfa-job-cards.css
   Loaded by wfa/jobs-index.php only.

   After the Discover deals grid on outsite.co/deals: a panel on top with
   a pill in each corner, a serif title, a thin rule, the details, and a
   full-width button pinned to the foot so every card in a row lines up.
   Square corners, matching the header, search bar and dropdowns.
   ========================================================================== */

.wfa-jobs-index,
.wfa-job-single {
	--jc-ink:     var(--wfa-text, #14171a);
	--jc-muted:   var(--wfa-muted, #5f6a70);
	--jc-paper:   var(--wfa-bg, #faf7f2);
	--jc-card:    var(--wfa-surface, #f2ede4);
	--jc-line:    var(--wfa-line, #e2dcd2);
	--jc-accent:  var(--wfa-accent, #0f5548);
	--jc-soft:    var(--wfa-accent-soft, #e3eeea);
	--jc-display: var(--wfa-display, "Fraunces", Georgia, "Times New Roman", serif);
}

/* GeneratePress lays .site-content out as a row, and the jobs <main>
   was shrinking to its content: about 940px inside a 1200px container,
   and not lined up with the logo. Let it fill the row, and use the same
   side padding as the header (40px, 30px on phones). */
.site-content > .wfa-jobs-index {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
}

.wfa-jobs-index > .wfa-wrap {
	max-width: none;
	padding-left: 40px;
	padding-right: 40px;
}

@media (max-width: 768px) {
	.wfa-jobs-index > .wfa-wrap {
		padding-left: 30px;
		padding-right: 30px;
	}
}

/* No products in the sidebar: the grid takes the full width. */
.wfa-jobs-index .wfa-layout.wfa-layout--full {
	grid-template-columns: minmax(0, 1fr);
}

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

.wfa-jobs-index .wfa-jobs.wfa-jobs--cards,
.wfa-job-single .wfa-jobs.wfa-jobs--cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
	gap: 1.75rem 1.25rem;
	margin: 0 0 2.5rem;
	padding: 0;
	border: 0;
	list-style: none;
}

/* ---------- card ---------- */

.wfa-jcard {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--jc-card);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wfa-jcard:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 28px -18px rgba(20, 23, 26, 0.35);
}

/* ---------- panel ---------- */

.wfa-jcard__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	text-decoration: none;
}

/* One card per row on phones: a shorter panel keeps more than one role
   on screen. */
@media (max-width: 599px) {
	.wfa-jcard__media {
		aspect-ratio: 16 / 9;
	}
}

/* One panel colour for every role: a shade darker than the card, with
   the icon in ink. The tone classes stay in the markup but no longer
   change anything. */
.wfa-jcard__media,
.wfa-jcard__media--1,
.wfa-jcard__media--2,
.wfa-jcard__media--3,
.wfa-jcard__media--4 {
	background: var(--jc-line);
	color: var(--jc-ink);
}

/* The category icon, large and thin, centred on the panel. */
.wfa-jcard__art {
	position: relative;
	width: clamp(4.5rem, 34%, 6rem);
	height: auto;
	transition: transform 0.4s ease;
}

.wfa-jcard:hover .wfa-jcard__art {
	transform: scale(1.06);
}

/* The sentence picker is gone from the template; hide it too in case a
   cached page still has it. */
.wfa-jobs-index .wfa-picker-band {
	display: none;
}

/* ---------- corner pills ---------- */

/* One row across the top of the panel: category left, REMOTE right.
   The category is never cut off; if it is too long for one line beside
   REMOTE it wraps onto a second line instead. */
.wfa-jcard__pills {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	right: 0.75rem;
	z-index: 1;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.5rem;
}

.wfa-jcard__pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.55rem;
	font-family: var(--wfa-ui, "Public Sans", system-ui, sans-serif);
	font-size: 0.625rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.wfa-jcard__pill--cat {
	flex: 0 1 auto;
	min-width: 0;
	background: var(--jc-paper);
	color: var(--jc-ink);
}

.wfa-jcard__pill--remote {
	flex: 0 0 auto;
	margin-left: auto;
	white-space: nowrap;
	background: var(--jc-ink);
	color: var(--jc-paper);
}

.wfa-jcard__globe {
	flex: 0 0 auto;
	width: 0.75rem;
	height: 0.75rem;
}

/* ---------- body ---------- */

.wfa-jcard__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 1.1rem 1.1rem 1.25rem;
}

.wfa-jcard__title {
	margin: 0;
	font-family: var(--jc-display);
	font-size: 1.3125rem;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: -0.005em;
}

.wfa-jcard__title a {
	color: var(--jc-ink);
	text-decoration: none;
}

/* The whole card is clickable through the title link. */
.wfa-jcard {
	position: relative;
}

.wfa-jcard__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.wfa-jcard__title a:focus-visible {
	outline: none;
}

.wfa-jcard:focus-within {
	outline: 2px solid var(--jc-ink);
	outline-offset: 3px;
}

.wfa-jcard__company {
	margin: 0.35rem 0 0;
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--jc-muted);
}

.wfa-jcard__meta {
	margin: 0.9rem 0 1.25rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--jc-line);
}

.wfa-jcard__meta p {
	margin: 0;
}

.wfa-jcard__salary {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--jc-ink);
}

.wfa-jcard__where {
	display: flex;
	align-items: flex-start;
	gap: 0.35rem;
	margin-top: 0.3rem !important;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--jc-ink);
}

.wfa-jcard__icon {
	flex: 0 0 auto;
	width: 0.875rem;
	height: 0.875rem;
	margin-top: 0.1rem;
	color: var(--jc-muted);
}

.wfa-jcard__when {
	margin-top: 0.3rem !important;
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--jc-muted);
}

/* ---------- button ---------- */

.wfa-jcard__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	margin-top: auto;
	padding: 0.7rem 1rem;
	border: 1px solid var(--jc-ink);
	background: var(--jc-ink);
	color: var(--jc-paper);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover flips it light with an ink edge, like the other site buttons.
   No green. */
.wfa-jcard:hover .wfa-jcard__btn,
.wfa-jcard a.wfa-jcard__btn:hover {
	border-color: var(--jc-ink);
	background: var(--jc-paper);
	color: var(--jc-ink);
	text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
	.wfa-jcard,
	.wfa-jcard__art,
	.wfa-jcard__btn {
		transition: none;
	}

	.wfa-jcard:hover {
		transform: none;
	}
}
