/* ==========================================================
   WordPress のテーマ側の幅制限（1200px などのコンテナ）を無効にする
   ----------------------------------------------------------
   親テーマ／ブロックテーマが本文を .container や .entry-content、
   Gutenberg の constrained レイアウトなどで囲み、max-width や左右の
   余白をかけてしまうと、全画面のセクション・背景色つきのセクションが
   1200px の中に閉じ込められる。TOPページ（body.axcel-page）では、
   それらの外枠の幅・余白をゼロにして、コンテンツを画面いっぱいに使う。
   body.axcel-page（TOPと下層ページ共通）は functions.php の body_class フィルターで付く。
   （中身の幅は .common__inner で 1120px に制限しているので、ここでは触らない）
   ========================================================== */

body.axcel-page :is(
  #page, #wrapper, #container, #content, #primary, #main, #site-content,
  .site, .site-content, .site-main, .content-area, .main-content,
  .container, .container-fluid, .l-container, .l-content, .l-main, .inner, .wrap, .wrapper,
  .entry, .entry-content, .page-content, .post-content, .post, .page,
  .wp-site-blocks, .wp-block-post-content, .is-layout-constrained, .is-layout-flow,
  .has-global-padding, .alignwide, .alignfull
) {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Gutenberg の constrained レイアウト：直下の子に content-size の max-width がかかる */
body.axcel-page .is-layout-constrained > *,
body.axcel-page .wp-block-post-content > * {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 本文の上下の余白や、テーマ側のパンくず・タイトルなど（TOPでは使わない） */
body.axcel-page .entry-header,
body.axcel-page .page-header,
body.axcel-page .entry-title,
body.axcel-page .breadcrumbs,
body.axcel-page .wp-block-post-title {
  display: none !important;
}
body.axcel-page :is(.site-content, .entry-content, .page-content, .wp-block-post-content, main) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* 横に少しはみ出しても横スクロールを出さない（overflow:hidden ではなく clip：position:sticky を壊さない） */
body.axcel-page {
  overflow-x: clip;
}

/* テーマ（Lightning）が h2 / h3 に自動で付ける罫線・余白を消す（TOPのみ）
   ・h2：上に太線＋下に細線（border-top / border-bottom / padding）
   ・h3：下に細線（border-bottom / padding）
   :where() で除外しているので詳細度は上がらず、独自の罫線を持つ .top_reason__name などは
   自分のCSSがそのまま効く。 */
body.axcel-page :is(h2, h3):where(:not(.top_reason__name)) {
  border: 0;
  border-radius: 0;
  padding: 0;
}

/* テーマ／WordPress標準のスタイルがリンク全体に付ける下線を消す（TOPのみ）
   カード全体が <a> のため、カード内の文字すべてに下線が入っていた。
   下線を残したいリンク（.top_info__map）は除外。:where() は詳細度を上げない */
body.axcel-page a:where(:not(.top_info__map)),
body.axcel-page a:where(:not(.top_info__map)):is(:hover, :focus, :active) {
  text-decoration: none;
}

/* テーマ（Lightning）が h2 / h3 の ::after で付ける青い短い線を消す（TOPのみ）
   （h3:where(:not(.wp-block-post-title))::after … 幅30%・下に1pxのメインカラー線） */
body.axcel-page :is(h2, h3):where(:not(.top_plan__group-title, .top_first__sub))::after {
  content: none;
}

/* 自分で ::after を使っている見出し（.top_plan__group-title / .top_first__sub）は、
   テーマの position・幅・下線などが混ざらないよう、混ざる分だけを打ち消す
   （content・height・background・margin など自分のCSSで指定しているものは触らない） */
body.axcel-page :is(.top_plan__group-title, .top_first__sub)::after {
  position: static;
  bottom: auto;
  overflow: visible;
  border: 0;
  line-height: normal;
}
/* .top_plan__group-title の線は flex:1 で伸ばすので、テーマの width:30% だけ外す */
body.axcel-page .top_plan__group-title::after {
  width: auto;
}

/* テーマ（Lightning）が h4 に自動で付ける灰色の背景・余白・角丸を消す（TOPのみ）
   .top_first__flow-title は独自の padding-bottom を持つので、下の余白だけ残す */
body.axcel-page h4:where(:not(.top_first__flow-title)) {
  background: none;
  border-radius: 0;
  padding: 0;
}
body.axcel-page h4.top_first__flow-title {
  background: none;
  border-radius: 0;
  padding-block-start: 0;
  padding-inline: 0;
}

/* テーマの `a { color: var(--vk-color-text-link) }` に、色を「親から引き継ぐ」リンクが上書きされるのを防ぐ（TOPのみ）
   common.css の `a { color: inherit }` は、テーマの `a` と同じ強さで後から読まれて負けるため。
   色を自分で指定しているリンクは対象外（自分のCSSがそのまま効く）。
   色を引き継ぐ新しいリンクを作ったら、そのクラスをここに足すこと */
body.axcel-page a:not([class]),
body.axcel-page :is(
  .common_header__logo, .top_kv__logo,
  .top_kv__area-tel, .top_kv__menu-tel, .top_kv__cta, .top_kv__banner,
  .top_plan__card-link, .top_halls__card-link, .top_column__card-link,
  .common_footer__tel, .common_side__btn--tel, .common_side__btn--mail,
  .first__crumb-link, .plans__crumb-link, .hall__crumb-link, .temple__crumb-link, .company__crumb-link, .contact__crumb-link
) {
  color: inherit;
}

/* テーマの `a:hover { color: … }`（ホバーで文字が青くなる）に、通常時の色を上書きされないようにする（TOPのみ）
   色を自分で指定していて、ホバー用の色は指定していないリンクだけ、通常時と同じ色を明示する。
   （ホバーで色を変えたいリンクは、自分のCSSに :hover の色を書けばそちらが効く） */
body.axcel-page :is(
  .common_header__tel, .top_option__link, .top_info__map
):is(:hover, :focus, :active) {
  color: var(--color-brand);
}
body.axcel-page :is(
  .common_header__drawer-tel,
  .top_contact__tel, .top_contact__mail,
  .common_footer_contact__tel, .common_footer_contact__mail,
  .common_fixed__tel, .common_fixed__mail,
  .first__flow-mail
):is(:hover, :focus, :active) {
  color: var(--color-white);
}

/* プラグイン（VK All in One Expansion Unit）の「ページトップへ」ボタンを消す（TOPのみ）
   プラグイン側は .scrolled .page_top_btn { display:block } で出すため、ID指定で確実に上書きする */
body.axcel-page #page_top {
  display: none !important;
}

/* テーマ（Lightning）が p / ul / ol / dl / blockquote / iframe に付ける下の余白を消す（アクセル社のページのみ）
   `.wp-block-table, blockquote, dl, iframe, ol, p, ul { margin-bottom: var(--vk-margin-element-bottom) }` への対策。
   詳細度は、テーマ（0,0,1）より高く、こちらのクラス指定（0,1,0）より低い（0,0,2）にしている。
   → こちらのCSSで margin を指定している要素はその値のまま、指定のない要素だけ余白が0になる */
html :where(body.axcel-page) :is(p, ul, ol, dl, blockquote, iframe) {
  margin-bottom: 0;
}

/* テーマが ul / ol に付ける左余白（`:is(ul,ol):where(:not(.wp-block-post-template)) { padding-left: 1.5em }`）を、
   クラス付きの ul / ol（こちらで作ったレイアウト用リスト）だけ消す。カードや一覧が右に寄るのを防ぐ。
   詳細度は（0,0,2）で、テーマ（0,0,1）より高く、こちらのクラス指定（0,1,0）より低い。
   → 余白を自分で指定しているリストはその値のまま。クラスなしの本文中のリストには影響しない */
html :where(body.axcel-page) :is(ul, ol):where([class]) {
  padding-left: 0;
}
