/* ===========================================
   上部に戻るボタン（Scroll to Top Button）
   最終版 - 外部ファイル
   =========================================== */

/* 上部に戻るボタン */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.6);; /* 半透明のグレー */
    color: white;
    border: none;
    border-radius: 6px; /* 角丸の四角 */
    cursor: pointer;
    font-size: 0; /* 文字を非表示 */
    text-align: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* ふわっとアニメーション用の初期状態 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out, transform 0.6s ease-out;
}

/* 上矢印のスタイル（山形・V字逆さま） */
.scroll-to-top::before {
    content: '';
    width: 12px;
    height: 12px;
    border-top: 2px solid white;
    border-right: 2px solid white;
    transform: rotate(-45deg);
    display: block;
    margin-top: 3px; /* 位置調整 */
}

.scroll-to-top:hover {
    background-color: rgba(0, 0, 0, 0.9); /* ホバー時は少し濃く */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    color: white;
    text-decoration: none;
}

/* ホバー時のtransformは別途定義 */
.scroll-to-top.show:hover {
    transform: translateY(-2px);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* SP版の調整 */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 66px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
    
    /* SP版の上矢印サイズ調整 */
    .scroll-to-top::before {
        width: 10px;
        height: 10px;
        border-top: 2px solid white;
        border-right: 2px solid white;
        margin-top: 2px;
    }
}