@charset "UTF-8";
/**
 * No.18 SP：画面下に固定するオンライン診療ボタン・ページ上部へ戻るボタン
 *
 * 対象：マガジンTOP・一覧ページ（body.has_sp_fixed_cta）
 * PC（769px以上）では何も表示しない。
 *
 * ボタンのオレンジは、テーマのオレンジ（--link-color の #ff8c00）にそろえる。
 * 黒・青の背景色テーマでは --link-color が黄色になるため、変数ではなく色を直接指定する。
 *
 * ヘッダーのロゴを残す指定は、記事詳細ページにも効かせる（body.sp_header_keep_logo）。
 */

.magazine_sp_fixed_cta,
.magazine_pagetop {
  display: none;
}

@media screen and (max-width: 768px) {
  /* ---------- ヘッダー：スクロールしてもロゴを残し、ボタンは出さない ---------- */
  body.sp_header_keep_logo #header-container .header_sitename.scr_hidden {
    opacity: 1;
  }

  body.sp_header_keep_logo #header_fix_container .header_sidebar .hs_online_shinryo,
  body.sp_header_keep_logo #header_fix_container .header_sidebar .hs_online_shinryo.scr_show {
    display: none;
  }

  /* ---------- 画面下の固定ボタン ---------- */
  .magazine_sp_fixed_cta {
    --msfc-orange: #ff8c00;
    --msfc-orange-hover: #f8a814;

    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9700;
    padding: 0 10px calc(10px + env(safe-area-inset-bottom));
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.25s, transform 0.25s, visibility 0s 0.25s;
  }

  .magazine_sp_fixed_cta.is_show {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.25s, transform 0.25s, visibility 0s 0s;
  }

  /* ボタン全体がクリックできる */
  .magazine_sp_fixed_cta .msfc_btn {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    padding: 12px 40px;
    box-sizing: border-box;
    font-size: 1.125rem;
    font-weight: bold;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: var(--msfc-orange);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  }

  /* 右端の矢印 */
  .magazine_sp_fixed_cta .msfc_btn::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 9px;
    height: 9px;
    margin-top: -5px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
  }

  .magazine_sp_fixed_cta .msfc_btn:hover,
  .magazine_sp_fixed_cta .msfc_btn:active {
    background-color: var(--msfc-orange-hover);
    color: #fff;
  }

  .magazine_sp_fixed_cta .msfc_btn:focus-visible {
    outline: 3px solid var(--base-text-color);
    outline-offset: 2px;
  }

  /* ---------- ページ上部へ戻るボタン ---------- */
  .magazine_pagetop {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 9690;
    width: 46px;
    height: 46px;
    padding: 0;
    color: var(--base-primary-color);
    background-color: var(--base-background-color);
    border: 2px solid var(--base-primary-color);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s, bottom 0.25s, visibility 0s 0.25s;
  }

  .magazine_pagetop.is_show {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.25s, bottom 0.25s, visibility 0s 0s;
  }

  /* 固定ボタンが出ているときは、その上に置く（ボタンの高さ56px＋余白） */
  body.msfc_is_show .magazine_pagetop {
    bottom: calc(10px + 56px + 10px + env(safe-area-inset-bottom));
  }

  /* 上向き矢印 */
  .magazine_pagetop::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -5px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(45deg);
  }

  .magazine_pagetop .magazine_pagetop_txt {
    margin-top: 12px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    letter-spacing: 0.04em;
  }

  .magazine_pagetop:focus-visible {
    outline: 3px solid var(--base-text-color);
    outline-offset: 2px;
  }
}


/* ==========================================================
 * PC：右端の縦型「オンライン診療はこちら」ボタン（No.18）
 * SPの画面下ボタンと同じテーマのオレンジにそろえ、文字を大きくする。
 * 縦に長くなってよい（幅は右端の列に合わせて56pxのまま）。
 * ========================================================== */
@media screen and (min-width: 769px) {
  body.sp_header_keep_logo #header_fix_container .header_sidebar .hs_online_shinryo .hs_search_btn {
    padding: 1.4em 0;
    font-size: 1.0625rem;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: 0.12em;
    color: #fff;
    background-color: #ff8c00;
    transition: background-color 0.2s;
  }

  body.sp_header_keep_logo #header_fix_container .header_sidebar .hs_online_shinryo .hs_search_btn:hover,
  body.sp_header_keep_logo #header_fix_container .header_sidebar .hs_online_shinryo .hs_search_btn:focus-visible {
    color: #fff;
    background-color: #f8a814;
  }
}
