/* VERITUM EKSPERTYZY - Modern Image Optimization CSS */

/* Podstawowe style dla obrazów */
img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Picture element responsywny */
picture {
	display: block;
	width: 100%;
}

picture img {
	width: 100%;
	height: auto;
	object-fit: cover;
}

/* FIX: Hero logo wycentrowanie */
.hero-logo {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	margin-bottom: var(--spacing-lg, 2rem);
}

.hero-logo picture {
	display: flex;
	justify-content: center;
	align-items: center;
	width: auto;
}

.hero-logo picture img {
	width: auto;
	height: auto;
	max-width: 280px;
	max-height: 280px;
	object-fit: contain;
}

/* FIX: Nav logo wycentrowanie */
.nav-logo {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nav-logo picture {
	display: flex;
	align-items: center;
	width: auto;
	flex-shrink: 0;
}

.nav-logo picture img {
	width: 40px;
	height: 40px;
	object-fit: contain;
}

/* FIX: Footer logo wycentrowanie */
.footer-logo {
	display: flex;
	align-items: center;
}

.footer-logo picture {
	display: flex;
	align-items: center;
	width: auto;
}

.footer-logo picture img {
	width: 40px;
	height: 40px;
	object-fit: contain;
}

/* FIX: Certyfikaty - pełna wysokość kontenera */
.certificates-slider {
	width: 100%;
	overflow: visible;
}

.slider-container {
	width: 100%;
	overflow: hidden;
	position: relative;
}

.slider-track {
	display: flex;
	width: 100%;
	transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	gap: 24px;
	align-items: stretch;
}

.certificate-item {
	flex: 0 0 auto;
	width: 280px;
	height: 380px;
	display: flex;
	align-items: stretch;
}

.certificate-card {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: white;
	border-radius: 20px;
	padding: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	cursor: pointer;
	transition: all 0.4s ease;
}

.certificate-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 12px;
	flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
	.hero-logo picture img {
		max-width: 200px;
		max-height: 200px;
	}

	.certificate-item {
		width: 250px;
		height: 340px;
	}

	.certificate-card img {
		height: 240px;
	}
}

@media (max-width: 480px) {
	.hero-logo picture img {
		max-width: 150px;
		max-height: 150px;
	}

	.certificate-item {
		width: 220px;
		height: 300px;
	}

	.certificate-card img {
		height: 200px;
	}
}

/* Lazy loading - placeholder podczas ładowania */
img.lazy {
	opacity: 0;
	transition: opacity 0.3s ease-in-out;
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: loading 1.5s infinite;
}

img.lazy.loaded {
	opacity: 1;
}

@keyframes loading {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* Lightbox dla certyfikatów */
.certificate-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.certificate-lightbox.active {
	opacity: 1;
	visibility: visible;
}

.lightbox-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	background: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lightbox-content img {
	width: 100%;
	height: auto;
	display: block;
}

.lightbox-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	background: rgba(0, 0, 0, 0.7);
	color: white;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	transition: background 0.3s ease;
	z-index: 10001;
}

.lightbox-close:hover {
	background: rgba(0, 0, 0, 0.9);
}

/* Responsive images utilities */
.img-responsive {
	max-width: 100%;
	height: auto;
}

.img-cover {
	object-fit: cover;
}

.img-contain {
	object-fit: contain;
}

/* Modern image format indicators (dev only) */
.dev-mode .webp-support::after {
	content: 'WebP ✓';
	position: fixed;
	top: 10px;
	right: 10px;
	background: #10b981;
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	z-index: 9998;
}

.dev-mode .avif-support::after {
	content: 'AVIF ✓';
	position: fixed;
	top: 10px;
	right: 80px;
	background: #3b82f6;
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	z-index: 9998;
}

/* Performance hints */
@media (prefers-reduced-motion: reduce) {
	img.lazy {
		transition: none;
		animation: none;
	}

	.certificate-item img {
		transition: none;
	}

	.certificate-lightbox {
		transition: none;
	}
}

/* Print optimization */
@media print {
	.certificate-lightbox,
	.lightbox-close {
		display: none !important;
	}

	img {
		break-inside: avoid;
		max-width: 100% !important;
	}
}
