/* ==========================================================================
   matohouse トップページ専用 CSS（子テーマ front.css）
   - 共通部分（配色・紙面・ヘッダー・フッター・記事セル）は site.css
   - ここはファーストビュー、カテゴリーカード、折りたたみ、CTA、マウス追従の定規だけ
   ========================================================================== */

/* --------------------------------------------------------------------------
   ファーストビュー
   -------------------------------------------------------------------------- */
/* 本家と同じく画面にぴったり収める（calc(100dvh - 1.6rem)）。上段が伸び、大きな文字は上段の中で下寄せ */
.mh-hero { position: relative; display: grid; grid-template-rows: 1fr auto; min-height: calc(100dvh - 72px); }   /* 紙面の余白 16px とヘッダー 56px を引く */

/* 上段：文字と罫線だけ */
.mh-hero-top { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 0 0 12px 0; }
.mh-hero-labels { position: relative; display: flex; justify-content: space-between; padding: 12px 16px 12px 24px; }
.mh-hero-word { display: block; width: 100%; height: auto; margin-top: 8px; padding: 0 8px 4px; overflow: visible; }
.mh-hero-word text { font-family: var(--mh-latin); font-weight: 700; font-size: 200px; letter-spacing: -0.03em; fill: var(--mh-ink); }
.mh-hero-top > .mh-ruler--y { left: 0; }

/* 下段：左にキャッチコピー、右に説明とボタン */
.mh-hero-content { position: relative; display: grid; grid-template-columns: 7fr 5fr; }
.mh-hero-h1 { padding: 32px 32px 40px; font-family: var(--mh-sans); font-weight: 700; font-size: clamp(32px, 4.2vw, 56px); line-height: 1.15; letter-spacing: -0.02em; color: var(--mh-ink); word-break: keep-all; overflow-wrap: anywhere; word-break: auto-phrase; }
.mh-hero-side { position: relative; display: grid; grid-template-rows: 1fr auto; }
.mh-hero-sub { padding: 24px 24px 24px; font-size: 16px; font-weight: 400; line-height: 1.7; color: var(--mh-ink-2); max-width: 520px; }
.mh-hero-btn { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 12px 24px; font-size: 16px; font-weight: 700; color: var(--mh-red); overflow: hidden; }
.mh-hero-btn::before { content: ""; position: absolute; inset: 0; background: var(--mh-red); transform: scaleY(0); transform-origin: 50% 100%; transition: transform var(--mh-t-fill) var(--mh-ease); }
.mh-hero-btn > * { position: relative; transition: color var(--mh-t-fill) var(--mh-ease); }
.mh-hero-btn .mh-arrow { font-family: var(--mh-mono); font-size: 16px; }
@media (hover: hover) {
  .mh-hero-btn:hover { color: var(--mh-white); }
  .mh-hero-btn:hover::before { transform: scaleY(1); }
}

/* マウス追従の定規とポインタ印（front-ruler.js が --mh-rx / --mh-ry を更新する。＋印と座標ラベルは JS が .mh-rf-cur として足す）
   本家 heronaiapp.com の実測（2026-11-07）：交点に 1rem=8.33px の赤い＋（線 0.2rem、#FA3600）、その左下に等幅 10px・大文字・#282828b8 の
   「X:493PX / Y:240PX」ラベル。ポインタに少し遅れて付いてくる。本物のカーソルは隠さない。すべて pointer-events: none */
.mh-rf { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity var(--mh-t); --mh-rx: 0px; --mh-ry: 0px; display: none; }
.mh-rf.is-on { opacity: 1; }
.mh-rf > i, .mh-rf-cur, .mh-rf-cur * { pointer-events: none; }
.mh-rf > i { position: absolute; display: block; }
.mh-rf-x { left: 0; right: 0; top: 0; height: 1px; background: var(--mh-dash-x); opacity: .64; transform: translateY(var(--mh-ry)); }
.mh-rf-y { top: 0; bottom: 0; left: 0; width: 2px; background: var(--mh-red); transform: translateX(var(--mh-rx)); }
.mh-rf-tx { top: 0; left: -3px; width: 7px; height: 8px; background: var(--mh-red); transform: translateX(var(--mh-rx)); }
.mh-rf-ty { left: 0; top: -3px; width: 8px; height: 7px; background: var(--mh-red); transform: translateY(var(--mh-ry)); }
.mh-rf-cur { position: absolute; left: 0; top: 0; width: 0; height: 0; transform: translate(var(--mh-rx), var(--mh-ry)); }
.mh-rf-plus { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; display: block; }
.mh-rf-plus::before, .mh-rf-plus::after { content: ""; position: absolute; background: var(--mh-red); }
.mh-rf-plus::before { left: 3px; top: 0; width: 2px; height: 8px; }
.mh-rf-plus::after { left: 0; top: 3px; width: 8px; height: 2px; }
.mh-rf-xy { position: absolute; right: 4px; top: 4px; display: block; font-family: var(--mh-mono); font-weight: 500; font-size: 10px; line-height: 1.3; letter-spacing: 0; text-transform: uppercase; text-align: left; color: var(--mh-ink-2); white-space: nowrap; }
.mh-rf-xy b { display: block; font-weight: 500; }
@media (hover: hover) and (min-width: 992px) { .mh-rf { display: block; } }
@media (prefers-reduced-motion: reduce) { .mh-rf { display: none !important; } }

/* --------------------------------------------------------------------------
   カテゴリー：4 枚カード
   -------------------------------------------------------------------------- */
.mh-cards { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); }
.mh-cards::before, .mh-cards::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--mh-line); z-index: 1; }
.mh-cards::before { top: 0; }
.mh-cards::after { bottom: 0; }
.mh-card { position: relative; }
.mh-card + .mh-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--mh-line); }
.mh-card > a { display: flex; flex-direction: column; height: 100%; color: inherit; }
.mh-card-head { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; }
.mh-card-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--mh-dash-x); }
.mh-card-fig { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 200px; padding: 24px; overflow: hidden; }   /* 出現前の拡大（scale 1.25）がはみ出さないように */
.mh-card-fig::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--mh-dash-x); }
.mh-card-count { display: block; font-family: var(--mh-mono); font-weight: 500; font-size: 72px; line-height: 1; color: var(--mh-ink); letter-spacing: -0.02em; }
.mh-card-count.is-zero { color: var(--mh-ink-2); }
.mh-card-countlabel { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--mh-ink-3); }
.mh-card-upd { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-top: 16px; }
.mh-card-upd .mh-label, .mh-card-upd .mh-label-ja { color: var(--mh-ink-3); }
.mh-card-upd .mh-mono { font-size: 14px; color: var(--mh-ink); text-transform: none; }
.mh-card-title { padding: 40px 24px 0; font-family: var(--mh-sans); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; color: var(--mh-ink); transition: transform var(--mh-t); word-break: keep-all; overflow-wrap: anywhere; word-break: auto-phrase; }
.mh-card-body { padding: 12px 24px 28px; font-size: 16px; font-weight: 400; line-height: 1.7; color: var(--mh-ink-2); margin-top: auto; }
.mh-card .mh-num { transition: color var(--mh-t); }
@media (hover: hover) {
  .mh-card > a:hover .mh-num { color: var(--mh-red); }
  .mh-card > a:hover .mh-card-title { transform: translateX(20px); }
}

/* --------------------------------------------------------------------------
   よくある悩み：番号つき折りたたみ（details）
   -------------------------------------------------------------------------- */
.mh-faq { position: relative; }
.mh-faq-item { position: relative; }
.mh-faq-item::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--mh-dash-x); }
.mh-faq-item:first-of-type::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--mh-dash-x); }
.mh-faq-item > summary { list-style: none; cursor: pointer; position: relative; display: grid; grid-template-columns: 104px 1fr 48px; align-items: center; min-height: 64px; padding: 20px 26px 20px 24px; }
.mh-faq-item > summary::-webkit-details-marker { display: none; }
.mh-faq-item > summary .mh-num { transition: color var(--mh-t); }
.mh-faq-item[open] > summary .mh-num { color: var(--mh-red); }
.mh-faq-title { font-family: var(--mh-sans); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; color: var(--mh-ink); word-break: keep-all; overflow-wrap: anywhere; word-break: auto-phrase; }
.mh-faq-plus { position: relative; width: 16px; height: 16px; justify-self: end; }
.mh-faq-plus::before, .mh-faq-plus::after { content: ""; position: absolute; background: var(--mh-line); transition: transform var(--mh-t); }
.mh-faq-plus::before { left: 0; right: 0; top: 50%; height: 1px; }
.mh-faq-plus::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.mh-faq-item[open] .mh-faq-plus::after { transform: scaleY(0); }
.mh-faq-body { padding: 0 24px 24px 128px; }
.mh-faq-body p { max-width: 640px; font-size: 16px; font-weight: 400; line-height: 1.7; color: var(--mh-ink-2); }
.mh-faq-links { margin-top: 8px; }
.mh-faq-links li { position: relative; }
.mh-faq-links a { display: flex; align-items: baseline; gap: 12px; min-height: 44px; padding: 10px 0; font-size: 16px; font-weight: 700; color: var(--mh-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color var(--mh-t); }
.mh-faq-links .mh-post-date { flex: 0 0 auto; }
.mh-faq-more a { text-decoration: none; }
.mh-faq-more a::after { content: "→"; font-family: var(--mh-mono); margin-left: 8px; }
@media (hover: hover) {
  .mh-faq-item > summary:hover .mh-num { color: var(--mh-red); }
  .mh-faq-links a:hover { color: var(--mh-red); }
}

/* --------------------------------------------------------------------------
   CTA（比較・まとめへの誘導）：3 列、点線
   -------------------------------------------------------------------------- */
.mh-cta { position: relative; display: grid; grid-template-columns: 60px 1fr 60px; margin-top: 64px; }
.mh-cta-side { position: relative; padding: 16px 0 0 12px; }
.mh-cta-side--l::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px; background: var(--mh-dash-y); }
.mh-cta-side--r::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--mh-dash-y); }
.mh-cta-main { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 32px; }
.mh-cta-main h2 { font-family: var(--mh-sans); font-weight: 700; font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; color: var(--mh-ink); word-break: keep-all; overflow-wrap: anywhere; word-break: auto-phrase; }
.mh-cta-main p { max-width: 600px; margin-top: 16px; font-size: 16px; font-weight: 400; line-height: 1.7; color: var(--mh-ink-2); }
.mh-cta-main .mh-btn-fill { margin-top: 24px; }

/* --------------------------------------------------------------------------
   タブレット（〜991px）
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .mh-hero-content { grid-template-columns: 1fr; }
  .mh-hero-side > .mh-line--l { display: none; }
  .mh-hero-side::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--mh-line); }
  .mh-cards { grid-template-columns: repeat(2, 1fr); }
  .mh-card:nth-child(3)::before { display: none; }
  .mh-card:nth-child(-n + 2)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--mh-line); }
}

/* --------------------------------------------------------------------------
   スマホ（〜767px）
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .mh-hero-labels { padding: 12px 16px; }
  .mh-hero-labels .mh-label { font-size: 12px; }
  .mh-hero-labels .mh-label-ja { display: none; }
  .mh-hero-word { padding: 0 4px 4px; margin-top: 4px; }
  .mh-hero-top > .mh-ruler--y { display: none; }
  .mh-hero-h1 { padding: 28px 16px 24px; font-size: 32px; line-height: 1.2; }
  .mh-hero-sub { padding: 16px 16px 20px; font-size: 15px; }
  .mh-hero-btn { min-height: 64px; padding: 12px 16px; background: var(--mh-red); color: var(--mh-white); font-size: 19px; }
  .mh-hero-btn::before { display: none; }
  .mh-hero-btn > * { color: var(--mh-white); }

  /* カード：横スクロール（scroll-snap） */
  .mh-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--mh-line) transparent; padding-bottom: 1px; }
  .mh-card { flex: 0 0 312px; scroll-snap-align: start; }
  .mh-card:nth-child(3)::before { display: block; }
  .mh-card:nth-child(-n + 2)::after { display: none; }
  .mh-card-head { padding: 8px 16px; }
  .mh-card-fig { min-height: 168px; padding: 16px; }
  .mh-card-count { font-size: 56px; }
  .mh-card-title { padding: 32px 16px 0; font-size: 22px; }
  .mh-card-body { padding: 12px 16px 20px; font-size: 15px; }

  .mh-faq-item > summary { grid-template-columns: 56px 1fr 40px; padding: 16px; min-height: 56px; }
  .mh-faq-title { font-size: 18px; }
  .mh-faq-body { padding: 0 16px 20px 72px; }

  .mh-cta { grid-template-columns: 1fr; margin-top: 48px; }
  .mh-cta-side { display: none; }
  .mh-cta-main { padding: 56px 16px 48px; }
  .mh-cta-main h2 { font-size: 26px; }
  .mh-cta-main .mh-btn-fill { display: flex; width: 100%; justify-content: space-between; }
}

@media (max-width: 479px) {
  .mh-card { flex-basis: 288px; }
}

/* ==========================================================================
   第 4 版（2026-11-07）：本家の動きの再現（トップ専用ぶん）
   ========================================================================== */

/* ファーストビュー上段は data-cursor="hidden"（線を消して、定規と＋印に切り替える範囲） */

/* カードのホバー（本家 .home-problem-item の実測）：見出しが 2rem 右へ、図版エリアの四隅に 10px の＋（#72726F）が scale(0)→1、
   頭の左に 8px の赤い点、数字の色が罫線色 → 黒。すべて 0.4s */
.mh-card-head { padding-left: 24px; }
.mh-card-dot { position: absolute; left: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; background: var(--mh-red); opacity: 0; transition: opacity var(--mh-t); }
.mh-card-head > .mh-mono { transition: transform var(--mh-t); }
.mh-card-plus { position: absolute; width: 10px; height: 10px; color: var(--mh-ink-hover); transform: scale(0); transition: transform var(--mh-t) ease; z-index: 1; }
.mh-card-plus::before, .mh-card-plus::after { content: ""; position: absolute; background: currentColor; }
.mh-card-plus::before { left: 0; right: 0; top: 50%; height: 1px; }
.mh-card-plus::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.mh-card-plus--tl { left: 16px; top: 16px; } .mh-card-plus--tr { right: 16px; top: 16px; }
.mh-card-plus--bl { left: 16px; bottom: 16px; } .mh-card-plus--br { right: 16px; bottom: 16px; }
.mh-card-fig::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--mh-grid) 1px, transparent 1px), linear-gradient(90deg, var(--mh-grid) 1px, transparent 1px); background-size: 64px 64px; opacity: 0; transition: opacity var(--mh-t); pointer-events: none; }
.mh-card-fig > * { position: relative; }
.mh-card-count { color: var(--mh-line); transition: color var(--mh-t) ease; }
@media (hover: hover) {
  .mh-card > a:hover .mh-card-head > .mh-mono { transform: translateX(20px); }
  .mh-card > a:hover .mh-card-dot { opacity: 1; }
  .mh-card > a:hover .mh-card-plus { transform: scale(1); }
  .mh-card > a:hover .mh-card-fig::before { opacity: .24; }
  .mh-card > a:hover .mh-card-count { color: var(--mh-ink); }
}

/* ファーストビューのボタン：ピクセル状に赤が塗り上がる（本家 .btn-fill と同じ 0.58s steps(19)） */
.mh-hero-btn::before { transform: none; -webkit-mask-image: var(--mh-pixel); mask-image: var(--mh-pixel); -webkit-mask-size: 2000% 100%; mask-size: 2000% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: 0% 0; mask-position: 0% 0; transition: -webkit-mask-position .58s steps(19), mask-position .58s steps(19); }
.mh-hero-btn > * { transition: color .15s cubic-bezier(.55, 0, 1, .45); }
@media (hover: hover) {
  .mh-hero-btn:hover::before { transform: none; -webkit-mask-position: 100% 0; mask-position: 100% 0; }
}

/* 固定セクション（本家 home-map：700dvh、中身は画面に貼り付く） */
.mh-pin { position: relative; height: 700dvh; --mh-pin-h: 700dvh; }
.mh-pin-stick { position: sticky; top: 0; height: 100dvh; display: grid; grid-template-columns: 464px 1fr; overflow: hidden; }
.mh-pin-left { display: flex; flex-direction: column; padding: 16px 32px 32px; }
.mh-pin-label { display: block; }
.mh-pin-h { margin-top: auto; margin-bottom: 24px; font-family: var(--mh-sans); font-weight: 700; font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; color: var(--mh-ink); }
.mh-cycle-item { display: block; }
.mh-ch { display: inline-block; white-space: pre; }
.mh-pin-sub { max-width: 431px; font-size: 16px; line-height: 1.7; color: var(--mh-ink); }
.mh-pin-list { margin-top: 24px; }
.mh-pin-list li { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 0; font-size: 16px; font-weight: 700; color: var(--mh-ink); }
.mh-pin-list li + li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--mh-dash-x); }
.mh-pin-right { position: relative; padding: 20px; }
.mh-pin-coords { position: absolute; left: 24px; top: 16px; font-size: 12px; color: var(--mh-ink-2); }
.mh-pin-frame { display: block; width: 100%; height: 100%; overflow: visible; }
.mh-pin-frame [data-draw] { fill: none; stroke: var(--mh-ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mh-pin-frame .is-dash { stroke: var(--mh-line); stroke-dasharray: 1 3 10 3; }
.mh-pin-stages { position: absolute; right: 24px; bottom: 16px; display: flex; gap: 24px; }
.mh-pin-stage { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mh-mono); font-weight: 500; font-size: 14px; text-transform: uppercase; color: var(--mh-ink-faint); transition: color var(--mh-t); }
.mh-pin-stage.is-active { color: var(--mh-red); }
.mh-pin-stage.is-active .mh-num { color: var(--mh-red); }
@media (max-width: 991px) {
  .mh-pin-stick { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .mh-pin { height: auto; }
  .mh-pin-stick { position: static; height: auto; grid-template-columns: 1fr; }
  .mh-pin-left { padding: 16px 16px 24px; }
  .mh-pin-h { margin-top: 24px; font-size: 26px; }
  .mh-pin-right { height: 320px; padding: 16px; }
  .mh-pin-right > .mh-line--l { display: none; }
  .mh-pin-right::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--mh-line); }
  .mh-pin-stages { right: 16px; bottom: 12px; gap: 12px; }
}
