/* DVTV-040 アイコンボタン - フロントエンドCSS v1.4.1 */

/* テーブルレイアウト（dvtv_icon_grid用） */
.dvtv-icon-grid-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 16px;
    margin: 10px -16px;
    table-layout: fixed;
}

.dvtv-icon-grid-cell {
    vertical-align: top;
    padding: 0;
}

/* カード本体 */
.dvtv-ib-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    text-decoration: none !important;
    cursor: pointer;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e8e8;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
    width: 100%;
}

.dvtv-ib-card:hover {
    transform: translateY(-3px);
    text-decoration: none !important;
}

/* トップライン */
.dvtv-ib-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.dvtv-ib-card:hover::before {
    opacity: 1;
}

/* アイコンボックス */
.dvtv-ib-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dvtv-ib-card:hover .dvtv-ib-icon {
    animation: dvtvIbIconPulse 1.2s ease-in-out infinite;
}

@keyframes dvtvIbIconPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* テキスト部分 */
.dvtv-ib-text {
    flex: 1;
    min-width: 0;
}

.dvtv-ib-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-weight: 600;
    line-height: 1.4;
}

.dvtv-ib-title {
    margin: 0 0 4px !important;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.dvtv-ib-desc {
    margin: 0 !important;
    font-size: 13px;
    color: #777;
    line-height: 1.6;
}

/* 矢印アイコン */
.dvtv-ib-arrow {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    color: #999;
}

.dvtv-ib-card:hover .dvtv-ib-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* 単体表示用 */
.dvtv-ib-card:not(.dvtv-icon-grid .dvtv-ib-card) {
    margin: 10px 0;
}

/* =======================================
   レスポンシブ: スマホ（768px以下）
   WordPress標準テーブル内も含めて対応
   ======================================= */
@media (max-width: 768px) {

    /* dvtv_icon_grid テーブル */
    .dvtv-icon-grid-table,
    .dvtv-icon-grid-table tbody,
    .dvtv-icon-grid-table tr,
    .dvtv-icon-grid-cell {
        display: block !important;
        width: 100% !important;
    }
    .dvtv-icon-grid-table {
        border-spacing: 0;
        margin: 10px 0;
    }
    .dvtv-icon-grid-cell {
        margin-bottom: 12px;
    }

    /* WordPress標準テーブル内のアイコンボタン */
    table:has(.dvtv-ib-card),
    table:has(.dvtv-ib-card) tbody,
    table:has(.dvtv-ib-card) tr,
    table:has(.dvtv-ib-card) td,
    .dvtv-ib-parent-table,
    .dvtv-ib-parent-table tbody,
    .dvtv-ib-parent-table tr,
    .dvtv-ib-parent-table td {
        display: block !important;
        width: 100% !important;
        border: none !important;
        padding: 0 !important;
    }

    table:has(.dvtv-ib-card) td,
    .dvtv-ib-parent-table td {
        margin-bottom: 12px;
    }

    table:has(.dvtv-ib-card),
    .dvtv-ib-parent-table {
        border-collapse: collapse !important;
        border: none !important;
    }

    /* カード自体のモバイル調整 */
    .dvtv-ib-card {
        gap: 12px;
        padding: 16px;
    }

    .dvtv-ib-card.dvtv-ib-lg .dvtv-ib-icon,
    .dvtv-ib-card .dvtv-ib-icon[style*="width:80px"] {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
    }

    .dvtv-ib-card .dvtv-ib-icon[style*="width:80px"] svg {
        width: 28px !important;
        height: 28px !important;
    }

    .dvtv-ib-title {
        font-size: 14px;
    }

    .dvtv-ib-desc {
        font-size: 12px;
    }
}
