/* ==========================================================
   MONOPAGE Toolkit｜MP 境界デザイン（mp-edge）
   フルワイド・グループの上下の境界に、形・グラデーション・角丸を付ける
   ・色は「前／次のセクションの色」を edge.js が読み取って入れる（--mp-edge-prev / -next / -self）
   ・高さは PC の px。画面が狭くなると「スマホの高さ（%）」まで縮む
   ========================================================== */
.mp-edge { position: relative; overflow-x: clip; }
.mp-edge-el {
  position: absolute; left: -1px; right: -1px; z-index: 1;
  pointer-events: none; display: block;
  -webkit-mask-repeat: round no-repeat; mask-repeat: round no-repeat;
  -webkit-mask-position: left bottom; mask-position: left bottom;
}
.mp-edge-el--t {
  --_h: clamp(calc(var(--mp-edge-t-h, 80) * var(--mp-edge-t-hs, 50) / 100 * 1px), calc(var(--mp-edge-t-h, 80) / 14 * 1vw), calc(var(--mp-edge-t-h, 80) * 1px));
  height: var(--_h); top: 0; transform: scaleY(-1);
  background: var(--mp-edge-t-c, var(--mp-edge-prev, #fff));
  -webkit-mask-image: var(--mp-edge-t-m); mask-image: var(--mp-edge-t-m);
  -webkit-mask-size: calc(100% / var(--mp-edge-t-n, var(--_n, 1))) 100%; mask-size: calc(100% / var(--mp-edge-t-n, var(--_n, 1))) 100%;
  opacity: var(--mp-edge-t-op, 1);
}
.mp-edge-el--b {
  --_h: clamp(calc(var(--mp-edge-b-h, 80) * var(--mp-edge-b-hs, 50) / 100 * 1px), calc(var(--mp-edge-b-h, 80) / 14 * 1vw), calc(var(--mp-edge-b-h, 80) * 1px));
  height: var(--_h); bottom: 0;
  background: var(--mp-edge-b-c, var(--mp-edge-next, #fff));
  -webkit-mask-image: var(--mp-edge-b-m); mask-image: var(--mp-edge-b-m);
  -webkit-mask-size: calc(100% / var(--mp-edge-b-n, var(--_n, 1))) 100%; mask-size: calc(100% / var(--mp-edge-b-n, var(--_n, 1))) 100%;
  opacity: var(--mp-edge-b-op, 1);
}
.mp-edge-t-fx > .mp-edge-el--t { transform: scale(-1, -1); }
.mp-edge-b-fx > .mp-edge-el--b { transform: scaleX(-1); }
/* このセクションの色で、となりのセクションに食い込む（形を外側に出して、抜きを反対にする） */
.mp-edge-t-out > .mp-edge-el--t { top: auto; bottom: 100%; transform: scaleY(-1); z-index: 3; background: var(--mp-edge-t-c, var(--mp-edge-self, #fff)); -webkit-mask-image: var(--mp-edge-t-m), linear-gradient(#000 0 0); mask-image: var(--mp-edge-t-m), linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; -webkit-mask-size: calc(100% / var(--mp-edge-t-n, var(--_n, 1))) 100%, 100% 100%; mask-size: calc(100% / var(--mp-edge-t-n, var(--_n, 1))) 100%, 100% 100%; }
.mp-edge-t-out.mp-edge-t-fx > .mp-edge-el--t { transform: scale(-1, -1); }
.mp-edge-b-out > .mp-edge-el--b { bottom: auto; top: 100%; transform: none; z-index: 3; background: var(--mp-edge-b-c, var(--mp-edge-self, #fff)); -webkit-mask-image: var(--mp-edge-b-m), linear-gradient(#000 0 0); mask-image: var(--mp-edge-b-m), linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; -webkit-mask-size: calc(100% / var(--mp-edge-b-n, var(--_n, 1))) 100%, 100% 100%; mask-size: calc(100% / var(--mp-edge-b-n, var(--_n, 1))) 100%, 100% 100%; }
.mp-edge-b-out.mp-edge-b-fx > .mp-edge-el--b { transform: scaleX(-1); }
/* となりとの境目に細い隙間（にじみ）が出ないよう、1px だけ重ねる */
.mp-edge-el--t, .mp-edge-el--b { margin-top: -1px; margin-bottom: -1px; }
/* セクションの中身は境界の形より前に */
.mp-edge > .swell-block-fullWide__inner, .mp-edge > .wp-block-group__inner-container { position: relative; z-index: 2; }
.mp-edge.mpd > .swell-block-fullWide__inner { position: static; }

.mp-edge-t--wave { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,62 C200,100 380,8 600,42 C820,76 1000,18 1200,48 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--wave { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,62 C200,100 380,8 600,42 C820,76 1000,18 1200,48 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--wave2 { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,50 C150,0 450,100 600,50 C750,0 1050,100 1200,50 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--wave2 { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,50 C150,0 450,100 600,50 C750,0 1050,100 1200,50 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--waves3 { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C220,80 420,0 640,34 C860,68 1020,10 1200,36 L1200,100 L0,100 Z' fill='%23000' fill-opacity='0.25'/%3E%3Cpath d='M0,52 C240,10 460,86 700,52 C900,24 1060,74 1200,50 L1200,100 L0,100 Z' fill='%23000' fill-opacity='0.5'/%3E%3Cpath d='M0,74 C200,96 420,48 620,70 C840,94 1020,60 1200,72 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--waves3 { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C220,80 420,0 640,34 C860,68 1020,10 1200,36 L1200,100 L0,100 Z' fill='%23000' fill-opacity='0.25'/%3E%3Cpath d='M0,52 C240,10 460,86 700,52 C900,24 1060,74 1200,50 L1200,100 L0,100 Z' fill='%23000' fill-opacity='0.5'/%3E%3Cpath d='M0,74 C200,96 420,48 620,70 C840,94 1020,60 1200,72 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--softwave { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -40 1200 180' preserveAspectRatio='none'%3E%3Cfilter id='b' x='-10%' y='-50%' width='120%' height='200%'%3E%3CfeGaussianBlur stdDeviation='18'/%3E%3C/filter%3E%3Cpath d='M-40,60 C180,110 380,0 600,40 C820,80 1000,10 1240,50 L1240,180 L-40,180 Z' fill='%23000' fill-opacity='1' filter='url(%23b)'/%3E%3C/svg%3E"); }
.mp-edge-b--softwave { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -40 1200 180' preserveAspectRatio='none'%3E%3Cfilter id='b' x='-10%' y='-50%' width='120%' height='200%'%3E%3CfeGaussianBlur stdDeviation='18'/%3E%3C/filter%3E%3Cpath d='M-40,60 C180,110 380,0 600,40 C820,80 1000,10 1240,50 L1240,180 L-40,180 Z' fill='%23000' fill-opacity='1' filter='url(%23b)'/%3E%3C/svg%3E"); }
.mp-edge-t--curve { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,0 Q600,200 1200,0 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--curve { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,0 Q600,200 1200,0 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--arch { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 Q600,-100 1200,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--arch { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 Q600,-100 1200,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--tilt { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 L1200,0 L1200,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--tilt { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 L1200,0 L1200,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--tilt2 { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 L1200,0 L1200,100 Z' fill='%23000' fill-opacity='0.35'/%3E%3Cpath d='M0,100 L1200,45 L1200,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--tilt2 { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 L1200,0 L1200,100 Z' fill='%23000' fill-opacity='0.35'/%3E%3Cpath d='M0,100 L1200,45 L1200,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--triangle { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L600,100 L1200,0 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--triangle { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,0 L600,100 L1200,0 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--zigzag { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 L0,30 L50,100 L100,30 L100,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--zigzag { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 L0,30 L50,100 L100,30 L100,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--zigzag > .mp-edge-el--t, .mp-edge-b--zigzag > .mp-edge-el--b { --_n: 24; }
.mp-edge-t--steps { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 V45 H45 V20 H95 V55 H140 V35 H200 V10 H250 V48 H300 V28 H355 V60 H400 V100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--steps { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 V45 H45 V20 H95 V55 H140 V35 H200 V10 H250 V48 H300 V28 H355 V60 H400 V100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--steps > .mp-edge-el--t, .mp-edge-b--steps > .mp-edge-el--b { --_n: 4; }
.mp-edge-t--torn { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,40 L38,52 L80,30 L126,58 L170,36 L214,50 L262,26 L300,48 L352,34 L398,60 L444,30 L490,46 L540,24 L586,52 L630,38 L680,58 L722,28 L770,46 L820,32 L862,56 L910,30 L958,48 L1004,26 L1050,54 L1098,34 L1150,50 L1200,32 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--torn { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,40 L38,52 L80,30 L126,58 L170,36 L214,50 L262,26 L300,48 L352,34 L398,60 L444,30 L490,46 L540,24 L586,52 L630,38 L680,58 L722,28 L770,46 L820,32 L862,56 L910,30 L958,48 L1004,26 L1050,54 L1098,34 L1150,50 L1200,32 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-t--blob { --mp-edge-t-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,58 C110,20 230,92 400,60 C560,30 640,96 820,62 C960,36 1060,84 1200,44 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }
.mp-edge-b--blob { --mp-edge-b-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,58 C110,20 230,92 400,60 C560,30 640,96 820,62 C960,36 1060,84 1200,44 L1200,100 L0,100 Z' fill='%23000' fill-opacity='1'/%3E%3C/svg%3E"); }

/* フェード：グラデーションで次のセクションへ溶ける（形なし） */
.mp-edge-t--fade > .mp-edge-el--t, .mp-edge-b--fade > .mp-edge-el--b { -webkit-mask-image: none; mask-image: none; }
.mp-edge-t--fade > .mp-edge-el--t { background: linear-gradient(to top, transparent, color-mix(in srgb, var(--mp-edge-t-c, var(--mp-edge-prev, #fff)) 18%, transparent) 30%, color-mix(in srgb, var(--mp-edge-t-c, var(--mp-edge-prev, #fff)) 55%, transparent) 60%, var(--mp-edge-t-c, var(--mp-edge-prev, #fff)) 100%); transform: none; }
.mp-edge-b--fade > .mp-edge-el--b { background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--mp-edge-b-c, var(--mp-edge-next, #fff)) 18%, transparent) 30%, color-mix(in srgb, var(--mp-edge-b-c, var(--mp-edge-next, #fff)) 55%, transparent) 60%, var(--mp-edge-b-c, var(--mp-edge-next, #fff)) 100%); transform: none; }
.mp-edge-t-out.mp-edge-t--fade > .mp-edge-el--t { -webkit-mask-image: none; mask-image: none; background: linear-gradient(to top, var(--mp-edge-t-c, var(--mp-edge-self, #fff)), transparent); }
.mp-edge-b-out.mp-edge-b--fade > .mp-edge-el--b { -webkit-mask-image: none; mask-image: none; background: linear-gradient(to bottom, var(--mp-edge-b-c, var(--mp-edge-self, #fff)), transparent); transform: none; }

/* ▼タブ：中央に小さな三角（このセクションの色が次のセクションへ少し出る） */
.mp-edge-t--tab > .mp-edge-el--t, .mp-edge-b--tab > .mp-edge-el--b { -webkit-mask-image: none; mask-image: none; background: none; left: 50%; right: auto; width: calc(var(--_h) * 1.6); margin-left: calc(var(--_h) * -0.8); }
.mp-edge-b--tab > .mp-edge-el--b { top: 100%; bottom: auto; z-index: 3; background: var(--mp-edge-b-c, var(--mp-edge-self, #fff)); clip-path: polygon(0 0, 100% 0, 50% 100%); transform: none; }
.mp-edge-t--tab > .mp-edge-el--t { bottom: 100%; top: auto; z-index: 3; background: var(--mp-edge-t-c, var(--mp-edge-self, #fff)); clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: none; }

/* 縦の線：区切りを入れず、境界をまたぐ細い線で次へ視線を送る（スクロールで線が伸びる） */
.mp-edge-t--line > .mp-edge-el--t, .mp-edge-b--line > .mp-edge-el--b { -webkit-mask-image: none; mask-image: none; left: 50%; right: auto; width: 1px; opacity: 1; transform: none; z-index: 3; background: var(--_lc); }
.mp-edge-t--line > .mp-edge-el--t { --_lc: var(--mp-edge-t-c, color-mix(in srgb, currentColor 55%, transparent)); top: calc(var(--_h) / -2); transform-origin: top; }
.mp-edge-b--line > .mp-edge-el--b { --_lc: var(--mp-edge-b-c, color-mix(in srgb, currentColor 55%, transparent)); bottom: calc(var(--_h) / -2); transform-origin: top; }
@supports (animation-timeline: view()) {
  .mp-edge-t--line > .mp-edge-el--t, .mp-edge-b--line > .mp-edge-el--b { animation: mp-edge-line linear both; animation-timeline: view(); animation-range: entry 10% cover 50%; }
}
@keyframes mp-edge-line { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* 角丸カード：角を丸くして、となりのセクションに重ねる */
.mp-edge.mp-edge-t--round { border-top-left-radius: var(--_rt); border-top-right-radius: var(--_rt); margin-top: calc(var(--_rt) * -1) !important; z-index: 2; }
.mp-edge.mp-edge-b--round { border-bottom-left-radius: var(--_rb); border-bottom-right-radius: var(--_rb); margin-bottom: calc(var(--_rb) * -1) !important; z-index: 2; }
.mp-edge.mp-edge-t--round { --_rt: clamp(calc(var(--mp-edge-t-h, 48) * var(--mp-edge-t-hs, 50) / 100 * 1px), calc(var(--mp-edge-t-h, 48) / 14 * 1vw), calc(var(--mp-edge-t-h, 48) * 1px)); }
.mp-edge.mp-edge-b--round { --_rb: clamp(calc(var(--mp-edge-b-h, 48) * var(--mp-edge-b-hs, 50) / 100 * 1px), calc(var(--mp-edge-b-h, 48) / 14 * 1vw), calc(var(--mp-edge-b-h, 48) * 1px)); }
.mp-edge-t--round > .mp-edge-el--t, .mp-edge-b--round > .mp-edge-el--b { display: none; }
.mp-edge.mp-edge-t--round, .mp-edge.mp-edge-b--round { overflow: clip; }

/* ---------- スクロール演出 ---------- */
/* 色の切り替わり：前のセクションの色から、このセクションの色へ（スクロールに合わせて） */
@supports (animation-timeline: view()) {
  .mp-edge-shift { animation: mp-edge-shift linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
}
@keyframes mp-edge-shift { from { background-color: var(--mp-edge-prev, transparent); color: var(--mp-edge-prev-tx, inherit); } }
/* スタック：このセクションを固定して、次のセクションが上に重なってくる */
.mp-edge-stick { position: sticky !important; top: var(--mp-edge-stick-top, 0px); z-index: 0; }
.mp-edge-stick + * { position: relative; z-index: 1; }
.editor-styles-wrapper .mp-edge-stick { position: relative !important; top: 0; }
@media (prefers-reduced-motion: reduce) {
  .mp-edge-shift, .mp-edge-el { animation: none !important; }
}
/* 編集画面：ブロックの中身（編集エリア）は形より前に */
.editor-styles-wrapper .mp-edge .block-editor-inner-blocks { position: relative; z-index: 2; }
.editor-styles-wrapper .mp-edge:has(> [data-mptk-stage]) { border-radius: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; overflow: visible !important; animation: none !important; }
