/* ============================================================
   レスポンシブ対応スタイル — ietomachi.com
   base.css は変更せず、このファイルで上書き追加。
   ============================================================ */

/* ── 全幅共通：画像の最大幅制御 ───────────────────────── */
img {
  max-width: 100%;
  height: auto;
}

/* ── タブレット（1024px 以下）────────────────────────── */
@media screen and (max-width: 1024px) {

  body {
    min-width: 0;
  }

  /* min-width 固定を解除 */
  #head,
  .body,
  .bodyno,
  #foot {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* 固定幅コンテナをフルード化 */
  #headc,
  #bodyc,
  .bodyc,
  #footc,
  .submenuc {
    width: 100%;
    max-width: 996px;
    box-sizing: border-box;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* position:absolute で配置されているヘッダー内の要素を静的配置へ */
  #head {
    height: auto;
    padding-bottom: 10px;
    position: relative;
  }

  #headtop {
    position: static;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    text-align: center;
    padding: 10px 0 6px;
  }

  #headtop a {
    display: inline-block;
    margin: 3px 4px;
  }

  #headtop img {
    max-height: 48px;
    width: auto;
  }

  #headmenu {
    position: static;
    width: 100%;
    text-align: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* back-to-top ボタン */
  #back-top {
    width: 96%;
    right: 2%;
  }

  /* テーブル */
  .table1,
  .underline {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    word-break: break-word;
  }
}

/* ── スマートフォン（767px 以下）────────────────────────── */
@media screen and (max-width: 767px) {

  /* ヘッダー */
  #head {
    padding: 0 0 8px;
  }

  #styletop {
    height: auto;
  }

  /* ナビゲーション画像を少し縮小 */
  #headtop img {
    max-height: 40px;
    width: auto;
  }

  /* フッター */
  #footc {
    padding: 16px 12px;
  }

  #footdata {
    font-size: 11px;
    line-height: 1.7;
  }

  /* コンテンツ */
  #bodyc,
  .bodyc {
    padding: 16px 10px;
  }

  /* サブメニュー */
  .submenuc {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .submenuc a {
    display: inline-block;
  }

  /* フォーム入力欄を幅100%に */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[name="address"],
  textarea {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* テーブル表示改善 */
  .table1 td,
  .table1 th {
    font-size: 12px;
    padding: 7px 6px;
    white-space: normal;
  }

  /* フォームテーブル縦積み */
  .table1 tr.top1 {
    display: block;
    margin-bottom: 6px;
  }

  .table1 tr.top1 th,
  .table1 tr.top1 td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .table1 tr.top1 th {
    background-color: #f0f0f0;
    padding: 6px 10px;
  }

  /* 見出し */
  h2 {
    font-size: 15px;
    padding: 10px 6px;
  }

  .hist2 {
    margin: 0 4px 16px;
    font-size: 15px;
  }

  /* bottom-menu ボタン群 */
  .bottommenu {
    width: 90px;
    height: 90px;
    margin: 4px;
  }

  /* 画像コンテナ */
  .comphoto {
    width: 45%;
    height: auto;
  }

  .comphotoarea {
    width: 100%;
    padding-left: 0;
  }

  .comarea {
    width: 100%;
    margin-right: 0;
    float: none;
  }

  /* リンクブロック */
  .linkblock {
    width: 100%;
    height: auto;
    margin: 10px 0;
  }

  .linkname,
  .linkdisp {
    position: static;
    width: 100%;
  }
}

/* ============================================================
   Bootstrap 5 統合後の追加調整 (2026年5月)
   ============================================================ */

/* Bootstrap のリセットで崩れる既存スタイルの復元 */
a { color: #0092d7; font-weight: bold; }
a:hover { color: #000; }
h2 {
  border-top: 1px solid #0092d7;
  border-bottom: 1px solid #0092d7;
  color: #0092d7;
  margin: 30px 0 20px;
  padding: 15px 10px;
  font-size: 18px;
}

/* スライダー：centit を responsive 化 */
.centit {
  width: 100% !important;
  max-width: 990px;
}

.demo-2 .sl-slider h2,
.demo-2 .sl-slider blockquote,
.demo-2 .sl-slider .linklink {
  width: 100% !important;
  max-width: 990px;
}

/* スライダー高さをモバイルで調整 */
@media screen and (max-width: 767px) {
  .demo-2 .sl-slider-wrapper {
    height: 280px;
  }
  .centit img {
    max-width: 90%;
    height: auto;
  }
}

@media screen and (max-width: 480px) {
  .demo-2 .sl-slider-wrapper {
    height: 220px;
  }
}

/* フォームページのBootstrap競合回避 */
.table1 th, .table1 td {
  border-top: 2px solid #dadada;
  border-left: 2px solid #dadada;
}
.table1 th {
  background: #d9d9d9 url(../image/subtitback11.png) center top repeat;
  color: #fff;
  font-weight: normal;
}

/* news.phpのfb-pageをモバイルで幅制限 */
.fb-page, .fb-page span, .fb-page span iframe {
  max-width: 100% !important;
}

/* ============================================================
   フォーム・Facebook iframeの幅補正 (2026年5月追記)
   ============================================================ */

/* フォームページ：bodyc 内の全要素を100%幅に */
.bodyno > .bodyc > div,
.bodyno > .bodyc > form,
.bodyno > .bodyc > div > div {
  max-width: 100%;
  box-sizing: border-box;
}

/* フォームの table を親幅に合わせる */
.bodyno .table-responsive {
  width: 100%;
}

/* Facebook iframe をモバイルで幅いっぱいに */
iframe[title*="Facebook"] {
  width: 100% !important;
  max-width: 100% !important;
}

/* index.phpのニュース・予定表セクションのrow幅修正 */
.bodyno .bodyc > .row {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* ============================================================
   フォームページ専用：bodyc 幅・submenuタイトル中央揃え (2026年5月)
   ============================================================ */

/* submenuimgtit を中央に（contacttit.png等） */
.submenuimgtit {
  text-align: center;
}
.submenuimgtit img {
  max-width: 100%;
  height: auto;
}

/* フォーム専用bodyc：全幅で横スペースなし */
.bodyc--form {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* form-table：親に追従して100%幅 */
.form-table {
  width: 100% !important;
  table-layout: auto;
}

/* form-th：見出し列の幅をモバイルで自動調整 */
.form-th {
  width: 130px;
  white-space: nowrap;
  vertical-align: top;
}

@media screen and (max-width: 600px) {
  .form-th {
    width: auto;
    white-space: normal;
  }
  /* 入力セルを縦積み */
  .form-table tr.top1 th.form-th,
  .form-table tr.top1 td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }
  .form-table tr.top1 th.form-th {
    background-color: #f0f0f0;
    padding: 6px 10px;
  }
  /* テキストエリア */
  .bodyc--form textarea {
    width: 100% !important;
  }
}

/* ============================================================
   980px ブレークポイント追加：テーブル・コンテンツ全幅対応 (2026年5月)
   ============================================================ */

/* ── 980px 以下：コンテンツ幅を 100% に ──────────────────── */
@media screen and (max-width: 980px) {

  /* 基本コンテナ全幅化 */
  #head, .body, .bodyno, #foot {
    min-width: 0;
    width: 100%;
  }
  #headc, #bodyc, .bodyc, #footc, .submenuc,
  #headtop, #headmenu, #topmenu0, #back-top {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding-left: 12px;
    padding-right: 12px;
  }
  #headtop { position: static; }
  #headmenu { position: static; }

  /* テーブル全般：水平スクロール */
  .table1, .underline, table.table1 {
    width: 100% !important;
  }
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Google マップ */
  #map {
    width: 100% !important;
    height: 350px !important;
  }
  #map iframe {
    width: 100% !important;
    height: 100% !important;
  }

  /* company.php のマップ外枠 */
  #map + br { display: none; }

  /* service.php float レイアウト → 縦積み */
  .svc-float-left,
  .svc-float-right,
  .svc-img-left {
    float: none !important;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 0 16px 0 !important;
  }
  .svc-float-left img,
  .svc-float-right img,
  .svc-img-left img {
    max-width: 100%;
    height: auto;
  }

  /* service3.png・service4.jpg・その他コンテンツ画像 */
  .bodyc img, .bodyno img {
    max-width: 100%;
    height: auto;
  }

  /* profile.php ietomachi4.png float解除 */
  .ie-float-img,
  .ie-float-text {
    float: none !important;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 0 12px 0 !important;
  }
  .ie-float-img img {
    max-width: 100%;
    height: auto;
  }

  /* banner 固定幅解除 */
  .banner {
    width: 100% !important;
    height: auto !important;
  }

  /* body/bodyno内のインラインfloat（サービスページ等の汎用） */
  .bodyc [style*="float:left"],
  .bodyc [style*="float: left"],
  .bodyc [style*="float:right"],
  .bodyc [style*="float: right"] {
    /* ※ インラインstyleは !important で上書き（クラス追加できないケース用） */
  }

  /* back-to-top */
  #back-top {
    width: 96% !important;
    right: 2%;
  }
}

/* ── 767px 以下 ───────────────────────────────────────────── */
@media screen and (max-width: 767px) {
  /* Google マップ高さを縮小 */
  #map {
    height: 260px !important;
  }

  /* コンテンツ余白調整 */
  #bodyc, .bodyc {
    padding: 16px 10px !important;
  }

  /* 予定表テーブルのnowrapを解除してモバイルで折り返し */
  .underline td[nowrap],
  .underline th[nowrap] {
    white-space: normal;
  }

  /* フッター */
  #footc {
    padding: 16px 10px !important;
  }
  #footdata {
    font-size: 11px;
    line-height: 1.7;
  }

  /* ナビゲーション画像を縮小 */
  #headtop {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 8px 0;
  }
  #headtop img { max-height: 40px; width: auto; }
}
