/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* === LAZY LOADING E IMAGENS === */

/* Placeholder para lazy loading */
img[loading="lazy"] {
	opacity: 0;
	transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded {
	opacity: 1;
}

/* Otimização de imagens */
img {
	max-width: 100%;
	height: auto;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
}

/* WebP support detection */
.webp img {
	image-rendering: -webkit-optimize-contrast;
}

/* === WILL-CHANGE PARA ANIMAÇÕES === */

.employee.rotation,
.employee .card-inner {
	will-change: transform;
}

.slider-container,
.revolution-slider {
	will-change: transform, opacity;
}

/* Otimizar animações para 60fps */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translate3d(0, 30px, 0);
	}
	to {
		opacity: 1;
		transform: translate3d(0, 0, 0);
	}
}

/* === CONTENÇÃO DE LAYOUT (CLS) === */

/* Reservar espaço para sliders */
.slider-container {
	aspect-ratio: 16 / 9;
	min-height: 300px;
}

/* Reservar espaço para cards */
.employee {
	aspect-ratio: 1;
	min-height: 200px;
}

/* === GPU ACCELERATION === */

.employee .default,
.employee .employee-hover {
	transform: translateZ(0);
}

.slider-container,
.btn:hover {
	transform: translateZ(0);
	backface-visibility: hidden;
}

/* === PRELOAD CRÍTICO === */

/* Critical fonts preload */
@font-face {
	font-family: 'Open Sans Critical';
	font-weight: 400;
	font-display: swap;
	src: local('Open Sans Regular'), local('OpenSans-Regular');
}

/* === REDUÇÃO DE MOTION PARA ACCESSIBILITY === */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* === TOUCH OPTIMIZATION === */

/* Melhor área de toque em mobile */
@media (max-width: 768px) {
	.btn,
	button,
	a[href],
	input[type="button"],
	input[type="submit"] {
		min-height: 44px;
		min-width: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
	
	/* Cards em mobile */
	.employee {
		margin-bottom: 20px;
		min-height: 250px;
	}
}

/* === CONTENÇÃO DE LAYOUT SHIFT === */

/* Skeleton loading para cards */
.employee.loading {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
	0% {
		background-position: -200% 0;
	}
	100% {
		background-position: 200% 0;
	}
}

/* === INTERSECTION OBSERVER OPTIMIZATIONS === */

/* Elementos fora da viewport */
.fade-in-element {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-element.visible {
	opacity: 1;
	transform: translateY(0);
}

/* === CONTAINMENT === */

/* CSS Containment para isolamento de layout */
.employee {
	contain: layout style paint;
}

.slider-container {
	contain: layout;
}

/* === FONT LOADING STRATEGIES === */

/* Font display strategy */
@font-face {
	font-family: 'Open Sans';
	font-display: swap;
	font-weight: 300 800;
	src: local('Open Sans');
}

/* === MODERN FOCUS STYLES === */

/* Foco visível moderno */
*:focus-visible {
	outline: 2px solid #007bff;
	outline-offset: 2px;
	border-radius: 2px;
}

/* Remove outline padrão quando focus-visible disponível */
*:focus:not(:focus-visible) {
	outline: none;
}

/* === PRINT STYLES === */

@media print {
	* {
		color: #000 !important;
		background: transparent !important;
		box-shadow: none !important;
		text-shadow: none !important;
	}
	
	.slider-container,
	.employee-hover,
	nav,
	.search {
		display: none !important;
	}
}