/*
 * NsIDEA ONE - 取材結果記事フロント表示
 * v5.2.7
 *
 * Cocoon・子テーマ・記事内に保存済みのインラインCSSとの競合を避けるため、
 * 取材結果カード配下だけを強く限定して指定しています。
 */

.single-post .entry-content .nsidea-result-card,
.single-post .article .nsidea-result-card {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1080px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: hidden !important;
}

.single-post .entry-content .nsidea-result-card table,
.single-post .article .nsidea-result-card table {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
}

.single-post .entry-content .nsidea-result-card th,
.single-post .entry-content .nsidea-result-card td,
.single-post .article .nsidea-result-card th,
.single-post .article .nsidea-result-card td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

.single-post .entry-content .nsidea-result-card img,
.single-post .article .nsidea-result-card img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media screen and (max-width: 768px) {
    .single-post .entry-content,
    .single-post .article .entry-content {
        overflow-x: hidden !important;
    }

    .single-post .entry-content .nsidea-result-card,
    .single-post .article .nsidea-result-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 12px auto !important;
        padding: 10px 5px 12px !important;
        border-radius: 7px !important;
        overflow: hidden !important;
    }

    /* カード最上部のタイトルバー */
    .single-post .entry-content .nsidea-result-card > div:first-child,
    .single-post .entry-content .nsidea-result-title,
    .single-post .article .nsidea-result-card > div:first-child,
    .single-post .article .nsidea-result-title {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 12px !important;
        padding: 10px 4px !important;
        font-size: 19px !important;
        line-height: 1.25 !important;
        letter-spacing: 0 !important;
        overflow-wrap: anywhere !important;
    }

    .single-post .entry-content .nsidea-result-card table,
    .single-post .article .nsidea-result-card table {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 auto 14px !important;
        table-layout: fixed !important;
    }

    /* 1つ目の表＝台別データ。旧記事と新記事の両方に対応 */
    .single-post .entry-content .nsidea-result-card table:first-of-type th:nth-child(1),
    .single-post .entry-content .nsidea-result-card table:first-of-type td:nth-child(1),
    .single-post .article .nsidea-result-card table:first-of-type th:nth-child(1),
    .single-post .article .nsidea-result-card table:first-of-type td:nth-child(1) {
        width: 13% !important;
    }
    .single-post .entry-content .nsidea-result-card table:first-of-type th:nth-child(2),
    .single-post .entry-content .nsidea-result-card table:first-of-type td:nth-child(2),
    .single-post .article .nsidea-result-card table:first-of-type th:nth-child(2),
    .single-post .article .nsidea-result-card table:first-of-type td:nth-child(2) {
        width: 45% !important;
    }
    .single-post .entry-content .nsidea-result-card table:first-of-type th:nth-child(3),
    .single-post .entry-content .nsidea-result-card table:first-of-type td:nth-child(3),
    .single-post .article .nsidea-result-card table:first-of-type th:nth-child(3),
    .single-post .article .nsidea-result-card table:first-of-type td:nth-child(3) {
        width: 19% !important;
    }
    .single-post .entry-content .nsidea-result-card table:first-of-type th:nth-child(4),
    .single-post .entry-content .nsidea-result-card table:first-of-type td:nth-child(4),
    .single-post .article .nsidea-result-card table:first-of-type th:nth-child(4),
    .single-post .article .nsidea-result-card table:first-of-type td:nth-child(4) {
        width: 23% !important;
    }

    .single-post .entry-content .nsidea-result-card table:first-of-type th,
    .single-post .article .nsidea-result-card table:first-of-type th {
        min-width: 0 !important;
        padding: 7px 1px !important;
        border-width: 2px !important;
        font-size: clamp(10px, 3.35vw, 14px) !important;
        line-height: 1.08 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    .single-post .entry-content .nsidea-result-card table:first-of-type td,
    .single-post .article .nsidea-result-card table:first-of-type td {
        min-width: 0 !important;
        max-width: none !important;
        padding: 7px 2px !important;
        border-width: 1.5px !important;
        font-size: clamp(10px, 3.25vw, 14px) !important;
        line-height: 1.16 !important;
        letter-spacing: -0.02em !important;
        overflow: hidden !important;
        text-overflow: clip !important;
    }

    .single-post .entry-content .nsidea-result-card table:first-of-type td:nth-child(1),
    .single-post .entry-content .nsidea-result-card table:first-of-type td:nth-child(3),
    .single-post .entry-content .nsidea-result-card table:first-of-type td:nth-child(4),
    .single-post .article .nsidea-result-card table:first-of-type td:nth-child(1),
    .single-post .article .nsidea-result-card table:first-of-type td:nth-child(3),
    .single-post .article .nsidea-result-card table:first-of-type td:nth-child(4) {
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    .single-post .entry-content .nsidea-result-card table:first-of-type td:nth-child(2),
    .single-post .article .nsidea-result-card table:first-of-type td:nth-child(2) {
        padding-left: 3px !important;
        padding-right: 3px !important;
        font-size: clamp(9px, 2.95vw, 13px) !important;
        white-space: normal !important;
        word-break: break-all !important;
        overflow-wrap: anywhere !important;
    }

    /* インライン指定された推定・差枚用spanもセルサイズに追従させる */
    .single-post .entry-content .nsidea-result-card table:first-of-type td span,
    .single-post .article .nsidea-result-card table:first-of-type td span {
        display: inline !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: inherit !important;
        line-height: inherit !important;
        vertical-align: baseline !important;
        white-space: inherit !important;
    }

    /* 2つ目の表＝集計 */
    .single-post .entry-content .nsidea-result-card table:nth-of-type(2) th,
    .single-post .entry-content .nsidea-result-card table:nth-of-type(2) td,
    .single-post .entry-content .nsidea-result-summary th,
    .single-post .entry-content .nsidea-result-summary td,
    .single-post .article .nsidea-result-card table:nth-of-type(2) th,
    .single-post .article .nsidea-result-card table:nth-of-type(2) td,
    .single-post .article .nsidea-result-summary th,
    .single-post .article .nsidea-result-summary td {
        padding: 9px 4px !important;
        border-width: 2px !important;
        font-size: clamp(13px, 4vw, 18px) !important;
        line-height: 1.15 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    .single-post .entry-content .nsidea-result-card table:nth-of-type(2) th,
    .single-post .entry-content .nsidea-result-summary th,
    .single-post .article .nsidea-result-card table:nth-of-type(2) th,
    .single-post .article .nsidea-result-summary th {
        width: 62% !important;
    }

    .single-post .entry-content .nsidea-result-note,
    .single-post .article .nsidea-result-note {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }
}
