/*
Theme Name: XWrite Child
Template: xwrite
Version: 2.0
Author: FXマニア
Description: 余白リセット＆フル幅最適化 完全版
*/

/* =====================================
✅ グローバルデザインリセット（XWrite対応）
===================================== */

/* 背景統一 */
body {
  background: #fff !important;
}

/* =====================================
📏 固定ページ フル幅化（余白・中央寄せ解除）
===================================== */
body.page,
body.page #wrap,
body.page #content,
body.page .contents,
body.page main,
body.page .articleContainer,
body.page .articleBodyInner,
body.page .l-container,
body.page .l-content,
body.page .xw-inner,
body.page .inner {
  display: block !important;
  float: none !important;
  flex: none !important;
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  background: #fff !important;
}

/* =====================================
🧾 本文要素調整（目次・見出し・カードなど）
===================================== */
body.page .entry-content,
body.page main.main,
body.page article.articleContainer,
body.page section,
body.page .fx-section,
body.page .vps-section,
body.page .crypto-section,
body.page .cta-wrap,
body.page .summary-table,
body.page .faq-section {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* 目次やセクション内側もフル幅に */
body.page .toc,
body.page .toc-wrap,
body.page .xw-toc,
body.page .xw-toc__inner {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 段落・表・画像など上下マージン調整 */
body.page .entry-content > * {
  margin-top: 10px !important;
  margin-bottom: 10px !important;
}

/* =====================================
📱 スマホ最適化
===================================== */
@media (max-width: 768px) {
  body.page .entry-content {
    padding: 0 8px !important;
  }

  /* 画像・表がはみ出さないように */
  body.page img,
  body.page table {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* =====================================
💡 横スクロール防止
===================================== */
html, body {
  overflow-x: hidden !important;
}

/* =====================================
🎨 テーマ干渉防止（デザイン崩れ対策）
===================================== */
.wrap,
.container,
.contents,
.l-container,
.l-content,
.inner,
.xw-inner {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* =====================================
🧭 セクション調整（FX・VPS・暗号資産・CTA）
===================================== */
.section.fx-section,
.section.vps-section,
.section.crypto-section {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* =====================================
✅ 見出し調整（中央寄せ用CSSを解除）
===================================== */
body.page h2, body.page h3, body.page h4 {
  margin-left: 0 !important;
  padding-left: 0 !important;
  border-left: none !important;
}

/* =====================================
✨ 表デザインの幅統一補正（横スクロール防止）
===================================== */
body.page table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 10px 0 !important;
  box-sizing: border-box !important;
}

/* =====================================
🚫 不要なmax-width上書き対策
===================================== */
body.page .articleBodyInner[style*="max-width"],
body.page .contents[style*="max-width"] {
  max-width: 100% !important;
}
/* =====================================
🏠 トップページ専用の余白を復活
===================================== */

/* トップページ全体に軽い上下余白を戻す */
body.home main,
body.front-page main,
body.home .contents,
body.front-page .contents {
  padding-top: 40px !important;
  padding-bottom: 60px !important;
}

/* セクションの間隔も調整 */
body.home section,
body.front-page section {
  margin-top: 40px !important;
  margin-bottom: 40px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  box-sizing: border-box !important;
}
/* =====================================
🏠 トップ固定ページだけ余白を復活（PC & スマホ両対応）
===================================== */

/* PC用：中央寄せ＋最大幅1200px */
body.home,
body.front-page {
  background: #fff !important;
}

body.home #wrap,
body.front-page #wrap,
body.home main,
body.front-page main,
body.home .contents,
body.front-page .contents,
body.home .articleContainer,
body.front-page .articleContainer {
  max-width: 1200px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 32px !important;
  padding-right: 32px !important;
  padding-top: 40px !important;
  padding-bottom: 60px !important;
  box-sizing: border-box !important;
}

/* スマホ用：軽めの余白で中央寄せ維持 */
@media (max-width: 768px) {
  body.home #wrap,
  body.front-page #wrap,
  body.home main,
  body.front-page main,
  body.home .contents,
  body.front-page .contents,
  body.home .articleContainer,
  body.front-page .articleContainer {
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 24px !important;
    padding-bottom: 40px !important;
  }
}
/* =====================================
🎯 XWrite標準見出しスタイル再現版（子テーマ補正）
===================================== */

/* h2：標準青線＋自然な余白 */
body.page h2 {
  position: relative !important;
  padding-left: 12px !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
  border: none !important; /* テーマ側の線をリセット */
}

/* 青い線（高さ・太さXWriteと同じ） */
body.page h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;         /* 少し下から開始（文字高さに合わせる） */
  height: 1em;         /* 見出し文字高さにぴったり */
  width: 3px;          /* 太すぎない標準幅 */
  background: #0b63c7; /* XWriteの青 */
  border-radius: 0;    /* 丸みなし */
}

/* h3：少し細い青線で統一感を保つ */
body.page h3 {
  position: relative !important;
  padding-left: 10px !important;
  font-weight: 600 !important;
  line-height: 1.6 !important;
  border: none !important;
}
body.page h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38em;
  height: 0.9em;
  width: 2px;
  background: #0b63c7;
  border-radius: 0;
}

/* スマホ調整：少し細く */
@media (max-width: 768px) {
  body.page h2::before {
    width: 2.5px;
    top: 0.4em;
    height: 1em;
  }
  body.page h3::before {
    width: 2px;
    top: 0.4em;
    height: 0.9em;
  }
}
/* =====================================
🩵 フッター中央寄せ・幅補正（XWrite全ページ対応）
===================================== */

/* フッター全体を強制的に中央寄せ */
footer,
.site-footer,
.xw-footer,
#footer {
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

/* フッターメニュー内のリンクを中央に整列 */
footer .menu,
.site-footer .menu,
.footer-menu,
.xw-footer .menu {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  text-align: center !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* スマホ時の微調整 */
@media (max-width: 768px) {
  footer,
  .site-footer,
  .xw-footer {
    padding: 12px 10px !important;
    max-width: 100% !important;
  }
}

/* =====================================
💜 postid=109 （VPS比較ページ）余白完全削除・最終版
===================================== */
body.single.postid-109 main.main.main[style*="padding-left"],
body.single.postid-109 main.main.main[style*="padding-right"],
body.single.postid-109 main.main.main {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* .contents や .articleContainer もフル幅化 */
body.single.postid-109 .contents,
body.single.postid-109 .articleContainer,
body.single.postid-109 .entry-content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* 本文内セクションを中央寄せ（PC用） */
body.single.postid-109 .entry-content > *,
body.single.postid-109 section,
body.single.postid-109 .vps-section {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

/* スマホ時：左右8pxの安全余白 */
@media (max-width: 768px) {
  body.single.postid-109 main.main.main,
  body.single.postid-109 .contents,
  body.single.postid-109 .articleContainer {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.single.postid-109 .entry-content > *,
  body.single.postid-109 section {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}
body.single.postid-321 .entry-content[style] {
  width: auto !important;
  max-width:1180px !important;
  margin-left:auto !important;
  margin-right:auto !important;
  padding-left:0 !important;
  padding-right:0 !important;
  box-sizing:border-box !important;
}

body.single.postid-321 .entry-content {
  width:auto !important;
  max-width:1180px !important;
}
@media (min-width: 1025px) {
  body.single.postid-321 .entry-content {
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}
