@charset "utf-8";
/* CSS Document */

/* =========================================
   グループ会社一覧（カード型レイアウト基本設定）
========================================= */
.group-category-section {
    max-width: 1200px; /* 5列配置のため広めに設定 */
    margin: 0 auto 60px;
    padding: 0 20px;
}

/* カード本体 */
.group-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 2px solid #3182ce;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: #3182ce;
}

/* ロゴエリア */
.card-logo {
    padding: 30px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* テキストエリア */
.card-body {
    padding: 20px 15px; 
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.company-name {
    font-size: 16px;
    font-weight: bold;
    color: #1a365d;
    margin-bottom: 10px;
    line-height: 1.3;
}

.company-desc {
    font-size: 17px; 
    color: #333333; 
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1; 
}

/* 詳細を見るボタン */
.btn-detail {
    font-size: 13px;
    font-weight: bold;
    color: #3182ce;
    text-align: right;
    display: block;
    transition: color 0.3s;
}
.group-card:hover .btn-detail {
    color: #1e40af;
}

/* =========================================
   スマホ専用ロゴ画像（PC・タブレットでは非表示）
========================================= */
.sp-group-logo {
    display: none;
}

/* =========================================
   本社用のレイアウト（横長カード）
========================================= */
.hq-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0 !important;
    z-index: 2;
}

.hq-card {
    width: 100%;
    max-width: 900px;
    border: 4px solid #3182ce !important; /* 太枠 */
}

@media (min-width: 768px) {
    .hq-card {
        flex-direction: row; 
        align-items: center;
    }
    .hq-card .card-logo {
        width: 40%;
        height: auto;
        min-height: 130px;
        padding: 20px;
        border-bottom: none;
        border-right: 1px solid #f1f5f9;
    }
    .hq-card .card-logo img {
        max-height: 150px;
        width: auto;
        max-width: 100%;
    }
    .hq-card .card-body {
        width: 60%;
        padding: 25px 30px; 
        justify-content: center;
    }
    .hq-card .company-name {
        font-size: 38px !important; 
        margin-bottom: 12px !important;
        font-weight: normal !important;
    }
    .hq-card .company-name .corp-type {
        font-size: 20px !important; 
        font-weight: normal !important;
        display: inline-block !important; /* 本社だけは株式会社を横並びに */
        margin-right: 8px !important;
        margin-bottom: 0 !important;
    }
}

/* =========================================
   グループ会社用の5列グリッド
========================================= */
.group-grid-5col {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 15px;
    position: relative; 
    z-index: 1; 
}

/* グループ会社同士を繋ぐ背面の横線 */
.group-grid-5col::before {
    content: "";
    position: absolute;
    top: 90px; 
    left: 10%; 
    width: 80%; 
    height: 12px; 
    background-color: rgba(49, 130, 206, 0.3); 
    z-index: -1; 
}

/* 法人格（株式会社など） */
.group-grid-5col .corp-type {
    display: block; 
    font-size: 14px; 
    margin-bottom: 4px;
    color: #64748b; 
}

/* 社名メイン部分 */
.group-grid-5col .company-name-main {
    display: block;
    font-size: 24px; 
    word-break: auto-phrase; 
}

/* =========================================
   組織図（而の形）の接続線
========================================= */
.org-tree-line {
    width: 100%;
    max-width: 100%; 
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tree-stem {
    width: 4px;
    height: 30px; 
    background-color: #3182ce; 
}

.tree-branches {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 15px; 
}

.tree-drop {
    position: relative;
    height: 30px; 
}
.tree-drop::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    width: 4px; height: 100%;
    background-color: #3182ce;
    transform: translateX(-50%);
}
.tree-drop::after {
    content: "";
    position: absolute;
    top: 0; height: 4px; 
    background-color: #3182ce;
}
.tree-drop:first-child::after {
    left: 50%; width: calc(50% + 10px); 
}
.tree-drop:last-child::after {
    right: 50%; width: calc(50% + 10px);
}
.tree-drop:not(:first-child):not(:last-child):after {
    left: -10px; width: calc(100% + 20px);
}

/* =========================================
   タブレット用の設定（画面幅1024px以下）
========================================= */
@media (max-width: 1024px) {
    .group-grid-5col {
        gap: 10px; 
    }
    .group-grid-5col::before {
        top: 65px; 
    }
    .card-body {
        padding: 15px 10px;
    }
    .card-logo {
        height: 90px; 
        padding: 15px 10px;
    }
    .group-grid-5col .company-name-main {
        font-size: 18px; 
    }
    .group-grid-5col .company-desc {
        font-size: 13px; 
    }
    .group-grid-5col .corp-type {
        font-size: 12px;
    }
    
    /* タブレット用の組織図矢印 */
    .tree-branches {
        display: none; 
    }
    .tree-stem {
        height: 40px;
        position: relative;
        margin-bottom: 20px;
    }
    .tree-stem::after {
        content: "";
        position: absolute;
        bottom: -2px; left: 50%;
        transform: translateX(-50%);
        border-top: 10px solid #3182ce; 
        border-left: 8px solid transparent; 
        border-right: 8px solid transparent; 
    }
}

/* =========================================
   スマホ用の設定（画面幅767px以下）
========================================= */
@media (max-width: 767px) {
    
    /* 組織図の矢印と線を完全に非表示にする */
    .org-tree-line {
        display: none !important; 
    }

    /* スマホの場合のみ表示順を入れ替える */
    .group-category-section {
        display: flex;
        flex-direction: column;
    }
    
    /* 最上部（本社の上）にロゴ画像を表示 */
    .sp-group-logo {
        display: block;
        order: 0; 
        text-align: center;
        margin-bottom: 20px;
    }
    .sp-group-logo img {
        width: 100%;
        max-width: 400px; 
        height: auto;
    }

    /* 本社カードの設定（2番目） */
    .hq-wrap {
        order: 2; 
        margin-bottom: 30px !important;
        width: 100%;
        box-sizing: border-box; 
    }
    .hq-card {
        flex-direction: column;
        width: 100%;
        box-sizing: border-box; 
    }
    .hq-card .card-logo,
    .hq-card .card-body {
        width: 100%;
        box-sizing: border-box; 
    }
    .hq-card .card-logo {
        height: auto;
        min-height: auto;
        padding: 20px;
    }
    .hq-card .card-logo img {
        max-width: 200px !important; 
        max-height: 80px !important;  
        width: auto;
        height: auto;
    }
    .hq-card .company-name {
        font-size: 24px !important; 
    }
    .hq-card .company-name .corp-type {
        font-size: 14px !important; 
    }

    /* グループ会社カード一覧の設定（3番目） */
    .group-grid-5col {
        order: 3; 
        grid-template-columns: 1fr;
    }
    /* 背面の横線はスマホでは消す */
    .group-grid-5col::before {
        display: none !important;
    }

    /* 本社以外のグループ会社ロゴだけを1.5倍に拡大 */
    .group-card:not(.hq-card) .card-logo {
        height: 130px; 
        padding: 15px; 
    }

    /* グループ会社の文字サイズを、本社と全く同じサイズに大きく戻す */
    .group-grid-5col .company-name-main {
        font-size: 24px !important; 
    }
    .group-grid-5col .corp-type {
        font-size: 14px !important; 
    }
    .group-grid-5col .company-desc {
        font-size: 17px !important; 
        line-height: 1.5;
    }

    /* リンクのテキスト見切れ防止 */
    .btn-detail {
        white-space: normal !important;
        word-break: keep-all; 
        line-height: 1.4;
        width: 100%;
        box-sizing: border-box;
    }
}

/* =========================================
   組織図・4列グリッド完全修正版
========================================= */

/* セクション全体の幅固定 */
.group-category-section {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 本社カード */
.hq-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0;
}

/* 組織図ユニット */
.org-tree-line {
    width: 100%;
    margin: 0 auto;
}

.tree-stem {
    width: 4px;
    height: 30px;
    background-color: #3182ce;
    margin: 0 auto;
}

.tree-branches-wrap {
    position: relative;
    width: 100%;
    height: 30px; /* 縦線の高さと合わせる */
}

/* ★横の一本線：4等分(25%ずつ)の各中心を繋ぐ (12.5% 〜 87.5%) */
.tree-horizontal-line {
    position: absolute;
    top: 0;
    left: 12.5%;
    right: 12.5%;
    height: 4px;
    background-color: #3182ce;
    z-index: 1;
}

/* 縦線のみを配置するグリッド */
.tree-branches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.tree-drop {
    position: relative;
    height: 100%;
}

.tree-drop::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background-color: #3182ce;
    transform: translateX(-50%);
}

/* カードの4列グリッド：幅が崩れないよう固定 */
.group-grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
    margin: 0 auto;
}

/* 以前の5列設定の干渉をリセット */
.group-grid-5col, .group-grid-5col::before {
    display: none !important;
}

/* スマホ表示の調整 */
@media (max-width: 767px) {
    .org-tree-line {
        display: none !important;
    }
    .group-grid-4col {
        grid-template-columns: 1fr; /* スマホは1列 */
        gap: 20px;
        order: 3; /* ★これを追加（本社より後の順番にする） */
    }
}