/* ========================================================================
   7NOW Q&A 詳細ページ — /faq/[faqId] 専用スタイル
   Public/step3/apps/7now-qa-cms/src/app/faq/[faqId]/styles.css を PHP 版に忠実移植
   ヘッダ緑グラデ + ライトモード (トップページ home.css と同一 7NOW 緑系デザイントークン)
   ========================================================================

   [デザイナー向けガイド] assets/css/faq.css — FAQ 詳細ページのデザイン編集場所

     ✏️ 変更OK  :
       ・:root の CSS 変数（カラートークン）— 色を一括変更できる。
       ・.faq-detail-answer 配下のすべてのスタイル（本文の p/h2/h3/ul/code/a 等）—
         ここが Lexical.php が生成した FAQ 回答本文の見た目を担う。
         自由に調整してよい。
       ・.lexical-btn / .lexical-btn--primary / .lexical-btn--secondary —
         回答内のリンクボタンの見た目。
       ・.lexical-img / .lexical-block / .lexical-quote —
         回答内の画像・テキストブロック・引用の見た目。
       ・.faq-feedback-btn / .faq-feedback-textarea 等の視覚的プロパティ —
         評価ウィジェットの色・余白・形。
     ⛔ 変更禁止（feedback.js との連動）:
       ・#feedback-idle / #feedback-no-form / #feedback-done の display プロパティ —
         feedback.js が display を直接 inline-style で切り替えるため、
         CSS 側でこれらに display を設定しても JS に上書きされる。混乱の元なので触らない。
       ・.faq-feedback-btn:disabled のスタイル —
         feedback.js が送信中に disabled にする。opacity などの視覚的な値は変えてよいが
         セレクタ自体は消さない（cursor: not-allowed が無効化の見た目に必要）。
       ・セレクタ名（.faq-feedback-widget / .faq-feedback-btn--yes /
         .faq-feedback-btn--no / .faq-feedback-btn--submit 等）—
         faq.php の HTML の class 名と一致している。リネームしない。

     凡例 → ⛔=変えると壊れる / ✏️=自由に変えてOK / ⚠️=デプロイ先で要調整
   ======================================================================== */

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

:root {
  /* ── ✏️ 7NOW グリーン系デザイントークン（design2-faq.html 準拠）──
     ここの変数を変えると詳細ページ全体の色が一括で変わる。 */
  --seven-green:        #009639;
  --green-dark:         #007530;
  --green-bright:       #00c94e;
  --green-soft:         #e9f7ee;
  --green-pale:         #f4fbf6;
  --green-border:       #c8e8d0;
  --orange:             #FF6C00;
  --red:                #EC0F2A;
  --text-dark:          #1b2e22;
  --text-mid:           #5a6e60;
  --text-light:         #8fa394;
  --white:              #ffffff;
  --surface-header:     #f8fdf9;
  --surface-bg:         #f4fbf6;
  --surface-card:       #ffffff;
  --shadow-header:      0 1px 0 var(--green-border), 0 2px 8px rgba(0,100,40,0.06);
  --radius-sm:          6px;
  --radius-lg:          18px;
  --shadow-card:        0 2px 12px rgba(0,100,40,0.07);
  --transition:         0.18s ease;

  /* ── 旧青系変数を緑系に対応付け（既存セレクタとの互換維持）── */
  --primary-blue:       #009639;
  --primary-blue-dark:  #007530;
  --primary-blue-light: #00c94e;
  --accent-cyan:        #00a843;
  --highlight-red:      #EC0F2A;
  --bg-primary:         #f4fbf6;
  --bg-card:            #ffffff;
  --text-primary:       #1b2e22;
  --text-secondary:     #5a6e60;
  --border-soft:        #c8e8d0;
}

body {
  font-family: 'Hiragino Sans', hiragino-kaku-gothic-pron, 'Noto Sans JP', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  /* sticky footer: コンテンツが短くてもフッターをビューポート最下部に配置し、
     長い場合は自然に下へ流れる。fixed ではないので重ならない。 */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== Header — 白サーフェス + ロゴ + 緑アクセントライン (design2-faq.html 準拠) ===== */
.faq-detail-header {
  background: var(--surface-header);
  border-bottom: 3px solid var(--seven-green);
  box-shadow: var(--shadow-header);
  position: sticky;
  top: 0;
  z-index: 200;
}
.faq-detail-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.faq-detail-header-logo {
  height: 38px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.faq-detail-header h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.faq-detail-top-link {
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--green-border);
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.faq-detail-top-link:hover {
  background: var(--green-soft);
  border-color: var(--seven-green);
  text-decoration: none;
}

/* ===== Main ===== */
.faq-detail-main {
  /* width:100% が無いと、body の flex(column) + margin:auto により
     コンテンツ量に応じて幅が縮む（shrink-to-fit）。全記事で一定幅にするため 100% を明示。 */
  width: 100%;
  max-width: 860px;
  margin: 32px auto;
  padding: 0 20px 80px;
}

/* ===== Card ===== */
.faq-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 32px 36px;
  box-shadow: 0 2px 12px rgba(0,100,40,0.07);
  overflow: hidden;
}

/* ===== パンくず (L1 > L2、複数行可) ===== */
.faq-detail-breadcrumbs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.faq-detail-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  background: var(--bg-primary);
  padding: 0.3em 1em;
}
.faq-detail-breadcrumb .bc-l1 {
  color: var(--primary-blue-dark);
  font-weight: 700;
}
.faq-detail-breadcrumb .bc-sep {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.6;
}
.faq-detail-breadcrumb .bc-l2 {
  color: var(--text-secondary);
  font-weight: 700;
}

/* ===== FAQ ID ===== */
.faq-detail-id {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
  text-align: right;
}

/* ===== 質問タイトル ===== */
.faq-detail-question {
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--primary-blue-dark);
  line-height: 1.45;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-blue);
  padding-left: 14px;
}

/* ===== ✏️ 回答本文 — デザイナーのメイン編集エリア =====
   .faq-detail-answer 配下のすべてのルールは Lexical.php が生成した FAQ 回答本文の見た目を担う。
   p / h2 / h3 / ul / ol / a / code / blockquote / .lexical-btn / .lexical-img /
   .lexical-block / .lexical-quote 等、自由に調整してよい。 */
.faq-detail-answer {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-primary);
  margin-bottom: 28px;
}
.faq-detail-answer p { margin: 10px 0; }
.faq-detail-answer p:first-child { margin-top: 0; }
.faq-detail-answer p:last-child { margin-bottom: 0; }
.faq-detail-answer h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-blue-dark);
  margin: 20px 0 8px;
}
.faq-detail-answer h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--primary-blue-dark);
  margin: 18px 0 8px;
}
.faq-detail-answer ul,
.faq-detail-answer ol {
  margin: 8px 0;
  padding-left: 24px;
}
.faq-detail-answer li { margin: 4px 0; }
.faq-detail-answer a {
  color: var(--primary-blue);
  text-decoration: underline;
}
.faq-detail-answer a:hover { color: var(--primary-blue-dark); }
.faq-detail-answer code {
  font-family: 'Courier New', Courier, monospace;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.88em;
}
.faq-detail-answer blockquote.lexical-quote {
  border-left: 3px solid var(--green-border);
  margin: 12px 0;
  padding: 6px 14px;
  color: var(--text-secondary);
  background: var(--green-pale);
}
/* Lexical ボタンリンク */
.faq-detail-answer .lexical-btn {
  display: inline-block;
  padding: 7px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  margin: 4px 2px;
}
.faq-detail-answer .lexical-btn--primary {
  background: var(--seven-green);
  color: #fff;
  border: 1.5px solid var(--seven-green);
}
.faq-detail-answer .lexical-btn--primary:hover {
  background: var(--green-dark);
  color: #fff;
}
.faq-detail-answer .lexical-btn--secondary {
  background: #fff;
  color: var(--green-dark);
  border: 1.5px solid var(--green-border);
}
.faq-detail-answer .lexical-btn--secondary:hover {
  background: var(--green-soft);
  border-color: var(--seven-green);
}
/* Lexical 画像 */
.faq-detail-answer .lexical-img {
  margin: 12px 0;
}
.faq-detail-answer .lexical-img img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.faq-detail-answer .lexical-img--hero img {
  width: 100%;
}
.faq-detail-answer .lexical-img--thumbnail img {
  max-width: 160px;
}
.faq-detail-answer .lexical-img figcaption {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
/* Lexical テキストブロック */
.faq-detail-answer .lexical-block {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green-border);
}
.faq-detail-answer .lexical-block--highlight {
  background: #fffde7;
  border-color: #f9a825;
}
.faq-detail-answer .lexical-block--note {
  background: var(--green-pale);
  border-color: var(--seven-green);
}
.faq-detail-answer .lexical-block--callout {
  background: #fff3e0;
  border-color: var(--orange);
}
.faq-detail-answer .lexical-block--normal {
  background: #f5f5f5;
  border-color: #ccc;
}

/* ===== 役立ち評価ウィジェット =====
   ✏️ 評価ボタンの色・形・余白はここで自由に変えてよい。
   ⛔ .faq-feedback-btn:disabled はセレクタを消さない（feedback.js が disabled を設定する）。
   ⛔ セレクタ名（.faq-feedback-btn--yes / --no / --submit）はfaq.php の class と一致。リネームしない。 */
.faq-feedback-widget {
  margin-bottom: 24px;
}
.faq-feedback-divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 0 0 20px;
}
.faq-feedback-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 12px;
  text-align: center;
}
.faq-feedback-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.faq-feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--green-border);
  background: var(--white);
  color: var(--green-dark);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  min-width: 92px;
  font-family: inherit;
}
.faq-feedback-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.faq-feedback-btn--yes:hover:not(:disabled) {
  background: var(--green-soft);
  border-color: var(--seven-green);
  color: var(--green-dark);
}
.faq-feedback-btn--no:hover:not(:disabled) {
  background: #fff5f5;
  border-color: var(--red);
  color: var(--red);
}
.faq-feedback-no-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-feedback-textarea {
  width: 100%;
  border: 1.5px solid var(--green-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  resize: vertical;
  transition: border-color var(--transition);
  line-height: 1.6;
}
.faq-feedback-textarea:focus {
  outline: none;
  border-color: var(--seven-green);
}
.faq-feedback-btn--submit {
  align-self: flex-start;
  background: var(--seven-green);
  color: var(--white);
  border-color: var(--seven-green);
}
.faq-feedback-btn--submit:hover:not(:disabled) {
  background: var(--green-dark);
  border-color: var(--green-dark);
}
.faq-feedback-thanks {
  font-size: 0.88rem;
  color: var(--green-dark);
  font-weight: 600;
  padding: 4px 0;
}
@media (max-width: 768px) {
  .faq-feedback-btn {
    width: 100%;
    padding: 10px 20px;
  }
  .faq-feedback-buttons {
    flex-direction: column;
    max-width: 260px;
    margin: 0 auto;
  }
}

/* ===== 「一覧に戻る」リンク ===== */
.faq-detail-back {
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
.faq-detail-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--primary-blue);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.faq-detail-back-link:hover {
  background: var(--green-soft);
  color: var(--primary-blue-dark);
  text-decoration: none;
}

/* ===== Footer ===== */
.faq-detail-footer {
  /* margin-top:auto で余白を全てフッターの上に集める → 短いページでは最下部に押し下がる。 */
  margin-top: auto;
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--seven-green) 100%);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 20px 20px 28px;
  font-size: 0.78rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .faq-detail-card { padding: 22px 18px; }
  .faq-detail-question { font-size: 1.1rem; }
  .faq-detail-header-inner { height: 54px; gap: 10px; }
  .faq-detail-header h1 { font-size: 0.9rem; }
  .faq-detail-header-logo { height: 32px; }
}

/* スマホ実機幅で本文の横幅を確保: カード余白を外し、各要素に横 14px を持たせる */
@media (max-width: 500px) {
  .faq-detail-card { padding: 0; }
  .faq-detail-id { padding-right: 14px; }
  .faq-detail-question { padding-right: 14px; }
  .faq-detail-answer { padding: 0 14px; }
  .faq-detail-back { padding: 18px 14px; }
}

@media print {
  .faq-detail-header { position: static; }
  .faq-detail-footer { display: none; }
}
