/*
Theme Name: chibatatemono Child
Theme URI: https://chibatatemono.co.jp/
Author: Yuri Fujii
Author URI: https://step-log.com/
Description: 千葉県の不動産調査・査定・契約書作成サイト用WordPressテーマ
Template: chibatatemono-wp
Version: 1.0
*/

/* 1) 横はみ出し対策（100vw問題・計算誤差を封じる） */
html, body { width: 100%; overflow-x: hidden; }

/* 2) ボックス計算を安定化 */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

/* 3) iOSのアドレスバー高さ変動でvhがズレるのを回避（可能ならdvhを使う） */
._fullvh { min-height: 100dvh; }                 /* 新しい動的vh */
@supports not (height: 100dvh) {
  ._fullvh { min-height: -webkit-fill-available; } /* 古いiOS */
}

/* 4) 100vw を使っている要素があれば上書き（幅100%に） */
/* 例：.hero, .section, .container などで width:100vw を使っていれば… */
.hero, .section, .container { max-width: 100%; width: 100%; }

/* 5) 固定ヘッダー/フッターの「見切れ」対策（ノッチの安全域対応） */
:root { --safe-bottom: env(safe-area-inset-bottom); --safe-top: env(safe-area-inset-top); }
.header { padding-top: max(0px, var(--safe-top)); }
.is-fixed-bottom,
.fixed-bottom, .cta-fixed {
  bottom: calc(16px + var(--safe-bottom));       /* ホームバーに重ならない */
}

/* 6) 変換系をかけた親の下でposition:fixedが効かなくなるのを回避 */
.has-transform { transform: none !important; }   /* 該当があれば検証で当てる */

/* 7) iOSの自動文字拡大で崩れるケースを抑止（必要な時だけ） */
html { -webkit-text-size-adjust: 100%; }

/* 検索フォーム：iPhoneでのはみ出し対策 */
.search-form-inner{
  display: flex;
  align-items: stretch;   /* 高さ揃え */
  width: 100%;
  overflow: hidden;       /* 角丸内に収める */
  gap: 0;
}

/* 入力欄は「縮められる」ことを明示 */
.search-field{
  flex: 1 1 auto;         /* 幅は余りを全部、必要なら縮む */
  min-width: 0;           /* ← iOS Safari で超重要 */
  width: auto;            /* 念のため */
  -webkit-appearance: none;
  appearance: none;       /* iOS の既定スタイル解除 */
  border: 0;
  padding: 10px 12px;
  box-sizing: border-box;
}

/* 送信ボタンは固定幅＋中央寄せ */
.search-submit{
  flex: 0 0 44px;         /* 幅を固定（アイコンボタンなら 44px 目安） */
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;             /* はみ出し原因の余計なpaddingを消す */
  border: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* iOS限定の保険。Safariのみ効く @supports で min-width を再指定 */
@supports (-webkit-touch-callout: none) {
  .search-field{ min-width: 0; }
}