/**
 * @file
 * Image Block with Text Overlay - CSS for positioning and styling
 */

/* Image Block Container */
.image-block__container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.image-block__wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.image-block__wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

/* Text Overlay Base Styles */
.image-block__text-overlay {
  position: absolute;
  padding: 20px;
  border-radius: 8px;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  max-width: 80%;
  word-wrap: break-word;
}

.image-block__text-content {
  position: relative;
  z-index: 2;
}

.image-block__text-content h1,
.image-block__text-content h2,
.image-block__text-content h3,
.image-block__text-content h4,
.image-block__text-content h5,
.image-block__text-content h6 {
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.2;
}

.image-block__text-content p {
  margin-bottom: 10px;
  line-height: 1.5;
}

.image-block__text-content p:last-child {
  margin-bottom: 0;
}

/* Horizontal Positioning */
.image-block__text-overlay--left-top,
.image-block__text-overlay--left-center,
.image-block__text-overlay--left-bottom {
  left: 20px;
}

.image-block__text-overlay--center-top,
.image-block__text-overlay--center-center,
.image-block__text-overlay--center-bottom {
  left: 50%;
  transform: translateX(-50%);
}

.image-block__text-overlay--right-top,
.image-block__text-overlay--right-center,
.image-block__text-overlay--right-bottom {
  right: 20px;
}

/* Vertical Positioning */
.image-block__text-overlay--left-top,
.image-block__text-overlay--center-top,
.image-block__text-overlay--right-top {
  top: 20px;
}

.image-block__text-overlay--left-center,
.image-block__text-overlay--center-center,
.image-block__text-overlay--right-center {
  top: 50%;
  transform: translateY(-50%);
}

.image-block__text-overlay--left-bottom,
.image-block__text-overlay--center-bottom,
.image-block__text-overlay--right-bottom {
  bottom: 20px;
}

/* Combined transforms for center-center */
.image-block__text-overlay--center-center {
  transform: translate(-50%, -50%);
}

/* Hover Effects */
.image-block__wrapper:hover .image-block__text-overlay {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.image-block__wrapper:hover .image-block__text-overlay--center-center {
  transform: translate(-50%, -50%) scale(1.02);
}

/* Responsive Design */
@media (max-width: 768px) {
  .image-block__text-overlay {
    padding: 15px;
    max-width: 90%;
    font-size: 14px;
  }
  
  .image-block__text-overlay--left-top,
  .image-block__text-overlay--left-center,
  .image-block__text-overlay--left-bottom {
    left: 10px;
  }
  
  .image-block__text-overlay--right-top,
  .image-block__text-overlay--right-center,
  .image-block__text-overlay--right-bottom {
    right: 10px;
  }
  
  .image-block__text-overlay--left-top,
  .image-block__text-overlay--center-top,
  .image-block__text-overlay--right-top {
    top: 10px;
  }
  
  .image-block__text-overlay--left-bottom,
  .image-block__text-overlay--center-bottom,
  .image-block__text-overlay--right-bottom {
    bottom: 10px;
  }
}

@media (max-width: 480px) {
  .image-block__text-overlay {
    padding: 10px;
    max-width: 95%;
    font-size: 13px;
  }
  
  .image-block__text-content h1,
  .image-block__text-content h2,
  .image-block__text-content h3 {
    font-size: 18px;
  }
  
  .image-block__text-content h4,
  .image-block__text-content h5,
  .image-block__text-content h6 {
    font-size: 16px;
  }
}

/* Text Color Variations */
.image-block__text-overlay.text-light {
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.image-block__text-overlay.text-dark {
  color: #333333;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
}

/* Background Variations */
.image-block__text-overlay.bg-transparent {
  background: transparent;
}

.image-block__text-overlay.bg-dark {
  background: rgba(0, 0, 0, 0.7);
}

.image-block__text-overlay.bg-light {
  background: rgba(255, 255, 255, 0.9);
  color: #333333;
}

.image-block__text-overlay.bg-primary {
  background: rgba(102, 126, 234, 0.9);
  color: #ffffff;
}

/* Animation Effects */
.image-block__text-overlay.fade-in {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.image-block__text-overlay.slide-up {
  opacity: 0;
  animation: slideUp 0.6s ease-out forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Special positioning for center-center with animation */
.image-block__text-overlay--center-center.fade-in {
  animation: fadeInCenter 0.5s ease-in-out forwards;
}

@keyframes fadeInCenter {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}





