/* Lego media — figuras, pies de foto y lightbox (páginas + posts) */

.cco-lego-gallery .cco-media-figure,
.cco-lego-gallery .cco-visual-slot,
.cco-lego-gallery .cco-visual-slot.wp-block-image,
.cco-lego-gallery .wp-block-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
}

/* Imágenes sueltas del contenido: no recortar */
.cco-lego-gallery .cco-single-body > .wp-block-image,
.cco-lego-gallery .cco-single-body > figure.wp-block-image,
.cco-lego-gallery .cco-prose > .wp-block-image,
.cco-lego-gallery .cco-prose > figure.wp-block-image {
  overflow: visible;
  align-items: stretch;
}

.cco-lego-gallery .cco-media-figure img,
.cco-lego-gallery .cco-visual-slot img,
.cco-lego-gallery .cco-visual-slot.wp-block-image img,
.cco-lego-gallery .wp-block-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  align-self: stretch;
}

.cco-lego-gallery.cco-prose .cco-media-caption,
.cco-lego-gallery .cco-media-caption,
.cco-lego-gallery.cco-prose .cco-visual-slot__caption,
.cco-lego-gallery .cco-visual-slot__caption,
.cco-lego-gallery .cco-prose figcaption.cco-media-caption,
.cco-lego-gallery .cco-prose .wp-element-caption.cco-media-caption {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.7rem 1rem 0.85rem;
  border: 0;
  border-left: 0;
  border-top: 1px solid rgba(189, 176, 70, 0.32);
  background: linear-gradient(180deg, rgba(189, 176, 70, 0.07) 0%, rgba(255, 255, 255, 0.92) 100%);
  font-family: var(--cco-font-article);
  font-size: var(--cco-type-sm);
  font-style: italic;
  font-weight: 400;
  color: var(--cco-vino);
  text-align: center;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.cco-lego-gallery.cco-prose .cco-media-caption::before,
.cco-lego-gallery .cco-media-caption::before,
.cco-lego-gallery.cco-prose .cco-visual-slot__caption::before,
.cco-lego-gallery .cco-visual-slot__caption::before,
.cco-lego-gallery .cco-prose figcaption.cco-media-caption::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 2px;
  margin: 0 auto 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, var(--cco-gold) 50%, transparent 100%);
}

/* Post destacado */
.cco-single .cco-lego-gallery > .cco-single-media.cco-media-figure {
  margin: 0 0 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 48px rgba(78, 11, 29, 0.14);
  background: var(--cco-white);
}

.cco-single .cco-single-media-img {
  object-fit: contain;
}

/* Imágenes en el cuerpo del post: enteras, sin recorte */
.cco-single .cco-single-body.cco-prose > .wp-block-image,
.cco-single .cco-single-body.cco-prose > figure.wp-block-image {
  overflow: visible;
}

.cco-single .cco-single-body.cco-prose > .wp-block-image img,
.cco-single .cco-single-body.cco-prose > figure.wp-block-image img {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center top;
}

.cco-lego-gallery .cco-gallery-thumb {
  cursor: zoom-in;
}

/* Embeds multimedia (YouTube → modal Lego) */
.cco-lego-gallery .cco-media-embed--youtube {
  position: relative;
  cursor: pointer;
}

.cco-lego-gallery .cco-media-embed--youtube .wp-block-embed__wrapper iframe {
  pointer-events: none;
}

.cco-lego-gallery .cco-media-embed-thumb.cco-media-embed--youtube::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(78, 11, 29, 0.08) 0%, rgba(78, 11, 29, 0.28) 100%);
  transition: background 0.2s ease;
}

.cco-lego-gallery .cco-media-embed-thumb.cco-media-embed--youtube:hover::after,
.cco-lego-gallery .cco-media-embed-thumb.cco-media-embed--youtube:focus-visible::after {
  background: linear-gradient(180deg, rgba(78, 11, 29, 0.12) 0%, rgba(78, 11, 29, 0.42) 100%);
}

.cco-lego-gallery .cco-media-embed-thumb.cco-media-embed--youtube::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 4rem;
  height: 4rem;
  margin: -2rem 0 0 -2rem;
  border-radius: 50%;
  background: rgba(78, 11, 29, 0.82);
  border: 2px solid var(--cco-gold);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.cco-page-prose .cco-media-band__media .cco-media-caption,
.cco-page-prose .cco-media-band__media .cco-visual-slot__caption {
  padding: 0.75rem 1.15rem 0.9rem;
  background: linear-gradient(180deg, rgba(189, 176, 70, 0.1) 0%, var(--cco-bg-page) 100%);
}

.cco-page-prose .cco-visual-slot:has(.cco-visual-slot__placeholder) {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--cco-bg-page);
  min-height: 220px;
}

.cco-page-prose .cco-page-split .cco-visual-slot {
  width: 100%;
}
