/* ============================================================
 * 補助金ナビ — styles
 * ============================================================ */
:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --blue: #1f6feb;
  --blue-dark: #1858c4;
  --teal: #0fa3a3;
  --gold: #d99a18;
  --ink: #1a2433;
  --ink-soft: #51607a;
  --line: #e4e9f2;
  --bg: #f6f8fc;
  --bg-soft: #eef2f9;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(11, 37, 69, .08);
  --shadow-md: 0 8px 24px rgba(11, 37, 69, .10);
  --shadow-lg: 0 20px 50px rgba(11, 37, 69, .18);
  --radius: 14px;
  --radius-sm: 9px;
  /* size accent colors */
  --c-small: #2f9e6f;
  --c-sme: #1f6feb;
  --c-mid: #8a5cf6;
  --c-large: #d4612a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1140px, 92vw); margin-inline: auto; }

a { color: inherit; text-decoration: none; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff; font-weight: 900; font-size: 18px;
}
.brand-mark.small { width: 28px; height: 28px; font-size: 15px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 18px; color: var(--navy); }
.brand-text small { font-size: 10px; letter-spacing: .18em; color: var(--ink-soft); font-weight: 500; }
.nav { display: flex; gap: 26px; font-weight: 700; font-size: 14px; }
.nav a { color: var(--ink-soft); transition: color .15s; }
.nav a:hover { color: var(--blue); }

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(31,111,235,.18), transparent 60%),
    radial-gradient(900px 400px at 0% 110%, rgba(15,163,163,.14), transparent 55%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 72px 0 88px;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: #bcd4ff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 900; line-height: 1.22; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: #ffd56b; }
.lead { margin-top: 20px; font-size: 16px; color: #d6e2f5; max-width: 36em; }
.hero-cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta { margin-top: 18px; font-size: 12px; color: #9fb6d6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; padding: 13px 26px; border-radius: 999px;
  cursor: pointer; border: 1px solid transparent; transition: transform .12s, box-shadow .12s, background .15s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; box-shadow: 0 8px 22px rgba(31,111,235,.4); }
.btn-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.28); }
.list-section .btn-ghost, .diag-result-head .btn-ghost { background: var(--white); color: var(--ink-soft); border-color: var(--line); }
.btn-small { font-size: 13px; padding: 9px 16px; }

.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 4px; backdrop-filter: blur(4px);
}
.stat-card { border-top: 3px solid var(--accent, #fff); }
.stat-card[data-size="small"] { --accent: #58d39a; }
.stat-card[data-size="sme"] { --accent: #6ea8ff; }
.stat-card[data-size="mid"] { --accent: #b69bff; }
.stat-card[data-size="large"] { --accent: #ffae7a; }
.stat-label { font-size: 12px; color: #bcd0ee; font-weight: 700; }
.stat-value { font-size: 26px; font-weight: 900; color: #fff; line-height: 1.1; }
.stat-value small { font-size: 13px; font-weight: 700; margin-left: 2px; }
.stat-sub { font-size: 11px; color: #9fb6d6; }

/* ===== Section ===== */
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 40em; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 900; color: var(--navy); }
.section-head h2::after {
  content: ""; display: block; width: 48px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--teal)); margin: 14px auto 0;
}
.section-head p { margin-top: 14px; color: var(--ink-soft); font-size: 15px; }

/* ===== Diagnosis ===== */
.diagnosis { background: var(--white); }
.diag-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; }
.diag-step h3 { font-size: 16px; color: var(--navy); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.step-num {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 14px; font-weight: 900;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--white); color: var(--ink-soft); transition: all .14s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed="true"], .chip.active {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.chip.size-chip[aria-pressed="true"][data-key="small"] { background: var(--c-small); border-color: var(--c-small); }
.chip.size-chip[aria-pressed="true"][data-key="sme"] { background: var(--c-sme); border-color: var(--c-sme); }
.chip.size-chip[aria-pressed="true"][data-key="mid"] { background: var(--c-mid); border-color: var(--c-mid); }
.chip.size-chip[aria-pressed="true"][data-key="large"] { background: var(--c-large); border-color: var(--c-large); }

.diag-placeholder { text-align: center; color: var(--ink-soft); margin-top: 36px; font-size: 14px; }
.diag-result { margin-top: 44px; }
.diag-result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.diag-result-head h3 { font-size: 20px; color: var(--navy); }
.result-count { font-size: 14px; color: var(--ink-soft); font-weight: 700; }

/* ===== Cards ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); cursor: pointer;
  display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
  transition: transform .14s, box-shadow .14s, border-color .14s;
  border-top: 4px solid var(--card-accent, var(--blue));
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cdd9ee; }
.card.is-match::before {
  content: "おすすめ"; position: absolute; top: 14px; right: -34px;
  transform: rotate(45deg); background: var(--gold); color: #fff;
  font-size: 11px; font-weight: 900; padding: 4px 40px; box-shadow: var(--shadow-sm);
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-status {
  font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.status-ongoing { background: #e7f7ee; color: #1d8a4f; }
.status-preparing { background: #fff5e0; color: #b9821a; }
.status-closed { background: #f0f1f4; color: #8a94a6; }
.card h3 { font-size: 17px; color: var(--navy); line-height: 1.45; }
.card-org { font-size: 12px; color: var(--ink-soft); }
.card-amount { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.amount-big { font-size: 24px; font-weight: 900; color: var(--navy); }
.amount-rate { font-size: 12px; color: var(--ink-soft); background: var(--bg-soft); padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.card-summary { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--navy-2); }
.tag.size-tag[data-key="small"] { background: #e4f6ed; color: var(--c-small); }
.tag.size-tag[data-key="sme"] { background: #e7f0ff; color: var(--c-sme); }
.tag.size-tag[data-key="mid"] { background: #efe9ff; color: var(--c-mid); }
.tag.size-tag[data-key="large"] { background: #fdeae0; color: var(--c-large); }
.card-more { font-size: 12px; font-weight: 800; color: var(--blue); margin-top: 4px; }

/* ===== Filters ===== */
.list-section { background: var(--bg); }
.filters { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.filter-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.filter-label { font-size: 13px; font-weight: 800; color: var(--navy); width: 48px; flex-shrink: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 7px 14px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--white); color: var(--ink-soft); transition: all .14s;
}
.seg button:hover { border-color: var(--blue); color: var(--blue); }
.seg button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.list-count { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; font-weight: 700; }

/* ===== Guide ===== */
.guide { background: var(--white); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.guide-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; position: relative; }
.guide-num { font-size: 32px; font-weight: 900; color: #d7e2f4; line-height: 1; }
.guide-card h3 { font-size: 16px; color: var(--navy); margin: 10px 0 8px; }
.guide-card p { font-size: 13px; color: var(--ink-soft); line-height: 1.75; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11,37,69,.55); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; background: var(--white); border-radius: 18px; box-shadow: var(--shadow-lg);
  width: min(680px, 94vw); max-height: 88vh; overflow-y: auto; padding: 38px 38px 34px;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 16px; right: 18px; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--bg-soft); color: var(--ink-soft); font-size: 22px; cursor: pointer; line-height: 1;
  transition: background .14s;
}
.modal-close:hover { background: #dfe5ef; }
.modal-body h2 { font-size: 23px; color: var(--navy); line-height: 1.4; padding-right: 30px; }
.modal-official { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.modal-meta .mbox { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; flex: 1 1 140px; }
.modal-meta .mbox span { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.modal-meta .mbox strong { font-size: 17px; color: var(--navy); }
.modal-section { margin-top: 18px; }
.modal-section h4 { font-size: 14px; color: var(--navy); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.modal-section h4::before { content: ""; width: 4px; height: 16px; background: var(--blue); border-radius: 2px; }
.modal-section p, .modal-section li { font-size: 14px; color: var(--ink); line-height: 1.8; }
.modal-section ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.modal-section ul li { background: var(--bg-soft); padding: 5px 12px; border-radius: 8px; font-size: 13px; color: var(--navy-2); }
.modal-cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.modal-note { font-size: 12px; color: var(--ink-soft); margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ===== Footer ===== */
.site-footer { background: var(--navy); color: #c3d2e8; padding: 40px 0; margin-top: 20px; }
.footer-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.footer-inner > div { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 17px; }
.disclaimer { font-size: 12px; max-width: 52em; color: #9fb6d6; }
.copyright { font-size: 12px; color: #7f96b8; }

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .diag-grid { grid-template-columns: 1fr; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .hero-stats { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .modal-panel { padding: 30px 22px 26px; }
}

/* ============================================================
 * v2 additions — 業種ステップ / 検索 / 並べ替え / 相談 / 印刷
 * ============================================================ */

/* --- Diagnosis steps (stacked) --- */
.diag-steps { display: flex; flex-direction: column; gap: 24px; }
.diag-step h3 .req, .diag-step h3 .opt {
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; font-style: normal;
}
.diag-step h3 .req { background: #ffe7e0; color: #c0492a; }
.diag-step h3 .opt { background: var(--bg-soft); color: var(--ink-soft); }

.diag-result-head { align-items: flex-start; }
.diag-result-cond { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.diag-result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.diag-contact { margin-top: 26px; }
.diag-contact-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, #eef4ff, #f4fbfa);
  border: 1px solid #d7e6ff; border-radius: var(--radius); padding: 18px 22px;
}
.diag-contact-inner p { font-size: 13px; color: var(--ink-soft); }
.diag-contact-inner strong { color: var(--navy); display: block; margin-bottom: 2px; }

/* --- Filters: search / sort / toggle --- */
.filter-top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px dashed var(--line);
}
.search-wrap { position: relative; flex: 1 1 300px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; }
.search-wrap input {
  width: 100%; font-family: inherit; font-size: 14px; padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink);
}
.search-wrap input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.filter-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sort-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--navy); }
.sort-wrap select {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--white); cursor: pointer;
}
.toggle-wrap { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--navy); cursor: pointer; user-select: none; }
.toggle-wrap input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.list-bar .list-count { margin-bottom: 0; }

/* --- Contact section --- */
.contact-section { background: var(--bg); padding-top: 0; }
.contact-box {
  display: grid; grid-template-columns: 1.4fr .8fr; gap: 32px; align-items: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  border-radius: 20px; padding: 44px 48px; color: #fff; box-shadow: var(--shadow-md);
}
.contact-copy h2 { font-size: 26px; font-weight: 900; }
.contact-copy h2::after { display: none; }
.contact-copy > p { margin-top: 14px; font-size: 15px; color: #d6e2f5; }
.contact-copy strong { color: #ffd56b; }
.contact-points { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.contact-points li { font-size: 14px; color: #cddcf2; }
.contact-actions { text-align: center; }
.contact-btn { width: 100%; font-size: 16px; padding: 16px; }
.contact-mail { margin-top: 12px; font-size: 14px; color: #bcd0ee; font-weight: 700; }
.contact-note { margin-top: 14px; font-size: 12px; color: #9fb6d6; }

@media (max-width: 880px) {
  .contact-box { grid-template-columns: 1fr; padding: 32px 26px; }
  .filter-top { flex-direction: column; align-items: stretch; }
}

/* ============================================================
 * 印刷（診断結果のみ）— printBtn で body.printing-diag を付与
 * ============================================================ */
@media print {
  .site-header, .hero, .list-section, .guide, .contact-section,
  .site-footer, .modal, .diag-step, .section-head,
  .diag-placeholder, .diag-result-actions, .diag-contact { display: none !important; }

  body { background: #fff; }
  .section.diagnosis { padding: 0; }
  .diag-result { margin-top: 0; }
  .diag-result-head h3 { font-size: 18px; }
  .card-grid { display: block; }
  .card {
    break-inside: avoid; page-break-inside: avoid; box-shadow: none;
    border: 1px solid #ccc; margin-bottom: 10px; cursor: default;
  }
  .card.is-match::before { background: #999; }
  .card-more { display: none; }
  .diag-result::after {
    content: "出典: subsidy（補助金ナビ）/ subsidy.uneetoile.jp ｜ 金額・締切は公募回ごとに変動。申請前に公式公募要領をご確認ください。";
    display: block; font-size: 10px; color: #666; margin-top: 14px;
  }
}
