@charset "utf-8";

/* ==========================================================================
   ファイル名: back-to-top.css - Nishikawa Compact Edition
   - Size: Compact Square (50px / 44px)
   - Color: Nishikawa Navy & Gold Hover Icon
   - Style: Minimal & Refined
   ========================================================================== */

/* 1. スムーズスクロール */
html {
    scroll-behavior: smooth;
}

/* 2. ボタン全体を画面右下に固定 (JS連動型) */
.page-top-wrapper {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 90; 
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
}

/* 表示クラス */
.page-top-wrapper.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- メニュー展開時は物理的に消去 --- */
body.is-menu-open .page-top-wrapper,
body:has(.is-menu-open) .page-top-wrapper,
#js-header.is-menu-open ~ .page-top-wrapper,
.is-menu-open .page-top-wrapper {
    display: none !important;
}

/* 3. ボタン自体のデザイン (一回り小さく 50px) */
.page-top-btn {
    width: 50px;
    height: 50px;
    display: block !important;
    background: #002d5e;
    border: none;
    border-radius: 4px; /* わずかな角丸 */
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

/* 小さなアイコン（矢印） */
.page-top-btn::before {
    content: "";
    position: absolute;
    top: 58%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    transform: translate(-50%, -50%) rotate(45deg);
    transition: all 0.3s ease;
}

/* ホバー演出：アイコンのみゴールドに変化 */
.page-top-btn:hover {
    background: #002d5e;
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.page-top-btn:hover::before {
    border-color: #c5a059; /* ホバー時にゴールド */
    transform: translate(-50%, -85%) rotate(45deg);
}

/* 4. モバイル対応 (さらにコンパクトに 44px) */
@media (max-width: 768px) {
    .page-top-wrapper {
        right: 20px;
        bottom: 20px;
    }
    
    .page-top-btn {
        width: 44px;
        height: 44px;
    }

    .page-top-btn::before {
        width: 8px;
        height: 8px;
        top: 58%;
    }
}