/*
Theme Name: Twenty Twenty-Five
Theme URI: https://wordpress.org/themes/twentytwentyfive/
Author: the WordPress team
Author URI: https://wordpress.org
Description: Twenty Twenty-Five emphasizes simplicity and adaptability. It offers flexible design options, supported by a variety of patterns for different page types, such as services and landing pages, making it ideal for building personal blogs, professional portfolios, online magazines, or business websites. Its templates cater to various blog styles, from text-focused to image-heavy layouts. Additionally, it supports international typography and diverse color palettes, ensuring accessibility and customization for users worldwide.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyfive
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, blog, portfolio, news
*/

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .1em;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
}

/* Increase the bottom margin on submenus, so that the outline is visible. */
.wp-block-navigation .wp-block-navigation-submenu .wp-block-navigation-item:not(:last-child) {
	margin-bottom: 3px;
}

/* Increase the outline offset on the parent menu items, so that the outline does not touch the text. */
.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
	outline-offset: 4px;
}

/* Remove outline offset from the submenus, otherwise the outline is visible outside the submenu container. */
.wp-block-navigation .wp-block-navigation-item ul.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	outline-offset: 0;
}

/*
 * Progressive enhancement to reduce widows and orphans
 * https://github.com/WordPress/gutenberg/issues/55190
 */
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}

/*
 * Change the position of the more block on the front, by making it a block level element.
 * https://github.com/WordPress/gutenberg/issues/65934
*/
.more-link {
	display: block;
}

/* =========================================
   2026-01-15
   目的：ヘッダー共通デザイン
   （帯＋高さ圧縮＋ロゴ画像＋中央固定）
========================================= */

/* 1) ヘッダーの帯（全ページ共通） */
.wp-site-blocks > header.wp-block-template-part {
  background-color: #f4f1ea;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-block: 0 !important;
  margin-block: 0 !important;
}

/* 2) ヘッダー内の横並び行：高さを確保（ロゴがabsoluteでも帯が潰れない） */
.wp-site-blocks > header.wp-block-template-part
  > .wp-block-group.alignfull
  > .wp-block-group.has-global-padding
  > .wp-block-group.alignwide.wp-block-group-is-layout-flex {

  position: relative;

  min-height: 52px;              /* 帯の高さ */
  align-items: center;           /* 中身を縦中央 */
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* 3) サイトタイトルをロゴ画像に差し替え
   └ absolute で「完全に中央固定」 */
.wp-site-blocks > header.wp-block-template-part .wp-block-site-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  margin: 0 !important;
  line-height: 0;
  text-align: center;
  z-index: 2; /* 他要素より前面に */
}

.wp-site-blocks > header.wp-block-template-part .wp-block-site-title > a {
  display: block;

  width: 160px;  /* ロゴ横幅（必要ならここだけ調整） */
  height: 28px;  /* ロゴ高さ */

  background-image: url("https://sub.local-farm.jp/wp-admin/images/localfarmlogo_1.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center center;

  /* テキストは見せない */
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
}

/* 4) ナビゲーション領域は右側に退避
   └ 存在してもロゴ中央に影響しない */
.wp-site-blocks > header.wp-block-template-part .wp-block-navigation {
  margin-left: auto;
}

/* 5) ハンバーガー（開くボタン）の余白圧縮（※非表示にしているなら実質無効） */
.wp-site-blocks > header.wp-block-template-part
  .wp-block-navigation__responsive-container-open {
  padding: 6px 8px !important;
}

/* =========================================
   2026-01-18
   目的：契約フォームではフッターを非表示
========================================= */

footer.wp-block-template-part {
  display: none;
}

/* =========================================
   Step indicator（入会フォーム専用・最終版）
   位置：h1の上（mainの先頭）
   対象：page-id 7,15,17,19,21
========================================= */

/* -----------------------------------------
   共通（擬似要素の器）
----------------------------------------- */
:is(
  body.page-id-7,
  body.page-id-15,
  body.page-id-17,
  body.page-id-19,
  body.page-id-21
) main.wp-block-group::before{
  content: "";
  display: block;

  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  aspect-ratio: 750 / 212;
  height: auto;
}

/* -----------------------------------------
   画像指定（SP/PC共通）
----------------------------------------- */
body.page-id-7  main.wp-block-group::before{ background-image: url("/wp-content/themes/twentytwentyfive-child/assets/images/step/step-1-sp.png"); }
body.page-id-15 main.wp-block-group::before{ background-image: url("/wp-content/themes/twentytwentyfive-child/assets/images/step/step-2-sp.png"); }
body.page-id-17 main.wp-block-group::before{ background-image: url("/wp-content/themes/twentytwentyfive-child/assets/images/step/step-3-sp.png"); }
body.page-id-19 main.wp-block-group::before{ background-image: url("/wp-content/themes/twentytwentyfive-child/assets/images/step/step-4-sp.png"); }
body.page-id-21 main.wp-block-group::before{ background-image: url("/wp-content/themes/twentytwentyfive-child/assets/images/step/step-5-sp.png"); }

/* -----------------------------------------
   SP：中央固定＋余白最小
----------------------------------------- */
@media (max-width: 768px) {

  :is(
    body.page-id-7,
    body.page-id-15,
    body.page-id-17,
    body.page-id-19,
    body.page-id-21
  ) main.wp-block-group::before{
    width: min(92vw, 340px);
    margin: 4px 0 6px !important;

    /* viewport基準で強制中央（右寄り完全対策） */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }

  /* フォームページの上余白を根こそぎ削る */
  :is(
    body.page-id-7,
    body.page-id-15,
    body.page-id-17,
    body.page-id-19,
    body.page-id-21
  ){
    main.wp-block-group,
    .entry-content.wp-block-post-content{
      margin-top: 0 !important;
      padding-top: 0 !important;
    }

    .entry-content.wp-block-post-content > *:first-child{
      margin-top: 0 !important;
    }
  }
}

/* -----------------------------------------
   PC：サイズ・中央・余白を最小構成に統一
----------------------------------------- */
@media (min-width: 769px) {

  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  main.wp-block-group{
    display: block !important;
  }

  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  main.wp-block-group::before{
    width: min(420px, 60vw);
    max-width: 420px;
    margin: 0 auto 2px !important;
  }

  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  .entry-content.wp-block-post-content{
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  .entry-content.wp-block-post-content > *:first-child{
    margin-top: 0 !important;
  }
}

/* =========================================
   フォーム固定ページ：タイトル非表示
========================================= */

:is(
  body.page-id-7,
  body.page-id-15,
  body.page-id-17,
  body.page-id-19,
  body.page-id-21
) h1.wp-block-post-title{
  display: none;
}

/* =========================================
   SP余白調整（全ページ共通）
========================================= */
@media (max-width: 768px) {

  body main.wp-block-group{
    margin-top: 0 !important;
  }

  body .entry-content.wp-block-post-content{
    padding-top: 6px !important;
    padding-bottom: 20px !important;
  }

  body h1.wp-block-post-title{
    margin: 0 !important;
  }

  body .wpcf7 form p{
    margin: 8px 0 !important;
  }

  body .wpcf7 form label{
    display: inline-block;
    margin-bottom: 3px;
  }
}


/* =========================================
   2026-01-18
   ナビ（ハンバーガー）をSP/PCとも非表示
========================================= */

/* ハンバーガー（開閉ボタン）を消す */
.wp-block-navigation__responsive-container-open{
  display: none !important;
}
.wp-block-navigation__responsive-container-close{
  display: none !important;
}

/* もしメニューが開いても、オーバーレイ自体を出さない */
.wp-block-navigation__responsive-container{
  display: none !important;
}

/* =========================================
   2026-01-18
   CF7 入会フォーム（page-id: 7,15,17,19,21）
   前提DOM：form内に <div class="lf-form"> がある
========================================= */

:is(
  body.page-id-7,
  body.page-id-15,
  body.page-id-17,
  body.page-id-19,
  body.page-id-21
){

  /* （保険）SPでプルダウン展開時にスクロールが死ぬ対策 */
  main,
  .entry-content,
  .wp-block-post-content{
    overflow: visible !important;
  }

  /* 1) フォーム本体（中央寄せ） */
  .wpcf7 .lf-form{
    max-width: 560px;
    margin: 0 auto;
  }

  /* 2) プラン選択 見出し（CF7側で p.lf-plan-title を付ける） */
  .wpcf7 .lf-form .lf-plan-title{
    text-align: center;
    margin: 6px 0 14px !important;
  }

  .wpcf7 .lf-form .lf-plan-title > span{
    display: inline-block;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #0b5d6f; /* 次へボタンと同色 */
    line-height: 1.2;
  }

  /* 3) ラベル（項目名） */
  .wpcf7 form.wpcf7-form .lf-form label{
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-top: 16px !important;    /* 前の項目との区切り */
    margin-bottom: 0 !important;    /* 入力欄との距離 */
    color: rgba(0,0,0,.86);
  }

  /* 4) 入力（境目を作る：下に余白） */
  .wpcf7 form.wpcf7-form .lf-form select.wpcf7-form-control,
  .wpcf7 form.wpcf7-form .lf-form input.wpcf7-form-control:not(.wpcf7-submit),
  .wpcf7 form.wpcf7-form .lf-form textarea.wpcf7-form-control{
    width: 100% !important;
    box-sizing: border-box !important;

    min-height: 40px !important;
    padding: 8px 10px !important;

    border: 1px solid rgba(0,0,0,.22) !important;
    border-radius: 8px !important;
    background: #fff !important;

    font-size: 16px;
    line-height: 1.2;

    margin-top: 0px !important;    /* 前の項目との区切り */
    margin-bottom: 8 !important;    /* 入力欄との距離 */
  }

  /* textareaだけ高さ */
  .wpcf7 form.wpcf7-form .lf-form textarea.wpcf7-form-control{
    height: auto !important;
    min-height: 120px !important;
  }

  /* disabled */
  .wpcf7 .lf-form select:disabled,
  .wpcf7 .lf-form input:disabled,
  .wpcf7 .lf-form textarea:disabled{
    opacity: .55;
    background: rgba(0,0,0,.04) !important;
  }

  /* focus */
  .wpcf7 form.wpcf7-form .lf-form input:focus,
  .wpcf7 form.wpcf7-form .lf-form select:focus,
  .wpcf7 form.wpcf7-form .lf-form textarea:focus{
    outline: none;
    border-color: rgba(11,93,111,.55) !important;
    box-shadow: 0 0 0 3px rgba(11,93,111,.12);
  }

  /* 5) ラジオ（区画数）のまとまり */
  .wpcf7 form.wpcf7-form .lf-form .wpcf7-radio{
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px !important; /* ←境目 */
  }

  .wpcf7 form.wpcf7-form .lf-form .wpcf7-list-item{
    margin: 0 !important;
  }

  .wpcf7 form.wpcf7-form .lf-form .wpcf7-radio label{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,.12);
    background: rgba(255,255,255,.92);
    font-weight: 700;

    /* 上の「ラベル共通」の margin を打ち消す */
    margin: 0 !important;
  }

  .wpcf7 form.wpcf7-form .lf-form input[type="radio"]{
    width: 18px;
    height: 18px;
  }

  /* 6) 次へボタン */
  .wpcf7 form.wpcf7-form input.wpcf7-submit{
    width: min(560px, 100%) !important;
    display: block;
    margin: 10px auto 0 !important;

    height: 44px !important;
    padding: 0 18px !important;
    line-height: 44px !important;

    border: none !important;
    border-radius: 8px !important;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;

    background: #0b5d6f;
    color: #fff;
    letter-spacing: .02em;
  }

  @media (hover:hover){
    .wpcf7 form.wpcf7-form input.wpcf7-submit:hover{
      filter: brightness(0.96);
    }
  }

  /* スピナー */
  .wpcf7 form.wpcf7-form .wpcf7-spinner{
    margin-left: 8px;
  }

  /* エラー */
  .wpcf7 .wpcf7-not-valid-tip{
    margin-top: 6px;
    font-size: 12px;
  }

  .wpcf7 .wpcf7-response-output{
    width: min(560px, 100%);
    margin: 12px auto 0 !important;
    border-radius: 8px;
  }
}


/* =========================================
   入会フォーム：補足説明（lf-note とその説明文）
========================================= */
:is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
.wpcf7 .lf-form p.lf-note,
:is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
.wpcf7 .lf-form p.lf-note ~ p{
  font-size: 13px !important;
  line-height: 1.6 !important;
  font-weight: 400 !important;
  color: rgba(0,0,0,.75) !important;
  text-align: left !important;
  margin: 18px 0 !important;
}


/* lf-note先頭に勝手に入ってる <br> が邪魔なら消す */
:is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
.wpcf7 .lf-form p.lf-note br:first-child{
  display: none;
}


/* =========================================
   入会フォーム（PC） 余白
   対象：page-id 7,15,17,19,21
========================================= */
@media (min-width: 769px) {

  /* 1) main / entry-content の上下 padding・margin をゼロ寄せ */
  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  main.wp-block-group{
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  .entry-content.wp-block-post-content{
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* 2) Twenty Twenty-Five の block-gap（ブロック間の標準余白）を潰す */
  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  .entry-content.wp-block-post-content.is-layout-flow{
    --wp--style--block-gap: 0px !important;
  }

  /* 3) 念のため「最初と最後のブロックのmargin」も潰す */
  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  .entry-content.wp-block-post-content > *:first-child{
    margin-top: 0 !important;
  }

  :is(body.page-id-7, body.page-id-15, body.page-id-17, body.page-id-19, body.page-id-21)
  .entry-content.wp-block-post-content > *:last-child{
    margin-bottom: 0 !important;
  }
}
