/* --------------------------------------------------
 * Floating Buttons (Search & Back to Top)
 * -------------------------------------------------- */

/* ボタンを包むコンテナ */
.kimoota-floating-buttons {
    position: fixed;
    right: 20px;
    bottom: 100px; /* AdSenseアンカー回避 */
    z-index: 10; /* 【修正】AdSense（z-index: 100想定）の裏に回るよう低く設定 */
    display: flex;
    flex-direction: column;
    gap: 15px; /* ボタン同士の間隔 */
}

/* ボタン共通設定 */
.k-float-button {
    width: 50px;
    height: 50px;
    background: rgba(255, 20, 147, 0.75); /* 視認性の高い透過ピンク */
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    
    /* SVGアイコンを中央に寄せるための設定 */
    display: flex !important;
    align-items: center;
    justify-content: center;
    
    /* アニメーション用 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        background-color 0.3s ease !important;
}

/* スクロール時にJSで付与されるクラス */
.k-float-button.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ホバー時の挙動 */
.k-float-button:hover {
    background: rgba(255, 20, 147, 1);
    transform: translateY(-2px);
    /* box-shadowは変化させない */
}

/* SVGアイコン自体のサイズと色 */
.k-icon {
    width: 26px;
    height: 26px;
    fill: #ffffff; /* アイコンは白 */
    display: block;
}

/* モバイルでの微調整 */
@media screen and (max-width: 480px) {
    .kimoota-floating-buttons {
        right: 15px;
        bottom: 90px;
    }
    .k-float-button {
        width: 46px;
        height: 46px;
    }
    .k-icon {
        width: 24px;
        height: 24px;
    }
}

/* --------------------------------------------------
 * Search Overlay (全画面検索窓)
 * -------------------------------------------------- */
.ksearch-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); /* AdSense対策：0.9くらいの透過が安全 */
    z-index: 100000; /* 【維持】ボタンは隠れても、全画面検索はAdSenseを含む全てより前面に出す */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease !important;
}
.ksearch-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.ksearch-inner { width: 80%; max-width: 500px; text-align: center; }
.search-form { display: flex; gap: 10px; margin-bottom: 20px; }
.search-field { flex: 1; padding: 12px; border-radius: 4px; border: none; font-size: 16px; }
.search-submit { padding: 12px 24px; background: #ff1493; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.ksearch-close { color: #fff; cursor: pointer; text-decoration: underline; font-size: 14px; }


/* --------------------------------------------------
 * AdSense Layer Setup (ダークテーマ用・潜り込み設定)
 * -------------------------------------------------- */
@media screen and (max-width: 480px) {
    .ad-container {
        position: relative !important;
        z-index: 100 !important; /* ボタン（z-index: 10）より前面に出す */
        
        /* * 【ダークテーマ対応】
         * スクショの背景色（Indexの枠色など）に合わせ、違和感のない黒・濃灰色を指定。
         * これにより、左右に広げたシールドが背景と完全に同化します。
         * ※もしサイト全体の背景色が完全な黒なら #000000 に変更してください。
         */
        background: #1a1a1e !important; 
        
        /* 左右のはみ出しを防ぐシールド（余白） */
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin-left: -20px !important;
        margin-right: -20px !important;
        overflow: hidden; /* 領域外のボタンを完全にカット */
    }
    
    /* 広告タグ自体もスタッキングコンテキストを維持 */
    .adsbygoogle {
        position: relative !important;
        z-index: 101 !important;
    }
}