/* Image Block Styles */

.image-block-container {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
}

.image-block-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-block-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.image-block-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.image-block-constrained {
  object-fit: contain;
}

.image-block-caption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.5;
  font-style: italic;
  max-width: 100%;
}

.image-block-caption p {
  margin: 0.5rem 0;
}

.image-block-caption p:first-child {
  margin-top: 0;
}

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

.image-block-caption strong {
  font-weight: 600;
  color: #374151;
}

.image-block-caption em {
  font-style: italic;
}

.image-block-caption code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8em;
}

.image-block-caption a {
  color: #3b82f6;
  text-decoration: underline;
}

.image-block-caption a:hover {
  color: #1d4ed8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .image-block-container {
    margin: 1rem 0;
  }

  .image-block-image {
    border-radius: 6px;
  }

  .image-block-caption {
    font-size: 0.8rem;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .image-block-container {
    margin: 0.75rem 0;
  }

  .image-block-image {
    border-radius: 4px;
  }

  .image-block-caption {
    font-size: 0.75rem;
    margin-top: 0.375rem;
  }
}

/* Focus states for accessibility */
.image-block-figure:focus-within {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 8px;
}

.image-block-image:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .image-block-container {
    margin: 1rem 0;
    break-inside: avoid;
  }

  .image-block-image {
    box-shadow: none;
    max-width: 100%;
  }

  .image-block-caption {
    color: #000;
    font-style: normal;
  }
}
