/*
Theme Name:   SWELL Child LP
Description:  SWELL子テーマ - アフィリエイトLP量産テンプレート（エディター併用対応版）
Template:     swell
Version:      4.1.0
Author:       Ishimo
*/

/*
 * 詳細なLPスタイルは assets/css/lp.css に集約。
 * このファイルは LP ページ表示に必要な SWELL 上書きのみ定義する。
 *
 * セレクタは body.lp-page（カスタムクラス）と
 * body.page-template-page-template-lp-php（WordPress標準クラス）の両方を対象にする。
 */

/* ============================================================
   LP ページで SWELL ヘッダー・フッター・サイドバーを非表示
============================================================ */
body.lp-page .l-header,
body.page-template-page-template-lp-php .l-header,
body.lp-page #header,
body.page-template-page-template-lp-php #header,
body.lp-page .p-header,
body.page-template-page-template-lp-php .p-header,
body.lp-page #fixedHeader,
body.page-template-page-template-lp-php #fixedHeader,
body.lp-page .p-fixedHeader,
body.page-template-page-template-lp-php .p-fixedHeader,
body.lp-page .p-fixedNav,
body.page-template-page-template-lp-php .p-fixedNav,
body.lp-page .l-fixHeader,
body.page-template-page-template-lp-php .l-fixHeader,
body.lp-page .l-footer,
body.page-template-page-template-lp-php .l-footer,
body.lp-page #footer,
body.page-template-page-template-lp-php #footer,
body.lp-page .l-sidebar,
body.page-template-page-template-lp-php .l-sidebar,
body.lp-page .p-entryNav,
body.page-template-page-template-lp-php .p-entryNav,
body.lp-page .p-share,
body.page-template-page-template-lp-php .p-share,
body.lp-page .p-relatedPosts,
body.page-template-page-template-lp-php .p-relatedPosts,
body.lp-page .p-authorBox,
body.page-template-page-template-lp-php .p-authorBox {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* ============================================================
   メインビジュアル・スライダー非表示
============================================================ */
body.lp-page .p-mainVisual,
body.page-template-page-template-lp-php .p-mainVisual,
body.lp-page .p-mainVisual__inner,
body.page-template-page-template-lp-php .p-mainVisual__inner,
body.lp-page .p-mainVisual__slide,
body.page-template-page-template-lp-php .p-mainVisual__slide,
body.lp-page .p-mainVisual__slider,
body.page-template-page-template-lp-php .p-mainVisual__slider,
body.lp-page .swiper,
body.page-template-page-template-lp-php .swiper,
body.lp-page .swiper-container,
body.page-template-page-template-lp-php .swiper-container,
body.lp-page .slick-slider,
body.page-template-page-template-lp-php .slick-slider,
body.lp-page .top-slider,
body.page-template-page-template-lp-php .top-slider,
body.lp-page .main-slider,
body.page-template-page-template-lp-php .main-slider,
body.lp-page .mv-slider,
body.page-template-page-template-lp-php .mv-slider {
  display: none !important;
}

/* ============================================================
   タイトルエリア非表示
============================================================ */
body.lp-page .l-header__title,
body.page-template-page-template-lp-php .l-header__title,
body.lp-page .p-pageTitle,
body.page-template-page-template-lp-php .p-pageTitle,
body.lp-page .c-pageTitle,
body.page-template-page-template-lp-php .c-pageTitle,
body.lp-page .l-pageTitle,
body.page-template-page-template-lp-php .l-pageTitle,
body.lp-page .p-entryTitle,
body.page-template-page-template-lp-php .p-entryTitle,
body.lp-page .p-entryTitle__title,
body.page-template-page-template-lp-php .p-entryTitle__title,
body.lp-page .p-entryTitle__meta,
body.page-template-page-template-lp-php .p-entryTitle__meta,
body.lp-page .entry-title,
body.page-template-page-template-lp-php .entry-title {
  display: none !important;
}

/* ============================================================
   パンくず非表示
============================================================ */
body.lp-page .p-breadcrumb,
body.page-template-page-template-lp-php .p-breadcrumb,
body.lp-page .c-breadcrumb,
body.page-template-page-template-lp-php .c-breadcrumb,
body.lp-page .breadcrumb,
body.page-template-page-template-lp-php .breadcrumb,
body.lp-page .p-topicPath,
body.page-template-page-template-lp-php .p-topicPath,
body.lp-page .c-topicPath,
body.page-template-page-template-lp-php .c-topicPath,
body.lp-page [class*="breadcrumb"],
body.page-template-page-template-lp-php [class*="breadcrumb"] {
  display: none !important;
}

/* ============================================================
   LP レイアウトリセット
============================================================ */
body.lp-page .l-main,
body.page-template-page-template-lp-php .l-main,
body.lp-page .l-container,
body.page-template-page-template-lp-php .l-container,
body.lp-page #content,
body.page-template-page-template-lp-php #content,
body.lp-page .l-contents,
body.page-template-page-template-lp-php .l-contents,
body.lp-page .l-article,
body.page-template-page-template-lp-php .l-article,
body.lp-page .l-main__contents,
body.page-template-page-template-lp-php .l-main__contents {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}

body.lp-page .l-main,
body.page-template-page-template-lp-php .l-main {
  display: block !important;
}

/* ============================================================
   LP ページ基本
============================================================ */
body.lp-page,
body.page-template-page-template-lp-php {
  background: #f8fafc;
  margin: 0;
  padding: 0;
}

/* ============================================================
   ヒーロー画像
============================================================ */
body.lp-page .lp-hero,
body.page-template-page-template-lp-php .lp-hero {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body.lp-page .lp-hero img,
body.page-template-page-template-lp-php .lp-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

#lp-wrap {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans",
               "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1e293b;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ============================================================
   CV-002.2: 本文内TOC 安全ネット非表示（PHP除去の二重ガード）
============================================================ */
body.lp-page .lp-content #toc,
body.lp-page .lp-content .toc,
body.lp-page .lp-content .ez-table-of-contents,
body.lp-page .lp-content [id^="ez-toc"],
body.lp-page .lp-content .swell-block-toc,
body.page-template-page-template-lp-php .lp-content #toc,
body.page-template-page-template-lp-php .lp-content .toc,
body.page-template-page-template-lp-php .lp-content .ez-table-of-contents,
body.page-template-page-template-lp-php .lp-content [id^="ez-toc"],
body.page-template-page-template-lp-php .lp-content .swell-block-toc {
  display: none !important;
}

/* ============================================================
   CV-002.2: 比較表SP全幅化
============================================================ */
/* 比較表コンテナ全幅 */
body.lp-page .lp-content table,
body.lp-page .lp-content .lp-comparison-table,
body.lp-page .lp-content .lp-compare-table,
body.page-template-page-template-lp-php .lp-content table,
body.page-template-page-template-lp-php .lp-content .lp-comparison-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

/* テーブル wrapper（wp:html ブロック等）のはみ出し防止 */
body.lp-page .lp-content .wp-block-html,
body.lp-page .lp-content .wp-block-table,
body.page-template-page-template-lp-php .lp-content .wp-block-html,
body.page-template-page-template-lp-php .lp-content .wp-block-table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* SP: 横スクロール許容・縮小禁止 */
@media (max-width: 768px) {
  body.lp-page .lp-content table,
  body.lp-page .lp-content .lp-comparison-table,
  body.page-template-page-template-lp-php .lp-content table {
    width: 100% !important;
    min-width: 320px;
    font-size: 0.85em;
  }
  body.lp-page .lp-content .wp-block-html,
  body.lp-page .lp-content .wp-block-table,
  body.page-template-page-template-lp-php .lp-content .wp-block-html {
    overflow-x: auto !important;
    width: 100% !important;
  }
  body.lp-page .lp-content td,
  body.lp-page .lp-content th,
  body.page-template-page-template-lp-php .lp-content td,
  body.page-template-page-template-lp-php .lp-content th {
    min-width: 80px;
    word-break: break-word;
    padding: 6px 8px;
  }
}

/* ============================================================
   CV-001: 比較ポイントカード (lp-keypoints)
============================================================ */
body.lp-page .lp-keypoints,
body.page-template-page-template-lp-php .lp-keypoints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  padding: 0 16px;
}

body.lp-page .lp-keypoint-item,
body.page-template-page-template-lp-php .lp-keypoint-item {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.95em;
  font-weight: 600;
  color: #166534;
  line-height: 1.6;
}

@media (min-width: 769px) {
  body.lp-page .lp-keypoints,
  body.page-template-page-template-lp-php .lp-keypoints {
    flex-direction: row;
    flex-wrap: wrap;
  }
  body.lp-page .lp-keypoint-item,
  body.page-template-page-template-lp-php .lp-keypoint-item {
    flex: 1 1 calc(33.33% - 16px);
    min-width: 160px;
  }
}

/* ============================================================
   CV-001: 今確認する理由ブロック (lp-reason-box)
============================================================ */
body.lp-page .lp-reason-box,
body.page-template-page-template-lp-php .lp-reason-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
}

body.lp-page .lp-reason-title,
body.page-template-page-template-lp-php .lp-reason-title {
  font-weight: 700;
  font-size: 1em;
  color: #92400e;
  margin-bottom: 10px;
}

body.lp-page .lp-reason-item,
body.page-template-page-template-lp-php .lp-reason-item {
  font-size: 0.9em;
  color: #78350f;
  margin: 4px 0;
  line-height: 1.7;
}

/* ============================================================
   CV-002 実装6: 目次デザイン強化（背景色・枠線・視認性向上）
   CV-001 実装5: スマホ目次折りたたみ
============================================================ */

/* 目次コンテナ */
body.lp-page .lp-toc,
body.page-template-page-template-lp-php .lp-toc {
  background: #fffaf0;
  border: 2px solid #f4c542;
  border-radius: 14px;
  padding: 18px 20px 14px;
  margin: 24px 0;
  box-shadow: 0 2px 8px rgba(244,197,66,0.15);
}

/* PC目次タイトル */
body.lp-page .lp-toc-pc-title,
body.page-template-page-template-lp-php .lp-toc-pc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #92400e;
  margin-bottom: 12px;
}

/* 目次リスト */
body.lp-page .lp-toc ol,
body.page-template-page-template-lp-php .lp-toc ol {
  margin: 0;
  padding-left: 20px;
}
body.lp-page .lp-toc ol li,
body.page-template-page-template-lp-php .lp-toc ol li {
  margin: 6px 0;
  line-height: 1.5;
}
body.lp-page .lp-toc ol li a,
body.page-template-page-template-lp-php .lp-toc ol li a {
  color: #1d4ed8;
  text-decoration: none;
  font-size: 0.92em;
}
body.lp-page .lp-toc ol li a:hover,
body.page-template-page-template-lp-php .lp-toc ol li a:hover {
  text-decoration: underline;
  color: #1e40af;
}

/* SPトグルボタン */
body.lp-page .lp-toc-toggle,
body.page-template-page-template-lp-php .lp-toc-toggle {
  display: none;
  width: 100%;
  background: #fef3c7;
  border: 2px solid #f4c542;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 700;
  color: #92400e;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 8px;
  margin-bottom: 8px;
}

body.lp-page .lp-toc-pc-title,
body.page-template-page-template-lp-php .lp-toc-pc-title {
  display: block;
}

@media (max-width: 768px) {
  body.lp-page .lp-toc-toggle,
  body.page-template-page-template-lp-php .lp-toc-toggle {
    display: flex;
  }
  body.lp-page .lp-toc-pc-title,
  body.page-template-page-template-lp-php .lp-toc-pc-title {
    display: none;
  }
  body.lp-page .lp-toc ol,
  body.page-template-page-template-lp-php .lp-toc ol {
    margin-top: 0;
    border-top: 1px solid #e2e8f0;
  }
}
