/* =============================================================
   faq.css  — FAQ ページ専用スタイル
   既存の main.css / style.css を上書きせず追加のみ行う
   ============================================================= */

/* ----------------------------------------------------------
   セクション見出し（GIF 画像 <p> を置換）
   ---------------------------------------------------------- */
.faq-section-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: #336619;
    border-left: 4px solid #336619;
    padding: 6px 12px 6px 14px;
    margin: 24px 0 10px;
    background: #f4faf1;
    border-radius: 0 3px 3px 0;
    line-height: 1.5;
}
.faq-section-heading:first-child {
    margin-top: 12px;
}

/* ----------------------------------------------------------
   目次ナビ（<dl> ラッパー）
   ---------------------------------------------------------- */
.faq-toc {
    background: #f9fdf7;
    border: 1px solid #aad8ac;
    border-radius: 4px;
    padding: 10px 16px 10px 12px;
    margin-bottom: 18px;
}
.faq-toc dl {
    margin: 0;
    padding: 0;
}
.faq-toc dd {
    margin: 0;
    padding: 0;
    line-height: 1;
}
.faq-toc dd a {
    font-size: 1.2rem;
    display: block;
    padding: 3px 0 3px 4px;
    line-height: 1.5;
    color: #004d00;
    border-bottom: none;
    transition: color 0.1s;
}
.faq-toc dd a:hover {
    color: #ac70d5;
    text-decoration: underline;
}

/* ----------------------------------------------------------
   Q&A アコーディオン（<details> / <summary>）
   ---------------------------------------------------------- */
.faq-item {
    border: 1px solid #d0e8d2;
    border-radius: 4px;
    margin-bottom: 6px;
    background: #fff;
    overflow: hidden;
}

/* Q サマリー行 */
.faq-question {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 11px 14px 11px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    list-style: none;
    user-select: none;
    background: #fff;
    transition: background 0.15s;
    line-height: 1.55;
}
/* WebKit summary triangle 非表示 */
.faq-question::-webkit-details-marker {
    display: none;
}
.faq-question::marker {
    content: none;
}
/* ホバー */
.faq-question:hover {
    background: #f3f9f1;
}
/* 展開時 */
.faq-item[open] > .faq-question {
    background: #eaf4e8;
    border-bottom: 1px solid #cce5ce;
}

/* chevron */
.faq-question::after {
    content: '▼';
    font-size: 1.2rem;
    margin-left: auto;
    color: #888;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    padding-left: 8px;
}
.faq-item[open] > .faq-question::after {
    transform: rotate(180deg);
}

/* Q ラベル */
.faq-q {
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1.2rem;
    color: #1a6bb5;
    width: 1.1em;
    text-align: center;
    line-height: 1;
}

/* A 回答エリア */
.faq-answer {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 16px 14px 12px;
    font-size: 1.2rem;
    line-height: 1.72;
    background: #fafffe;
}
.faq-answer-body {
    flex: 1;
    min-width: 0;
}

/* A ラベル */
.faq-a {
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1.2rem;
    color: #c0392b;
    width: 1.1em;
    text-align: center;
    line-height: 1;
}

/* 回答内の要素 */
.faq-answer-body ul,
.faq-answer-body ol {
    padding-left: 1.4em;
    margin: 6px 0;
}
.faq-answer-body hr {
    margin: 8px 0;
    border-color: #ddd;
}
.faq-answer-body a {
    color: #003600;
    text-decoration: underline;
}
.faq-answer-body a:hover {
    color: #ac70d5;
}

/* ----------------------------------------------------------
   タブナビ（既存 .faq-nav を微調整）
   ---------------------------------------------------------- */
.faq-nav .nav-link {
    border-radius: 4px 4px 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 8px 18px;
    color: #336619;
    background: #f4faf1;
    border: 1px solid #aad8ac;
    border-bottom: none;
    transition: background 0.15s;
}
.faq-nav .nav-link:hover {
    background: #e8f5e4;
    color: #1a3e0a;
}
.faq-nav .nav-link.active {
    background: #fff;
    color: #1a3e0a;
    border-color: #aad8ac;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    z-index: 1;
    position: relative;
}

/* 回答内の強調テキスト（メンテナンス時刻等）*/
.faq-warn {
    color: #d4580f;
}

.faq-border-1 {
    padding: 14px 16px 20px;
}

/* ----------------------------------------------------------
   アンカーターゲット ハイライト
   目次リンクからスクロール後、該当 Q&A を視認しやすくする
   ---------------------------------------------------------- */
@keyframes faq-target-flash {
    0%   { background-color: #fffbcc; box-shadow: 0 0 0 3px #e8c000; border-color: #e8c000; }
    60%  { background-color: #fffbcc; box-shadow: 0 0 0 3px #e8c000; border-color: #e8c000; }
    100% { background-color: transparent; box-shadow: 0 0 0 0 transparent; border-color: transparent; }
}

/* スクロール時に固定ヘッダーに隠れないよう余白を確保 */
.faq-item {
    scroll-margin-top: 80px;
}

/* JS が付与するクラス — animationend 後に JS 側で除去する */
.faq-item.faq-highlight {
    animation: faq-target-flash 2.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
