/* ============================================================================
   浮きCTA（資料ダウンロード／LINE）— tag 20261107a・20261107b・20261107c
   ----------------------------------------------------------------------------
   ディレクター指示 2026-11-07：コンバージョンの入口（いちばん軽い段階＝資料DL）を
   押してもらう確率を上げる。NEXT の1つ前のコンテンツ節まで読んだところで、右下から
   丸いボタンが「ぴょこん」と出て、資料DL・LINE のボタンが横に伸びる。
   ・ページの面とは別の層に見せる＝ここだけ影と丸を使う（サイト全体は影なし・角丸なしが既定＝tokens.css の例外）
   ・資料DL＝白い円に資料の表紙3冊を扇に重ねる（いろいろ見られることを示す）＋グレーの札
   ・LINE＝LINE のブランドカラー（#06C755）の円に LINE ロゴ（Iconify simple-icons:line・CC0）＋同色の札
   ・マークアップは float-cta.js が作る（リンク先はフッターの CTA と同じものを使う）
   ・表示の条件・隠す条件は float-cta.js の冒頭コメント
   ・20261107b（ディレクター指示）：札の幅を2つとも同じにする／資料DL の札の左アイコンをやめ、「ダウンロード」の後ろに
     文字と同じ大きさのダウンロードアイコン／札の右端は角を作らず円の中心までもぐらせる（円の外に角丸の右角を見せない）。
     そのため2つの円は中心を縦にそろえ（LINE の円を内側へ寄せる）、札の左端も縦にそろう。
   正本＝theme/idworks/assets/css/float-cta.css（design/pages/assets/float-cta.css は同じ内容）
   ============================================================================ */

.fcta{
  --fcta-line:#06C755;
  --fcta-disc-doc:108px;
  --fcta-disc-line:82px;
  --fcta-label-w:216px;                       /* 札の幅（2つ共通・円の下にもぐる分を含む） */
  --fcta-shadow:0 10px 28px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.10);
  --fcta-pop:cubic-bezier(.34,1.56,.64,1);   /* 少し行き過ぎて戻る＝ぴょこん */
  --fcta-out:cubic-bezier(.22,1,.36,1);
  position:fixed;
  right:calc(24px + env(safe-area-inset-right, 0px));
  bottom:calc(24px + env(safe-area-inset-bottom, 0px));
  z-index:120;                               /* グローバルナビの開いた面（170〜）より下 */
  display:flex;flex-direction:column;align-items:flex-end;gap:14px;
  pointer-events:none;
  visibility:hidden;
  transition:visibility 0s linear .45s;
}
.fcta.is-on{visibility:visible;transition:none;}
.fcta.is-on .fcta__item,
.fcta.is-on .fcta__close{pointer-events:auto;}

/* ---- 1件（札＋円） ---- */
.fcta__item{
  position:relative;
  display:flex;align-items:center;justify-content:flex-end;
  color:inherit;text-decoration:none;
  -webkit-tap-highlight-color:transparent;
}
.fcta__item:focus-visible{outline:none;}
.fcta__item--doc{--fcta-d:var(--fcta-disc-doc);}
.fcta__item--line{--fcta-d:var(--fcta-disc-line);margin-right:calc((var(--fcta-disc-doc) - var(--fcta-disc-line)) / 2);}  /* 円の中心を資料DL の円とそろえる */
.fcta__item:focus-visible .fcta__disc{outline:2px solid #1a1a1a;outline-offset:3px;}

/* 円 */
.fcta__disc{
  position:relative;z-index:2;flex:none;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;
  box-shadow:var(--fcta-shadow);
  transform:translateY(24px) scale(.3);
  opacity:0;
  transition:transform .3s var(--fcta-out), opacity .2s ease, box-shadow .3s ease;
}
.fcta__disc--doc{width:var(--fcta-disc-doc);height:var(--fcta-disc-doc);background:#fff;overflow:hidden;}
.fcta__disc--line{width:var(--fcta-disc-line);height:var(--fcta-disc-line);background:var(--fcta-line);color:#fff;
  box-shadow:0 0 0 3px #fff, var(--fcta-shadow);}   /* 白い縁＝同じ緑の札と円を分けて見せる */
.fcta__disc--line svg{width:48%;height:48%;display:block;}

/* 札（円の後ろから横へ伸びる） */
.fcta__label{
  position:relative;z-index:1;
  box-sizing:border-box;width:var(--fcta-label-w);
  margin-right:calc(var(--fcta-d) / -2);           /* 右端は円の中心まで＝円の下に完全にもぐる */
  padding:11px calc(var(--fcta-d) / 2 + 14px) 11px 20px;
  border-radius:999px 0 0 999px;                   /* 右は角を作らない（円に隠れる側） */
  font-family:var(--ff-jp, sans-serif);
  font-size:13px;line-height:1.45;letter-spacing:.04em;font-weight:500;
  white-space:nowrap;
  box-shadow:var(--fcta-shadow);
  opacity:0;
  transform:translateX(28px);
  clip-path:inset(0 0 0 100% round 999px 0 0 999px);
  transition:transform .25s var(--fcta-out), opacity .2s ease, clip-path .25s var(--fcta-out);
}
.fcta__item--doc .fcta__label{background:#ebebeb;color:#1a1a1a;}
.fcta__item--line .fcta__label{background:var(--fcta-line);color:#fff;}
.fcta__dl{display:inline-block;width:1.3em;height:1.3em;margin-left:.08em;vertical-align:-.3em;}  /* 文字と同じ大きさに見せる（図形は枠の2/3なので枠を1.3文字分に） */
.fcta__label-sub{display:block;font-size:11px;font-weight:400;letter-spacing:.06em;opacity:.75;}

/* 資料の表紙（扇に3冊） */
.fcta__cover{
  position:absolute;left:50%;top:50%;
  width:40px;height:auto;aspect-ratio:150/212;
  margin:-31px 0 0 -20px;
  box-shadow:0 1px 3px rgba(0,0,0,.28);
  transition:transform .45s var(--fcta-out);
}
.fcta__cover--1{transform:translate(-17px,4px) rotate(-14deg);}
.fcta__cover--2{transform:translate(17px,4px) rotate(13deg);}
.fcta__cover--3{transform:translate(0,-2px) rotate(-1deg);z-index:1;}

/* ---- 出る（.is-on）＝円がぴょこん → 札が伸びる。資料DLが先・LINEが続く ---- */
.fcta.is-on .fcta__disc{
  transform:none;opacity:1;
  transition:transform .6s var(--fcta-pop), opacity .2s ease, box-shadow .3s ease;
}
.fcta.is-on .fcta__label{
  transform:none;opacity:1;clip-path:inset(0 0 0 0 round 999px 0 0 999px);
  transition:transform .55s var(--fcta-out) .32s, opacity .3s ease .32s, clip-path .55s var(--fcta-out) .32s;
}
.fcta.is-on .fcta__item--line .fcta__disc{transition-delay:.12s;}
.fcta.is-on .fcta__item--line .fcta__label{transition-delay:.44s;}
.fcta.is-on .fcta__close{opacity:1;transform:none;transition:opacity .3s ease .7s, transform .3s var(--fcta-out) .7s;}

/* マウスを乗せたとき＝少し浮く・表紙が広がる */
@media (hover:hover){
  .fcta.is-on .fcta__item:hover .fcta__disc{transform:translateY(-3px);box-shadow:0 14px 34px rgba(0,0,0,.22), 0 3px 8px rgba(0,0,0,.12);transition:transform .3s var(--fcta-out), box-shadow .3s ease;}
  .fcta.is-on .fcta__item--line:hover .fcta__disc{box-shadow:0 0 0 3px #fff, 0 14px 34px rgba(0,0,0,.22), 0 3px 8px rgba(0,0,0,.12);}
  .fcta.is-on .fcta__item:hover .fcta__label{transform:translateY(-3px);transition:transform .3s var(--fcta-out);}
  .fcta__item:hover .fcta__cover--1{transform:translate(-22px,5px) rotate(-20deg);}
  .fcta__item:hover .fcta__cover--2{transform:translate(22px,5px) rotate(19deg);}
  .fcta__item:hover .fcta__cover--3{transform:translate(0,-5px) rotate(-1deg);}
}

/* 閉じる */
.fcta__close{
  position:relative;
  width:28px;height:28px;margin:0 calc((var(--fcta-disc-doc) - 28px) / 2) -4px 0;padding:0;   /* 円と同じ縦の軸に置く */
  border:0;border-radius:50%;
  background:#fff;color:#555;
  box-shadow:0 3px 10px rgba(0,0,0,.16);
  cursor:pointer;
  opacity:0;transform:scale(.6);
  transition:opacity .15s ease, transform .15s ease;
}
.fcta__close::before,
.fcta__close::after{
  content:"";position:absolute;left:50%;top:50%;
  width:12px;height:1.5px;margin:-.75px 0 0 -6px;
  background:currentColor;border-radius:1px;
}
.fcta__close::before{transform:rotate(45deg);}
.fcta__close::after{transform:rotate(-45deg);}
.fcta__close:focus-visible{outline:2px solid #1a1a1a;outline-offset:2px;}
@media (hover:hover){ .fcta__close:hover{color:#1a1a1a;} }

/* ---- スマホ ---- */
@media (max-width:767px){
  .fcta{
    --fcta-disc-doc:78px;
    --fcta-disc-line:60px;
    --fcta-label-w:184px;
    right:calc(14px + env(safe-area-inset-right, 0px));
    bottom:calc(16px + env(safe-area-inset-bottom, 0px));
    gap:10px;
  }
  .fcta__label{font-size:12px;padding:9px calc(var(--fcta-d) / 2 + 11px) 9px 15px;}
  .fcta__label-sub{font-size:10px;}
  .fcta__disc--line svg{width:50%;height:50%;}
  .fcta__cover{width:29px;margin:-22px 0 0 -14.5px;}
  .fcta__cover--1{transform:translate(-12px,3px) rotate(-14deg);}
  .fcta__cover--2{transform:translate(12px,3px) rotate(13deg);}
  .fcta__close{width:26px;height:26px;margin-right:calc((var(--fcta-disc-doc) - 26px) / 2);}
}

/* SP：札が出てから5秒で畳んで丸だけにする（本文・NEXT を覆い続けない）。丸はそのまま押せる。20261107c でスクロール量による畳みをやめた（float-cta.js） */
.fcta.is-on.is-mini .fcta__label{
  opacity:0;transform:translateX(28px);clip-path:inset(0 0 0 100% round 999px 0 0 999px);pointer-events:none;
  transition:transform .4s var(--fcta-out), opacity .3s ease, clip-path .4s var(--fcta-out);
}

/* 動きを減らす設定＝ぴょこんと伸びを止めて、ふわっと出すだけ */
@media (prefers-reduced-motion: reduce){
  .fcta__disc,.fcta__label,.fcta__close,.fcta__cover{transition:opacity .3s ease !important;transform:none !important;clip-path:none !important;}
}

@media print{ .fcta{display:none !important;} }
