/**
 * WP投稿埋め込みカード（/embed/）用スタイル
 * @see https://developer.wordpress.org/news/2025/02/customize-wordpress-embeds-to-match-your-theme/
 */

.wp-embed {
  border: 0 !important;
  box-shadow: none !important;
  font-size: 14px;
}

.wp-embed a,
.wp-embed-excerpt a {
  color: #000080 !important;
}

/* 左:画像 / 右:タイトル+抜粋 */
.wp-embed:has(.wp-embed-featured-image) {
  display: grid;
  grid-template-columns: 30% 1fr;
  grid-template-areas:
    "image heading"
    "image excerpt"
    "footer footer";
  column-gap: 20px;
  align-items: start;
}

.wp-embed-featured-image {
  grid-area: image;
  float: none;
  max-width: none;
  width: 100%;
  margin: 0;
}

.wp-embed-featured-image.square,
.wp-embed-featured-image.rectangular {
  float: none;
  max-width: none;
  margin-right: 0;
}

.wp-embed-featured-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

p.wp-embed-heading {
  grid-area: heading;
  font-size: 18px;
  margin: 0;
  line-height: 1.3;
}

.wp-embed-excerpt {
  grid-area: excerpt;
}

.wp-embed-footer {
  grid-area: footer;
  margin-top: 15px;
}

/* SP: 画像上・テキスト下に積み上げ */
@media screen and (max-width: 767px) {
  .wp-embed:has(.wp-embed-featured-image) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "heading"
      "excerpt"
      "footer";
    column-gap: 0;
    row-gap: 0;
  }

  .wp-embed-featured-image {
    margin: 0;
  }

  p.wp-embed-heading {
    font-size: 16px;
  }
}
