/* 追従バナー全体 */
#custom-sticky-job-banner {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 230px; /* PC版バナーの幅 (必要に応じて調整) */
    height: 230px; /* ★バナー全体の高さを再調整 (サムネイルとタイトルが収まるように余裕を持たせる) */
    background-color: #06C755;
    /* border: 1px solid #ddd; */
    z-index: 9999;
    padding: 10px 5px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease-in-out;
    box-shadow: 0px 0px 4px rgba(6, 199, 85, 0.55);
}

/* 閉じるボタン */
.close-banner {
    position: absolute;
    background-color: #ffffff;
    top: -16px;
    right: -16px;
    color: #333;
    cursor: pointer;
    z-index: 10001;
    border-radius: 50%;
    border: 1px solid #333333;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
}

.close-banner svg {
    width: 16px;
    height: 16px;
    display: block;
}

.close-banner:hover {
    color: #333;
}

/* バナー見出し */
#custom-sticky-job-banner .banner-heading {
    font-size: 1em;
    font-weight: bold;
    color: #555;
    margin: 0 0 5px 0;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}

/* スライダーとボタンを囲む新しいラッパー */
.custom-job-slider-content-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* スライダーのコンテナ (内部) */
.custom-job-slider-container {
    /* width: calc(100% - 40px); 矢印ボタンのスペースを確保 */
    width: 100%;
    height: 100%;
    position: relative;
}

/* スライダー本体 */
.custom-job-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 各スライド */
.custom-job-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    /* padding: 5px; */
    box-sizing: border-box;
}

.custom-job-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* スライド内のリンク */
.custom-job-slide a.job-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* サムネイルのコンテナ (4:3比率を維持) */
.custom-job-slide .job-thumbnail {
    flex-shrink: 0;
    width: 100%;
    /* height: auto; /* autoのままにして、padding-bottomで高さを制御 */
    position: relative; /* 子要素の絶対配置の基準 */
    padding-bottom: 95%; /* ★4:3 = 3/4 = 0.75 = 75% のアスペクト比維持 */
    overflow: hidden;
    display: block; /* padding-bottom を有効にするため */
    /* margin-bottom: 5px; */
        /* filter: brightness(0.5); */
}

.custom-job-slide .job-thumbnail img {
    position: absolute; /* 親に対して絶対配置 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* border-radius: 8px; */
}


/* スライド内のタイトル */
.custom-job-slide h3.job-title {
    margin: 0 1.3rem;
    padding: 0 5px;
    font-size: 0.85em; /* ★フォントサイズを調整 (必要であれば0.9emなど) */
    line-height: 1.3em; /* ★行間を調整 */
    font-weight: bold;
    text-align: left;
    flex-grow: 0;
    /* 2行分の max-height を計算: (font-size * line-height * 2) + α */
    max-height: calc(0.85em * 1.3 * 2 + 5px); /* ★2行分の高さに設定 (おおよそ2.2em * 2 = 4.4em + α) */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* ★表示を2行に制限 */
    -webkit-box-orient: vertical;
    position: absolute;
    color: #fff;
}

.custom-job-slide a:hover h3.job-title {
    /* color: #0073aa; */
    text-decoration: none;
}

/* ナビゲーション矢印 */
.slider-nav {
    background: none;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10000;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.slider-nav:hover {
    opacity: 1;
    background-color: rgba(0,0,0,0.1);
}

.slider-nav.prev-arrow {
    left: 0;
}

.slider-nav.next-arrow {
    right: 0;
}


/* モバイル表示 (画面幅が 768px 以下の場合) */
@media (max-width: 768px) {
    #custom-sticky-job-banner {
        bottom: 50px;
        /* left: 0; */
        right: 0;
        width: 210px;
        height: 210px;
        padding: 5px;
        /* border-radius: 0; */
    }

    /* 閉じるボタン（モバイル） */
    .close-banner {
        /* font-size: 1.2em; */
        top: -24px;
        right: 0px;
    }

    .custom-job-slider-content-wrapper {
        flex-grow: 1;
    }

    .custom-job-slider-container {
        height: 100%;
        /* width: calc(100% - 30px); */
        width: 100%;
    }

    .custom-job-slider {
        height: 100%;
    }

    .custom-job-slide {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3px;
        /* padding: 3px; */
    }

    .custom-job-slide a.job-link {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    /* モバイルでのサムネイルのコンテナ (4:3比率を維持) */
    .custom-job-slide .job-thumbnail {
        width: 100%; /* モバイルでの幅を調整 */
        padding-bottom: 95%; /* ★4:3 = (90%の幅に対して)0.75倍 = 67.5% */
        /* margin-bottom: 3px; */
    }
    /* imgはPC版と共通のスタイルでOK */


    /* モバイルでのスライド内のタイトル */
    .custom-job-slide h3.job-title {
        font-size: 0.75em; /* ★モバイルでのフォントサイズを調整 (0.65emから0.75emへ) */
        text-align: center;
        -webkit-line-clamp: 2; /* ★モバイルでも2行表示 */
        max-height: calc(0.75em * 1.3 * 2 + 5px); /* ★モバイルでの2行分の高さに設定 */
        padding: 0 3px;
    }
    
    /* モバイルでのナビゲーション矢印の調整 */
    .slider-nav {
        font-size: 1em;
        padding: 3px 6px;
    }
}