@charset "UTF-8";

.staff-cards-container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 15px 20px;
    width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-content: flex-start;
}

.staff-card-link {
    display: block;
    flex-shrink: 0;
    flex-grow: 0;
    text-decoration: none;
    color: inherit;
    width: 280px;
}

.staff-card {
    box-sizing: border-box;
    border: 1px solid #e3e8ec;
    color: rgb(38, 38, 38);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    width: 100%;
    height: 100%;
}

.staff-card .staff-position {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 400;
}

.staff-card .staff-name {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 300;
}

.staff-card .staff-image {
    object-fit: cover;
}

/* デスクトップ向け (現在の1200px幅の4列表示) */
@media (min-width: 1024px) {
    .staff-cards-container {
        width: 1200px;
        /* 元の固定幅 */
    }

    .staff-card-link {
        /* ★修正: (1200px - 20px*3) / 4 = 285px */
        width: 285px;
    }
}


/* スマートフォン向け（4列表示が崩れるため、1列または2列に調整） */
@media (max-width: 767px) {
    .staff-cards-container {
        width: 100%;
        padding: 10px;
        /* ★変更: スマホでのgapも指定 */
        gap: 10px 10px;
        /* 行間10px, 列間10px */
    }

    .staff-card-link {
        /* ★修正: 2列表示の場合 (gap: 10pxを考慮) -> (100% - 10px) / 2 = 50% - 5px */
        width: calc(50% - 5px);
        /* 1列表示にする場合は、以下のコメントアウトを解除してください */
        /* width: 100%; */
    }

    .staff-card {
        padding: 10px;
        /* カード内部のパディングも小さくする */
    }
}

/* タブレット向け（2列または3列に調整） */
@media (min-width: 768px) and (max-width: 1023px) {
    .staff-cards-container {
        width: 100%;
        /* タブレットでは画面幅いっぱいに広げる */
        max-width: 900px;
        /* ある程度の最大幅を設定 */
        padding: 15px;
        /* ★変更: タブレットでのgapも指定 */
        gap: 15px 15px;
        /* 行間15px, 列間15px (デスクトップの列間20pxより狭くするなど適宜) */
    }

    .staff-card-link {
        /* ★修正: 3列表示の場合 (gap: 15pxを考慮) -> (100% - 15px*2) / 3 = 33.33% - 10px */
        width: calc(33.33% - 10px);
        /* 2列表示にする場合は、以下のコメントアウトを解除してください */
        /* width: calc(50% - 7.5px); */
        /* (100% - 15px)/2 = 50% - 7.5px */
    }
}
