/* リンクカード（公開記事・プレビュー・TinyMCE 本文 iframe 共通） */

figure.wn-link-card {
  position: relative;
  margin: 1.35rem 0;
  border: 1px solid #e7e5e4;
  border-radius: 0.8rem;
  overflow: visible;
  background: #fafaf9;
  container-type: inline-size;
  container-name: wn-lc;
}

figure.wn-link-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wn-link-card__a {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  border-radius: 0.8rem;
  position: relative;
  min-width: 0;
}

/* 画像あり: カードの高さは左列（画像）に合わせ、右列はクリップ */
.wn-link-card__a:has(.wn-link-card__img-wrap) .wn-link-card__body {
  position: absolute;
  left: 200px;
  right: 0;
  top: 0;
  bottom: 0;
  overflow: hidden;
  box-sizing: border-box;
}

@container wn-lc (max-width: 520px) {
  .wn-link-card__a:has(.wn-link-card__img-wrap) .wn-link-card__body {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    overflow: visible;
  }

  .wn-link-card__img-wrap {
    flex: 1 1 100%;
    width: 100%;
  }
}

.wn-link-card__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.96);
  color: #57534e;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 1px #e7e5e4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, sans-serif;
}

.wn-link-card__remove:hover {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 0 0 1px #fecaca;
}

.wn-link-card__img-wrap {
  flex: 0 0 200px;
  width: 200px;
  min-height: 90px;
  max-width: 100%;
  background: #e7e5e4;
}

figure.wn-link-card .wn-link-card__img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 0;
}

.wn-link-card__body {
  flex: 1 1 220px;
  padding: 1rem 1.1rem;
  min-width: 0;
}

.wn-link-card__title {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  color: #1c1917;
}

.wn-link-card__desc {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #57534e;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wn-link-card__host {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: #a8a29e;
}

/* 公開・プレビュー（.wn-article-body 内）では削除ボタンを出さない。TinyMCE iframe の body には付かない想定 */
.wn-article-body .wn-link-card__remove {
  display: none !important;
}
