/* ==========================================================
   Careers Manager – front-end styles
   All colors / sizes come from CSS variables set in Settings.
   ========================================================== */

.cm-scope,
.cm-scope *,
.cm-scope *::before,
.cm-scope *::after { box-sizing: border-box; }

.cm-scope {
	font-family: var(--cm-font, inherit);
	font-size: var(--cm-base-font-size, 16px);
	color: var(--cm-text-color, #1e293b);
	line-height: 1.6;
	-webkit-text-size-adjust: 100%;
}
.cm-scope a { text-decoration: none; }
.cm-scope h1, .cm-scope h2, .cm-scope h3 { font-family: inherit; }

.cm-page { background: var(--cm-page-bg); padding-bottom: 64px; width: 100%; }
.cm-container { width: 100%; max-width: var(--cm-container-width, 1140px); margin: 0 auto; padding: 0 20px; }
.cm-embed { width: 100%; }

/* ---------- Hero ---------- */
.cm-hero {
	background: linear-gradient(135deg, var(--cm-primary-dark), var(--cm-primary));
	color: var(--cm-hero-text);
	padding: clamp(36px, 7vw, 76px) 0 clamp(52px, 8vw, 92px);
	text-align: center;
}
.cm-hero h1 {
	color: inherit; margin: 0 0 10px;
	font-size: var(--cm-hero-title-size);
	font-weight: var(--cm-title-weight);
	line-height: 1.2; word-break: break-word;
}
.cm-hero p { margin: 0 auto; max-width: 640px; opacity: .92; font-size: 1.05em; }

.cm-hero--single { text-align: left; padding-bottom: clamp(40px, 6vw, 64px); }
.cm-hero--single h1 { font-size: var(--cm-single-title-size); margin: 10px 0 14px; }
.cm-back {
	display: inline-flex; align-items: center; gap: 6px;
	color: var(--cm-hero-text) !important; opacity: .9; font-size: .9em; margin-bottom: 14px;
}
.cm-back:hover { opacity: 1; text-decoration: underline; }
.cm-hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; opacity: .95; font-size: .95em; }
.cm-hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.cm-badges { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Filters ---------- */
.cm-archive-body { padding-top: 32px; }
.cm-archive-body.has-hero { padding-top: 0; }

.cm-filters {
	display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
	background: var(--cm-card-bg); border: 1px solid var(--cm-border-color);
	border-radius: var(--cm-card-radius); padding: 14px; margin-bottom: 26px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
	position: relative; z-index: 2;
}
.cm-archive-body.has-hero .cm-filters { margin-top: -32px; }
.cm-filters input[type="search"],
.cm-filters select {
	flex: 1 1 200px; min-width: 0; height: 46px; padding: 0 14px;
	border: 1px solid var(--cm-border-color); border-radius: 10px;
	background: #fff; color: var(--cm-text-color); font: inherit; font-size: .95em;
}
.cm-filters input:focus, .cm-filters select:focus { outline: 2px solid var(--cm-primary); outline-offset: 0; border-color: var(--cm-primary); }
.cm-filters .cm-btn { height: 46px; }

/* ---------- List / Grid ---------- */
.cm-list { display: grid; gap: 16px; grid-template-columns: 1fr; }
.cm-layout-grid .cm-list { grid-template-columns: repeat(var(--cm-grid-columns, 2), minmax(0, 1fr)); }

.cm-card {
	position: relative;
	display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center;
	background: var(--cm-card-bg); border: 1px solid var(--cm-border-color);
	border-radius: var(--cm-card-radius); padding: 20px 22px;
	transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.cm-card:hover { border-color: var(--cm-primary); box-shadow: 0 12px 30px rgba(36, 67, 147, .13); transform: translateY(-2px); }
.cm-card.is-new {
	border-color: var(--cm-primary);
	background: linear-gradient(90deg, var(--cm-primary-light), var(--cm-card-bg) 60%);
	box-shadow: inset 4px 0 0 var(--cm-primary);
}
.cm-card.is-closed { opacity: .72; }

.cm-card__icon {
	width: 52px; height: 52px; border-radius: 50%;
	background: var(--cm-primary-light); color: var(--cm-primary);
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cm-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cm-card__title { margin: 0; font-size: var(--cm-card-title-size); font-weight: var(--cm-title-weight); line-height: 1.3; }
.cm-card__title a { color: var(--cm-text-color); }
.cm-card__title a:hover { color: var(--cm-primary); }
.cm-card__sub { color: var(--cm-muted-color); font-size: .9em; margin-top: 2px; }

.cm-meta { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cm-meta li { display: inline-flex; align-items: center; gap: 6px; color: var(--cm-muted-color); font-size: .9em; margin: 0; }
.cm-meta svg { color: var(--cm-primary); flex-shrink: 0; }

.cm-layout-grid .cm-card { grid-template-columns: 1fr; align-items: start; gap: 14px; }
.cm-layout-grid .cm-card__action .cm-btn { width: 100%; }

/* ---------- Badges ---------- */
.cm-badge {
	display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
	font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.6;
}
.cm-badge--new { background: var(--cm-new-bg); color: var(--cm-new-text); animation: cm-pulse 2s infinite; }
.cm-badge--open { background: #fff; color: var(--cm-open-color); }
.cm-badge--closed { background: var(--cm-closed-color); color: #fff; }
.cm-card .cm-badge--open { background: transparent; }
@keyframes cm-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(255, 90, 31, .55); }
	70%  { box-shadow: 0 0 0 9px rgba(255, 90, 31, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.cm-badge--new { animation: none; }
	.cm-card, .cm-modal, .cm-modal__dialog { transition: none !important; }
}

/* ---------- Buttons ---------- */
.cm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px; border-radius: 10px; border: 0; cursor: pointer;
	font: inherit; font-size: .95em; font-weight: 600; line-height: 1.2; white-space: nowrap;
	transition: background .18s ease, color .18s ease, transform .1s ease;
}
.cm-btn:active { transform: scale(.98); }
.cm-btn--primary { background: var(--cm-primary); color: #fff !important; }
.cm-btn--primary:hover { background: var(--cm-primary-dark); }
.cm-btn--soft { background: var(--cm-primary-light); color: var(--cm-primary) !important; }
.cm-btn--soft:hover { background: var(--cm-primary); color: #fff !important; }
.cm-btn--block { width: 100%; padding: 14px 22px; font-size: 1em; }
.cm-btn.is-disabled { background: #cbd5e1; color: #64748b !important; cursor: not-allowed; }

/* ---------- Contact icons ---------- */
.cm-contact { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cm-icon-btn {
	width: 46px; height: 46px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	color: #fff !important; transition: transform .15s ease, box-shadow .15s ease;
}
.cm-icon-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0, 0, 0, .22); }
.cm-icon-btn--whatsapp { background: var(--cm-whatsapp-color); }
.cm-icon-btn--call { background: var(--cm-call-color); }
.cm-icon-btn--mail { background: var(--cm-mail-color); }

/* ---------- Single page ---------- */
.cm-single__grid {
	display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 28px;
	align-items: start; margin-top: -28px; position: relative; z-index: 2;
}
.cm-single__main { display: grid; gap: 22px; min-width: 0; }

.cm-panel {
	background: var(--cm-card-bg); border: 1px solid var(--cm-border-color);
	border-radius: var(--cm-card-radius); padding: 26px;
	box-shadow: 0 6px 22px rgba(15, 23, 42, .05);
}
.cm-panel__title {
	margin: 0 0 16px; font-size: 1.25em; font-weight: var(--cm-title-weight); color: var(--cm-text-color);
	padding-bottom: 12px; border-bottom: 2px solid var(--cm-primary-light); position: relative;
}
.cm-panel__title::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 56px; height: 2px; background: var(--cm-primary); }
.cm-sticky { position: sticky; top: 24px; }

.cm-content { overflow-wrap: anywhere; }
.cm-content > *:first-child { margin-top: 0; }
.cm-content > *:last-child { margin-bottom: 0; }
.cm-content p { margin: 0 0 1em; }
.cm-content ul, .cm-content ol { margin: 0 0 1em 1.2em; padding: 0; }
.cm-content li { margin-bottom: .35em; }
.cm-content h2, .cm-content h3, .cm-content h4 { margin: 1.4em 0 .5em; line-height: 1.3; color: var(--cm-text-color); }
.cm-content img { max-width: 100%; height: auto; }
.cm-content table { display: block; max-width: 100%; overflow-x: auto; }

.cm-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.cm-chips li {
	margin: 0; padding: 7px 14px; border-radius: 999px; font-size: .9em; font-weight: 500;
	background: var(--cm-primary-light); color: var(--cm-primary);
}

.cm-overview { list-style: none; margin: 0 0 20px; padding: 0; }
.cm-overview li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--cm-border-color); margin: 0; }
.cm-overview li:last-child { border-bottom: 0; }
.cm-overview__icon {
	flex: 0 0 38px; height: 38px; border-radius: 10px;
	background: var(--cm-primary-light); color: var(--cm-primary);
	display: flex; align-items: center; justify-content: center;
}
.cm-overview__text { display: flex; flex-direction: column; min-width: 0; }
.cm-overview__label { font-size: .75em; text-transform: uppercase; letter-spacing: .06em; color: var(--cm-muted-color); }
.cm-overview__value { font-weight: 600; overflow-wrap: anywhere; }
.cm-overview__value.cm-open { color: var(--cm-open-color); }
.cm-overview__value.cm-closed { color: var(--cm-closed-color); }

.cm-apply { margin-top: 4px; }
.cm-alt { text-align: center; margin: 10px 0 0; font-size: .9em; color: var(--cm-muted-color); }
.cm-alt a { color: var(--cm-primary); font-weight: 600; text-decoration: underline; }
.cm-reach { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--cm-border-color); }
.cm-reach__label { display: block; font-size: .85em; color: var(--cm-muted-color); margin-bottom: 10px; }

.cm-mobile-bar { display: none; }

.cm-empty { text-align: center; padding: 50px 20px; color: var(--cm-muted-color); background: var(--cm-card-bg); border: 1px dashed var(--cm-border-color); border-radius: var(--cm-card-radius); }

/* ---------- Pagination ---------- */
.cm-pagination { margin-top: 30px; display: flex; justify-content: center; }
.cm-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.cm-pagination li { margin: 0; }
.cm-pagination a, .cm-pagination span {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
	border: 1px solid var(--cm-border-color); background: var(--cm-card-bg);
	color: var(--cm-primary); font-weight: 600; font-size: .95em;
}
.cm-pagination a:hover { background: var(--cm-primary-light); border-color: var(--cm-primary); }
.cm-pagination .current { background: var(--cm-primary); border-color: var(--cm-primary); color: #fff; }
.cm-pagination .dots { border: 0; background: transparent; }

/* ==========================================================
   Apply popup
   ========================================================== */
body.cm-modal-lock { overflow: hidden; }

.cm-modal {
	position: fixed; inset: 0; z-index: 100000;
	display: flex; align-items: center; justify-content: center; padding: 20px;
	visibility: hidden; opacity: 0; pointer-events: none;
	transition: opacity .25s ease, visibility 0s linear .25s;
}
.cm-modal.is-open { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .25s ease; }

.cm-modal__overlay { position: absolute; inset: 0; background: var(--cm-overlay-color); opacity: var(--cm-overlay-opacity, .6); }

.cm-modal__dialog {
	position: relative; width: 100%; max-width: var(--cm-popup-width, 640px);
	max-height: var(--cm-popup-max-height, 90vh);
	display: flex; flex-direction: column;
	background: var(--cm-card-bg); border-radius: var(--cm-popup-radius, 16px);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .35); overflow: hidden; outline: 0;
	transform: translateY(24px) scale(.98); transition: transform .3s ease;
}
@supports (height: 100dvh) {
	.cm-modal__dialog { max-height: min(var(--cm-popup-max-height, 90vh), calc(100dvh - 24px)); }
}
.cm-modal.is-open .cm-modal__dialog { transform: none; }

.cm-modal__head {
	flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 16px 20px; background: var(--cm-primary); color: #fff;
}
.cm-modal__title { margin: 0; font-size: 1.15em; font-weight: var(--cm-title-weight); color: #fff; line-height: 1.3; overflow-wrap: anywhere; }
.cm-modal__close {
	flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(255, 255, 255, .16); color: #fff; padding: 0; transition: background .15s ease;
}
.cm-modal__close:hover, .cm-modal__close:focus-visible { background: rgba(255, 255, 255, .32); outline: 0; }

/* The scrolling area: form can be any height, never gets cropped */
.cm-modal__body {
	flex: 1 1 auto; min-height: 0;
	overflow-y: auto; overflow-x: hidden;
	padding: 22px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	scrollbar-width: thin; scrollbar-color: var(--cm-primary) transparent;
}
.cm-modal__body::-webkit-scrollbar { width: 8px; }
.cm-modal__body::-webkit-scrollbar-thumb { background: var(--cm-primary); border-radius: 8px; }
.cm-modal__body::-webkit-scrollbar-track { background: transparent; }

/* Keep third-party forms inside the popup */
.cm-modal__body img, .cm-modal__body iframe, .cm-modal__body video, .cm-modal__body table,
.cm-modal__body form, .cm-modal__body select, .cm-modal__body textarea { max-width: 100%; }
.cm-modal__body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
.cm-modal__body select, .cm-modal__body textarea { width: 100%; }
.cm-modal__body iframe { border: 0; }
.cm-modal__body .wpcf7, .cm-modal__body .wpforms-container, .cm-modal__body .frm-fluent-form,
.cm-modal__body .gform_wrapper { max-width: 100% !important; margin: 0 !important; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1000px) {
	.cm-layout-grid .cm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.cm-single__grid { grid-template-columns: 1fr; margin-top: -24px; }
	.cm-single__side { order: -1; }
	.cm-sticky { position: static; }

	/* Apply stays visible on mobile through the sticky bottom bar */
	.cm-single-page { padding-bottom: 92px; }
	.cm-apply, .cm-reach { display: none; }
	.cm-mobile-bar {
		display: flex; align-items: center; gap: 10px;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
		background: var(--cm-card-bg); border-top: 1px solid var(--cm-border-color);
		box-shadow: 0 -8px 24px rgba(15, 23, 42, .12);
	}
	.cm-mobile-bar > .cm-btn { flex: 1 1 auto; }
	.cm-mobile-bar .cm-contact { flex: 0 0 auto; flex-wrap: nowrap; gap: 8px; }
	.cm-mobile-bar .cm-icon-btn { width: 44px; height: 44px; }
}

@media (max-width: 768px) {
	.cm-container { padding: 0 16px; }
	.cm-card { grid-template-columns: auto minmax(0, 1fr); padding: 18px; gap: 14px; }
	.cm-card__icon { width: 44px; height: 44px; }
	.cm-card__action { grid-column: 1 / -1; }
	.cm-card__action .cm-btn { width: 100%; }
	.cm-panel { padding: 20px; }
	.cm-filters { padding: 12px; }
	.cm-filters .cm-btn { flex: 1 1 100%; }
}

@media (max-width: 640px) {
	.cm-layout-grid .cm-list { grid-template-columns: 1fr; }
	.cm-meta { gap: 6px 14px; }

	/* Popup becomes a bottom sheet */
	.cm-modal { padding: 0; align-items: flex-end; }
	.cm-modal__dialog {
		max-width: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
		max-height: 92vh; transform: translateY(40px);
	}
	@supports (height: 100dvh) { .cm-modal__dialog { max-height: 92dvh; } }
	.cm-modal__body { padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
}
