/* ==========================================================================
   Jobs by VELYON — Single Listing Page
   Scoped to body.single-veljob_listing (WP's auto-added body class).
   Milestone D: also scoped to .single-veljob_assessment — the Assessment
   detail page (class-veljob-single-assessment.php) reuses this same
   stylesheet and the same Easy Apply modal markup/JS wholesale, rather
   than duplicating ~450 lines for what is visually an identical page.
   Deliberately icon-font-free — no Dashicons dependency on the front end,
   consistent with the fix applied to the submission form after the
   Milestone 2 front-end icon issue.
   Colors/radius sourced from the VELYON theme's design tokens — see the
   local --veljob-* aliases below, pointed at --velyon-* rather than
   hardcoded hex (same pattern as every other file in this plugin).
   Body text/heading fonts are NOT set here on purpose — this page's markup
   lives inside the theme's normal post content, so it already inherits
   --velyon-font-body / --velyon-font-heading sitewide; no override needed.
   ========================================================================== */

.single-veljob_listing,
.single-veljob_assessment {
	--veljob-primary: var(--velyon-accent);
	--veljob-primary-dark: var(--velyon-accent-deep);
	--veljob-primary-light: color-mix(in srgb, var(--velyon-accent) 14%, transparent);
	--veljob-border: var(--velyon-border);
	--veljob-text: var(--velyon-text);
	--veljob-text-muted: var(--velyon-text-muted);
	--veljob-bg-card: var(--velyon-surface);
	--veljob-bg-alt: var(--velyon-surface-alt);
	--veljob-success: var(--velyon-success);
	--veljob-danger: var(--velyon-danger);
	--veljob-warning: var(--velyon-warning);
	--veljob-on-accent: var(--velyon-on-accent);
}

.veljob-single-content-wrap {
	position: relative;
}
@media (max-width: 860px) {
	/* Keeps the fixed mobile action bar from covering the tail end of
	   the content — env() adds the extra safe-area inset on notched
	   phones, so the bar itself never sits under a home-indicator. */
	.veljob-single-content-wrap {
		padding-bottom: calc(78px + env(safe-area-inset-bottom));
	}
}
@media (max-width: 782px) {
	/* Below 782px the theme's own bottom tab bar also reserves space —
	   our bar sits ON TOP of it (see the bottom-nav-height override
	   above), so the content needs room for BOTH stacked, not just ours.
	   No extra env(safe-area-inset-bottom) here — the theme's tab-bar
	   height token already includes that inset. */
	.veljob-single-content-wrap {
		padding-bottom: calc(70px + var(--velyon-bottom-nav-height, 0px) + 12px);
	}
}

.veljob-single-back-link {
	margin: 0 0 18px;
}
.veljob-single-back-link a {
	font-size: 14px;
	font-weight: 600;
	color: var(--veljob-primary);
	text-decoration: none;
}
.veljob-single-back-link a:hover {
	text-decoration: underline;
}

/* ---- Two-column layout: main content + sticky sidebar ---- */
.veljob-single-layout {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 40px;
	align-items: start;
}
@media (max-width: 860px) {
	.veljob-single-layout {
		grid-template-columns: 1fr;
	}
}

.veljob-single-sidebar {
	position: sticky;
	top: 20px;
}
.veljob-single-sidebar-sticky {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
@media (max-width: 860px) {
	.veljob-single-sidebar {
		position: static;
	}
}

/* ---- Meta block ---- */
.veljob-single-meta {
	margin-bottom: 26px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--veljob-border);
}
.veljob-single-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-bottom: 12px;
}
.veljob-single-pill {
	display: inline-block;
	background: var(--veljob-bg-alt);
	color: var(--veljob-text-muted);
	font-size: 13px;
	font-weight: 600;
	padding: 7px 15px;
	border-radius: 20px;
}
.veljob-single-pill-category {
	background: var(--veljob-primary-light);
	color: var(--veljob-primary);
}
.veljob-single-posted {
	font-size: 13px;
	color: var(--veljob-text-muted);
	margin: 0;
}

/* ---- Description ---- */
.veljob-single-description {
	font-size: 16.5px;
	line-height: 1.75;
	color: var(--veljob-text);
	margin-bottom: 34px;
}
.veljob-single-description p {
	margin: 0 0 1.3em;
}

/* ---- Sticky sidebar "job summary" card ---- */
.veljob-sidebar-card {
	background: var(--veljob-bg-card);
	border: 1px solid var(--veljob-border);
	border-radius: var(--velyon-radius-m);
	padding: 24px 22px;
	box-shadow: var(--velyon-shadow);
}
.veljob-sidebar-company {
	font-size: 15px;
	font-weight: 700;
	color: var(--veljob-text-muted);
	margin: 0 0 6px;
}
.veljob-sidebar-budget {
	font-size: 24px;
	font-weight: 800;
	color: var(--veljob-success);
	margin: 0 0 18px;
	line-height: 1.2;
}

/* Buttons inside the sidebar card stack full-width (narrow column) —
   different sizing from the same buttons in the mobile bar below. */
.veljob-sidebar-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.veljob-sidebar-actions .veljob-single-cta-btn,
.veljob-sidebar-actions .veljob-single-prepare-btn {
	width: 100%;
	justify-content: center;
	text-align: center;
	padding: 15px 20px;
	font-size: 15.5px;
}
@media (max-width: 860px) {
	/* The mobile fixed bottom bar covers this need on mobile — showing
	   the same two buttons twice in one scroll flow would be redundant. */
	.veljob-sidebar-actions {
		display: none;
	}
}

.veljob-sidebar-divider {
	height: 1px;
	background: var(--veljob-border);
	margin: 20px 0;
}

.veljob-sidebar-details {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.veljob-sidebar-detail-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 13.5px;
}
.veljob-sidebar-detail-label {
	color: var(--veljob-text-muted);
}
.veljob-sidebar-detail-value {
	color: var(--veljob-text);
	font-weight: 600;
	text-align: right;
}

/* ---- Shared button styles (used by both the sidebar card and the
   mobile bar via render_action_buttons()) ---- */
.veljob-single-cta-btn {
	display: inline-flex;
	align-items: center;
	padding: 17px 40px;
	background: var(--veljob-primary);
	color: var(--veljob-on-accent) !important;
	border-radius: 9px;
	font-size: 17px;
	font-weight: 700;
	text-decoration: none !important;
}
.veljob-single-cta-btn:hover {
	background: var(--veljob-primary-dark);
	color: var(--veljob-on-accent) !important;
}
.veljob-single-cta-closed {
	background: var(--veljob-bg-alt);
	color: var(--veljob-text-muted) !important;
	cursor: default;
}
.veljob-single-cta-closed:hover {
	background: var(--veljob-bg-alt);
	color: var(--veljob-text-muted) !important;
}
.veljob-single-prepare-btn {
	display: inline-flex;
	align-items: center;
	padding: 17px 32px;
	background: var(--veljob-bg-card);
	color: var(--veljob-primary);
	border: 2px solid var(--veljob-primary);
	border-radius: 9px;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
}
.veljob-single-prepare-btn:hover {
	background: var(--veljob-primary-light);
}

/* ---- Mobile fixed bottom action bar ---- */
.veljob-mobile-action-bar {
	display: none;
}
@media (max-width: 860px) {
	.veljob-mobile-action-bar {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 99999;
		background: var(--veljob-bg-card);
		border-top: 1px solid var(--veljob-border);
		box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.15);
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
	}
}
/* VELYON Theme bottom-tab-bar collision fix (v2.21.0): below 782px the
   theme's own fixed bottom tab bar is also on screen, so this bar needs
   to sit ON TOP of it rather than underneath/overlapping it. Between
   783px and 860px the theme's tab bar is hidden and
   --velyon-bottom-nav-height resolves to 0px, so the 860px block above
   stays correct unmodified in that range — only this narrower breakpoint
   needs the override. See README changelog for the full reasoning this
   was built against (VELYON-THEME-DESIGN-CONTRACT §9a / §6). */
@media (max-width: 782px) {
	.veljob-mobile-action-bar {
		bottom: var(--velyon-bottom-nav-height, 0px);
		z-index: 95; /* theme's bottom nav = 90, theme's drawer = 300 */
		padding-bottom: 12px; /* no env(safe-area-inset-bottom) here — the theme's tab bar already covers that inset */
	}
}
@media (max-width: 782px) {
	/* Tells the theme how tall our bar is at THIS breakpoint specifically
	   (70px: 10px top padding + ~46px button content + 12px bottom
	   padding + 1px border) — lets the theme's own scroll-to-top button
	   clear it. Defaults to 0px (theme-side) everywhere else, where our
	   bar isn't reserving this token's space in the first place. */
	body.single-veljob_listing,
	body.single-veljob_assessment {
		--velyon-bottom-bar-height: 70px;
	}
}
.veljob-mobile-actions-inner {
	display: flex;
	gap: 10px;
}
.veljob-mobile-actions-inner .veljob-single-cta-btn,
.veljob-mobile-actions-inner .veljob-single-prepare-btn {
	flex: 1;
	justify-content: center;
	text-align: center;
	padding: 12px 8px;
	font-size: 13.5px;
	border-radius: 8px;
	white-space: nowrap;
}

/* ---- Ad placements ---- */
.veljob-ad-sidebar-slot,
.veljob-ad-banner-slot {
	position: relative;
	border: 1px solid var(--veljob-border);
	border-radius: 10px;
	background: var(--veljob-bg-alt);
	padding: 30px 10px 10px;
	text-align: center;
	overflow: hidden;
}
.veljob-ad-sidebar-slot {
	min-height: 640px;
}
.veljob-ad-banner-slot {
	margin: 0 0 26px;
	min-height: 100px;
}
.veljob-ad-sidebar-slot .veljob-ad-label,
.veljob-ad-banner-slot .veljob-ad-label {
	position: absolute;
	top: 8px;
	left: 12px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--veljob-text-muted);
	opacity: 0.7;
}

/* ---- "Prepare for this Job" lead popup ---- */
.veljob-lead-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}
.veljob-lead-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}
.veljob-lead-modal-box {
	position: relative;
	background: var(--veljob-bg-card);
	border-radius: var(--velyon-radius-m);
	padding: 34px 30px;
	max-width: 420px;
	width: calc(100% - 32px);
	max-height: calc(100vh - 60px);
	overflow-y: auto;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.veljob-lead-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	color: var(--veljob-text-muted);
	cursor: pointer;
	padding: 4px;
}
.veljob-lead-form-panel h3,
.veljob-lead-success-panel h3 {
	margin: 0 0 8px;
	font-size: 20px;
}
.veljob-lead-form-panel p,
.veljob-lead-success-panel p {
	margin: 0 0 20px;
	font-size: 13.5px;
	color: var(--veljob-text-muted);
	line-height: 1.55;
}

/* ---- Milestone A: Easy Apply popup shell ---- */
.veljob-easy-apply-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
}
.veljob-easy-apply-modal-inner {
	position: relative;
	background: var(--veljob-bg-card);
	border-radius: var(--velyon-radius-m);
	padding: 34px 30px;
	max-width: 460px;
	width: calc(100% - 32px);
	max-height: calc(100vh - 60px);
	overflow-y: auto;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.veljob-easy-apply-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	color: var(--veljob-text-muted);
	cursor: pointer;
	padding: 4px;
}
.veljob-easy-apply-modal-inner h3 {
	margin: 0 0 10px;
	font-size: 20px;
}
.veljob-ea-panel p {
	margin: 0 0 18px;
	font-size: 13.5px;
	color: var(--veljob-text-muted);
	line-height: 1.55;
}

/* ---- Buttons shared across Easy Apply states ---- */
.veljob-ea-fetch-btn,
.veljob-ea-submit-btn,
.veljob-ea-retry-btn,
.veljob-ea-complete-profile-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 20px;
	background: var(--veljob-primary);
	color: var(--veljob-on-accent);
	border: none;
	border-radius: 8px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
}
.veljob-ea-fetch-btn:hover,
.veljob-ea-submit-btn:hover,
.veljob-ea-retry-btn:hover,
.veljob-ea-complete-profile-btn:hover {
	background: var(--veljob-primary-dark);
	color: var(--veljob-on-accent);
}
.veljob-ea-fetch-btn:disabled,
.veljob-ea-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}
.veljob-ea-fetch-btn-spinner,
.veljob-ea-submit-btn-spinner {
	width: 14px;
	height: 14px;
	border: 2px solid color-mix(in srgb, var(--veljob-on-accent) 35%, transparent);
	border-top-color: var(--veljob-on-accent);
	border-radius: 50%;
	animation: veljob-ea-spin 0.7s linear infinite;
}
@keyframes veljob-ea-spin {
	to { transform: rotate(360deg); }
}

/* ---- Already applied ---- */
.veljob-ea-already h3 {
	color: var(--veljob-success);
}

/* ---- Gate fail ---- */
.veljob-ea-gate-reasons {
	margin: 0 0 18px;
	padding-left: 18px;
}
.veljob-ea-gate-reasons li {
	font-size: 13.5px;
	color: var(--veljob-text);
	margin-bottom: 8px;
	line-height: 1.5;
}

/* ---- Review & Apply form ---- */
.veljob-ea-hint {
	background: color-mix(in srgb, var(--veljob-primary) 8%, var(--veljob-bg-card));
	border-radius: 8px;
	padding: 10px 12px;
}
/* Milestone G: Application Fee + Prizes note, shown above the Submit
   button only for a paid Assessment — visually distinct from
   .veljob-ea-hint (warning-toned, not accent) since this is money-related
   information the candidate should notice, not just a UI tip. */
.veljob-ea-payment-info {
	background: color-mix(in srgb, var(--veljob-warning) 14%, var(--veljob-bg-card));
	border: 1px solid color-mix(in srgb, var(--veljob-warning) 45%, var(--veljob-border));
	border-radius: 8px;
	padding: 10px 12px;
	margin: 0 0 14px;
}
.veljob-ea-fee-note,
.veljob-ea-prizes-note {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--veljob-warning);
}
.veljob-ea-fee-note + .veljob-ea-prizes-note {
	margin-top: 6px;
}
.veljob-ea-profile-fields {
	display: grid;
	grid-template-columns: 90px 1fr;
	row-gap: 10px;
	column-gap: 10px;
	margin: 0 0 18px;
	padding: 14px 16px;
	background: var(--veljob-bg-alt);
	border-radius: 8px;
}
.veljob-ea-profile-fields dt {
	font-size: 12px;
	font-weight: 700;
	color: var(--veljob-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.veljob-ea-profile-fields dd {
	margin: 0;
	font-size: 13.5px;
	color: var(--veljob-text);
	word-break: break-word;
}
.veljob-ea-question {
	margin-bottom: 14px;
}
.veljob-ea-question label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--veljob-text);
}
.veljob-ea-question textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 11px;
	border: 1px solid var(--veljob-border);
	border-radius: 7px;
	font-family: inherit;
	font-size: 13.5px;
	resize: vertical;
	background: var(--veljob-bg-card);
	color: var(--veljob-text);
}
.veljob-ea-form-error {
	margin-bottom: 14px;
	padding: 10px 12px;
	background: color-mix(in srgb, var(--veljob-danger) 12%, var(--veljob-bg-card));
	border: 1px solid color-mix(in srgb, var(--veljob-danger) 40%, var(--veljob-border));
	color: var(--veljob-danger);
	border-radius: 7px;
	font-size: 13px;
}

/* ---- Success ---- */
.veljob-ea-success {
	text-align: center;
}
.veljob-ea-success-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--veljob-success) 18%, var(--veljob-bg-card));
	color: var(--veljob-success);
	font-size: 24px;
	font-weight: 700;
	margin-bottom: 14px;
}

/* Milestone E: "Submit Your Report" link on the success panel — only
   shown for an Assessment application when Settings has the report
   page URL configured (see showReportLink() in single-listing.js). */
.veljob-ea-report-link {
	display: inline-block;
	margin-top: 16px;
	padding: 10px 20px;
	border-radius: 8px;
	background: var(--veljob-primary);
	color: var(--veljob-on-accent);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}
.veljob-ea-report-link:hover {
	background: var(--veljob-primary-dark);
}

.veljob-lead-field {
	margin-bottom: 16px;
}
.veljob-lead-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
}
.veljob-lead-field input {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--veljob-border);
	border-radius: 7px;
	font-size: 14px;
	font-family: inherit;
	background: var(--veljob-bg-card);
	color: var(--veljob-text);
}
.veljob-lead-field input:focus {
	outline: none;
	border-color: var(--veljob-primary);
	box-shadow: 0 0 0 3px var(--veljob-primary-light);
}
.veljob-lead-field input.has-error {
	border-color: var(--veljob-danger);
}
.veljob-required {
	color: var(--veljob-danger);
}
.veljob-field-error {
	display: none;
	font-size: 12px;
	color: var(--veljob-danger);
	margin-top: 5px;
}
.veljob-lead-form-error {
	display: none;
	background: color-mix(in srgb, var(--veljob-danger) 12%, var(--veljob-bg-card));
	color: var(--veljob-danger);
	border: 1px solid color-mix(in srgb, var(--veljob-danger) 40%, var(--veljob-border));
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 13px;
	margin-bottom: 16px;
}
.veljob-lead-hp-field {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.veljob-lead-submit-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-top: 6px;
	padding: 13px;
	background: var(--veljob-primary);
	color: var(--veljob-on-accent);
	border: none;
	border-radius: 8px;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
}
.veljob-lead-submit-btn:hover:not(:disabled) {
	background: var(--veljob-primary-dark);
}
.veljob-lead-submit-btn:disabled {
	opacity: 0.75;
	cursor: not-allowed;
}
.veljob-lead-submit-spinner {
	width: 15px;
	height: 15px;
	border: 2px solid color-mix(in srgb, var(--veljob-on-accent) 35%, transparent);
	border-top-color: var(--veljob-on-accent);
	border-radius: 50%;
	animation: veljob-lead-spin 0.7s linear infinite;
}
@keyframes veljob-lead-spin {
	to { transform: rotate(360deg); }
}

.veljob-lead-success-panel {
	text-align: center;
}
.veljob-lead-success-panel button {
	padding: 10px 22px;
	border: 1px solid var(--veljob-border);
	background: var(--veljob-bg-card);
	border-radius: 7px;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	color: var(--veljob-text);
}
