/* Ghost editor media: remove browser figure margins and give captions a
   consistent editorial treatment. Kept separate from card/cover imagery. */
.gh-content > :is(.kg-image-card, .kg-gallery-card) {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}

.gh-content .kg-image-card .kg-image,
.gh-content .kg-gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.gh-content :is(.kg-image-card, .kg-gallery-card) figcaption,
.article-image figcaption {
  position: relative;
  margin: 0;
  padding: 10px 2px 0 30px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: .04em;
  text-align: left;
}

.gh-content :is(.kg-image-card, .kg-gallery-card) figcaption::before,
.article-image figcaption::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 2px;
  width: 18px;
  height: 1px;
  background: var(--green);
  box-shadow: 0 0 7px color-mix(in srgb, var(--green) 34%, transparent);
}

@media (max-width: 680px) {
  /* Let editorial images use the complete viewport on phones. The caption
     keeps the same 14px reading inset as the surrounding article text. */
  .gh-content > :is(.kg-image-card, .kg-gallery-card) {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  .gh-content > :is(.kg-image-card, .kg-gallery-card) figcaption {
    padding: 9px 14px 0 42px;
    font-size: 9px;
    line-height: 1.5;
  }

  .gh-content > :is(.kg-image-card, .kg-gallery-card) figcaption::before {
    top: 15px;
    left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gh-content > :is(.kg-image-card, .kg-gallery-card) { transform: none; }
}
