/* ============================================================
   swipe.css — ミラーのスクロール挙動だけをスワイプ型にする追加レイヤー
   コピー元: claude-projects\winxcy-top-swipe\swipe-build\css\swipe.css
   （reference_swipe_lp_full_screen_snap_recipe の動作確認済み実装）

   ミラー本体(assets/vendor/... 配下)のCSSは一切書き換えない。
   このファイルの読み込みと html の swipe-b クラスを外せば完全に元へ戻る。
   ------------------------------------------------------------
   本案件の実測DOM:
     body > div#app > div.lContainer > header.lHeader(fixed) + main.lMain
       main.lMain   > .pMv / section#about / section#setup / section#case / .pBgWrapper
       .pBgWrapper  > section.pFaq / section.pCompany / .pBanner
   固定要素の実測:
     PC1440 : header.lHeader 118px / 下部固定バーなし
     SP390  : .lHeader__menuButton 60px / 下部固定バーなし
   ============================================================ */

html.swipe-b {
  --swipe-top: 118px;
  --swipe-bottom: 0px;
}
@media (max-width: 768px) {
  html.swipe-b {
    --swipe-top: 60px;
    --swipe-bottom: 0px;
  }
}

/* ---- スナップ土台 ----------------------------------------
   🔴 2026-09-11 修正（実機iPhoneで1枚目の下に2枚目が見えていた）。
   ウィンドウ自体をスクロールさせると、iOS Safari はアドレスバーの
   出し入れでビューポート高さを変える。その瞬間 100dvh が変わるのに
   スクロール位置は据え置かれるため、パネルの継ぎ目がズレて見える。

   明成電気LP（前案件・同じ下請けルート）と同じ構造にする:
     html,body を 100% + overflow:hidden で固定し、
     #app を「高さ100dvhの内部スクローラー」にしてそこでスナップさせる。
   ドキュメント自体がスクロールしないので、iOSはアドレスバーを
   出し入れせず、ビューポート高さが変わらない。
   （参考実装: meisei-denki-lp/build/assets/css/style.css の #wrapper）*/
html.swipe-b,
html.swipe-b body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior-y: none;
}
html.swipe-b #app {
  /* 🔴 実機iPhoneで下に数十pxの余白が残った（2026-09-11 指摘）。
     iOSの 100dvh はツールバーの出し入れ中に実際の可視領域とズレる。
     swipe.js が window.innerHeight を --app-h に入れるので、それを優先する。 */
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  height: var(--app-h, 100dvh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
html.swipe-b #app::-webkit-scrollbar {
  display: none;
}

/* 🔴 ミラーの .lHeader{position:fixed} は @media(min-width:768px) 専用。
   モバイル幅（実機SP・PC内iframe480pxとも常にこちら）では元々
   position:static で、代わりに .lHeader__logo と .lHeader__menuButton の
   各要素が個別に position:fixed で角に浮く設計だった（実測で発覚）。
   ロゴ+募集要項+ENTRYの横並びバーに変えたので、幅にかかわらず
   .lHeader 自体を固定バーにする。 */
html.swipe-b .lContainer > header.lHeader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 1000;
  /* 🔴 ヘッダーのロゴだけ欠けて描画される件、img→インラインSVGに
     変えても再現した。ラスタ形式の問題ではなく、.pMv配下の
     transform要素と合成レイヤーを共有して壊れている疑い。
     ヘッダーごと独立レイヤーへ強制的に昇格させる。 */
  transform: translateZ(0);
  isolation: isolate;
}

/* ---- ヘッダー中身（ロゴ＋募集要項＋ENTRYのみ・ハンバーガー削除）----
   2026-09-10 ユーザー指示「2セクション目 ロゴと募集要項とエントリーの
   ボタンだけヘッダーにつけて　ハンバーガーメニューいらん」。
   ミラーの .lHeader__inner は position:fixed の子を個別配置する構造の
   ため、position:static に戻して素直な横並びに変える。 */
/* 🔴 2026-09-11: ヘッダーに背景と下罫線を入れる。以前は透明で、
   下のコンテンツが透けて文字が読みづらかった。 */
html.swipe-b .lContainer > header.lHeader {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(20, 39, 75, 0.08);
}
.lHeader__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  /* 🔴 SP390でロゴ右端233px＝ボタン左端233pxと隙間ゼロで接触していた
     （実測）。gapで最低余白を確保し、ロゴ側は縮小を許可して被りを断つ。 */
  gap: 12px;
  padding: 0 14px;
  box-sizing: border-box;
}
.pHeaderV2__logo {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  pointer-events: auto;
}
/* 🔴 動画→ヒーロー(#pMv)遷移後、<img src=logo.svg> の文字パスだけ
   欠けて描画される Chromium バグを確認（マークの円は正常・
   同じ画像を使うPC専用railでは発生しない＝ .pMv 配下の大量の
   transform要素とラスタを共有する合成バグ）。
   translateZ(0)で自前レイヤーに昇格させても直らなかったため、
   img参照をやめてインラインSVGに変更（_inline_header_logo.py）。
   ラスタ化を経由しないのでこの種の合成バグ自体が起きない。 */
.pHeaderV2__logoSvg {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
}
.pHeaderV2__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

/* ---- CTAボタン（2026-09-11 デザインブラッシュアップ）----------
   前: 高さ34px・角丸4px・枠線だけの平坦なボタンで安っぽかった。
   後: 高さを揃えたピル型にし、
       ・募集要項  = ゴースト（枠線＋薄い地）で従属的な導線
       ・ENTRY     = ベースカラーの塗り＋影＋矢印で主導線として目立たせる
       字間・ウェイトも上げて小さいサイズでも締まって見えるようにする。 */
.pHeaderV2__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  pointer-events: auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.pHeaderV2__btn--recruit {
  border: 1px solid rgba(20, 39, 75, 0.22);
  background: rgba(20, 39, 75, 0.04);
  color: #14274b;
}
.pHeaderV2__btn--recruit:hover {
  background: rgba(20, 39, 75, 0.09);
}
.pHeaderV2__btn--entry {
  border: 1px solid #00a0e9;
  background: linear-gradient(180deg, #1ab0f0 0%, #008fd1 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 160, 233, 0.35);
  letter-spacing: 0.08em;
}
.pHeaderV2__btn--entry::after {
  content: "";
  width: 5px;
  height: 5px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.9;
}
.pHeaderV2__btn--entry:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0, 160, 233, 0.45);
}

/* SP390 は横幅が足りないので少しだけ詰める */
@media (max-width: 400px) {
  .lHeader__inner { padding: 0 10px; gap: 8px; }
  .pHeaderV2__logoSvg { height: 26px; }
  .pHeaderV2__btn { height: 32px; padding: 0 11px; font-size: 11px; }
}

/* 🔴 1枚目（動画）はヘッダー類を一切出さない（2026-09-10 ユーザー指示）。
   swipe.js が現在のパネルindexを html[data-panel] へ反映するので、
   0（動画）のときだけ .lHeader を消す。ロゴ・募集要項・ENTRYは
   PC専用rail（index.html側・iframeの外）が担当する。

   🔴 2026-09-11 修正: data-panel="0" を条件にすると、その属性は
   swipe.js（deferスクリプト）が実行されるまでDOMに存在しないため、
   読み込み直後の一瞬だけヘッダーがデフォルト表示のまま見えていた
   （実測: JS実行前はセレクタが不一致→表示、実行後に非表示化）。
   ロジックを反転し、デフォルト＝非表示、JSが1以上のパネルを検出した
   ときだけ表示する形にして、JS実行前でもチラつきが出ないようにする。 */
html.swipe-b .lContainer > header.lHeader {
  display: none;
}
html.swipe-b[data-panel]:not([data-panel="0"]) .lContainer > header.lHeader {
  display: block;
}

/* ---- パネル＝1ジェスチャー=1セクション ----------------------------
   🔴 2026-09-10 修正: height/max-height固定 + overflow:hidden をやめた。
   元CSS(.pAbout 等)は align-items:center はあっても
   justify-content:center・固定高さ・overflow:hidden は**存在しない**。
   前回の実装はこれを追加してしまい、619px の中身を844pxの箱へ
   overflow:hidden で押し込めた結果、中央寄せではみ出した上下が
   丸ごと切れて見えなくなっていた（セクション2 #about で発覚）。
   ここでは元CSSの箱をそのまま使い、スナップ位置と
   固定ヘッダー分のpadding-topだけを追加する。
   中身が1画面より低いセクションは min-height で1画面ぶん確保、
   中身が1画面を超えるセクション（#case 等）は素直にそのぶん
   縦長のまま＝そのセクション内は通常スクロール、
   スナップは「セクションの先頭で止まる」だけを担保する。
   100vh ではなく 100dvh（iOSツールバー・規約18）。 */
html.swipe-b .lMain > .pMv,
html.swipe-b .lMain > section,
html.swipe-b .pBgWrapper > section,
html.swipe-b .pBgWrapper > .pBanner,
html.swipe-b .lContainer > footer.lFooter {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  scroll-margin-top: 0;

  /* 🔴 元サイトはセクション間に margin を持っている（実測 SP390:
     pAbout→pSetup 121px / pFaq→pCompany 48px / pCompany→pBanner 48px）。
     残すとパネルの先頭が 1画面の倍数からズレて隙間になるので 0 にする。 */
  margin-top: 0;
  margin-bottom: 0;

  min-height: 100svh;
  min-height: 100dvh;
  min-height: var(--app-h, 100dvh);

  padding-top: var(--swipe-top);
  padding-bottom: var(--swipe-bottom);
}

/* .pBgWrapper 自体はパネルではなく、中の3セクションを包む背景ラッパー。
   高さを固定せず、子をそのままスナップさせる。 */
html.swipe-b .lMain > .pBgWrapper {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
  display: block;
  scroll-snap-align: none;
}

/* メインビジュアルは自前で内部レイアウトを持つので display だけ戻す */
html.swipe-b .lMain > .pMv {
  display: block;
}

/* ---- セクション2（冒頭）: 縦書きタイトル -------------------
   指示書「見出しを縦文字。デザインは参考サイト準拠」。
   D列参考画像＝白帯に縦書きの体裁だったので、それに寄せる。
   ミラーの .pMv__head_title_main の位置はそのまま使い、
   中身だけ縦組みにする（DOM階層は触らない）。 */
/* 🔴 ミラー側の .pMv__head_title_main は横組み前提のCSSを持っており、
   そのままだと縦組みが潰れて横一列に伸びる（実測 h=37px・字が重なる）。
   !important で必要な指定だけ上書きし、独立した縦組みブロックにする。 */
.pMvTitleV {
  display: flex !important;
  flex-direction: row-reverse !important;   /* 縦書きは右から左へ読む */
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
}
.pMvTitleV__line {
  display: block !important;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 7.4cqw, 36px);
  line-height: 1.15;
  letter-spacing: 0.08em;
  color: #14274b;
  background: rgba(255, 255, 255, 0.94);
  padding: 16px 8px 18px;
  width: auto !important;
  box-shadow: 0 2px 14px rgba(20, 39, 75, 0.14);
}
.pMvTitleV__line--accent {
  color: #fff;
  background: #00a0e9;
  box-shadow: 0 2px 14px rgba(0, 160, 233, 0.35);
}
@media (min-width: 768px) {
  .pMvTitleV__line { font-size: clamp(28px, 2.9vw, 42px); }
}

/* 特許バッジは松本工業に該当なし。hidden 属性がミラー側CSSの
   display 指定に負けるため、CSSでも確実に消す。 */
.pMv__head_patent[hidden] {
  display: none !important;
}

/* ---- セクション3（フック）: #about パネル -------------------
   指示書【新】セクションの流れ 4行目
     タイトル：そんなあなたに知って欲しい仕事。
     文章    ：それが、施工管理です。
     参考P   ：特に強調したいです！
   ミラーの #about（青地の見出しパネル）の箱をそのまま使い、
   コピー元固有の要素（ロゴ画像／POINTカード／台車イラスト）は
   指示書セクション3に該当がないので hidden にしてある。
   要素が減って上に寄るので、パネル内で天地中央に置き直す。
   （🔴 height固定＋overflow:hidden は使わない＝中身が切れる罠を回避） */
html.swipe-b .lMain > section#about {
  display: flex;
  align-items: center;
}
html.swipe-b .lMain > section#about > .pAbout__inner {
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
}
#about-illust[hidden],
#about-point[hidden] {
  display: none !important;
}

.pHookTitle {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px;
  padding-left: 0 !important;
  font-size: clamp(27px, 8.4vw, 44px) !important;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: center;
}
.pHookTitle__line {
  display: block;
}

/* 「特に強調したいです！」＝ 文章側を主役サイズにし、
   「施工管理」を先方デザイン案（_spec/media/image1・image2）と同じ
   黄色マーカーで抜く。色は参考サイトCSSの実測値 #e4e53f。 */
.pHookLead {
  margin-top: 26px !important;
  font-size: clamp(21px, 6.6vw, 34px) !important;
  line-height: 1.6 !important;
  text-align: center;
}
.pHookLead__accent {
  padding: 0 2px;
  background: linear-gradient(transparent 58%, rgba(228, 229, 63, 0.85) 58%);
}

/* ---- 動画セクション（指示書セクション1・新設） ------------
   ミラーには存在しない新規コンテンツなので、ミラー本体のCSSではなく
   ここ(swipe.css＝我々の追加レイヤー)に置く。
   松本工業の実素材は未支給。sakota-mirror のプレースホルダー動画
   (1080x1920)を仮で使用中（差し替え待ち）。 */
.pVideoIntro {
  position: relative;
  padding: 0 !important;
  overflow: hidden;
  background: #000;
}
.pVideoIntro__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pVideoIntro__shade {
 display: none;
}

/* ---- SWIPEガイド（ref-sakota の video-intro__guide を cp→sed）------
   同じ下請けルートのマスター実装。値はそのまま、クラス名だけ本案件へ。 */
.pVideoIntro__guide {
  position: absolute;
  z-index: 2;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #fff;
  font: 10px/1 Arial, sans-serif;
  letter-spacing: 0.22em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
  pointer-events: none;
}
.pVideoIntro__arrow {
  width: 13px;
  height: 13px;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: rotate(45deg);
  animation: pVideoIntro-arrow 1.8s ease-in-out infinite;
}
@keyframes pVideoIntro-arrow {
  0%, 100% { opacity: 0.38; transform: translateY(-3px) rotate(45deg); }
  50% { opacity: 1; transform: translateY(5px) rotate(45deg); }
}
@media (prefers-reduced-motion: reduce) {
  .pVideoIntro__arrow { animation: none; }
}

/* スナップ中のスクロールバー非表示 */
html.swipe-b {
  scrollbar-width: none;
}
html.swipe-b::-webkit-scrollbar {
  display: none;
}

/* ---- モーション設定を尊重 -------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html.swipe-b {
    scroll-snap-type: none;
  }
}


/* ---- 未制作セクション(#case/#faq/#company/.pBanner/footer)は
   2026-09-11にコピー元残骸ごとDOMから削除済み。このdisplay:noneブロックは
   不要になったため削除（対象要素が存在しないdead CSS）。 */
