@charset "utf-8";
/* ============================================================================
   お客様の声  voice.css
   五月女建設株式会社 家の傾き相談室（katamukisoudan.com）

   ■ 対象
     ・カード（template-parts/voice-card.php）
     ・一覧ページ（page-voice.php）
     ・トップページのお客様の声セクション（front-page.php .top-voice）

   ■ 読み込み
     inc/voice.php が一覧ページとトップページでだけ読み込む。
     theme-additions.css の後に読み込まれるので、style.css の全体指定
     （p の 16px/32px、h2 の 36px、blockquote の余白など）をここで打ち消している。

   ■ ブレークポイント
     モバイルファースト。min-width: 851px を基本に、
     カードを2列・3列に並べる幅だけ min-width: 1160px を足している。

   ■ レイアウト（grid-template-areas で切り替え）
     DOM は「見出し → アバター → 声 → フッター」の順。

       スマホ・トップ（1160px以上）    一覧ページ（851px以上）
       ┌────┬──────────┐       ┌───────────────┐
       │ 画 │ 地域・お名前 │       │ 地域・お名前              │
       │ 像 │ キャッチ     │       │ キャッチ                  │
       ├────┴──────────┤       ├────┬──────────┤
       │ 声                 │       │ 画 │ 声                │
       ├───────────────┤       │ 像 │                    │
       │ 工法          続き›│       ├────┴──────────┤
       └───────────────┘       │ 工法       施工事例› │
                                       └───────────────┘
   ========================================================================== */


/* ==================================================================
   色・サイズ
   ================================================================== */
.voice-card,
.voice-list,
.top-voice {
  --voice-navy: #002266;      /* ブランドネイビー */
  --voice-navy-soft: #3c5d9c; /* 補助の青（.service-katamuki__text h4 と同じ） */
  --voice-accent: #fda61a;    /* アクセントオレンジ */
  --voice-text: #222222;
  --voice-muted: #5b6472;     /* 補足テキスト（theme-additions.css と同じ） */
  --voice-line: #e3e8f2;
  --voice-tint: #ebf2ff;      /* テーマの淡青 */
  --voice-avatar-bg: #dce8f7; /* イラストの背景色と同じ値にしておく（プロンプト集で指定） */
}

.voice-card {
  --voice-avatar-size: 64px;
}


/* ==================================================================
   カード
   ================================================================== */
.voice-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--voice-avatar-size) minmax(0, 1fr);
  grid-template-areas:
    "avatar title"
    "quote  quote"
    "footer footer";
  grid-template-rows: auto 1fr auto;
  gap: 16px 14px;
  width: 100%;
  box-sizing: border-box;
  padding: 22px 20px 18px;
  color: var(--voice-text);
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--voice-line);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 34, 102, 0.07);
  scroll-margin-top: 24px; /* 固定ヘッダー分は html の scroll-padding-top が持つ */
}

/* アバターなしで呼び出したとき */
.voice-card--no-avatar {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "title"
    "quote"
    "footer";
}

/* トップページの「続きを読む」から飛んできたカード */
.voice-card:target {
  outline: 3px solid var(--voice-accent);
  outline-offset: 3px;
}


/* ---- 見出し（地域・お名前 ＋ キャッチ） ---- */

/* style.css の h2（36px・下余白20px）を打ち消す */
.voice-card .voice-card__title {
  grid-area: title;
  align-self: center;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.5;
  color: var(--voice-navy);
}

/* 地域・お名前（投稿タイトル） */
.voice-card__who {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--voice-muted);
}

/* 地図ピンのアイコン */
.voice-card__who::before {
  content: "";
  flex-shrink: 0;
  width: 1.05em;
  height: 1.05em;
  margin-top: 0.2em;
  background-color: var(--voice-navy-soft);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.3 7 13 7 13s7-7.7 7-13a7 7 0 0 0-7-7zm0 9.6A2.6 2.6 0 1 1 12 6.4a2.6 2.6 0 0 1 0 5.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.3 7 13 7 13s7-7.7 7-13a7 7 0 0 0-7-7zm0 9.6A2.6 2.6 0 1 1 12 6.4a2.6 2.6 0 0 1 0 5.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* キャッチ（お客様の言葉から抜き出した一文）
   text-wrap: balance … 行の長さをそろえ、最終行に1〜2文字だけ残るのを防ぐ
   word-break: auto-phrase … 日本語を文節の切れ目で改行する（html lang="ja" が前提）
   いずれも未対応のブラウザでは通常の改行になるだけ */
.voice-card__catch {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--voice-navy);
  text-wrap: balance;
  word-break: auto-phrase;
}

/* キャッチが未入力の声：地域・お名前を見出しらしい大きさにする */
.voice-card__who:only-child {
  font-size: 16px;
  font-weight: 700;
  color: var(--voice-navy);
}


/* ---- アバター ---- */
.voice-card__avatar {
  grid-area: avatar;
  align-self: center;
  width: var(--voice-avatar-size);
  height: var(--voice-avatar-size);
  border-radius: 50%;
  overflow: hidden;
  background: var(--voice-avatar-bg);
  color: #9db8e0; /* 未設定時のアイコンの色 */
}

.voice-card__avatar-img,
.voice-card__avatar-fallback {
  display: block;
  width: 100%;
  height: 100%;
}

.voice-card__avatar-img {
  object-fit: cover;
}


/* ---- 声（本文） ---- */

/* reset.css の blockquote（0.93em・左余白1.5em）を打ち消す */
.voice-card__quote {
  grid-area: quote;
  align-self: start;
  width: auto;
  margin: 0;
  padding: 0;
  font-size: inherit;
}

/* style.css の p（16px / 32px / 500）を打ち消す */
.voice-card__text,
.voice-card__text p {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.9;
  color: var(--voice-text);
}

.voice-card__text p {
  margin: 0 0 0.8em;
}

.voice-card__text p:last-child {
  margin-bottom: 0;
}


/* ---- フッター（工法・リンク） ---- */
.voice-card__footer {
  grid-area: footer;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-top: 14px;
  border-top: 1px solid var(--voice-line);
}

.voice-card__methods {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.voice-card__methods-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--voice-muted);
}

.voice-card__method-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 工法：一覧カードの記事タイプラベル（.card-badge）と同じ見た目の系統にする */
.voice-card__method {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--voice-navy);
  text-decoration: none;
  background: var(--voice-tint);
  border-left: 3px solid var(--voice-navy);
  border-radius: 4px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

a.voice-card__method::after {
  content: "›";
  font-size: 15px;
  line-height: 1;
}

a.voice-card__method:hover,
a.voice-card__method:focus-visible {
  color: #ffffff;
  background: var(--voice-navy);
}

.voice-card__link {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--voice-navy);
  text-decoration: none;
  white-space: nowrap;
}

.voice-card__link::after {
  content: " ›";
}

.voice-card__link:hover,
.voice-card__link:focus-visible {
  color: var(--voice-accent);
}

/* スクリーンリーダー専用テキスト（テーマに無い場合の保険） */
.voice-card .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ==================================================================
   一覧ページ（page-voice.php）
   ================================================================== */

/* style.css の .wrapper-voice main（上余白 150px）を、この構成に合わせて詰める */
.wrapper-voice .voice-list {
  margin-top: 32px;
  margin-bottom: 64px;
}

.voice-list__lead {
  max-width: 820px;
  margin: 0 auto 28px;
}

.voice-list__lead p {
  margin: 0 0 0.75em;
}

.voice-list__lead p:last-child {
  margin-bottom: 0;
}

.voice-list .voice-list__note {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--voice-muted);
  text-align: right;
}

.voice-list__items {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.voice-list__item {
  display: flex; /* カードの高さを行の中で揃える */
}

.voice-list__empty {
  text-align: center;
}


/* ==================================================================
   トップページ（front-page.php .top-voice）
   ================================================================== */
.top-voice__cards {
  display: grid;
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.top-voice__card {
  display: flex; /* カードの高さを揃える */
}

/* style.css の .top-voice p { text-align: center; } をカード内では打ち消す */
.top-voice .voice-card p {
  text-align: left;
}

.top-voice__empty {
  padding: 40px 0;
  color: var(--voice-navy);
}

/* コンパクト版（抜粋表示） */
.voice-card--compact .voice-card__catch {
  font-size: 16px;
}

.voice-card--compact .voice-card__text,
.voice-card--compact .voice-card__text p {
  font-size: 14px;
  line-height: 1.85;
}


/* ==================================================================
   お問い合わせの導入（「昔はなかったのに家にひび割れが。」）
   トップページ・FAQ（style.css の .wrapper-top / .wrapper-fqq）と同じ見せ方にする
   ================================================================== */
.wrapper-voice .contact-introduction {
  position: relative;
  margin: 0 auto 40px;
  padding: 120px 0 150px 0;
  background: url(../img/top-contact-back.jpg) no-repeat center / cover;
}

.wrapper-voice .contact-introduction h2 {
  position: relative;
  color: #ffffff;
}

.wrapper-voice .contact-introduction p {
  color: #ffffff;
}

.wrapper-voice .contact-introduction h2::after {
  content: "";
  position: absolute;
  top: 45px;
  right: -140px;
  width: 115px;
  height: 112px;
  background: url(../img/house-katamuki.png) no-repeat;
  background-size: contain;
}

@media screen and (max-width: 850px) {
  .wrapper-voice .contact-introduction h2::after {
    top: -90px;
    right: 0;
    width: 80px;
    height: 77px;
  }
}

@media screen and (min-width: 851px) and (max-width: 1550px) {
  .wrapper-voice .contact-introduction h2::after {
    top: 35px;
    width: 100px;
    height: 97px;
  }
}


/* ==================================================================
   851px 以上
   ================================================================== */
@media screen and (min-width: 851px) {

  /* ---- 一覧ページ：キャッチを上段に通し、アバターは声の左に置く ---- */
  .wrapper-voice .voice-list {
    margin-top: 48px;
    margin-bottom: 96px;
  }

  .voice-list__lead {
    margin-bottom: 40px;
  }

  .voice-list .voice-card {
    --voice-avatar-size: 88px;
    grid-template-areas:
      "title  title"
      "avatar quote"
      "footer footer";
    gap: 18px 24px;
    padding: 30px 32px 22px;
  }

  .voice-list .voice-card--no-avatar {
    grid-template-areas:
      "title"
      "quote"
      "footer";
  }

  .voice-list .voice-card__avatar {
    align-self: start;
  }

  .voice-list .voice-card__who {
    font-size: 14px;
  }

  .voice-list .voice-card__catch {
    margin-top: 6px;
    font-size: 19px;
  }

  .voice-list .voice-card__who:only-child {
    font-size: 18px;
  }

  /* ---- トップページ：3列。この幅ではアバターを見出しの上に置く ---- */
  .top-voice__cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 40px;
  }

  .voice-card--compact {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "avatar"
      "title"
      "quote"
      "footer";
    grid-template-rows: auto auto 1fr auto;
    gap: 12px;
  }

  .voice-card--compact .voice-card__title {
    align-self: start;
  }
}


/* ==================================================================
   1160px 以上
   ================================================================== */
@media screen and (min-width: 1160px) {

  /* 一覧ページ：2列 */
  .voice-list__items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }

  /* トップページ：カード幅に余裕があるので、アバターを見出しの横に戻す */
  .voice-card--compact {
    --voice-avatar-size: 72px;
    grid-template-columns: var(--voice-avatar-size) minmax(0, 1fr);
    grid-template-areas:
      "avatar title"
      "quote  quote"
      "footer footer";
    grid-template-rows: auto 1fr auto;
    gap: 16px 16px;
    padding: 26px 24px 20px;
  }

  .voice-card--compact .voice-card__title {
    align-self: center;
  }
}
