/**
 * Image Box Paragraph Styles
 * A flexible image box component with various layouts and styling options
 */

.image-box {
  margin-bottom: 2rem;
}

.image-box__container {
  width: 100%;
}

.image-box__row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

/* Image positioning styles */
.image-box__image {
  flex-shrink: 0;
}

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

/* Top/Bottom positioning */
.image-box--position-top .image-box__image--top,
.image-box--position-bottom .image-box__image--bottom {
  margin-bottom: 1rem;
}

.image-box--position-bottom .image-box__image--bottom {
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Left/Right positioning */
.image-box--position-left .image-box__image--left {
  max-width: 300px;
  margin-right: 0;
}

.image-box--position-right .image-box__image--right {
  max-width: 300px;
  margin-left: 0;
}

.image-box--position-right .image-box__row {
  flex-direction: row-reverse;
}

/* Ensure proper spacing in flex layout */
.image-box__row .image-box__image {
  flex-shrink: 0;
}

.image-box__row .image-box__content {
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

/* Content styles */
.image-box__content {
  flex: 1;
}

/* Alignment-specific content styles */
.image-box--align-center .image-box__content {
  text-align: center;
}

.image-box--align-center .image-box__link {
  display: inline-block;
}

.image-box--align-right .image-box__content {
  text-align: right;
}

.image-box--align-justify .image-box__content {
  text-align: justify;
}

/* Button alignment for different text alignments */
.image-box--align-center .image-box__link.btn {
  margin: 0 auto;
}

.image-box--align-right .image-box__link.btn {
  margin-left: auto;
  margin-right: 0;
}

.image-box__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.image-box__description {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  color: #666;
}

.image-box__description p {
  margin-bottom: 1rem;
}

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

/* Link styles */
.image-box__link {
  display: inline-block;
  text-decoration: none;
  transition: all 0.3s ease;
}

.image-box__link--text {
  color: #007bff;
  font-weight: 500;
}

.image-box__link--text:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Button styles */
.image-box__link.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 500;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.image-box__link.btn-primary {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
}

.image-box__link.btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
  color: #fff;
  text-decoration: none;
}

.image-box__link.btn-secondary {
  background-color: #6c757d;
  color: #fff;
  border-color: #6c757d;
}

.image-box__link.btn-secondary:hover {
  background-color: #545b62;
  border-color: #545b62;
  color: #fff;
  text-decoration: none;
}

.image-box__link.btn-outline-primary {
  background-color: transparent;
  color: #007bff;
  border-color: #007bff;
}

.image-box__link.btn-outline-primary:hover {
  background-color: #007bff;
  color: #fff;
  text-decoration: none;
}

/* Custom styling support */

/* Text alignment support */
.image-box--align-left {
  text-align: left;
}

.image-box--align-center {
  text-align: center;
}

.image-box--align-right {
  text-align: right;
}

.image-box--align-justify {
  text-align: justify;
}

/* Padding and margin support */
.image-box--has-padding {
  /* Padding is applied inline */
}

.image-box--has-margin {
  /* Margin is applied inline */
}

/* Border radius support */
.image-box--has-border-radius {
  overflow: hidden;
}

/* Border support */
.image-box--has-border {
  /* Border styles are applied inline */
}

/* Background color support */
.image-box--has-bg-color {
  /* Background color is applied inline */
}

/* Ensure custom styles work with existing style variations */
.image-box--style-card.image-box--has-border-radius,
.image-box--style-shadow.image-box--has-border-radius,
.image-box--style-border.image-box--has-border-radius,
.image-box--style-rounded.image-box--has-border-radius {
  overflow: hidden;
}

/* Override predefined styles when custom values are set */
.image-box--has-bg-color.image-box--style-card,
.image-box--has-bg-color.image-box--style-shadow,
.image-box--has-bg-color.image-box--style-rounded {
  /* Custom background color takes precedence */
}

.image-box--has-border.image-box--style-border {
  /* Custom border takes precedence over predefined border */
}

.image-box--has-border-radius.image-box--style-rounded {
  /* Custom border radius takes precedence */
}

/* Style variations */

/* Default style */
.image-box--style-default {
  /* No additional styling */
}

/* Card style */
.image-box--style-card {
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
}

.image-box--style-card .image-box__container {
  padding: 0;
}

.image-box--style-card .image-box__content {
  padding: 0rem 1.5rem;
}

.image-box--style-card.image-box--position-top .image-box__image--top,
.image-box--style-card.image-box--position-bottom .image-box__image--bottom {
  margin: 0;
}

/* Shadow style */
.image-box--style-shadow {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.image-box--style-shadow .image-box__container {
  padding: 1.5rem;
}

/* Border style */
.image-box--style-border {
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.image-box--style-border .image-box__container {
  padding: 1.5rem;
}

/* Rounded style */
.image-box--style-rounded {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
}

.image-box--style-rounded .image-box__container {
  padding: 1.5rem;
}

.image-box--style-rounded .image-box__image img {
  border-radius: 0.5rem;
}

/* Minimal style */
.image-box--style-minimal {
  background: transparent;
}

.image-box--style-minimal .image-box__title {
  font-weight: 400;
  font-size: 1.25rem;
}

.image-box--style-minimal .image-box__description {
  color: #777;
}

/* Responsive styles */
@media (max-width: 768px) {
  .image-box__row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .image-box--position-right .image-box__row {
    flex-direction: column;
  }
  
  .image-box--position-left .image-box__image--left,
  .image-box--position-right .image-box__image--right {
    max-width: 100%;
    margin: 0 0 1rem 0;
  }
  
  .image-box__title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .image-box {
    margin-bottom: 1.5rem;
  }
  
  .image-box--style-card .image-box__content,
  .image-box--style-shadow .image-box__container,
  .image-box--style-border .image-box__container,
  .image-box--style-rounded .image-box__container {
    padding: 0rem 1.5rem;
  }
  
  .image-box__title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }
  
  .image-box__description {
    margin-bottom: 1rem;
  }
}
