/* 「機能」メガメニューのリデザイン：押せる場所（各機能）をボタン状の行にして、どれを押すか迷わないようにする */
#header .megamenu_b .item.category { position:relative; border-left:1px solid #e1e1e6; transition:background-color 0.2s ease; }
#header .megamenu_b .item.category:hover { background:#faf8fd; }
#header .megamenu_b .item.category .image_link { margin:0 -1px; } /* 画像の左右を1pxはみ出させて、区切り線を隠す（テーマ標準と同じ） */
/* 画像の左上を少し暗くして、重ねた見出しを読みやすくする */
#header .megamenu_b .item.category .image_wrap::after { content:''; position:absolute; inset:0; background:linear-gradient(135deg, rgba(10,5,40,0.7) 0%, rgba(10,5,40,0) 60%); pointer-events:none; }

/* 見出し（01.Mail Link など）は画像の左上に重ねて、機能名のボタンを画像のすぐ下に置く */
#header .megamenu_b .item.category .title_area { position:absolute; top:0; left:0; right:0; z-index:3; padding:16px 20px 0; pointer-events:none; }
#header .megamenu_b .item.category .title { font-size:22px; line-height:1.3; color:#fff; text-shadow:0 1px 6px rgba(0,0,0,0.5); }
#header .megamenu_b .item.category .title_area .arrow_link { margin-top:4px; padding:0; font-size:13px; color:#fff; text-shadow:0 1px 6px rgba(0,0,0,0.5); }

/* 各機能へのリンク：枠なしのボタン行（薄い紫の塗り）。ホバーで濃い紫に塗りつぶす */
#header .megamenu_b .post_list { display:grid; gap:12px; padding:20px 24px 32px; }
#header .megamenu_b .post_list a.arrow_link { margin:0; padding:18px 20px; display:flex; align-items:center; justify-content:space-between; box-sizing:border-box; border:none; border-radius:12px; background:#f1ebf8; color:#4e2584; font-size:17px; font-weight:700; line-height:1.4; transition:background-color 0.2s ease, color 0.2s ease; }
#header .megamenu_b .post_list a.arrow_link:hover { background:#4e2584; color:#fff; }
#header .megamenu_b .post_list a.arrow_link:focus-visible { outline:3px solid #4e2584; outline-offset:2px; }
#header .megamenu_b .post_list a.arrow_link .arrow_button_small { display:none; }
#header .megamenu_b .post_list a.arrow_link:after { content:''; flex:none; width:9px; height:9px; margin-left:12px; border-top:2.5px solid currentColor; border-right:2.5px solid currentColor; transform:rotate(45deg); transition:transform 0.2s ease; }
#header .megamenu_b .post_list a.arrow_link:hover:after { transform:translateX(4px) rotate(45deg); }

/* メガメニューの開閉：テーマ標準は一瞬で切り替わるため、ふわっと表示する（開く＝0.25秒で少し降りてくる／閉じる＝少し待ってから0.2秒で消える。マウスが一瞬外れてもすぐ消えない） */
body .megamenu { transform:translateY(-8px); transition:opacity 0.2s ease 0.1s, transform 0.2s ease 0.1s; }
body .megamenu.active_mega_menu { transform:translateY(0); transition:opacity 0.25s ease, transform 0.25s ease; }
@media (prefers-reduced-motion:reduce) { body .megamenu, body .megamenu.active_mega_menu { transform:none; transition:none; } }

/* メガメニューを開いたとき、周り（ヘッダーの背景・文字色・画面の暗い膜）も同じ速さでなめらかに変える。閉じるときは少し待つため、ボタンからメニューへマウスを動かす一瞬で、チカッと戻らない */
body #container:before { transition:opacity 0.25s ease 0.1s; }
body.active_header #container:before { transition-delay:0s; }
body.header_type2 #header { transition:transform 0.5s ease, opacity 0.7s ease 0.1s, background-color 0.25s ease 0.1s; }
body.header_type2.active_header #header { transition:transform 0.5s ease, opacity 0.7s ease 0.1s, background-color 0.25s ease; }
body #global_menu > ul > li:not(.pf-nav-btn) > a { transition:color 0.25s ease 0.1s; }
body.active_header #global_menu > ul > li:not(.pf-nav-btn) > a { transition-delay:0s; }
@media (prefers-reduced-motion:reduce) { body #container:before, body.header_type2 #header, body #global_menu > ul > li:not(.pf-nav-btn) > a { transition:none; } }
