/* ===================================================================
   PRACINOV RESPONSIVE IMAGES UTILITY
   Professional responsive image handling
   =================================================================== */

/* ===== BASE IMAGE STYLES ===== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent images from overflowing containers */
img,
picture,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== RESPONSIVE IMAGE UTILITIES ===== */

/* Full width responsive image */
.img-responsive {
  width: 100%;
  height: auto;
  display: block;
}

/* Image with object-fit cover (maintains aspect ratio, fills container) */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Image with object-fit contain (maintains aspect ratio, fits within container) */
.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Rounded images */
.img-rounded {
  border-radius: var(--radius-md);
}

.img-rounded-lg {
  border-radius: var(--radius-lg);
}

.img-circle {
  border-radius: 50%;
}

/* ===== HERO SECTION IMAGES ===== */

.hero-image {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 768px) {
  .hero-image {
    max-height: 400px;
  }
}

@media (max-width: 480px) {
  .hero-image {
    max-height: 300px;
  }
}

/* ===== CARD IMAGES ===== */

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

@media (max-width: 768px) {
  .card-image {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .card-image {
    height: 150px;
  }
}

/* ===== AVATAR IMAGES ===== */

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-md {
  width: 48px;
  height: 48px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
}

.avatar-xl {
  width: 96px;
  height: 96px;
}

/* ===== LOGO IMAGES ===== */

.logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 768px) {
  .logo-image {
    height: 32px;
  }
}

/* ===== THUMBNAIL IMAGES ===== */

.thumbnail {
  width: 100%;
  height: 120px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-sm);
}

.thumbnail-sm {
  height: 80px;
}

.thumbnail-md {
  height: 120px;
}

.thumbnail-lg {
  height: 160px;
}

/* ===== BACKGROUND IMAGES ===== */

.bg-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-image-contain {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* ===== IMAGE ASPECT RATIOS ===== */

.aspect-ratio-16-9 {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.aspect-ratio-16-9 img,
.aspect-ratio-16-9 video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aspect-ratio-4-3 {
  position: relative;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
}

.aspect-ratio-4-3 img,
.aspect-ratio-4-3 video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aspect-ratio-1-1 {
  position: relative;
  padding-bottom: 100%; /* 1:1 aspect ratio (square) */
  overflow: hidden;
}

.aspect-ratio-1-1 img,
.aspect-ratio-1-1 video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== IMAGE LOADING STATES ===== */

.img-loading {
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 0%,
    var(--color-bg-tertiary) 50%,
    var(--color-bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== IMAGE FILTERS ===== */

.img-grayscale {
  filter: grayscale(100%);
  transition: filter var(--transition-base);
}

.img-grayscale:hover {
  filter: grayscale(0%);
}

.img-blur {
  filter: blur(4px);
}

.img-brightness {
  filter: brightness(1.1);
}

/* ===== BLURRED BACKGROUND IMAGE SYSTEM ===== */
/* Generic classes for sections with blurred background images */
/* Reusable across any section where image should be subtle/secondary to text */

/* Background Image - Blurred and subtle */
.img-background-blurred {
  /*filter: blur(4px) brightness(0.9) saturate(0.85);*/
  opacity: 0.75;
  transition: all 0.5s ease;
}

.img-background-blurred:hover {
  /*filter: blur(3px) brightness(0.95) saturate(0.9);*/
  opacity: 0.95;
}

/* Background Container - Ensures proper layering */
.img-background-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  overflow: hidden;
}

.img-background-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Background Overlay - Subtle gradient for blending into section background */
.img-background-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(236, 253, 245, 0.3) 0%,
    rgba(209, 250, 229, 0.2) 50%,
    rgba(167, 243, 208, 0.25) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Background Content - Ensures text is always readable and properly layered */
.img-background-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 2rem;
}

/* ===== CTA BACKGROUND IMAGE - BLURRED & SUBTLE ===== */
/* For use in CTA sections where image should be secondary to text */

.img-cta-background {
  filter: blur(8px) brightness(0.7) saturate(0.8);
  opacity: 0.5;
  transform: scale(1.1); /* Prevents blur edge artifacts */
  transition: all 0.5s ease;
}

.img-cta-background:hover {
  filter: blur(6px) brightness(0.75) saturate(0.85);
  opacity: 0.6;
}

/* CTA Image Container - Ensures proper layering */
.cta-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.cta-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* CTA Overlay - Dark gradient for text contrast */
.cta-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(17, 24, 39, 0.6) 0%,
    rgba(17, 24, 39, 0.4) 50%,
    rgba(6, 78, 59, 0.5) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* CTA Content Overlay - Ensures text is always readable */
.cta-content-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 2rem;
}

/* ===== FADED/BLENDED IMAGE STYLING SYSTEM ===== */
/* Consistent styling for raster images (JPG, PNG, WebP) across all pages */
/* Excludes: SVG files, logos, favicons */

/* Base faded image style - applies opacity and smooth transitions */
.img-faded {
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.img-faded:hover {
  opacity: 0.95;
}

/* Faded with overlay gradient - for hero/feature sections */
.img-faded-overlay {
  position: relative;
  opacity: 0.85;
}

.img-faded-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(17, 106, 77, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(17, 106, 77, 0.08) 100%
  );
  pointer-events: none;
  border-radius: inherit;
}

/* Faded with blend mode - creates seamless integration */
.img-faded-blend {
  opacity: 0.75;
  mix-blend-mode: multiply;
  transition: opacity 0.3s ease, mix-blend-mode 0.3s ease;
}

.img-faded-blend:hover {
  opacity: 0.9;
  mix-blend-mode: normal;
}

/* Container wrapper for images with overlay effects */
.img-container-faded {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}

.img-container-faded img {
  opacity: 0.8;
  transition: opacity 0.4s ease, transform 0.4s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.img-container-faded:hover img {
  opacity: 0.95;
  transform: scale(1.02);
}

.img-container-faded::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(17, 106, 77, 0.05) 100%
  );
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}

/* Subtle faded style - for smaller images and cards */
.img-faded-subtle {
  opacity: 0.85;
  filter: brightness(0.98) contrast(0.95);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.img-faded-subtle:hover {
  opacity: 1;
  filter: brightness(1) contrast(1);
}

/* Faded with soft edges - creates dreamy effect */
.img-faded-soft {
  opacity: 0.8;
  position: relative;
}

.img-faded-soft::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 70%,
    rgba(255, 255, 255, 0.2) 100%
  );
  pointer-events: none;
  border-radius: inherit;
}

/* Professional IT services image styling - brand-aligned */
.img-professional {
  opacity: 0.82;
  filter: saturate(0.9) brightness(0.98);
  transition: all 0.3s ease;
}

.img-professional:hover {
  opacity: 0.95;
  filter: saturate(1) brightness(1);
}

/* Responsive adjustments for faded images */
@media (max-width: 768px) {
  .img-faded,
  .img-faded-overlay,
  .img-faded-blend,
  .img-faded-subtle,
  .img-professional {
    opacity: 0.85; /* Slightly more visible on mobile */
  }

  .img-container-faded img {
    opacity: 0.85;
  }
}

/* ===== RESPONSIVE IMAGE GRID ===== */

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .image-grid {
    grid-template-columns: 1fr;
  }
}

