/* django-cms/cms/static/cms/prose_extensions/wagtail_image_embed.css */
/* Show Wagtail <embed embedtype="image"> nodes visibly in the Prose editor */
.ProseMirror embed[embedtype="image"] {
  display: inline-block;
  box-sizing: border-box;
  width: 160px;
  height: 100px;
  margin: 0.25rem 0.5rem;
  border: 1px dashed #999;
  background: #f9f9f9;
  vertical-align: middle;
  position: relative;
}

.ProseMirror embed[embedtype="image"]::before {
  content: "📷 " attr(alt);
  font-size: 12px;
  color: #555;
  padding: 4px;
  display: block;
  text-align: center;
  white-space: normal;
}

/* ProseMirror NodeView placeholder for image embeds */
.ProseMirror .wagtail-image-embed {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: 200px;
  padding: 10px;
  margin: 0.25rem 0.5rem;
  border: 1px dashed #999;
  background: #f9f9f9;
  vertical-align: top;
  box-sizing: border-box;
}

.ProseMirror .wagtail-image-embed[data-format="left"] {
  float: left;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

.ProseMirror .wagtail-image-embed[data-format="right"] {
  float: right;
  margin-left: 1rem;
  margin-bottom: 0.5rem;
}

.ProseMirror .wagtail-image-embed[data-format="fullwidth"] {
  float: none;
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Internal structure of the image embed preview */
.wagtail-image-embed__wrap {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

/* Alignment variants for the wrap */
.wagtail-image-embed__wrap--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wagtail-image-embed__wrap--left {
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.wagtail-image-embed__wrap--right {
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.wagtail-image-embed__thumb--placeholder,
.wagtail-image-embed__thumb {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.wagtail-image-embed__thumb--placeholder svg {
  width: 32px;
  height: 32px;
}

.wagtail-image-embed__details {
  flex: 1;
  min-width: 0;
}

.wagtail-image-embed__row {
  margin-bottom: 0.5rem;
}

.wagtail-image-embed__label {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
  display: block;
  word-wrap: break-word;
}

.wagtail-image-embed__link {
  font-size: 0.75rem;
  color: #0ea5e9;
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wagtail-image-embed__link:hover {
  text-decoration: underline;
}

/* Thumbnail preview inside image embed placeholder */
.ProseMirror .wagtail-image-embed__wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.ProseMirror .wagtail-image-embed__thumb {
  max-width: 170px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #f1f1f1;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.ProseMirror .wagtail-image-embed__thumb--placeholder {
  display: grid;
  place-items: center;
  width: 170px;
  height: 100px;
  border-radius: 6px;
  background: #f1f1f1;
  border: 1px dashed rgba(0, 0, 0, 0.2);
}

.ProseMirror .wagtail-image-embed__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  font-size: 11px;
  line-height: 1.3;
}
