/* =====================================================
   記事カードブロック用スタイル
   ===================================================== */

/* エディタ用スタイル */
.article-card-block-editor {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;

    & .components-base-control {
        margin-bottom: 20px;
    }
}

.article-card-preview {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

/* フロントエンド用スタイル */
.custom-article-card-block {
    margin: 30px 0;
    background: #F7F6F9;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    position: relative;
    cursor: pointer;

    &:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

    /* カード全体をクリック可能にする擬似要素 */
    &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 0;
    }

    /* 画像エリア */
    & .custom-article-card-image {
        flex-shrink: 0;
        width: 281px;
        height: 158px;
        overflow: hidden;
        border-radius: 16.97px;

        & img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }

    /* テキストエリア */
    & .custom-article-card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        margin-top: 0 !important;
    }

    /* 日付 */
    & .custom-article-card-date {
        color: #666;
        font-size: 14px;
        line-height: 140%;
        margin-bottom: 8px;
    }

    /* タイトル */
    & .custom-article-card-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 180%;
        letter-spacing: 0;
        margin-top: 0px !important;
        margin-bottom: 0 !important;
    }

    /* メインリンク（擬似要素でカード全体をカバー） */
    & .custom-article-card-main-link {
        color: #333;
        text-decoration: none;
        position: static;

        &::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 1;
        }
    }

    /* タグコンテナ */
    & .custom-article-card-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 12px !important;
    }

    /* 個別タグ */
    & .custom-article-card-tag {
        display: inline-block;
        background: #F7F6F9;
        border: 1px solid #E5E5F0;
        border-radius: 999px;
        padding: 4px 12px;
        font-size: 12px;
        color: #666666;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s ease;
        position: relative;
        z-index: 2;
    }

    & .custom-article-card-tag:hover {
        color: #212529;
        font-weight: 500 !important;
        text-decoration: none !important;
    }

    /* 詳細リンク */
    & .custom-article-card-link {
        color: #000;
        font-size: 16px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-top: 24px;
        margin-left: auto;
    }

    /* レスポンシブ対応 */
    @media (max-width: 726px) {
        flex-direction: column;

        & .custom-article-card-image {
            width: 100%;
            max-width: 100%;
            height: auto;
            aspect-ratio: 281 / 158;
        }
    }

    @media (max-width: 400px) {
        padding: 14px;

        & .custom-article-card-title {
            font-size: 14px;
        }
    }
}
