/*
Theme Name: KNS Corporate
Theme URI: https://kns.company/
Author: KNS / Claude
Description: 株式会社KNS 向けのカスタム法人テーマ。多言語ソリューション製品を紹介するコーポレートサイト用。
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: kns-corporate
*/

/* =========================================================
   KNS Corporate Theme - メインスタイル
   ※色やサイズはこのファイルの上部「変数」で一括変更できます
   ========================================================= */

:root {
  --color-navy:    #0a2540;   /* メインの濃紺 */
  --color-blue:    #1e6fd0;   /* アクセントの青 */
  --color-cyan:    #00b8d4;   /* 差し色のシアン */
  --color-bg:      #ffffff;
  --color-bg-soft: #f5f8fc;
  --color-text:    #1f2933;
  --color-muted:   #5b6776;
  --color-border:  #e3e9f0;
  --radius:        14px;
  --shadow:        0 10px 30px rgba(10, 37, 64, 0.08);
  --maxw:          1120px;
  --font: "Noto Sans JP", -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--color-blue); color: #fff; box-shadow: 0 8px 20px rgba(30,111,208,.35); }
.btn-primary:hover { background: #1a5fb4; color:#fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color:#fff; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

/* ログイン中の管理バー（上部32px）の下で止まるようにし、ロゴの欠けを防ぐ */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 10px 0;
}
.site-logo { flex-shrink: 0; }   /* ロゴは縮めない（欠け防止） */
.site-logo { font-size: 22px; font-weight: 800; color: var(--color-navy); letter-spacing: .04em; }
.site-logo span { color: var(--color-blue); }
.site-logo a { color: inherit; display: flex; align-items: center; gap: 12px; }
.site-logo a:hover { text-decoration: none; }
.site-logo .logo-mark { height: 52px; width: auto; display: block; }
.site-logo .logo-text { font-size: 26px; font-weight: 800; color: var(--color-navy); letter-spacing: .02em; }
.site-logo img { height: 52px; width: auto; }

.header-contact { display: flex; gap: 16px; font-size: 13px; color: var(--color-navy); font-weight: 600; white-space: nowrap; }
.header-contact a { color: var(--color-navy); }

/* PCでは中身（TEL/FAX・メニュー）をそのまま横並びに、スマホでは開閉パネルに */
.header-nav-wrap { display: contents; }

/* スマホ用メニューボタン（ハンバーガー）。PCでは非表示 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 11px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--color-navy);
  transition: transform .25s ease, opacity .25s ease;
}
/* 開いたときに「×」に変形 */
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.main-nav ul {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.main-nav a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 15px;
  padding: 6px 0;
}
.main-nav a:hover { color: var(--color-blue); text-decoration: none; }

/* ---------- ヒーロー（写真バナー＋下に青帯） ---------- */
.hero { background-color: var(--color-navy); color: #fff; }

/* 写真バナー部分（PCは細い横長） */
.hero-media {
  position: relative;
  aspect-ratio: 16 / 5;
  overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slides .slide { background-size: cover; background-position: center; }
.hero-slides .slide::after { display: none; }
/* 写真の下側を少し暗くしてボタンを見やすく */
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(0,0,0,.42), rgba(0,0,0,0) 38%);
  pointer-events: none;
}

/* ボタンは写真の右下に配置 */
.hero-actions {
  position: absolute;
  right: clamp(20px, 4vw, 56px);
  bottom: 20px;
  z-index: 3;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn-on-photo { background: rgba(10,37,64,.4); }
.btn-on-photo:hover { background: rgba(10,37,64,.6); color: #fff; }

/* 下の青帯：見出し（1行）＋小文字 */
.hero-band {
  background: linear-gradient(120deg, var(--color-navy), var(--color-blue));
  padding: 28px 0 30px;
}
.hero-band .hero-badge { margin-bottom: 12px; }
.hero-band h1 {
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1.4;
  font-weight: 800;
  margin: 0;
  color: #fff;
}
.hero-band p {
  font-size: clamp(14px, 1.4vw, 16px);
  color: rgba(255,255,255,.85);
  margin: 10px 0 0;
}

/* 2カラム：左テキスト / 右スライド */
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-grid .hero h1, .hero-copy h1 { margin-top: 0; }

/* ---------- スライドショー（コンパクト） ---------- */
.slideshow {
  position: relative;
  width: 100%;
  max-width: 460px;          /* 大きくなりすぎないよう上限 */
  margin-left: auto;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
}
.slides { position: absolute; inset: 0; }
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,37,64,.65), rgba(10,37,64,0) 60%);
}
.slide-caption { position: relative; z-index: 2; padding: 20px 22px; color: #fff; }
.slide-caption h3 { margin: 0 0 2px; font-size: 18px; }
.slide-caption span { font-size: 13px; opacity: .9; }

.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  color: var(--color-navy);
  font-size: 14px;
  cursor: pointer;
  display: grid; place-items: center;
  z-index: 3;
  transition: background .15s;
}
.slide-arrow:hover { background: #fff; }
.slide-prev { left: 10px; }
.slide-next { right: 10px; }

.slide-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}
.slide-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  padding: 0;
  transition: background .15s, width .15s;
}
.slide-dot.is-active { background: #fff; width: 20px; border-radius: 4px; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  margin-bottom: 22px;
}

/* ---------- セクション共通 ---------- */
.section { padding: 88px 0; }
.section-soft { background: var(--color-bg-soft); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-head .eyebrow { color: var(--color-blue); font-weight: 700; letter-spacing: .12em; font-size: 13px; text-transform: uppercase; }
.section-head h2 { font-size: clamp(24px, 4vw, 34px); margin: 10px 0 14px; color: var(--color-navy); }
.section-head p { color: var(--color-muted); margin: 0; }

/* ---------- 製品カード ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 26px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--color-blue); }
.product-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--color-blue), var(--color-cyan));
  margin-bottom: 20px;
}
.product-icon svg { width: 28px; height: 28px; stroke: #fff; }
.product-card h3 { font-size: 18px; margin: 0 0 10px; color: var(--color-navy); }
.product-card p { font-size: 14px; color: var(--color-muted); margin: 0; }

/* ---------- 強み ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.feature-item { text-align: center; }
.feature-num { font-size: 40px; font-weight: 800; color: var(--color-blue); line-height: 1; }
.feature-item h3 { color: var(--color-navy); margin: 14px 0 8px; font-size: 18px; }
.feature-item p { color: var(--color-muted); font-size: 14px; margin: 0; }

/* ---------- CTA 帯 ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--color-navy), var(--color-blue));
  color: #fff;
  border-radius: 20px;
  padding: 56px;
  text-align: center;
}
.cta-band h2 { font-size: clamp(22px, 3.5vw, 30px); margin: 0 0 12px; }
.cta-band p { opacity: .9; margin: 0 0 28px; }

/* ---------- フッター ---------- */
.site-footer { background: var(--color-navy); color: #cdd7e3; padding: 56px 0 28px; margin-top: 0; }
.footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.footer-brand .site-logo { color: #fff; }
.footer-brand p { color: #93a3b8; font-size: 14px; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 14px; margin: 0 0 14px; letter-spacing: .05em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #cdd7e3; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px; padding-top: 20px; text-align: center; font-size: 13px; color: #7d8da4; }

/* ---------- BGM プレーヤー（右下に小さく固定） ---------- */
.bgm-player { position: fixed; right: 18px; bottom: 18px; z-index: 60; }
#kns-bgm-toggle {
  border: none;
  background: var(--color-navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(10,37,64,.3);
}
#kns-bgm-toggle:hover { background: var(--color-blue); }
#kns-bgm-toggle .bgm-icon-pause { display: none; }
#kns-bgm-toggle[data-state="playing"] .bgm-icon-play { display: none; }
#kns-bgm-toggle[data-state="playing"] .bgm-icon-pause { display: inline; }

/* ---------- 一覧カード（製品・活用シーン） ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}
.info-card {
  display: block;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.18);   /* 未選択時：薄い黒で枠を見せる */
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
a.info-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--color-blue); text-decoration: none; }
.info-thumb {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--color-bg-soft);
}
.info-thumb--ph { background: linear-gradient(135deg, var(--color-blue), var(--color-cyan)); }

/* アイコン版カード（写真の代わりにアイコンを表示） */
.info-card--icon .info-body { padding-top: 30px; }
.info-card--icon .product-icon { margin-bottom: 18px; }

.info-body { padding: 22px 24px 26px; }
.info-body h3 { margin: 0 0 10px; font-size: 18px; color: var(--color-navy); }
.info-body p { margin: 0; font-size: 14px; color: var(--color-muted); }
.info-more { display: inline-block; margin-top: 14px; color: var(--color-blue); font-weight: 700; font-size: 14px; }

/* 戻るボタンの並び */
.back-row { display: flex; gap: 14px; justify-content: center; margin-top: 56px; flex-wrap: wrap; }
/* 詳細・固定・一覧ページ：ボタンの下に余白を入れてフッター/タスクバーと離す */
.single-kns_product .back-row,
.single-kns_usecase .back-row,
.page .back-row,
.post-type-archive .back-row { margin-bottom: 72px; }
.btn-ghost-dark { color: var(--color-navy); border-color: var(--color-border); }
.btn-ghost-dark:hover { background: var(--color-bg-soft); color: var(--color-navy); }

/* ---------- お問い合わせフォーム（Contact Form 7） ---------- */
.wpcf7 { max-width: 640px; }
.wpcf7-form label {
  display: block;
  font-weight: 700;
  color: var(--color-navy);
  font-size: 14px;
  margin-bottom: 20px;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.28);   /* 未選択時：薄い黒で枠を見せる */
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(30,111,208,.15);
}
.wpcf7-form textarea { min-height: 160px; resize: vertical; }
.wpcf7-form .wpcf7-submit {
  display: inline-block;
  margin-top: 8px;
  padding: 14px 40px;
  border: none;
  border-radius: 999px;
  background: var(--color-blue);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30,111,208,.35);
  transition: transform .15s ease, background .15s ease;
}
.wpcf7-form .wpcf7-submit:hover { background: #1a5fb4; transform: translateY(-2px); }
.wpcf7-not-valid-tip { color: #d33; font-size: 13px; }
.wpcf7-response-output {
  margin: 18px 0 0 !important;
  padding: 14px 16px !important;
  border-radius: 10px;
  font-size: 14px;
}

/* ---------- サンプル（プレースホルダー）表示 ---------- */
.doc-placeholder {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-soft);
  padding: 56px 32px;
  text-align: center;
  color: var(--color-muted);
}
.doc-placeholder-icon { font-size: 48px; line-height: 1; margin-bottom: 12px; }
.doc-placeholder h2 { color: var(--color-navy); margin: 0 0 12px; }
.doc-placeholder p { margin: 0 0 8px; }
.doc-placeholder-note { font-size: 13px; margin-top: 18px; color: var(--color-muted); }

/* ---------- ページ本文（固定ページ・投稿用） ---------- */
.page-hero {
  /* TOPヒーローと同じ色味（写真なしのグラデーション） */
  background-color: var(--color-navy);
  background-image:
    linear-gradient(120deg, rgba(10,37,64,.92), rgba(30,111,208,.85)),
    radial-gradient(circle at 80% 20%, rgba(0,184,212,.4), transparent 50%);
  padding: 64px 0;
}
.page-hero h1 { margin: 0; color: #fff; font-size: clamp(24px, 4vw, 34px); }
.page-hero-sub { margin: 12px 0 0; color: rgba(255,255,255,.85); }
.entry-content { padding: 64px 0; max-width: 860px; margin: 0 auto; }
.entry-content h2 { color: var(--color-navy); }
.detail-figure { margin: 0 0 32px; border-radius: var(--radius); overflow: hidden; }
.detail-figure img { width: 100%; }

/* ブロックの「幅広」「全幅」表示（画像などを大きく見せる） */
.entry-content .alignwide {
  width: min(1100px, calc(100vw - 48px));
  max-width: min(1100px, calc(100vw - 48px));
  margin-left: 50%;
  transform: translateX(-50%);
}
.entry-content .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.entry-content .alignwide img,
.entry-content .alignfull img { width: 100%; height: auto; display: block; }
.entry-content .alignfull img { border-radius: 0; }

/* 製品・活用シーンの詳細：画像を自動で大きく固定表示（ブロック操作なしでOK）
   ※「全幅」を選べば、さらに画面の端まで広がります */
.entry-content.detail .wp-block-image:not(.alignleft):not(.alignright):not(.alignwide):not(.alignfull) {
  width: min(1320px, calc(100vw - 40px)) !important;
  max-width: min(1320px, calc(100vw - 40px)) !important;
  margin-left: 50% !important;
  transform: translateX(-50%);
}
.entry-content.detail .wp-block-image img { width: 100%; height: auto; }

/* 動画（YouTube等）を16:9で画面幅に合わせる */
.entry-content.detail iframe,
.entry-content.detail video { max-width: 100%; }
.entry-content .wp-block-embed__wrapper { position: relative; }
.entry-content .wp-block-embed.is-type-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: var(--radius);
  display: block;
}
/* アップロードした動画ファイル(mp4等)も画面幅に合わせる */
.entry-content .wp-block-video { margin: 24px 0; }
.entry-content .wp-block-video video,
.entry-content video {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}

/* 詳細ページの動画・埋め込みは、はみ出さずに中央へ大きく表示
   （「全幅」にしても横スクロールバーが出ないよう安全な幅に統一） */
.entry-content.detail .wp-block-video,
.entry-content.detail .wp-block-embed {
  width: min(1320px, calc(100vw - 40px)) !important;
  max-width: min(1320px, calc(100vw - 40px)) !important;
  margin-left: 50% !important;
  margin-right: 0 !important;
  transform: translateX(-50%);
}
.entry-content.detail .wp-block-video video { width: 100%; height: auto; }

/* PDF（ファイルブロック）を見やすく */
.entry-content .wp-block-file {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 24px 0;
}
.entry-content .wp-block-file__embed {
  width: 100%;
  height: 70vh;
  border-radius: 8px;
  margin-bottom: 14px;
}
.entry-content .wp-block-file .wp-block-file__button {
  background: var(--color-blue);
  border-radius: 999px;
  padding: 8px 22px;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .slideshow { max-width: 100%; margin: 0 auto; }

  /* ハンバーガーボタンを表示 */
  .nav-toggle { display: flex; }

  /* ロゴは少し小さく */
  .site-logo .logo-mark,
  .site-logo img { height: 44px; }
  .site-logo .logo-text { font-size: 21px; }

  /* メニュー＋連絡先を、ヘッダー下に開く開閉パネルに */
  .header-nav-wrap {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 14px 26px rgba(10, 37, 64, 0.12);
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s ease;
  }
  .site-header.nav-open .header-nav-wrap {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  /* メニュー項目を縦並びに */
  .main-nav { order: 1; width: 100%; }
  .main-nav ul { flex-direction: column; gap: 0; align-items: stretch; }
  .main-nav li { border-top: 1px solid var(--color-border); }
  .main-nav li:first-child { border-top: none; }
  .main-nav a {
    display: block;
    padding: 16px 24px;
    font-size: 16px;
  }

  /* 連絡先はメニューの下に */
  .header-contact {
    order: 2;
    flex-direction: column;
    gap: 4px;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-soft);
    white-space: normal;
  }
}
/* スマホ：写真バナーを少し縦長（5:2）に、ボタンは写真右下に小さめで */
@media (max-width: 700px) {
  .hero-media { aspect-ratio: 5 / 2; }
  .hero-actions { right: 12px; bottom: 12px; gap: 8px; }
  .hero-actions .btn { padding: 9px 16px; font-size: 13px; }
  .hero-band { padding: 22px 0 26px; }
  .hero-band h1 { font-size: clamp(20px, 5.5vw, 26px); }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 24px; }
  .section { padding: 60px 0; }
  .page-hero { padding: 48px 0; }
  .container { padding: 0 18px; }
  .site-logo .logo-text { font-size: 19px; }
  .back-row { gap: 10px; }
  .back-row .btn { width: 100%; text-align: center; }
}
