/* --- ハンドル（矢印）専用スタイル --- */

.slider-wrapper, .popularity-wrapper {
    position: relative;
    overflow: hidden; 
}

.custom-handle {
    position: absolute;
    top: 0; bottom: 0;
    width: 3%; 
    min-width: 50px;
    
    background: rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    align-items: center; /* 上下中央 */
    
    font-size: 3rem;
    cursor: pointer;
    z-index: 9999; 
    user-select: none;
    pointer-events: auto;
    opacity: 0;
    
    /* 背景のみアニメーション（位置移動はspan側でやるため削除） */
    transition: opacity 0.5s ease, background 0.5s ease;

    /* ★追加：行の高さによるズレを防止 */
    line-height: 1;
}

/* ★重要：勝手に出てくる小さい矢印（疑似要素）を消す設定 */
.custom-handle::after,
.custom-handle::before {
    content: none !important;
    display: none !important;
}

/* 矢印（span）専用スタイル */
.handle-arrow {
    display: block; 
    line-height: 1;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
    backface-visibility: hidden;
}

/* 表示トリガー */
.slider-wrapper:hover .custom-handle,
.popularity-wrapper:hover .custom-handle {
    opacity: 1;
}

.custom-handle:hover {
    opacity: 1;
}


/* --- 左ハンドル --- */
.custom-handle.prev {
    left: 0;
    border-radius: 0 5px 5px 0;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, transparent 100%);
    justify-content: flex-start;
    padding-left: 1px; 
}

.custom-handle.prev:hover .handle-arrow {
    transform: translateX(-10px) scale(1.5);
}

/* --- 右ハンドル --- */
.custom-handle.next {
    right: 0;
    border-radius: 5px 0 0 5px;
    background: linear-gradient(to left, rgba(0,0,0,0.7) 0%, transparent 100%);
    justify-content: flex-end;
    padding-right: 1px; 
}

.custom-handle.next:hover .handle-arrow {
    transform: translateX(10px) scale(1.5);
}