/*
	Theme Name: diver_child
	Template: diver
	Description:  Diverの子テーマです。
	Theme URI: http://tan-taka.com/diver/
	Author: Takato Takagi
 */

/* カスタマイズする場合にはこれより下に追記してください  */

/* ==================================================
   【最終調整】Diver タグボタン：バランス完全補正
   ================================================== */

/* 1. テーブル全体の設定 */
.wp-block-table, .wp-block-table table, .wp-block-table td {
    overflow: visible !important;
}

/* 2. タグリストの親枠 */
.original-tag-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important; /* ボタン同士の隙間 */
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    
    /* ▼▼ ここでタグ内の行間のみ復活させます ▼▼ */
    line-height: 1.5 !important; 
}

/* 3. ボタンのデザイン（見切れ防止・レイヤー強制） */
a.original-tag-link {
    display: inline-block !important;
    
    /* レイヤー浮遊設定 */
    position: relative !important; 
    z-index: 10 !important;        
    transform: translateZ(0) !important; 

    /* 色・形 */
    background-color: #f4f5f7 !important;
    color: #444 !important;
    border-radius: 4px !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    
    /* 線（内側描画） */
    border: none !important;
    box-shadow: inset 0 0 0 1px #e1e4e8 !important;
    
    /* 高さ確保 */
    line-height: 1.5 !important;
    margin: 0 !important; /* 余計な余白はゼロ */
    vertical-align: middle !important;
    
    /* 装飾リセット */
    text-decoration: none !important;
    border-bottom: none !important;
    background-image: none !important;
}

/* ホバー時の動き */
a.original-tag-link:hover {
    background-color: #ddd !important;
    color: #000 !important;
    transform: translate3d(0, -2px, 0) !important; 
    text-decoration: none !important;
    box-shadow: inset 0 0 0 1px #ccc !important;
    border-bottom: none !important;
}

/* --------------------------------------------------
   4. テーブルセルの設定（ここが調整のキモです）
-------------------------------------------------- */
td:has(.original-tag-list) {
    /* ▼▼ バランス調整エリア ▼▼ */
    /* 上下の余白をここでミリ単位で調整できます */
    padding-top: 14px !important;    
    padding-bottom: 14px !important; 
    /* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */

    vertical-align: middle !important;
    height: auto !important;
    
    /* ▼▼ 【重要】見えないゴミ（改行）を潰す魔法 ▼▼ */
    line-height: 0 !important; 
    font-size: 0 !important;
    /* ▲▲ これでタグ以外の要素は高さ0になります ▲▲ */
}

/* 5. 邪魔なタグの完全無効化 */
td:has(.original-tag-list) p {
    display: inline !important; /* ブロック要素としての性質を消す */
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important; /* 高さ0 */
    font-size: 0 !important;   /* 高さ0 */
}
td:has(.original-tag-list) br,
.original-tag-list br { display: none !important; }
a.original-tag-link::after,
a.original-tag-link::before { display: none !important; content: none !important; }