:root {
  /*メンバーカラー */
  --color-blue: #007AFF;
  --color-green: #34C759;
  --color-orange: #FF9500;
  --color-purple: #AF52DE;

  /* アクセントカラー */
  --color-yellow: #FFC000;
  --color-light-blue: #EBF5FF;
  --color-gray: #7F7F7F;
  --color-link-blue: #366973;
}

/* ======================================
   共通 （根強い既存CSS対策：見出し、リンクなど）
   ====================================== */
.single-roundtable #contents #main_col {

    /* -------------------------------------
       1. h3 全体共通リセット（疑似要素の消去）
       ------------------------------------- */
    h3 {
        &::before,
        &::after {
            content: none !important;
            display: none !important;
        }
    }

    /* -------------------------------------
       2. お題グループ（.theme-heading-group）
       ------------------------------------- */
    .theme-topic-group {
        margin: 2.5rem 0 1.5rem;

        /* グループ配下のh3に対してスタイルを自動適用 */
        h3 {
            /* 既存スタイルのリセット＆ベース設定 */
            background: #fff;
            color: var(--text-color);
            font-size: 1.28125rem;
            font-weight: bold;
            line-height: 1.6;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
            border: 3px solid var(--color-yellow);
            border-radius: 0;
            position: relative;

            /* レイアウト（Grid指定） */
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 1.5rem;
            align-items: center;

            span {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                background-color: var(--color-yellow);
                color: #fff;
                font-size: 1rem;
                font-weight: bold;
                padding: 0.8rem 1.2rem;
                white-space: nowrap;
                text-align: center;
            }

            @media screen and (max-width: 639px) {
                padding: 1rem;
                grid-template-columns: 1fr;
                gap: 1rem;
                font-size: 1.1rem;

                span {
                    width: 100%;
                    padding: 0.6rem 1rem;
                }

                br {
                    display: none;
                }
            }
        }
    }

    /* 見出し */
    h4 {
        background: unset;
        color: unset;
        padding: 0;
        font-size: 1.875rem;

        &.hd-end {
            font-size: 1.125rem;
            text-align: center;
        }
        
        @media screen and (max-width: 639px) {
            font-size: 1.5rem;

            br {
                display: none;
            }
        
        }

    }

    /* → リンク（詳しくはこちらなど） */
    .link-more {
        display: inline-block;
        color: var(--color-link-blue);
        text-decoration: underline;
        transition: opacity 0.2s ease;

        /* FontAwesome矢印アイコン */
        &::before {
            content: "\f178";
            font-family: FontAwesome;
            font-weight: 900;
            text-decoration: none;
        }

        &:hover {
            opacity: 0.8;
        }
    }  

    img {
        padding: 0;
    }


}

/* -------------------------------------
   座談会投稿共通カスタム
   ------------------------------------- */
h4 {
    margin: 1.25rem 0;
}

p {
    font-size: 1.0625rem;

    & + p {
    margin-top: 1rem;
    }

    & + figure {
    margin-top: 1.5rem;
    }

}

.note {
    padding-left: 1em;
    text-indent: -1em;
    font-size: 16px;
    margin-top: .8rem;
}

.link-more {
    margin-left: 0.25em;
}

/* ==========================================================================
   解説ボックス（.info-box）
   ========================================================================== */
.info-box {
    margin: 2rem 0;
    padding: 1.5rem;
    border: 1px solid var(--color-gray);
    background-color: #fff;

    /* ボックス内タイトル */
    .title {
        font-size: 1.125rem;
        font-weight: bold;
        line-height: 1.5;
        margin-bottom: .8rem;
        margin-left: .5rem;
    }
    
    .index-text{

        p {
            padding-left: 4.525em;
            text-indent: -4.525em;

            & + p {
                margin-top: 0.8rem;
            }
        }
        
    }

    .link-more {        
        margin-left: 0.5em;

        &::before {
            margin-left: 4.5rem;
        }
        
    }
}

/* ==========================================================================
   プロフィールカード（.profile-card）
   ========================================================================== */
.profile-card {
    background-color: var(--color-light-blue);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;

    --member-color: var(--color-blue);

    &.member-green {
        --member-color: var(--color-green);
    }
    &.member-orange {
        --member-color: var(--color-orange);
    }
    &.member-purple {
        --member-color: var(--color-purple);
    }

    /* -----------------------------------
       メインエリア（Grid設計）
       ----------------------------------- */
    .card-main {
        display: grid;
        grid-template-columns: 1fr 200px;
        grid-template-areas:
            "header photo"
            "bio    photo";
        gap: 0 1.5rem;
        align-items: start;
        margin-bottom: 1rem;

        /* WP自動生成ラッパーの影響を打ち消す */
        > .wp-block-group__inner-container {
            display: contents;
        }
    }

    .card-header {
        grid-area: header;
        margin-bottom: .5rem;

        /* WP自動生成ラッパー打ち消し */
        > .wp-block-group__inner-container {
            display: contents;
        }
    }

    /* キャッチフキダシ */
    .badge {
        display: inline-block;
        position: relative;
        background-color: var(--member-color);
        color: #fff;
        font-weight: bold;
        font-size: 0.95rem;
        padding: 0.4rem 1.2rem;
        border-radius: 6px;

        &::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 1.2rem;
            border: 6px solid transparent;
            border-top-color: var(--member-color);
        }
    }

    .name-age {
        font-size: 1.35rem;
        font-weight: bold;
        color: var(--member-color);
        /* margin: 0 0 1rem 0 !important; */

        span {
            font-size: 1rem;
            font-weight: normal;
        }
    }

    .photo {
        grid-area: photo;

        figure {
            margin-bottom: 0;

            img {
                width: 100%;
                height: auto;
                display: block;
                border: 4px solid var(--member-color);
                background-color: #fff;
            }
        }
    }

    .bio {
        grid-area: bio;
        line-height: 1.8;
    }

    .license {
        background-color: #fff;
        padding: 0.8rem 1rem;
        font-size: 0.875rem;
        line-height: 1.6;
        border-radius: 2px;
    }

    /* スマホ表示：1カラム化 & 並び替え */
    @media screen and (max-width: 639px) {
        padding: 1.25rem;

        .card-main {
            grid-template-columns: 1fr;
            grid-template-areas:
                "header"
                "photo"
                "bio";
            gap: 1rem 0;
        }

        .photo {
            max-width: 280px;
            justify-self: center;
            width: 100%;
        }
    }
}

/* ==========================================================================
   お題メイン（.theme-topic-group）
   ========================================================================== */
.theme-topic-group {

    .facilitator {
        color: var(--color-gray);
        font-weight: bold;
        margin-bottom: 1rem;

        @media screen and (max-width: 639px) {
            br { display: none; }
        }

    }
    
    /* -------------------------------------
       会話グループ（.talk-group）
       ------------------------------------- */
    .talk-group {
        display: grid;
        grid-template-columns: 60px 1fr;
        gap: 0 1.25rem;
        margin-bottom: 2rem;
        align-items: start;

        @media screen and (max-width: 550px) {            
            margin-bottom: 1.5rem;
        }

        > .wp-block-group__inner-container {
            display: contents;
        }

        --member-color: var(--color-blue);

        &.member-green {
            --member-color: var(--color-green);
        }
        &.member-orange {
            --member-color: var(--color-orange);
        }
        &.member-purple {
            --member-color: var(--color-purple);
        }

        .talk-icon {
            width: 60px;

            img {
                width: 60px;
                height: 60px;
                object-fit: cover;
                border-radius: 50%;
                border: 2px solid var(--member-color);
                display: block;
            }
        }

        .talk-content {
            font-size: 1rem;
            line-height: 1.8;

            p strong:first-child {
                color: var(--member-color);
                font-weight: bold;
            }

            p {
                margin: 0 0 1rem 0;

                &:last-child {
                    margin-bottom: 0;
                }
            }

            .wp-block-image {
                margin: 0;

                @media screen and (max-width: 550px) {
                    figure {
                        margin-top: 0;
                        margin-bottom: 1.5rem;
                    }
                }
            }

        }

        /* -----------------------------------
            画像の回り込み設定（PC表示）
            ----------------------------------- */
        .alignleft,
        .img-left {
            float: left;
            margin-right: 1.25rem;
            max-width: 45%;

            img {
                width: 100%;
                height: auto;
                display: block;
            }
        }

        .alignright,
        .img-right {
            float: right;
            margin-left: 1.25rem;
            max-width: 45%;

            img {
                width: 100%;
                height: auto;
                display: block;
            }
        }

        &::after {
            content: "";
            display: block;
            clear: both;
        }

    }

    @media screen and (max-width: 639px) {
        grid-template-columns: 48px 1fr;
        gap: 0.8rem;

        .talk-icon {
            width: 48px;

            img {
                width: 48px;
                height: 48px;
            }
        }
    }

    @media screen and (max-width: 550px) {

        .talk-content {
            display: flex;
            flex-direction: column;

            > .wp-block-group__inner-container {
                display: flex;
                flex-direction: column;
            }

            p {
                &.order-top {
                    order: 0;
                }
                
                &.order-bottom {
                    order: 10;
                }
            }

            .wp-block-image {

                &.img-top {
                    order: -1;
                }

                &.img-bottom-2 {
                    order: 2;

                }

                &.img-bottom {
                    order: 10;

                    figure {
                        margin: 1.5rem 0 .5rem;
                    }
                    
                }

                .alignleft,
                .img-left,
                .alignright,
                .img-right {
                    float: none;
                    max-width: 100%;
                    margin: 1rem 0;
                }

                img {
                    width: 100%;
                    height: auto;
                }
            }
        }
                    
    }

    /* -------------------------------------
    2カラムで写真を配置
    ※どうしてもPC表示で写真が2人分以上にまたぎたい場合
    ※写真：PC（カラム直下 ）、スマホ（.talk-content内.only-sp-img）の2か所で表示設定
        ----------------------------------- */
    @media screen and (min-width: 640px) {
        
        .img-right-columns {
            display: grid;
            grid-template-columns: 1fr 39%;
            gap: 1.5rem;
        }

        .img-left-columns {
            display: grid;
            grid-template-columns: 39% 1fr;
            gap: 1.5rem;
        }

        .only-sp-img {
            display: none;
        }

    }

    @media screen and (max-width: 639px) {

        .img-right-columns > div:last-child,
        .img-left-columns > div:first-child {
            display: none;            
        }

        .talk-group:last-child {
            margin-bottom: 0;
        }

    }

    /* ワイド写真のマージン調整 */
    > div > .wp-block-image {
        margin-bottom: 2rem;
    }
    

}