@charset "UTF-8";
/**
 * ESP_SOKA-494【グランドデザイン】後期計画への導線バナー（画面右下・常時表示）
 * Figma: Frame 55（374 x 229）
 * https://www.figma.com/design/QHA7kvD3Y6zzOfZQWtt9lt/...?node-id=253-4
 * 読み込み: elements/special_header.php（special_granddesign_* テンプレートのみ）
 * マークアップ: elements/granddesign/floating_banner.php
 *
 * バナー本体はデザイナー書き出しの画像 1 枚。
 * 閉じるボタン・矢印のみ SVG を重ねる。座標は Figma 実測値。
 *   閉じる: 22x22 / left 344px top 7px  → right 8px  top 7px
 *   矢印  : 25x25 / left 341px top 198px → right 8px bottom 6px
 *
 * テーマ側の .global-wrapper img:not([class]) が padding を付けるため、
 * すべての img にクラスを付与している（外すと表示が崩れる）。
 */

.gd-fbanner {
    position: fixed;
    right: 20px;
    bottom: 100px; /* .pagetop と重ならない位置。実装時に要調整 */
    z-index: 100;  /* WOVN ウィジェットより手前 */
    width: 374px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 12px 30px rgba(15, 31, 90, .28);
    /* 表示時にふわっと出す（JS で hidden を外した直後に再生） */
    animation: gd-fbanner-in .5s ease-out both;
}

@keyframes gd-fbanner-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gd-fbanner *,
.gd-fbanner *::before,
.gd-fbanner *::after {
    box-sizing: border-box;
}

.gd-fbanner[hidden] {
    display: none;
}

/* 閉じる操作中（JS が付与）。フェードアウトしてから hidden にする */
.gd-fbanner.is-closing {
    animation: none;
    opacity: 0;
    transform: translateY(8px) scale(.98);
    transition: opacity .5s ease, transform .5s ease;
    pointer-events: none;
}

.gd-fbanner__link {
    position: relative;
    display: block;
}

.gd-fbanner__img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    padding: 0;
    transition: opacity .3s ease;
}

/* ホバーでバナーをわずかに透過させる */
.gd-fbanner__link:hover .gd-fbanner__img,
.gd-fbanner__link:focus-visible .gd-fbanner__img {
    opacity: .85;
}

/* Figma: 25x25 / right 8px / bottom 6px */
.gd-fbanner__arrow {
    position: absolute;
    right: 2.14%;  /* 8 / 374 */
    bottom: 2.62%; /* 6 / 229 */
    display: block;
    width: 6.68%;  /* 25 / 374 */
    height: auto;
    max-width: none;
    padding: 0;
    transition: transform .3s ease;
}

.gd-fbanner__link:hover .gd-fbanner__arrow,
.gd-fbanner__link:focus-visible .gd-fbanner__arrow {
    transform: translateX(3px);
}

/* Figma: 22x22 / right 8px / top 7px */
.gd-fbanner__close {
    position: absolute;
    top: 3.06%;   /* 7 / 229 */
    right: 2.14%; /* 8 / 374 */
    z-index: 1;
    width: 5.88%; /* 22 / 374 */
    padding: 0;
    border: none;
    border-radius: 50%;
    background: none;
    line-height: 0;
    cursor: pointer;
}

/* 見た目は Figma どおりのまま、タップ判定だけ 44px 四方まで広げる
   （モバイル縮小時にアイコンが約 11px になり指で押しにくくなるため） */
.gd-fbanner__close::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}

.gd-fbanner__close-icon {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    padding: 0;
    transition: transform .3s ease, opacity .3s ease;
}

.gd-fbanner__close:hover .gd-fbanner__close-icon,
.gd-fbanner__close:focus-visible .gd-fbanner__close-icon {
    opacity: .75;
    transform: rotate(90deg);
}

/* モバイルでは邪魔になりにくいよう従来比 70% に縮小（280px → 196px） */
@media screen and (max-width: 480px) {
    .gd-fbanner {
        right: 12px;
        bottom: 80px;
        width: 196px;
        max-width: calc(100vw - 24px);
    }
}

/* 動きを減らす設定の利用者にはアニメーションを適用しない
   （閉じる処理は JS 側の 600ms フォールバックで完了する） */
@media (prefers-reduced-motion: reduce) {
    .gd-fbanner {
        animation: none;
    }

    .gd-fbanner.is-closing {
        transition: none;
        transform: none;
    }

    .gd-fbanner__img,
    .gd-fbanner__arrow,
    .gd-fbanner__close-icon {
        transition: none;
    }

    /* 透過によるホバー表現は動きを伴わないため残し、移動・回転のみ無効化する */
    .gd-fbanner__link:hover .gd-fbanner__arrow,
    .gd-fbanner__link:focus-visible .gd-fbanner__arrow,
    .gd-fbanner__close:hover .gd-fbanner__close-icon,
    .gd-fbanner__close:focus-visible .gd-fbanner__close-icon {
        transform: none;
    }
}
