/* ==================================================
   固定SNSシェアボタン
================================================== */

.floating-share {
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) translateX(15px);

    display: flex;
    flex-direction: column;
    gap: 7px;

    z-index: 9998;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0.3s ease;
}


/* スクロール後に表示 */

.floating-share.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateY(-50%) translateX(0);
}


/* ボタン共通 */

.floating-share-btn {
    width: 43px;
    height: 43px;

    padding: 0;
    margin: 0;

    border: 0;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow:
        0 3px 10px rgba(0,0,0,0.16);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;

    -webkit-tap-highlight-color: transparent;
}


/* SVG */

.floating-share-btn svg {
    width: 19px;
    height: 19px;
    fill: #fff;
}


/* LINE */

.floating-share-line {
    background: #06C755;
}

.share-line-text {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.3px;
}


/* X */

.floating-share-x {
    background: #000;
}


/* Facebook */

.floating-share-facebook {
    background: #1877F2;
}


/* URLコピー */

.floating-share-copy {
    background: #666;
}


/* PCのマウスオーバー */

@media (hover: hover) {

    .floating-share-btn:hover {
        transform: scale(1.1);

        box-shadow:
            0 5px 15px rgba(0,0,0,0.22);
    }

    .floating-share-btn:active {
        transform: scale(0.96);
    }
}


/* ==================================================
   URLコピー完了メッセージ
================================================== */

.share-copy-toast {
    position: fixed;

    left: 50%;
    bottom: 30px;

    transform: translateX(-50%) translateY(10px);

    padding: 9px 18px;

    background: rgba(40,40,40,0.94);
    color: #fff;

    border-radius: 20px;

    font-size: 13px;
    line-height: 1.4;

    white-space: nowrap;

    z-index: 10001;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}


.share-copy-toast.is-visible {
    opacity: 1;
    visibility: visible;

    transform: translateX(-50%) translateY(0);
}


/* ==================================================
   スマートフォン
================================================== */

@media screen and (max-width: 768px) {

    .floating-share {

        /* 下部ではなく上部に固定 */
        top: calc(env(safe-area-inset-top, 0px) + 8px);
        bottom: auto;

        left: 50%;
        right: auto;

        transform:
            translateX(-50%)
            translateY(-12px);

        flex-direction: row;

        gap: 7px;

        padding: 6px 10px;

        background: rgba(255,255,255,0.96);

        border: 1px solid rgba(0,0,0,0.07);

        border-radius: 30px;

        box-shadow:
            0 3px 14px rgba(0,0,0,0.14);

        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }


    .floating-share.is-visible {

        transform:
            translateX(-50%)
            translateY(0);
    }


    .floating-share-btn {
        width: 38px;
        height: 38px;

        box-shadow:
            0 2px 6px rgba(0,0,0,0.12);
    }


    .floating-share-btn svg {
        width: 17px;
        height: 17px;
    }


    .share-line-text {
        font-size: 9px;
    }


    /*
    スマホ下部には既存固定ボタンがあるため、
    URLコピー通知だけ少し上へ移動
    */
    .share-copy-toast {
        bottom: 90px;
    }
}


/* ==================================================
   かなり小さいスマートフォン
================================================== */

@media screen and (max-width: 360px) {

    .floating-share {
        gap: 5px;
        padding: 5px 8px;
    }

    .floating-share-btn {
        width: 36px;
        height: 36px;
    }
}


/* ==================================================
   アニメーションを減らす設定のユーザー
================================================== */

@media (prefers-reduced-motion: reduce) {

    .floating-share,
    .floating-share-btn,
    .share-copy-toast {
        transition: none;
    }
}
