/* ================================================= */
/* 0. 共通設定 (カラー変数) */
/* ================================================= */
:root {
    --b-card-color-main: #01a000; /* 濃い緑 */
    --b-card-color-light: #e5f5e5; /* 薄い緑 */
    --b-color-shadow: rgba(0, 0, 0, 0.05);
    --b-color-shadow-hover: rgba(0, 0, 0, 0.15);
}

/* box-sizing: border-box を全要素に適用 (計算誤差を防ぐため) */
.b-staff-cards-wrapper a, 
.b-staff-cards-wrapper a * {
    box-sizing: border-box;
}

/* ================================================= */
/* 1. 4カラムの配置設定 (親要素) */
/* ================================================= */

/* カラム（aタグ）の幅設定と基本スタイル */
.b-staff-cards-wrapper a {
    /* PC (4列): flex-basis: 25% - 22.5px */
    flex: 1 1 calc(25% - 22.5px); 
    min-width: 150px; 
    text-decoration: none; 
    color: inherit;
    display: block; 
    position: relative;
    
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--b-color-shadow);
    /* 角丸を削除したので、念のため明示的に0に設定 */
    border-radius: 0; 
    overflow: hidden;
}

/* ホバーエフェクト */
.b-staff-cards-wrapper a:hover {
    box-shadow: 0 8px 20px var(--b-color-shadow-hover);
    transform: translateY(-5px);
}


/* ================================================= */
/* 2. カード本体 (.b-staff-cards) */
/* ================================================= */
.b-staff-cards {
    width: 100%;
    position: relative; 
}

/* 番号 (01) のデザイン */
.b-staff-cards-number {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--b-card-color-main); 
    background-color: #fff;
    border: 2px solid var(--b-card-color-main); 
    border-radius: 50%; /* ここは丸を維持 */
}

/* 画像エリア (上部) */
.b-staff-cards-imgarea {
    width: 100%;
    padding-top: 140%; /* 縦横比を確保 */
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

/* テキストエリア (下部の濃い緑色部分) */
.b-staff-cards-textarea {
    position: absolute; 
    
    /* 横幅を調整 */
    width: 70%;       
    
    /* 位置調整 */
    left: 0;
    bottom: 3%; 
    
    padding: 8px;
    background-color: var(--b-card-color-main); 
    color: #fff;
    line-height: 1.7;
    z-index: 5; 
    border-radius: 0; /* 角丸を削除 */
    @media (max-width: 1150px) {
        width: 100%;
        bottom: 0;
        padding: 10px;
    }
}

/* ネストされた p タグのスタイルを分離★ */
.b-staff-cards-textarea p {
    font-size: 12px;
    margin: 0; /* 自動マージンをリセット */
}


/* ================================================= */
/* 3. レスポンシブ対応 */
/* ================================================= */

/* wp-block-column のデフォルト幅設定を上書き（PC/全幅用） */
.b-staff-cards-wrapper .wp-block-column {
    width: 100%;
    flex-basis: auto;
    flex-grow: 0;
    flex-shrink: 0; 
    margin: 0; 
    padding: 0;
}

/* 画面幅が1024px以下の場合：2列表示 (タブレット/一部SP横) */
@media (max-width: 1024px) {
    .b-staff-cards-wrapper a {
        /* 2列設定を適用 */
        flex: 1 0 calc(50% - 15px);
    }
}

/* 画面幅が767px以下の場合：2列表示を維持 (スマートフォン縦) */
/* 1024pxと同じ設定を維持し、間に挟まる wp-block-column の競合を解決する */
@media (max-width: 767px) {
    .b-staff-cards-wrapper .wp-block-column {
        display: contents; /* ← これで、この要素はCSSボックスツリーから除外される */
    }

    .wp-block-columns.b-staff-cards-wrapper {
        flex-wrap: wrap !important;
    }
    .b-staff-cards-wrapper a {
        /* 2列設定を維持 */
        flex: 1 1 calc(50% - 15px); 
        max-width: none;
        margin: 0;
    }
    
    /* wp-block-column のリセットと強制設定 */
    .wp-block-column {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ラッパーの左右のパディング調整 */
    .b-staff-cards-wrapper {
        padding-left: 10px;
        padding-right: 10px;
        gap: 20px;
    }
}


