/*
Theme Name: 中村ウェルディング
Theme URI: https://www.nakamura-welding.example/
Author: Nakamura Welding
Description: 中村ウェルディング（福岡県大野城市の溶接会社）オリジナルテーマ。鉄・ステンレス・アルミニウム溶接。ネイビー×シルバー＋オレンジアクセント。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: nakamura-welding
*/

/* =================================================
   ベース
   ================================================= */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  color: #16203a;
  background: #f4f6f9;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: #16346a; text-decoration: none; }
a:hover { color: #c25f1c; }
::selection { background: #e0782f; color: #fff; }

/* =================================================
   キーフレーム / スクロール演出
   ================================================= */
@keyframes scrolldot { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(34px); opacity: 0; } }
@keyframes barWipe { 0% { transform: scaleX(0); transform-origin: left; } 48% { transform: scaleX(1); transform-origin: left; } 52% { transform: scaleX(1); transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
@keyframes revealText { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }

[data-anim] { opacity: 0; transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1.05s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
[data-anim="up"] { transform: translateY(36px); }
[data-anim="fade"] { transform: none; }
[data-anim][data-inview] { opacity: 1; transform: none; }
[data-anim="mask"] { opacity: 1; clip-path: inset(0 100% 0 0); transition: clip-path 1.15s cubic-bezier(.76,0,.24,1); }
[data-anim="mask"][data-inview] { clip-path: inset(0 0 0 0); }
[data-anim="mask"] img { transform: scale(1.16); transition: transform 1.5s cubic-bezier(.2,.7,.2,1); }
[data-anim="mask"][data-inview] img { transform: scale(1); }

/* 見出しの黒帯ワイプ */
.nw-reveal { position: relative; display: inline-block; }
.nw-reveal > .nw-reveal-text { opacity: 0; }
.nw-reveal > .nw-reveal-bar { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: #16203a; transform: scaleX(0); transform-origin: left; }
.nw-reveal.is-on > .nw-reveal-text { animation: revealText 1.2s cubic-bezier(.7,0,.2,1) forwards; }
.nw-reveal.is-on > .nw-reveal-bar { animation: barWipe 1.2s cubic-bezier(.7,0,.2,1) forwards; }

@media (prefers-reduced-motion: reduce) {
  [data-anim] { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
  [data-anim] img { transform: none !important; }
  .nw-reveal > .nw-reveal-text { opacity: 1 !important; animation: none !important; }
  .nw-reveal > .nw-reveal-bar { display: none !important; }
}

/* =================================================
   ヘッダー
   ================================================= */
.nw-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(18px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(6,13,30,0.6) 0%, rgba(6,13,30,0.32) 45%, rgba(6,13,30,0) 100%);
  transition: padding .35s ease, background .35s ease;
}
.nw-header.is-scrolled {
  padding: 13px clamp(18px, 4vw, 54px);
  background: rgba(255,255,255,0.97);
}
.nw-logo { display: flex; align-items: center; flex-shrink: 0; }
.nw-logo img { width: auto; transition: height .35s ease; }
.nw-logo-white { height: 42px; }
.nw-logo-color { height: 42px; position: absolute; opacity: 0; }
.nw-header.is-scrolled .nw-logo-white { opacity: 0; position: absolute; }
.nw-header.is-scrolled .nw-logo-color { opacity: 1; position: static; }
.nw-header.is-scrolled .nw-logo-white,
.nw-header.is-scrolled .nw-logo-color { height: 34px; }

.nw-nav { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 26px); }
.nw-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nw-nav-item .en { font-family: 'Cormorant Garamond', serif; font-size: 15px; font-weight: 600; letter-spacing: .14em; color: #eef2f8; }
.nw-nav-item .jp { font-size: 10px; letter-spacing: .16em; color: #9db0cc; }
.nw-header.is-scrolled .nw-nav-item .en { color: #16346a; }
.nw-header.is-scrolled .nw-nav-item .jp { color: #6a7488; }
.nw-nav-item.is-current { border-bottom-color: #f0a860; }
.nw-header.is-scrolled .nw-nav-item.is-current { border-bottom-color: #e0782f; }
.nw-nav-cta { display: flex; align-items: center; margin-left: 8px; padding: 11px 20px; border-radius: 2px; background: linear-gradient(135deg, #2f6bc4, #1c47a0); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .08em; box-shadow: 0 6px 18px rgba(30,80,170,.4); }
.nw-nav-cta:hover { color: #fff; }

.nw-ham { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 46px; height: 46px; padding: 0; border: none; background: transparent; cursor: pointer; }
.nw-ham span { display: block; width: 26px; height: 2px; background: #fff; margin: 0 auto; transition: background .35s ease; }
.nw-header.is-scrolled .nw-ham span { background: #16346a; }
.nw-header.menu-open .nw-ham { display: none; }

/* モバイルオーバーレイ */
.nw-overlay {
  position: fixed; inset: 0; z-index: 110;
  background: linear-gradient(160deg, #0a1730, #0d244c);
  opacity: 0; pointer-events: none; transition: opacity .38s ease;
  display: flex; flex-direction: column; padding: 96px 32px 40px;
}
.nw-overlay.is-open { opacity: 1; pointer-events: auto; }
.nw-overlay-close { position: absolute; z-index: 5; top: 20px; right: clamp(18px,4vw,54px); width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
.nw-overlay-nav { display: flex; flex-direction: column; gap: 2px; transform: translateY(-14px); transition: transform .4s ease; }
.nw-overlay.is-open .nw-overlay-nav { transform: translateY(0); }
.nw-overlay-nav a { display: flex; align-items: baseline; gap: 16px; padding: 16px 6px; border-bottom: 1px solid rgba(255,255,255,.1); }
.nw-overlay-nav a .en { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 600; letter-spacing: .1em; color: #fff; min-width: 120px; }
.nw-overlay-nav a .jp { font-size: 13px; letter-spacing: .14em; color: #9db0cc; }
.nw-overlay-tel { margin-top: auto; display: flex; align-items: center; gap: 10px; color: #fff; font-family: 'Cormorant Garamond', serif; font-size: 26px; letter-spacing: .04em; }

@media (max-width: 979px) {
  .nw-nav { display: none; }
  .nw-ham { display: flex; }
  .nw-logo-white { height: 34px; }
  .nw-logo-color { height: 34px; }
  .nw-header.is-scrolled .nw-logo-white,
  .nw-header.is-scrolled .nw-logo-color { height: 27px; }
}

/* =================================================
   フッター
   ================================================= */
.nw-footer { background: #fff; color: #46516a; padding: clamp(52px,7vw,80px) clamp(20px,6vw,80px) 34px; border-top: 1px solid #e6e9ef; }
.nw-footer-inner { max-width: 1180px; margin: 0 auto; }
.nw-footer-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 0; padding-bottom: clamp(40px,6vw,60px); }
.nw-footer-nav a { padding: 4px clamp(16px,2.4vw,32px); font-size: 14px; color: #28324a; border-left: 1px solid #d9dee6; }
.nw-footer-nav a:first-child { border-left: none; }
.nw-footer-brand { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: clamp(36px,5vw,52px); border-top: 1px solid #e6e9ef; }
.nw-footer-copy { display: flex; justify-content: center; padding-top: 34px; margin-top: 34px; border-top: 1px solid #eef1f5; }
@media (max-width: 979px) { .nw-footer-nav { display: none; } }

/* =================================================
   レイアウトユーティリティ（JS依存だったグリッドをCSS化）
   ================================================= */
.nw-2col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px,4vw,56px); align-items: center; }
@media (max-width: 760px) { .nw-2col { grid-template-columns: 1fr; } }

.nw-svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(3px,0.5vw,7px); }
@media (max-width: 720px) { .nw-svc-grid { grid-template-columns: 1fr; } }

.nw-menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px,2vw,26px); }
@media (max-width: 720px) { .nw-menu-grid { grid-template-columns: 1fr; } }

.nw-ig-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(6px,1vw,12px); }
@media (max-width: 560px) { .nw-ig-grid { grid-template-columns: repeat(3, 1fr); } }

/* PHILOSOPHY / PEOPLE ジグザグ */
.nw-zig { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.nw-zig .nw-zig-photo { aspect-ratio: 3/2; }
@media (max-width: 760px) {
  .nw-zig { grid-template-columns: 1fr; }
  .nw-zig .nw-zig-photo { aspect-ratio: 16/10; }
  .nw-zig--rev .nw-zig-photo { order: 1; }
  .nw-zig--rev .nw-zig-text { order: 0; }
}

/* 事業内容 素材ブロック（画像をモバイルで下へ） */
@media (max-width: 760px) { [data-matimg] { order: 2 !important; } }
/* 求人 強みブロック（画像をモバイルで上へ） */
@media (max-width: 760px) { [data-strimg] { order: -1 !important; } }

/* 対応内容 3カラム */
.nw-cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px,2vw,22px); }
@media (max-width: 960px) { .nw-cap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .nw-cap-grid { grid-template-columns: 1fr; } }

/* 設備 グリッド（2列） */
.nw-fac-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px,2.2vw,28px); }
@media (max-width: 620px) { .nw-fac-grid { grid-template-columns: 1fr; } }

/* 会社概要 定義リスト */
.nw-dl-row { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 18px 6px; border-bottom: 1px solid #e3e7ee; }
@media (max-width: 560px) { .nw-dl-row { grid-template-columns: 1fr; gap: 4px; } }

/* 会社案内メッセージ */
.nw-msg-grid { display: grid; grid-template-columns: minmax(0,0.8fr) minmax(0,1.2fr); gap: clamp(28px,5vw,64px); align-items: center; }
@media (max-width: 760px) { .nw-msg-grid { grid-template-columns: 1fr; } }

/* 加工実績 before/after */
.nw-ba { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .nw-ba { grid-template-columns: 1fr; } }

/* 求人 仕事内容 / 募集カード */
.nw-job-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px,2vw,22px); }
@media (max-width: 640px) { .nw-job-grid { grid-template-columns: 1fr; } }
.nw-pos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(18px,2.4vw,26px); }
@media (max-width: 760px) { .nw-pos-grid { grid-template-columns: 1fr; } }
.nw-pos-row { display: grid; grid-template-columns: 84px 1fr; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid #f0f2f6; }
@media (max-width: 400px) { .nw-pos-row { grid-template-columns: 1fr; } }

/* お問い合わせ */
.nw-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 560px) { .nw-form-2col { grid-template-columns: 1fr; } }
.nw-map-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px,4vw,48px); align-items: center; }
@media (max-width: 760px) { .nw-map-grid { grid-template-columns: 1fr; } }

/* フォーム入力 */
.nw-form input, .nw-form textarea, .nw-form select { font-family: inherit; font-size: 15px; color: #16203a; }
.nw-form input:focus, .nw-form textarea:focus, .nw-form select:focus { outline: none; border-color: #e0782f !important; box-shadow: 0 0 0 3px rgba(224,120,47,.14); }
.nw-form input::placeholder, .nw-form textarea::placeholder { color: #aab2c0; }

/* Contact Form 7 対応 */
.nw-form .wpcf7-form { display: flex; flex-direction: column; gap: 20px; }
.nw-form .wpcf7-form p { margin: 0; }
.nw-form label { display: block; font-size: 13px; font-weight: 700; color: #16346a; letter-spacing: .04em; margin-bottom: 8px; }
.nw-form label span.req { color: #c0392b; font-size: 11px; font-weight: 700; margin-left: 4px; }
.nw-form .wpcf7-form-control-wrap { display: block; }
.nw-form input.wpcf7-form-control,
.nw-form textarea.wpcf7-form-control,
.nw-form select.wpcf7-form-control {
  width: 100%; padding: 13px 15px; border: 1px solid #d6dce5; border-radius: 2px; background: #fbfcfe;
}
.nw-form textarea.wpcf7-form-control { resize: vertical; line-height: 1.8; }
.nw-form .wpcf7-list-item { margin-left: 0; margin-right: 16px; }
.nw-form input.wpcf7-submit {
  display: inline-block; margin: 6px auto 0; padding: 16px 56px;
  background: linear-gradient(135deg, #2f6bc4, #1c47a0); color: #fff;
  font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .1em;
  border: none; border-radius: 2px; cursor: pointer; box-shadow: 0 10px 24px rgba(30,80,170,.28);
}
.nw-form .wpcf7-submit-wrap, .nw-form p:has(> .wpcf7-submit) { text-align: center; }
.nw-form .wpcf7-not-valid-tip { color: #c0392b; font-size: 12px; margin-top: 6px; }
.nw-form .wpcf7-response-output { margin: 8px 0 0 !important; border-radius: 2px; font-size: 13px; }
.nw-form .wpcf7 .wpcf7-spinner { margin: 0 8px; }

/* CF7 インラインフォーム用（class:nwf / class:nwf-submit） */
.nw-form input.nwf, .nw-form textarea.nwf, .nw-form select.nwf {
  width: 100%; padding: 13px 15px; border: 1px solid #d6dce5; border-radius: 2px; background: #fbfcfe;
  font-family: inherit; font-size: 15px; color: #16203a;
}
.nw-form textarea.nwf { min-height: 180px; resize: vertical; line-height: 1.8; }
.nw-form input.nwf:focus, .nw-form textarea.nwf:focus, .nw-form select.nwf:focus {
  outline: none; border-color: #e0782f; box-shadow: 0 0 0 3px rgba(224,120,47,.14);
}
.nw-form input.nwf::placeholder, .nw-form textarea.nwf::placeholder { color: #aab2c0; }
.nw-form input.nwf-submit {
  display: inline-block; padding: 16px 56px;
  background: linear-gradient(135deg, #2f6bc4, #1c47a0); color: #fff;
  font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .1em;
  border: none; border-radius: 2px; cursor: pointer; box-shadow: 0 10px 24px rgba(30,80,170,.28);
}
.nw-form input.nwf-submit:hover { opacity: .94; }

/* モバイル：中央寄せテキストを左寄せに */
@media (max-width: 640px) {
  .nw-center-sp { text-align: left !important; }
  [data-anim="mask"] { margin-top: 30px; }
}

/* WordPress 本文（single） */
.nw-entry { font-size: 15px; line-height: 2.05; color: #46516a; }
.nw-entry h2 { font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 900; font-size: 22px; color: #16203a; margin: 40px 0 16px; }
.nw-entry h3 { font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 700; font-size: 18px; color: #16203a; margin: 32px 0 12px; }
.nw-entry img { margin: 20px 0; }
.nw-entry p { margin: 0 0 18px; }

/* ページネーション */
.nw-pager { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: clamp(36px,5vw,52px); }
.nw-pager .page-numbers { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid #d6dce5; color: #46516a; font-family: 'Cormorant Garamond', serif; font-size: 15px; }
.nw-pager .page-numbers.current { background: #16346a; color: #fff; border-color: #16346a; }
.nw-pager .page-numbers.dots { border: none; }
