/*
Theme Name: nekotokurasu
Description: A child theme of Themify Ultra
Template: themify-ultra
Author: 管理人
*/

/* ==========================================================================
   1. アイキャッチ周辺の余白調整（AdSense空枠の完全非表示化）
   ========================================================================== */

/* 広告モジュール（tb_im93689）：
   ローカル環境、広告未配信（unfilled）、読み込み待機中など、広告コンテンツが存在しない場合は外枠ごと完全非表示化 */
.module.module-plain-text.tb_im93689 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}


/* 広告が filled（配信済み）でない限り、モジュール全体を完全に非表示 */
.module.module-plain-text.tb_im93689:not(:has(ins[data-ad-status="filled"])),
.module.module-plain-text.tb_im93689:has(ins[data-ad-status="unfilled"]),
.module.module-plain-text.tb_im93689:empty {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}


/* insタグ自身も unfilled または未充填なら高さ0・非表示を強制 */
.module.module-plain-text.tb_im93689 ins.adsbygoogle:not([data-ad-status="filled"]),
.module.module-plain-text.tb_im93689 ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}


/* アイキャッチ画像モジュール：メタ情報（日付・カテゴリー）との間隔を自然な適正値に統一 */
.module.module-featured-image {
    margin-top: 0.8em !important;
    margin-bottom: 2em !important;
}

.module.module-featured-image img {
    border-radius: 8px;
    display: block;
    width: 100%;
    height: auto;
}

/* モバイル表示（600px以下）時の余白最適化 */
@media screen and (max-width: 600px) {
    .module.module-plain-text.tb_im93689 {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .module.module-featured-image {
        margin-top: 0.6em !important;
        margin-bottom: 1.5em !important;
    }
}

/* ==========================================================================
   2. 表（テーブル）の美しい表形式スタイリング
   ========================================================================== */
.themify_builder_content table,
.entry-content table,
.module-text table,
.tb_text_wrap table,
table.tf_table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 1.8em 0 !important;
    font-size: 0.95em !important;
    line-height: 1.6 !important;
    border: 1px solid #dcdfe6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.themify_builder_content table th,
.entry-content table th,
.module-text table th,
.tb_text_wrap table th,
table.tf_table th {
    background-color: #f2f5f8 !important;
    color: #2c3e50 !important;
    font-weight: 700 !important;
    text-align: left !important;
    padding: 12px 16px !important;
    border: 1px solid #dcdfe6 !important;
    font-size: 0.95em !important;
    vertical-align: middle !important;
}

.themify_builder_content table td,
.entry-content table td,
.module-text table td,
.tb_text_wrap table td,
table.tf_table td {
    padding: 12px 16px !important;
    border: 1px solid #e4e7ed !important;
    color: #4a5568 !important;
    vertical-align: top !important;
    background-color: #ffffff !important;
}

.themify_builder_content table tbody tr:nth-child(even) td,
.entry-content table tbody tr:nth-child(even) td,
.module-text table tbody tr:nth-child(even) td,
table.tf_table tbody tr:nth-child(even) td {
    background-color: #f9fafc !important;
}

/* テーブルを囲むレスポンシブコンテナ */
div[style*="overflow-x:auto"] {
    margin: 1.8em 0 !important;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   3. 見出しと本文との間の空間（余白）の調整
   ========================================================================== */

/* 本文内のH2見出し（投稿タイトル .tbp_title は除外） */
.module-text h2,
.tb_text_wrap h2,
.themify_builder_content h2:not(.tbp_title),
.entry-content h2:not(.post-title),
.tbp_template h2:not(.tbp_title):not(.post-title) {
    margin-top: 2.6em !important;
    /* 前の本文・段落との空間を十分に確保 */
    margin-bottom: 1.4em !important;
    /* 見出し直後の本文との空間をしっかり広げる */
    padding-bottom: 0.5em !important;
    /* 下線と見出し文字との余白 */
    border-bottom: 2px solid #e2e8f0 !important;
    color: #1a202c !important;
    font-size: 1.6em !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
    letter-spacing: -0.01em;
}

/* 本文内のH3見出し */
.module-text h3,
.tb_text_wrap h3,
.themify_builder_content h3,
.entry-content h3,
.tbp_template h3 {
    margin-top: 2.0em !important;
    /* 前の本文との空間を確保 */
    margin-bottom: 1.2em !important;
    /* 見出し直後の本文との空間をしっかり広げる */
    padding-left: 0.7em !important;
    /* 左のアクセントバーと文字の余白 */
    border-left: 4px solid var(--theme_accent, #ed1e24) !important;
    color: #2d3748 !important;
    font-size: 1.3em !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
}

/* 本文段落の行間と余白の最適化 */
.module-text p,
.tb_text_wrap p,
.themify_builder_content p,
.entry-content p {
    margin-top: 0 !important;
    margin-bottom: 1.6em !important;
    line-height: 1.9 !important;
    font-size: 1.02em !important;
    color: #333333 !important;
}