/* Photos of imported news: source credit on cards and on the article page, broken-image tile. */
.article-thumb,
.article-single-thumb {
  position: relative;
}

/* Compact credit on a card cover. Text only: the cover itself is already a link. */
.learnio-news-photo-chip {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 3px 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(10, 14, 40, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* Cover + caption on the article page stay one grid cell. Caption: «Фото: автор / домен», 12 px, muted, one compact line. */
.learnio-news-photo {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
/* Two columns: the photo grows to the header card's height, so both cards end on one line with the caption under. */
.learnio-news-photo > .article-single-thumb {
  flex: 1 1 auto;
  min-height: 0;
}
.learnio-news-photo-credit {
  margin: 0;
  padding: 0 4px;
  color: var(--ds-muted, var(--muted, #4a4a68));
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.learnio-news-photo-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.learnio-news-photo-credit a:hover,
.learnio-news-photo-credit a:focus-visible {
  color: var(--ds-focus, #0b0be4);
}
/* The theme widens the header when the cover is not a direct child of the shell; keep two columns. */
html .article-single-shell:has(> .learnio-news-photo) > .article-single-header {
  grid-column: auto;
}
@media (max-width: 760px) {
  html .article-single-shell:has(> .learnio-news-photo) > .article-single-header {
    grid-column: 1 / -1;
  }
}

/* Source photos inside the article text: full text width, same radius as the cover, caption under. */
.article-rich-content > .learnio-news-photo--inline {
  margin-top: 28px;
  margin-bottom: 28px;
}
.article-rich-content .learnio-news-photo--inline img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: var(--card-border, 0);
  border-radius: var(--card-radius, 20px);
  background: var(--tk-bg-blue-light, #eef0fb);
}

/* The picture failed to load: show the same brand tile as for posts without a photo. */
.article-thumb.is-broken,
.article-single-thumb.is-broken {
  background: #0b0be4 var(--learnio-news-logo) center / 34% auto no-repeat;
}
.article-thumb.is-broken img,
.article-single-thumb.is-broken img,
.article-thumb.is-broken .learnio-news-photo-chip {
  display: none;
}
