/* =========================================
   サイト共通スタイル（手書き）
   -----------------------------------------
   【MT.net】サイトのインデックステンプレート
   出力ファイル名: custom.css
   ※MT側が正。このローカルファイルは参照用コピー。
   ※style.css（Tailwind生成分）の後に読み込むこと。
   ========================================= */

/* =========================================
   1. ベーススタイル・リセット・CMS（Prose）
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; width: 100%; overflow-x: hidden; }
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 2.2; -webkit-font-smoothing: antialiased; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
h1, h2, h3, h4, h5, h6 { line-height: 1.6 !important; }

/* グレー文字を黒に統一 */
.text-gray-400 { color: #4b5563 !important; }
.text-gray-500 { color: #111827 !important; }
.text-gray-600 { color: #111827 !important; }
.text-gray-700 { color: #111827 !important; }

/* Prose (CMSコンテンツ用) */
.prose {
  /* TOPページの本文は .text-gray-600/700 が #111827 に上書きされているため、
     記事本文も同じ色にして濃さを揃える。 */
  color: #111827;
  line-height: 1.7;
}
.prose h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #111827;
}
.prose h2 {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0156B3;
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #A9CCEB;
}
.prose h3 {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.prose p {
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.prose blockquote {
  border-left: 4px solid #d1d5db;
  padding-left: 1.25rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  margin: 0 0 1rem 0;
  color: #6b7280;
  font-style: italic;
}
.prose blockquote p { margin-bottom: 0; }
.prose code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, monospace;
  font-size: 0.875em;
  color: #e11d48;
}
.prose pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.prose pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}
.prose a { color: #3b82f6; text-decoration: underline; }
.prose a:hover { color: #2563eb; }
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 2rem 0;
}
.prose hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.5rem 0;
}
.prose strong { font-weight: 600; color: #111827; }
.prose em { font-style: italic; }
.prose u { text-decoration: underline; }
.prose s { text-decoration: line-through; }

/* Tiptap text alignment support */
.prose [style*="text-align: center"],
.prose [style*="text-align:center"] {
  text-align: center !important;
}
.prose [style*="text-align: right"],
.prose [style*="text-align:right"] {
  text-align: right !important;
}
.prose [style*="text-align: justify"],
.prose [style*="text-align:justify"] {
  text-align: justify !important;
}


/* =========================================
   3. エディタ用のシステムスタイル
   ========================================= */
.selector-hover { outline: 2px solid rgba(59, 130, 246, 0.5) !important; outline-offset: -2px !important; cursor: pointer !important; }
.selector-selected { outline: 2px solid #ff7500 !important; outline-offset: -2px !important; box-shadow: inset 0 0 0 1000px rgba(255, 117, 0, 0.25) !important; }
img.selector-hover { filter: brightness(0.95) !important; }
img.selector-selected { filter: brightness(0.8) sepia(0.4) hue-rotate(-10deg) !important; }
.img-overlay-border { pointer-events: none; z-index: 9998; }
.img-overlay-border.hover-blue { border: 2px solid rgba(59, 130, 246, 0.7); background: rgba(59, 130, 246, 0.1); }
.img-overlay-border.selected-orange { border: 2px solid #ff7500; background: rgba(255, 117, 0, 0.15); }

.css-edit-hover { outline: 2px dashed #3b82f6 !important; outline-offset: -2px !important; cursor: pointer !important; }
.css-edit-selected { outline: 3px solid #3b82f6 !important; outline-offset: -3px !important; box-shadow: inset 0 0 0 1000px rgba(59, 130, 246, 0.25) !important; }
img.css-edit-hover { filter: brightness(0.95) !important; }
img.css-edit-selected { filter: brightness(0.85) saturate(1.3) !important; }


/* =========================================
   4. ページ固有のカスタムスタイル・アニメーション
   （元HTMLの <body> の直下にあった <style> です）
   ========================================= */
html { overflow-x: hidden; scroll-behavior: smooth; }
/* body.font-sans まで指定しているのは、記事ページなどの <body> に付いている
   Tailwind の .font-sans（詳細度0,1,0）が body（0,0,1）に勝ってしまい、
   Noto Sans JP が OS標準UIフォントに置き換わるのを防ぐため。 */
body,
body.font-sans { font-family: 'Noto Sans JP', sans-serif; }
body { color: #1F2937; background-color: #FFFFFF; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .font-heading { font-family: 'Zen Maru Gothic', sans-serif; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInLeft { from { transform: translateX(-30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.animate-fadeIn { animation: fadeIn 0.8s ease-out forwards; }
.animate-slideInUp { animation: slideInUp 0.8s ease-out forwards; }
.animate-slideInLeft { animation: slideInLeft 0.8s ease-out forwards; }
.animate-scaleIn { animation: scaleIn 0.8s ease-out forwards; }

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }

.glass-effect { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px); }
.gradient-text { background: linear-gradient(135deg, #0156B3, #00a8ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.bg-mesh { background-color: #f0f8ff; background-image: radial-gradient(at 40% 20%, rgba(0, 86, 179, 0.1) 0px, transparent 50%), radial-gradient(at 80% 0%, rgba(255, 140, 0, 0.1) 0px, transparent 50%), radial-gradient(at 0% 50%, rgba(0, 86, 179, 0.05) 0px, transparent 50%); }

.step-line::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 2px; height: 2rem; background-color: #0156B3; opacity: 0.3; }
.step-item:last-child .step-line::after { display: none; }
@media (min-width: 768px) { .step-line::after { top: 50%; left: 100%; transform: translateY(-50%); width: 2rem; height: 2px; } }

/* スムーススクロールを正常に機能させるための上書き */
html, body {
  height: auto !important;
}

/* =========================================
   取得パターンタイムライン＆チェックリスト
   ========================================= */
.wc-card { background:#fff; border-radius:16px; border:1px solid #e5e3de; padding:28px 32px; }
.wc-card-label { font-size:11px; font-weight:600; color:#888; letter-spacing:.1em; text-transform:uppercase; margin-bottom:4px; }
.wc-card-heading { font-size:22px !important; font-weight:600; color:#1a1a1a; margin-bottom:20px; }
.wc-legend { display:flex; flex-wrap:wrap; gap:14px; margin-bottom:20px; }
.wc-leg-item { display:flex; align-items:center; gap:7px; font-size:16px !important; color:#555; }
.wc-leg-dot { width:14px; height:14px; border-radius:3px; flex-shrink:0; }
.wc-timeline-wrap { overflow-x:auto; }
.wc-timeline-wrap svg { display:block; width:100%; min-width:600px; }

.progress-bar { height:3px; background:#e5e3de; border-radius:2px; margin-bottom:20px; overflow:hidden; }
.progress-fill { height:100%; background:#0156B3; border-radius:2px; transition:width .4s ease; }
.breadcrumb { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:18px; min-height:22px; }
.bc-item { font-size:11px; color:#888; background:#f7f6f3; border:1px solid #e5e3de; border-radius:20px; padding:2px 10px; }
.q-card { border:1px solid #e5e3de; border-radius:12px; padding:20px 20px 16px; background:#fff; }
.q-step { font-size:11px; font-weight:600; color:#0156B3; letter-spacing:.06em; margin-bottom:8px; }
.q-text { font-size:15px; font-weight:600; color:#1a1a1a; line-height:1.5; margin-bottom:6px; }
.q-sub { font-size:12px; color:#888; line-height:1.6; margin-bottom:16px; }
.btn-row { display:flex; gap:10px; }
.btn-yes, .btn-no { flex:1; padding:10px 0; border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; border:1.5px solid; transition:all .15s; }
.btn-yes { background:#EEF4FC; border-color:#0156B3; color:#0C447C; }
.btn-yes:hover { background:#D6E9F8; }
.btn-no { background:#f7f6f3; border-color:#ccc; color:#555; }
.btn-no:hover { background:#edece9; }
.result-card { border-radius:12px; padding:20px; border:1.5px solid; }
.result-card.ok   { background:#f0faf4; border-color:#1D9E75; }
.result-card.ng   { background:#fef3f2; border-color:#E24B4A; }
.result-card.warn { background:#fefbf0; border-color:#BA7517; }
.result-badge { display:inline-block; font-size:11px; font-weight:600; padding:3px 12px; border-radius:20px; margin-bottom:10px; }
.result-card.ok   .result-badge { background:#d1f5e4; color:#0F6E56; }
.result-card.ng   .result-badge { background:#fde8e8; color:#A32D2D; }
.result-card.warn .result-badge { background:#fef0c7; color:#854F0B; }
.result-title { font-size:16px; font-weight:600; margin-bottom:8px; color:#1a1a1a; }
.result-body { font-size:13px; color:#444; line-height:1.7; margin-bottom:12px; }
.result-items { list-style:none; border-top:1px solid rgba(0,0,0,.08); padding-top:12px; display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.result-item { display:flex; justify-content:space-between; align-items:baseline; font-size:13px; gap:8px; }
.result-item .label { color:#888; flex-shrink:0; }
.result-item .value { color:#1a1a1a; font-weight:600; text-align:right; }
.btn-restart { font-size:12px; color:#888; background:none; border:1px solid #e5e3de; border-radius:8px; padding:7px 16px; cursor:pointer; transition:background .15s; }
.btn-restart:hover { background:#f7f6f3; }

/* Noto Emoji */
.noto-emoji { font-family: "Noto Emoji", sans-serif; font-style: normal; }

/* パルスアニメーション */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(255,140,2,0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(255,140,2,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,140,2,0); }
}

.check-item { display:flex; align-items:flex-start; gap:12px; padding:12px 14px; border-radius:8px; border:1.5px dashed #d1c5b8; margin-bottom:8px; background:#fafaf8; cursor:pointer; transition:background .2s, border-color .2s, transform .2s; }
.check-item:hover { background:#f0f8ff; border-color:#0156B3; transform:translateX(6px); }
.check-item.checked { border-style:solid; border-color:#1D9E75; background:#f0faf4; transform:none; }
.check-item.failed  { border-style:solid; border-color:#E24B4A; background:#fef3f2; opacity:.75; transform:none; }
.check-box { width:20px; height:20px; border-radius:50%; border:1.5px solid #ccc; flex-shrink:0; margin-top:1px; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.check-item:not(.checked):not(.failed) .check-box { border-color:#0156B3; animation:pulse-ring 2s ease-in-out infinite; }
.check-item.checked .check-box { background:#1D9E75; border-color:#1D9E75; }
.check-item.checked .check-box::after { content:''; display:block; width:6px; height:10px; border:2px solid #fff; border-top:none; border-left:none; transform:rotate(45deg) translate(-1px,-1px); }
.check-item.failed .check-box { background:#fde8e8; border-color:#E24B4A; }
.check-item.failed .check-box::after { content:'×'; font-size:13px; font-weight:600; color:#A32D2D; line-height:1; }
.check-label { font-size:16px; font-weight:600; color:#1a1a1a; line-height:1.5; }
.check-sub   { font-size:14px; color:#888; margin-top:4px; line-height:1.6; }
.check-item.failed .check-label, .check-item.failed .check-sub { color:#A32D2D; }
.days-row { display:flex; align-items:center; gap:8px; margin-top:8px; }
.days-row input { width:70px; padding:5px 10px; font-size:15px; border:1px solid #ccc; border-radius:6px; font-family:inherit; }
.days-row span { font-size:14px; color:#888; }
.check-result-box { border-radius:12px; padding:18px 20px; margin-top:14px; border:1.5px solid; }
.check-result-box.ok { background:#f0faf4; border-color:#1D9E75; }
.check-result-box.ng { background:#fef3f2; border-color:#E24B4A; }
.cr-badge { display:inline-block; font-size:13px; font-weight:600; padding:3px 14px; border-radius:20px; margin-bottom:8px; }
.check-result-box.ok .cr-badge { background:#d1f5e4; color:#0F6E56; }
.check-result-box.ng .cr-badge { background:#fde8e8; color:#A32D2D; }
.cr-title { font-size:17px; font-weight:600; color:#1a1a1a; margin-bottom:6px; }
.cr-body  { font-size:15px; color:#444; line-height:1.7; }
.amount-row { display:flex; align-items:baseline; gap:8px; margin:12px 0 6px; flex-wrap:wrap; }
.amount-lbl { font-size:14px; color:#888; }
.amount-val { font-size:26px; font-weight:600; color:#0F6E56; }

/* =========================================
   スクロールアニメーション
   ========================================= */

/* 初期状態：非表示・少し下にオフセット */
.scroll-animate {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* 表示状態 */
.scroll-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 遅延バリエーション（カード等を順番に表示） */
.scroll-animate.delay-1 { transition-delay: 0.1s; }
.scroll-animate.delay-2 { transition-delay: 0.2s; }
.scroll-animate.delay-3 { transition-delay: 0.3s; }
.scroll-animate.delay-4 { transition-delay: 0.4s; }
.scroll-animate.delay-5 { transition-delay: 0.5s; }

/* アクセシビリティ：動きを減らす設定をしているユーザーには無効化 */
@media (prefers-reduced-motion: reduce) {
  .scroll-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================================
   SP版FV：下部パディング・min-heightリセット
   ========================================= */
@media (min-width: 768px) and (max-width: 1022px) {
  .fv-sp-layout {
    padding-top: 110px !important;
  }
  .fv-assist-img {
    top: 150px !important;
  }
  .fv-human-img {
    bottom: -55px !important;
  }
}
@media (max-width: 767px) {
  .fv-sp-layout {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: auto !important;
  }
  .fv-wrapper {
    min-height: auto !important;
  }
}

/* =========================================
   FV ページロードアニメーション（staggered fade-in）
   ========================================= */
@keyframes fv-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fv-fade-right {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 左テキストエリア：下から順番にフェードイン */
.fv-fade {
  opacity: 0;
  animation: fv-fade-up 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.fv-fade.d1 { animation-delay: 0.2s; }
.fv-fade.d2 { animation-delay: 0.45s; }
.fv-fade.d3 { animation-delay: 0.7s; }
.fv-fade.d4 { animation-delay: 0.95s; }
.fv-fade.d5 { animation-delay: 1.2s; animation-duration: 1.6s; }

/* 右イラストエリア：右からフェードイン */
.fv-fade-r {
  opacity: 0;
  animation: fv-fade-right 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.fv-fade-r.d1 { animation-delay: 0.5s; }
.fv-fade-r.d2 { animation-delay: 0.8s; }

/* テキストオーバーレイ：移動なしのゆっくりフェード */
@keyframes fv-softin {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fv-text-fade {
  opacity: 0;
  animation: fv-softin 1.8s ease-in-out 0.4s forwards;
}
.fv-text-fade.d2 {
  animation-delay: 1.2s;
}

@media (prefers-reduced-motion: reduce) {
  .fv-fade, .fv-fade-r, .fv-text-fade { opacity: 1; animation: none; }
}

/* ─── 参加企業マーキー ─── */
.marquee-outer {
  overflow: hidden;
  width: 100%;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 32s linear infinite;
}
.marquee-outer:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-item {
  flex-shrink: 0;
  width: 220px;
  margin-right: 20px;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}
.marquee-item-img {
  width: 100%;
  height: 150px;
  overflow: hidden;
  flex-shrink: 0;
}
.marquee-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.marquee-item-name {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid #f0f0f0;
}

/* ─── MT.net フォーム ボタン カスタマイズ ─── */
.button-group {
  display: flex;
  flex-direction: column-reverse; /* 送信ボタンを上に */
  gap: 12px;
}

.button-group .button {
  border-radius: 9999px;
  font-weight: 700;
  padding: 14px 32px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

/* 送信ボタン（オレンジ） */
.button-group .button-submit {
  background-color: #FF8C02;
  color: #fff;
}
.button-group .button-submit:hover {
  background-color: #e67e00;
  transform: translateY(-1px);
}

/* もどるボタン（テキストのみ） */
.button-group .button-confirm {
  background: transparent;
  color: #0156B3;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.button-group .button-confirm:hover {
  color: #0145A0;
  transform: none;
}

/* ─── トップ 事例紹介：常に3枠に保つ ───
   実記事（0〜3件）＋Coming Soon（常時3枚）を出力し、
   4枠目以降を隠すことで、記事件数に関わらず常に3枠だけ表示する。 */
.jirei-grid > *:nth-child(n+4) { display: none; }

/* ─── TOPページ 事例カードの文字サイズ ───
   タイトルに !important を付けているのは、下の SP専用ルール
   section h3 { font-size: 1.1rem !important } に勝つため。
   クラス(0,1,0) は 要素2つ(0,0,2) より詳細度が高いので、
   同じ !important 同士ならこちらが優先される。 */
.jirei-card-company { font-size: 1rem; }                 /* 16px */
.jirei-card-title   { font-size: 1.25rem !important; }   /* 20px */
@media (max-width: 767px) {
  .jirei-card-company { font-size: 0.875rem; }           /* 14px */
  .jirei-card-title   { font-size: 1.125rem !important; }/* 18px */
}

/* ─── SP専用レイアウト調整 ─── */
@media (max-width: 767px) {
  /* 全体の見出しを一周り小さく */
  section h2 { font-size: 1.375rem !important; line-height: 1.4 !important; }
  section h3 { font-size: 1.1rem !important; line-height: 1.5 !important; }

  /* キーメッセージ見出しはメインの主張なので大きめに */
  section h1.km-heading { font-size: 1.75rem !important; line-height: 1.4 !important; }

  /* 制度A取得条件テキスト */
  .wc-card > p:not(.wc-card-heading) { font-size: 13px !important; }

  /* 事前登録メッセージ：見出し(h2)より小さくなるよう調整 */
  #registration p.font-heading.text-2xl { font-size: 1.125rem !important; line-height: 1.5 !important; }

  /* 対象となる企業・事業所の要件リスト */
  #check .space-y-2 { font-size: 0.8125rem !important; }
  #check .space-y-2 p, #check .space-y-2 li { font-size: 0.8125rem !important; }
}
