/* 全固定ページのFV上余白を完全削除 */
.page .l-mainContent__inner,
.page .post_content,
.page .l-content,
.page .l-container {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ページタイトル・パンくずを非表示 */
.c-pageTitle,
.c-breadcrumb,
.l-breadcrumb {
  display: none !important;
}

/* Contact Form 7 の見た目調整 */
.wpcf7-form {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.wpcf7-form input[type="submit"] {
  display: block;
  margin: 20px auto;
}

/* スマホで、主要コンテンツ直下の要素すべてに横16px */
@media (max-width: 768px){

  /* main 直下／entry-content 直下のトップレベル要素に余白 */
  main > *:not(.full-bleed),
  .entry-content > *:not(.full-bleed),
  .wp-block-post-content > *:not(.full-bleed) {
    padding-inline: 16px !important;
    box-sizing: border-box !important;
  }

  /* Group/Coverの“内側ラッパー”にも保険をかける（display:contents対策） */
  .wp-block-group__inner-container,
  .wp-block-cover__inner-container {
    padding-inline: 16px !important;
    box-sizing: border-box !important;
  }

  /* 100vw系（alignfull等）で端に張り付くブロックのガード */
  .alignfull:not(.full-bleed),
  .wp-block-group.alignfull:not(.full-bleed),
  .wp-block-cover.alignfull:not(.full-bleed),
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    padding-inline: 16px !important;
    box-sizing: border-box !important;
  }

  /* 長い英単語/URLのはみ出しケア */
  .entry-content, .wp-block-post-content {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* PCの見た目はそのまま。スマホだけ幅・余白を強制上書き */
@media (max-width: 768px){

  /* CF7ブロックの外側ラッパーも含めて幅を100%に */
  .wp-block-contact-form-7-contact-form-selector,
  .wpcf7,
  .wpcf7 form,
  .wpcf7-form {
    width: 100% !important;
    max-width: none !important;       /* 600px制限を解除 */
    margin: 0 !important;             /* 中央寄せを解除 */
    padding: 0 16px !important;       /* 画面端に当たらないガター */
    box-sizing: border-box;
    text-align: left !important;      /* 中央寄せを解除 */
  }

  /* 各フィールドを100%幅に統一 */
  .wpcf7-form .wpcf7-form-control-wrap,
  .wpcf7-form input[type="text"],
  .wpcf7-form input[type="email"],
  .wpcf7-form input[type="tel"],
  .wpcf7-form input[type="url"],
  .wpcf7-form input[type="number"],
  .wpcf7-form select,
  .wpcf7-form textarea {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* 行間と上下マージンを統一 */
  .wpcf7-form p {
    margin: 0 0 14px !important;
  }

  /* 送信ボタン：幅100%にするなら有効化（任意） */
  .wpcf7-form input[type="submit"] {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    margin: 20px 0 0 !important;      /* 左右の余白は親の16pxに任せる */
    box-sizing: border-box;
  }
}

/* PC用フォーム */
.form-pc {
  display: block;
}
.form-sp {
  display: none;
}

/* スマホ用フォーム */
@media (max-width: 768px) {
  .form-pc {
    display: none; /* PC用は非表示 */
  }
  .form-sp {
    display: block; /* スマホ用だけ表示 */
    width: 100%;
    max-width: 100%;
    padding: 0 16px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .form-sp input[type="text"],
  .form-sp input[type="email"],
  .form-sp input[type="tel"],
  .form-sp textarea {
    width: 100%;
    box-sizing: border-box;
  }

  .form-sp input[type="submit"] {
    width: 100%;
    margin: 20px 0 0;
    box-sizing: border-box;
  }
}

/* A) スマホ時、ホームの最初のブロック（FV）だけ横paddingを完全ゼロ */
@media (max-width: 768px){
  .home main > *:first-child,
  .home .entry-content > *:first-child,
  .home .wp-block-post-content > *:first-child {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Cover/Groupの内側ラッパーにも余白が残るテーマ対策 */
  .home main > *:first-child .wp-block-cover__inner-container,
  .home main > *:first-child .wp-block-group__inner-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

div.is-all-centered.td_to_th_.sp_only {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  display: block !important;
}

div.is-all-centered.td_to_th_.sp_only table {
  min-width: 700px;
  width: auto !important;
}

/* ========= Swell 固定ページ用：SP限定で横スクロール表を有効化 ========= */
@media screen and (max-width: 768px) {
  .page .is-all-centered.td_to_th_.sp_only {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .page .is-all-centered.td_to_th_.sp_only table {
    min-width: 800px !important;  /* 横スクロール発生させる最小幅 */
    width: auto !important;
    border-collapse: collapse;
    white-space: nowrap;
  }

  .page .is-all-centered.td_to_th_.sp_only th,
  .page .is-all-centered.td_to_th_.sp_only td {
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
  }
}

/* 親ブロックoverflow解除（常時OK） */
.wp-block-group,
.wp-block-cover {
  overflow: visible !important;
}

/* ========= SWELL公式「スクロールできます →」英語化（完全置き換え） ========= */

/* すべての横スクロールヒントを英語に統一 */
.swl-table-wrap::after,
.is-all-centered.td_to_th_.sp_only::after,
.is-scrollable::after,
.p-horizontal-scroll::after,
.p-scrollable::after {
  content: "→ Swipe to see more →" !important; /* ←ここで文言変更OK */
  font-size: 12px;
  text-align: right;
  color: #888;
  display: block;
  margin-top: 4px;
  font-style: italic;
}

/* 日本語テキストを強制的に非表示にする（Swellのデフォルト） */
.swl-table-wrap[data-scroll-msg]::after {
  content: none !important;
}

/* スマホ限定にしたい場合 */
@media screen and (min-width: 769px) {
  .swl-table-wrap::after,
  .is-all-centered.td_to_th_.sp_only::after,
  .is-scrollable::after,
  .p-horizontal-scroll::after,
  .p-scrollable::after {
    content: none !important;
  }
}

/* ========= SWELL：全スクロールヒント英語化（表・ブログパーツ・How it works全対応） ========= */

/* --- 日本語テキストを非表示に --- */
.c-scrollHint span,
.c-scrollHint.sp_only span,
.p-scrollHint span,
.p-scrollHint.sp_only span {
  visibility: hidden !important;
  position: relative;
}

/* --- 英語テキストを差し替え表示 --- */
.c-scrollHint span::after,
.c-scrollHint.sp_only span::after,
.p-scrollHint span::after,
.p-scrollHint.sp_only span::after {
  content: "→ Swipe to see more →";
  visibility: visible;
  position: absolute;
  left: 0;
  right: 0;
  text-align: right;
  color: #888;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
