/* =========================================================
   竹内マシン 共通スタイル（Bootstrap 5 上書き用）
   - 配色: 黒×白ベース。ボタンとフッターは黒。
   - フォント: Noto Sans JP
   - 全ページ共通で読み込む
   ========================================================= */

:root {
  --tm-black: #111111;
  --tm-text: #222222;
  --tm-gray: #666666;
  --tm-line: #dddddd;
  --tm-bg-soft: #f1f1f1;
}

body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tm-text);
  line-height: 1.9;
  /* fixed-top navbar の高さ分、本文を下げる */
  padding-top: 64px;
}

.container { max-width: 1120px; }

img { max-width: 100%; height: auto; }

.text-18{font-size: 1.125rem!important;}
.text-20{font-size: 1.25rem!important;}
.text-26{font-size: 1.625rem!important;}
.text-34{font-size: 2.125rem!important;}
.text-38{font-size: 2.375rem!important;}

/* ===== ヘッダー / ナビ ===== */
.tm-navbar {
  background-color: rgba(17, 17, 17, 0.92);
  min-height: 64px;
  transition: background-color .25s ease, box-shadow .25s ease;
}
.tm-navbar .navbar-brand img { max-width: 253px; height: auto; }
.tm-footer-info img { max-width: 253px; height: auto; }
.tm-iso img { max-width: 345px; height: auto; }

.tm-navbar .tm-brand-text {
  font-weight: 900;
  letter-spacing: .08em;
  margin-left: .4rem;
}
.tm-navbar .nav-link {
  font-size: 1.125rem;
  font-weight: 500;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}
.tm-navbar .nav-link:hover { opacity: .7; }

/* ===== ヒーロー ===== */
.tm-hero {
  position: relative;
  min-height: 420px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}
.tm-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  animation: tmHeroOverlayFade 2s ease forwards;
}
@keyframes tmHeroOverlayFade {
  to { opacity: 1; }
}
.tm-hero__inner { position: relative; z-index: 1; padding: 4rem 0; opacity: 0; animation: tmHeroTextFade 1s ease 1.5s forwards; }
@keyframes tmHeroTextFade {
  to { opacity: 1; }
}
.tm-hero__catch {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .15em;
  margin-bottom: .5rem;
}
.tm-hero__title img{
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 132px;
}
/* 320〜992px は幅70%（height:autoで比率維持）、992px超は従来どおり max-height:132px */
@media (min-width: 320px) and (max-width: 992px) {
  .tm-hero__title img {
    width: 70%;
    height: auto;
    max-width: 70%;
    max-height: none;
  }
}
.tm-hero__title {
  font-size: clamp(2.25rem, 9vw, 4.5rem);
}


/* 下層ページ用の小さめヒーロー（works/about/recruit で利用）
   英語大見出し＋日本語サブを中央に置く */
.tm-page-hero { min-height: 320px; }
.tm-page-hero .tm-hero__title { letter-spacing: .18em; }
.tm-page-hero__sub {
  font-size: 1.75rem;
  letter-spacing: .2em;
  margin-top: .25rem;
}

/* ===== セクション共通 ===== */
.tm-section { padding: 4.5rem 0; }
.tm-section.pt-0 { padding-top: 0; }

.tm-lead {
  font-weight: 700;
  line-height: 1.8;
  white-space: nowrap;
}

/* 角括弧見出し（［ 募集要項 ］のような中央見出し） */
.tm-bracket-title {
  text-align: center;
  font-size: clamp(1.3rem, 3.2vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
}

/* ===== 画像ブロック ===== */
.tm-grid-img { aspect-ratio: 3 / 2; object-fit: cover; }
.tm-block-title {
  font-size: 1.325rem;
  font-weight: 700;
  line-height: 1.8;
}
.tm-block-text { font-size: 1.125rem; margin-top: 1rem; }

/* ===== ボタン（黒の塗り） ===== */
.tm-btn {
  display: inline-block;
  background-color: var(--tm-black);
  color: #fff;
  border: 1px solid var(--tm-black);
  border-radius: 0;
  padding: .7rem 5rem;
  font-weight: 500;
  letter-spacing: .1em;
  font-size: 1.5rem;
}
.tm-btn:hover { background-color: #444; color: #fff; }

/* ===== お問い合わせフォーム ===== */
.tm-contact-h { font-weight: 700; margin-bottom: .75rem; }
.tm-note { font-size: 1rem; color: var(--tm-gray); }
.tm-req { color: #d00; font-weight: 700; }
.tm-form .form-label { font-weight: 500; background: var(--tm-bg-soft); padding: .4rem .75rem; }
.tm-form .form-control { border-radius: 0; }

/* ===== テーブル（募集要項・設備一覧・会社概要で利用） ===== */
.tm-table { width: 100%; border-collapse: collapse; }
.tm-table th,
.tm-table td {
  border: 1px solid var(--tm-line);
  padding: .9rem 1rem;
  vertical-align: top;
  font-size: 1.125rem;
}
.tm-table th {
  background: var(--tm-bg-soft);
  font-weight: 500;
  white-space: nowrap;
  width: 12rem;
}

/* ===== フッター ===== */
.tm-footer { background: #f2f2f2; padding-top: 7rem; margin-top: 5rem;}
.tm-footer-cards { margin-bottom: 4rem; }
.tm-card:hover { opacity: 0.8;}

.tm-footer-info { color: var(--tm-text); }
.tm-iso img { margin: 0 .5rem; }

.tm-footer-bottom {
  background: #fff;
  color: #000;
  margin-top: 3rem;
  padding: 1rem 0;
}
.tm-footer-nav a {
  color: #000;
  text-decoration: none;
  font-size: 1.125rem;
  margin: 0 .75rem;
}
.tm-footer-nav a:hover { opacity: .7; }
.tm-copy { background-color: #000; color: #fff; font-size: 1.125rem; overflow: hidden; }

/* ===== レスポンシブ ===== */
@media (max-width: 575.98px) {
  .tm-section { padding: 3rem 0; }
  .tm-btn { padding: .7rem 2rem; }
  .tm-footer-nav a { display: inline-block; margin: .25rem .5rem; }
  /* スマホ幅では tm-lead の大きめフォントが手動<br>位置より先でコンテナ幅を超えるため、折り返しを許可 */
  .tm-lead { white-space: normal; }

  /* フッターの画像メニューを1列に（通常は2×2） */
  .tm-footer-cards > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .tm-card { height: 130px; } /* 1列化で幅が広がる分、高さ調整 */

  /* 強制改行 <br> が原因で最後の1文字だけ次行に落ちるため、スマホ幅は自然折り返しに
     （index.html の tm-recruit-lead だけは下部で個別に改行を復活させる） */
  .tm-block-title br { display: none; }

  /* 本文が18pxのため、見出し類はそれより小さくしない。
     34px系（about.html）→20px、26px系（recruit/works）→本文と同じ18pxに統一。
     px指定で確定値にし、text-38 と組み合わさる箇所（次の .text-38 ルール）とは
     別クラスの組み合わせなので競合しない。 */
  .tm-block-title.text-34 { font-size: 20px !important; }
  .tm-lead.text-26 { font-size: 18px !important; }
  .tm-block-title.text-26 { font-size: 18px !important; }
  .tm-block-text.text-26 { font-size: 18px !important; }

  /* text-38 を縮小（ベース定義が !important のため上書きにも !important が必要） */
  .text-38 { font-size: 21px !important; }

  /* index.html「未経験の方、資格がない方でも大歓迎！」だけ孤立文字が出るため、
     明示的に改行位置を指定し直す。.text-38 より後ろに置いて優先させる。 */
  .tm-recruit-lead { font-size: 19px !important; } /* 値は要調整。1行に収まる大きさで */
  /* .tm-block-title br（0,1,1）より詳細度が低いため !important で確実に上書き */
  .tm-recruit-lead__br { display: inline !important; } /* 上の .tm-block-title br 非表示をこの1箇所だけ解除 */

  /* お問い合わせフォーム（#contact の table）をラベル上・入力欄下の縦積みに */
  #contact .tm-table,
  #contact .tm-table tbody,
  #contact .tm-table tr { display: block; width: 100%; }
  #contact .tm-table th,
  #contact .tm-table td { display: block; width: 100%; white-space: normal; border: none; }
  #contact .tm-table tr { margin-bottom: .75rem; border: 1px solid var(--tm-line); }

  /* 募集要項・企業情報の表（tm-table--kv）を縦積みに。設備一覧(4列)には付与しないため対象外 */
  .tm-table--kv,
  .tm-table--kv tbody,
  .tm-table--kv tr { display: block; width: 100%; }
  .tm-table--kv th,
  .tm-table--kv td { display: block; width: 100%; white-space: normal; border: none; }
  .tm-table--kv tr { margin-bottom: .75rem; border: 1px solid var(--tm-line); }

  /* EQUIPMENTS 設備一覧テーブルの文字サイズを縮小（#equipment 内のみ） */
  #equipment .tm-table th,
  #equipment .tm-table td { font-size: 16px; }

  /* Copyright の文字を小さく */
  .tm-copy { font-size: 0.8rem; }
}

/* アクセシビリティ: フォーカスを見える化、モーション抑制 */
a:focus-visible,
button:focus-visible,
.form-control:focus-visible {
  outline: 2px solid #0a58ca;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .tm-hero__overlay { opacity: 1; animation: none; }
  .tm-hero__inner   { opacity: 1; animation: none; }
}

/* === レイアウト修正パッチ === */

/* フッターカードが2×2で横幅が広がる分、高さを調整 */
.tm-card { height: 160px; }

/* ヒーロー高さを全ページ共通に */
.tm-hero,
.tm-page-hero { min-height: clamp(540px, 65vh, 680px); }
@media (min-width: 992px) {
  .tm-hero,
  .tm-page-hero { min-height: 880px; }
}
/* EQUIPMENTS の小さめヒーロー（works.html内）は個別指定を維持 */

/* スマホ幅で about.html のヒーローだけ低くする（猫写真基準）。他ページは
   従来どおり上の clamp(540px, 65vh, 680px) のまま。
   上の clamp(540px, 65vh, 680px) より後ろに置いて確実に上書きする。
   この幅×高さでは background-size:cover が「高さ基準」で拡大されるため、
   実際に切れるのは左右（横方向）で、background-position の縦%は効果がない。
   縦を下げるほど横のクロップ量は増えるため、about.html の2匹の猫が両方見える
   下限（実測 ~248px）を目安に 240px を採用。 */
@media (max-width: 575.98px) {
  .page-about .tm-hero,
  .page-about .tm-page-hero { min-height: 240px; }
}

/* === 画像グリッド：セクション別 aspect-ratio 修正 === */

/* 製品写真（白背景・縦横不定）→ 正方形に収める */
.tm-grid-img--sq {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: transparent;
}

/* 工場・作業シーン（横長写真）→ 4:3 カバー */
.tm-grid-img--wide {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* 猫ポートレート（縦長）→ 3:4 カバー、顔が上なので top 寄せ */
.tm-grid-img--port {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
}

/* === ヘッダー2モード === */
/* 下層ページ（既定）: 白背景・黒文字 */
.tm-navbar { background-color: #fff; }
.tm-navbar .navbar-nav .nav-link { color: #111 !important; }
.tm-navbar .nav-link:hover { opacity: .6; }
.tm-navbar .navbar-nav .nav-link.active { color: #999 !important; }

/* トップページ: 透過・白文字・ヒーロー背面回り込み */
body.is-home { padding-top: 0; }
body.is-home .tm-navbar { background-color: transparent; }
body.is-home .tm-navbar .navbar-nav .nav-link { color: #fff !important; }

/* トップ: スクロール後は白背景・黒文字に */
body.is-home.is-scrolled .tm-navbar {
  background-color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}
body.is-home.is-scrolled .tm-navbar .navbar-brand,
body.is-home.is-scrolled .tm-navbar .nav-link {
  color: #111 !important;
}
/* スクロール後はモバイルのハンバーガーアイコンも濃色に */
body.is-home.is-scrolled .tm-navbar .navbar-toggler { filter: invert(1); }

/* === h2見出し画像（高さ基準で統一・1ルールで全対応） === */
.tm-bracket-title img {
  height: clamp(1.7rem, 4.2vw, 2.4rem);
  width: auto;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
}
/* lg以上(≥992px)は60px固定 */
@media (min-width: 992px) {
  .tm-bracket-title img { height: 60px; }
}
/* アイドル猫のみ肉球込みで縦長 → 専用クラスで高めに */
.tm-bracket-title img.tm-h2-tall {
  height: clamp(3.6rem, 8.5vw, 5.4rem);
}
@media (min-width: 992px) {
  .tm-bracket-title img.tm-h2-tall { height: 180px; }
}

/* === 加工事例ラベル画像（切削加工・ワイヤー放電・溶接） === */
.tm-h3-img {
  height: clamp(1.4rem, 3.2vw, 1.9rem);
  width: auto;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
  margin-top: 2rem;
}
@media (min-width: 992px) {
  .tm-h3-img { height: 40px; }
}