/* portal-v2 · base — 共有プリミティブ
 * スコープ: .theme-portal-v2 のみ。legacy ページには読み込まれない。
 * トークン定義: /tokens.css の .theme-portal-v2 / 規約: /design.md
 */

/* ---- page base ---- */
body.theme-portal-v2 {
  background: var(--portal-paper);
  color: var(--portal-ink);
  font-family: var(--portal-font-body);
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.theme-portal-v2 h1,
.theme-portal-v2 h2,
.theme-portal-v2 h3,
.theme-portal-v2 h4 {
  font-family: var(--portal-font-heading);
  font-style: normal;
  line-height: 1.4;
}

.theme-portal-v2 :focus-visible {
  outline: 2px solid var(--portal-focus);
  outline-offset: 2px;
  transition: none;
}

/* ---- buttons ---- */
.theme-portal-v2 .btn {
  border-radius: var(--portal-radius-control);
  font-family: var(--portal-font-body);
  font-weight: 700;
  border: 1px solid transparent;
  transition: background-color var(--dur-micro) var(--ease-out),
    border-color var(--dur-micro) var(--ease-out),
    color var(--dur-micro) var(--ease-out);
}

.theme-portal-v2 .btn-primary {
  background: var(--portal-primary);
  color: var(--portal-surface);
  background-image: none;
}

.theme-portal-v2 .btn-primary:hover {
  background: var(--portal-primary-deep);
}

/* 無料診断・相談系(オレンジ)。data-cta は変更せずクラスだけ追加で使う */
.theme-portal-v2 .btn-utility {
  background: var(--portal-utility);
  color: var(--portal-surface);
}

.theme-portal-v2 .btn-utility:hover {
  background: oklch(52% 0.15 50);
}

.theme-portal-v2 .btn-ghost {
  background: var(--portal-surface);
  color: var(--portal-primary-deep);
  border-color: var(--portal-rule-strong);
}

.theme-portal-v2 .btn-ghost:hover {
  border-color: var(--portal-primary);
}

.theme-portal-v2 .btn:disabled,
.theme-portal-v2 .btn[aria-disabled="true"] {
  background: var(--portal-rule);
  color: var(--portal-muted);
  cursor: not-allowed;
}

/* ---- card / pill primitives ---- */
.theme-portal-v2 .portal-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-rule);
  border-radius: var(--portal-radius-card);
  box-shadow: none;
}

.theme-portal-v2 .portal-pill {
  border-radius: var(--portal-radius-pill);
  border: 1px solid var(--portal-rule-strong);
  background: var(--portal-surface);
  color: var(--portal-ink);
  font-size: var(--text-sm);
  padding: 0.25rem 0.75rem;
}

.theme-portal-v2 .portal-pill[aria-pressed="true"],
.theme-portal-v2 .portal-pill.is-active {
  background: var(--portal-primary-wash);
  border-color: var(--portal-primary);
  color: var(--portal-primary-deep);
}

/* ---- header: portal variant ---- */
.theme-portal-v2 header.site.site--portal {
  background: var(--portal-surface);
  border-bottom: 1px solid var(--portal-rule);
  box-shadow: none;
}

.theme-portal-v2 header.site.site--portal.is-scrolled {
  box-shadow: var(--portal-shadow-float);
}

.theme-portal-v2 .site--portal .brand {
  color: var(--portal-ink);
  font-family: var(--portal-font-heading);
  font-weight: 700;
}

.theme-portal-v2 .site--portal .brand-mark {
  background: var(--portal-utility);
  border-radius: 4px;
}

.theme-portal-v2 .site--portal .brand-sub {
  color: var(--portal-muted);
  font-family: var(--portal-font-numeric);
}

.theme-portal-v2 .site--portal .nav-center a {
  color: var(--portal-ink);
  font-weight: 500;
}

.theme-portal-v2 .site--portal .nav-center a:hover {
  color: var(--portal-primary-deep);
}

.theme-portal-v2 .site--portal .nav-center a[aria-current="page"] {
  color: var(--portal-primary-deep);
  box-shadow: inset 0 -2px 0 var(--portal-primary);
}

/* ---- footer: portal variant ---- */
.theme-portal-v2 footer.site.site--portal {
  background: var(--portal-surface);
  border-top: 1px solid var(--portal-rule);
  color: var(--portal-muted);
}

.theme-portal-v2 footer.site.site--portal a {
  color: var(--portal-ink);
}

.theme-portal-v2 footer.site.site--portal a:hover {
  color: var(--portal-primary-deep);
}

/* legacyの暗色フッター用の白文字をportalの明色フッターで読める色に戻す */
.theme-portal-v2 footer.site.site--portal .brand-f {
  color: var(--portal-ink);
}
.theme-portal-v2 footer.site.site--portal .legal {
  color: var(--portal-muted);
}

/* ---- motion guardrails ---- */
@media (prefers-reduced-motion: reduce) {
  .theme-portal-v2 *,
  .theme-portal-v2 *::before,
  .theme-portal-v2 *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 140ms !important;
    scroll-behavior: auto !important;
  }
}
