/**
 * APEX RecSite Builder — Elementor Widgets Styles
 *
 * Skeleton loading states (F4), Load More button (F2), and shared
 * widget utility classes used by the frontend JS (widgets.js).
 *
 * @package ApexRecSiteBuilderCore
 * @since   1.0.0
 */

/* -----------------------------------------------------------------------
   Skeleton loading animation (F4)
   ----------------------------------------------------------------------- */

/**
 * Shimmer keyframe — translates a bright overlay left-to-right entirely on
 * the GPU compositor (transform only, no paint or layout triggered).
 */
@keyframes apex-shimmer {
	to { transform: translateX( 100% ); }
}

/**
 * Base skeleton element: a rounded rect with the shimmer overlay.
 */
.apex-skeleton-card {
	background: #ffffff;
	border: 1px solid #e0e3e5;
	border-radius: var(--apex-radius, 4px);
	padding: 20px;
	margin-bottom: 12px;
}

.apex-skeleton-card__title,
.apex-skeleton-card__meta span,
.apex-skeleton-card__excerpt {
	display: block;
	border-radius: 4px;
	background: #f0f0f0;
	overflow: hidden;
	position: relative;
}

.apex-skeleton-card__title::after,
.apex-skeleton-card__meta span::after,
.apex-skeleton-card__excerpt::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba( 255, 255, 255, 0.6 ) 50%,
		transparent 100%
	);
	transform: translateX( -100% );
	will-change: transform;
	animation: apex-shimmer 1.4s ease-in-out infinite;
}

.apex-skeleton-card__title {
	height: 20px;
	width: 60%;
	margin-bottom: 12px;
}

.apex-skeleton-card__meta {
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
}

.apex-skeleton-card__meta span {
	height: 14px;
	width: 120px;
}

.apex-skeleton-card__excerpt {
	height: 14px;
	width: 90%;
}

/* -----------------------------------------------------------------------
   Load More button state (F2)
   ----------------------------------------------------------------------- */

.apex-load-more-wrap {
	text-align: center;
	margin-top: 24px;
}

.apex-load-more {
	min-width: 180px;
	transition: opacity 0.2s ease;
}

.apex-load-more:disabled,
.apex-load-more.apex-loading {
	opacity: 0.6;
	cursor: wait;
}

/* -----------------------------------------------------------------------
   General loading state overlay
   ----------------------------------------------------------------------- */

/**
 * When .apex-loading is on the .apex-job-listings-wrap container, fade
 * the entire block to indicate in-flight data. The skeleton cards
 * injected by showSkeleton() are visible at full opacity inside.
 */
.apex-job-listings-wrap.apex-loading .apex-pagination,
.apex-job-listings-wrap.apex-loading .apex-job-listings-count {
	opacity: 0;
	pointer-events: none;
}

/* Visually hide the error state until needed. */
.apex-error {
	color: #b91c1c;
	font-size: 0.9em;
	padding: 12px;
	background: #fef2f2;
	border-radius: var(--apex-radius, 4px);
	border: 1px solid #fecaca;
}

/* -----------------------------------------------------------------------
   APEX Agency Hero widget
   ----------------------------------------------------------------------- */

.apex-hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 520px;
	color: #fff;
}

.apex-hero__overlay {
	position: absolute;
	inset: 0;
	background: rgba(5, 14, 29, 0.78);
	z-index: 0;
}

.apex-hero--no-image {
	background: var(--apex-dark, #050e1d);
}

.apex-hero--no-image .apex-hero__overlay {
	display: none;
}

.apex-hero__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 820px;
	margin-inline: auto;
	padding: clamp(80px, 12vw, 140px) calc(var(--apex-sp, 8px) * 2) clamp(64px, 10vw, 110px);
}

.apex-hero__eyebrow {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--apex-accent, #e8a020);
	margin: 0 0 1.5rem;
}

.apex-hero__heading {
	font-family: var(--apex-font-head, inherit), sans-serif;
	font-size: clamp(2rem, 5vw, 3.4rem);
	font-weight: 700;
	line-height: 1.15;
	margin: 0 0 1.5rem;
	color: #fff;
}

.apex-hero__sub {
	font-size: clamp(0.95rem, 2vw, 1.15rem);
	color: rgba(255, 255, 255, 0.75);
	max-width: 640px;
	margin: 0 0 2.5rem;
	line-height: 1.7;
}

.apex-hero[style*="text-align:center"] .apex-hero__sub,
.apex-hero__inner[style*="text-align:center"] .apex-hero__sub {
	margin-inline: auto;
}

.apex-hero__ctas {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

.apex-hero__inner[style*="text-align:center"] .apex-hero__ctas {
	justify-content: center;
}

.apex-btn--outline-white {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	border: 1.5px solid rgba(255, 255, 255, 0.4);
	border-radius: var(--apex-radius, 4px);
	color: #fff;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	transition: border-color 0.2s;
	background: transparent;
	cursor: pointer;
}

.apex-btn--outline-white:hover {
	border-color: #fff;
	color: #fff;
}

/* -----------------------------------------------------------------------
   APEX Stats Bar widget
   ----------------------------------------------------------------------- */

.apex-stats-bar {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 2rem;
	text-align: center;
}

.apex-stats-bar--dividers .apex-stats-bar__item + .apex-stats-bar__item {
	border-left: 1px solid #e0e3e5;
}

.apex-stats-bar__value {
	font-family: var(--apex-font-head, inherit), sans-serif;
	font-size: 1.8rem;
	font-weight: 700;
	color: var(--apex-primary, #163c74);
	line-height: 1.1;
	margin-bottom: 0.35rem;
}

.apex-stats-bar__label {
	font-size: 0.8rem;
	color: var(--apex-muted, #45474c);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

@media (max-width: 600px) {
	.apex-stats-bar--dividers .apex-stats-bar__item + .apex-stats-bar__item {
		border-left: none;
		border-top: 1px solid #e0e3e5;
		padding-top: 1.25rem;
	}
}

/* -----------------------------------------------------------------------
   APEX Insight Grid widget
   ----------------------------------------------------------------------- */

.apex-insight-filter-bar {
	display: flex;
	gap: 0.25rem;
	flex-wrap: wrap;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--apex-border, #e0e3e5);
	padding-bottom: 0;
}

.apex-insight-filter-bar__tab {
	display: inline-block;
	padding: 0.75rem 1rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--apex-muted, #45474c);
	border-bottom: 2px solid transparent;
	text-decoration: none;
	transition: color 0.15s, border-color 0.15s;
	white-space: nowrap;
}

.apex-insight-filter-bar__tab:hover,
.apex-insight-filter-bar__tab.is-active {
	color: var(--apex-dark, #050e1d);
	border-bottom-color: var(--apex-primary, #163c74);
}

.apex-insight-featured {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3rem;
	align-items: center;
	margin-bottom: 3.5rem;
	padding-bottom: 3.5rem;
	border-bottom: 1px solid var(--apex-border, #e0e3e5);
}

.apex-insight-featured__image {
	display: block;
	border-radius: var(--apex-radius, 4px);
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background-size: cover;
	background-position: center;
	background-color: var(--apex-light, #f7f9fb);
}

.apex-insight-featured__title {
	font-family: var(--apex-font-head, inherit), sans-serif;
	font-size: clamp(1.3rem, 2.5vw, 1.9rem);
	font-weight: 700;
	color: var(--apex-dark, #050e1d);
	line-height: 1.2;
	margin: 0.75rem 0 1rem;
}

.apex-insight-featured__title a {
	color: inherit;
	text-decoration: none;
}

.apex-insight-featured__title a:hover {
	color: var(--apex-primary, #163c74);
}

.apex-insight-featured__excerpt {
	color: var(--apex-muted, #45474c);
	font-size: 0.9375rem;
	line-height: 1.7;
	margin: 0 0 1.5rem;
}

.apex-insight-featured__meta {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	font-size: 0.8125rem;
	color: var(--apex-muted, #45474c);
}

.apex-insight-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}

.apex-insight-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.apex-insight-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
	.apex-insight-featured { grid-template-columns: 1fr; }
	.apex-insight-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
	.apex-insight-grid { grid-template-columns: 1fr; }
}

.apex-insight-pagination {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 3rem;
	padding-top: 3rem;
	border-top: 1px solid var(--apex-border, #e0e3e5);
}

.apex-no-results {
	color: var(--apex-muted, #45474c);
	padding: 3rem 0;
}
