/**
 * セマンティック記事検索ブロック（aidb/article-embed）
 *
 * フロントエンドの記事埋め込みカード。エディタのSSRプレビューでも
 * 同じCSSを読み込んで見た目を揃える。
 */

.aidb-rec-article-embed {
    margin: 1.5em 0;
}

/* 複数カードの縦積み */
.aidb-rec-article-embed-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aidb-rec-article-embed-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #6366f1;
    background: #eef2ff;
    padding: 3px 10px;
    border-radius: 4px;
    margin: 0 0 6px;
}

.aidb-rec-article-embed-card {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* テーマの本文リンク装飾（.entry-content a 等の下線・border・背景線）が
   カード内に効かないよう、!important で確実に打ち消す */
.aidb-rec-article-embed-card,
.aidb-rec-article-embed-card:hover,
.aidb-rec-article-embed-card:focus,
.aidb-rec-article-embed-card:visited {
    text-decoration: none !important;
    border: 1px solid #e5e7eb !important;
    background-image: none !important;
    color: inherit !important;
}

.aidb-rec-article-embed-card span {
    text-decoration: none !important;
    border-bottom: none !important;
    background-image: none !important;
}

/* 状態ルールより後に置いて hover の枠色を有効にする */
.aidb-rec-article-embed-card:hover,
.aidb-rec-article-embed-card:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.12);
}

.aidb-rec-article-embed-thumb {
    position: relative;
    flex: 0 0 148px;
    min-height: 104px;
    background: #f3f4f6;
}

.aidb-rec-article-embed-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aidb-rec-article-embed-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
}

.aidb-rec-article-embed-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aidb-rec-article-embed-card:hover .aidb-rec-article-embed-title {
    color: #4f46e5;
}

.aidb-rec-article-embed-excerpt {
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aidb-rec-article-embed-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #9ca3af;
}

.aidb-rec-article-embed-cat {
    color: #6366f1;
    font-weight: 600;
}

@media (max-width: 600px) {
    .aidb-rec-article-embed-thumb {
        flex-basis: 104px;
        min-height: 88px;
    }

    .aidb-rec-article-embed-body {
        padding: 10px 12px;
        gap: 4px;
    }

    .aidb-rec-article-embed-title {
        font-size: 14px;
        -webkit-line-clamp: 3;
    }

    .aidb-rec-article-embed-excerpt {
        display: none;
    }
}
