/* Force image display in about section */
.about-img {
  background: url('/public/images/author.png') center/contain no-repeat;
  min-height: 300px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.about-img img {
  opacity: 0.9 !important;
  visibility: visible !important;
  display: block !important;
}

/* Force all images to be visible */
img {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* Fix for images that fail to load or are still loading */
.image-container {
  position: relative;
  overflow: hidden;
  background-color: #f5f7fa;
}

.image-container img {
  transition: opacity 0.3s ease;
  opacity: 1;
}

.image-container.loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f5f7fa, #e7edf5, #f5f7fa);
  background-size: 200% 100%;
  animation: loading-pulse 1.5s infinite;
}

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

.image-container.error::before {
  content: "Image could not be loaded";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
  width: 80%;
}

.image-container.error img {
  opacity: 0;
}

/* Fix for newsletter hero images */
.newsletter-hero-container {
  position: relative;
  height: 500px;
  width: 100%;
  overflow: hidden;
  background-color: #1e3a8a;
}

.newsletter-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease-out;
}

.newsletter-hero-container:hover .newsletter-hero-image {
  transform: scale(1.03);
}

.newsletter-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.7));
  z-index: 1;
}

.newsletter-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 3rem;
  z-index: 2;
  color: white;
}

/* Responsive newsletter image handling */
@media (max-width: 768px) {
  .newsletter-hero-container {
    height: 400px;
  }
  
  .newsletter-hero-content {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .newsletter-hero-container {
    height: 350px;
  }
  
  .newsletter-hero-content {
    padding: 1.5rem;
  }
}

/* Global image loading script to be added via JS */
img.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.lazy-load.loaded {
  opacity: 1;
} 