/**
 * Block: Jobs List
 *
 * @package WePlay
 */

/* =============================================
   LAYOUT
   ============================================= */

.jobs-list__layout {
	display: grid;
	grid-template-columns: calc((min(34vw - var(--gutter), var(--content-width) * 0.34)) - (var(--grid-gap) / 2)) minmax(0, 1fr);
	column-gap: var(--container-gap);
	align-items: start;
}

@media (max-width: 900px) {
	.jobs-list__layout {
		grid-template-columns: 1fr;
	}
}

/* =============================================
   INTRO (left column)
   ============================================= */

.jobs-list__intro {
	display: flex;
	flex-direction: column;
	gap: var(--space-s);
}

.jobs-list__heading {
	font-family: var(--heading-font-family);
	font-weight: var(--heading-font-weight);
	text-transform: uppercase;
	line-height: 0.95;
	margin: 0;
}

.jobs-list__description {
	font-size: var(--text-m);
	line-height: 1.6;
	color: var(--base-semi-dark);
	max-width: 40ch;
}

/* =============================================
   ITEMS LIST
   ============================================= */

.jobs-list__items {
	display: flex;
	flex-direction: column;
}

.jobs-list__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
	padding: var(--space-s);
	border: none;
	border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
	background: none;
	cursor: pointer;
	text-align: left;
	font: inherit;
	width: 100%;
	transition: background var(--transition);
}

.jobs-list__item:last-child {
	border-bottom: none;
}

.jobs-list__item:hover {
	background: var(--bg-light, #f5f5f5);
}

/* =============================================
   ITEM INFO
   ============================================= */

.jobs-list__item-info {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.jobs-list__item-type {
	font-size: var(--text-xs);
	color: var(--base-semi-dark);
	font-weight: 500;
}

.jobs-list__item-title {
	margin: 0;
	font-size: var(--h3);
	font-weight: 700;
	line-height: 1.1;
}

/* =============================================
   ARROW ICON
   ============================================= */

.jobs-list__item-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid var(--border-color, rgba(0, 0, 0, 0.15));
	transition: background var(--transition), border-color var(--transition);
}

.jobs-list__item-arrow img {
	width: 20px;
	height: 20px;
	display: block;
}

.jobs-list__item:hover .jobs-list__item-arrow {
	background: var(--primary);
	border-color: var(--primary);
}

/* =============================================
   NO RESULTS
   ============================================= */

.jobs-list__no-results {
	text-align: center;
	color: var(--base-dark);
	padding: var(--space-l) 0;
}

/* =============================================
   MODAL
   ============================================= */

.jobs-modal[hidden] {
	display: none;
}

.jobs-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
	transform: none;
	animation: none;
}

.jobs-modal__panel {
	opacity: 0;
	transform: translateY(20px);
	animation: jobsModalPanelIn 0.4s ease-out 0.05s forwards;
}

@keyframes jobsModalPanelIn {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.jobs-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.jobs-modal__panel {
	--modal-padding: var(--space-m);
	position: relative;
	z-index: 1;
	background: #fff;
	width: 100%;
	max-width: 720px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
}

@media (min-width: 768px) {
	.jobs-modal__panel {
		--modal-padding: var(--space-l);
	}
}

/* =============================================
   MODAL TOP (fixed header area)
   ============================================= */

.jobs-modal__top {
	flex-shrink: 0;
	padding: var(--modal-padding);
	padding-bottom: var(--space-s);
	border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

/* =============================================
   MODAL HEADER
   ============================================= */

.jobs-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-s);
	margin-bottom: var(--space-xs);
}

.jobs-modal__title {
	margin: 0;
	font-size: var(--h3);
	font-family: 'Kinetika';
	text-transform: none;
	font-weight: 700;
	line-height: 1.1;
}

.jobs-modal__close {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border: none;
	background: none;
	cursor: pointer;
	border-radius: 50%;
	color: var(--base);
	transition: background var(--transition);
}

.jobs-modal__close:hover {
	background: var(--bg-light, #f5f5f5);
}

/* =============================================
   MODAL META
   ============================================= */

.jobs-modal__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
}

.jobs-modal__meta-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: var(--text-s);
	color: var(--base-semi-dark);
}

.jobs-modal__meta-item[hidden] {
	display: none;
}

.jobs-modal__meta-item svg {
	flex-shrink: 0;
	opacity: 0.6;
}

/* =============================================
   MODAL BODY (scrollable)
   ============================================= */

.jobs-modal__body {
	flex: 1;
	overflow-y: auto;
	padding: var(--space-s) var(--modal-padding);
}

.jobs-modal__body h2,
.jobs-modal__body h3,
.jobs-modal__body h4 {
	margin-top: var(--space-s);
}

.jobs-modal__body h2:first-child,
.jobs-modal__body h3:first-child,
.jobs-modal__body h4:first-child {
	margin-top: 0;
}

/* =============================================
   MODAL FOOTER (fixed at bottom)
   ============================================= */

.jobs-modal__footer[hidden] {
	display: none;
}

.jobs-modal__footer {
	flex-shrink: 0;
	padding: var(--space-s) var(--modal-padding);
	border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

.jobs-modal__apply {
	display: block;
	width: 100%;
	text-align: center;
}

/* =============================================
   BODY LOCK
   ============================================= */

html.is-job-modal-open {
	overflow: hidden;
}
