:root {
    /* --- Primary Colors --- */
    --color-main: #004D99;
    --color-main-footer: #2A487E;
    --color-accent-green: #4CAF50;
    
    /* --- Grayscale & Text --- */
    --color-text-dark: #333;
    --color-text-dark-2: #181818;
    --color-text-mid: #777;
    --color-text-light: #aaa;
    --color-text-q-list: #131313;
    --color-text-q-result: #040404;

    /* --- Backgrounds & Hover States --- */
    --color-background-page: #f3f3f3;
    --color-background-light: #fff;
    --color-background-dark: #e6e6e6;
    --color-background-hover: #f0f0f0;
    --color-background-active: #f0f8ff;

    /* --- Borders & Shadows --- */
    --color-border-light: #eee;
    --color-border-mid: #ddd;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-shadow-card: rgba(0, 0, 0, 0.08);
    --color-shadow-card-hover: rgba(0, 77, 153, 0.1);
    
    /* --- Buttons --- */
    --color-button-default: #999;
    --color-button-default-hover: #777;
    /* Specific accent colors from guide-item:nth-child */
    --color-accent-blue-1: #29b6f6; /* サイフの作成 */
    --color-accent-orange: #ffa726; /* チャージ方法 */
    --color-accent-blue-2: #039be5; /* 支払い方法 */
    --color-accent-red: #ef5350; /* 利用履歴 */
    --color-accent-cyan: #00acc1; /* 個人間送金 */
    --color-accent-gray: #757575; /* アカウント設定 */
}

/* --- 共通リセットとベーススタイル --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: var(--color-text-dark);
    background-color: var(--color-background-page);
    padding-top: 60px;
}

a {
    text-decoration: none;
    color: var(--color-main);
}

a:hover {
    opacity: 0.8;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 15px;
    /* ここに display: flex; が入っていないことを確認してください */
    display: block; /* 明示的にブロック要素とする */
}

.separator {
    border: 0;
    border-top: 1px solid var(--color-border-mid);
    margin: 40px 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-main);
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 5px solid var(--color-main);
}

/* --- 1. ヘッダー（固定） --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-background-light);
    box-shadow: 0 2px 4px var(--color-shadow);
    z-index: 100;
    height: 60px;
}

.header-content {
    max-width:1000px;
    width:100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.app-title {
    font-size: 16px; 
    font-weight: 700;
    color: var(--color-main);
    display: flex;
    align-items: center;
    padding-left:15px;
}

.app-title .logo-image {
    width: 30px; 
    height: 30px;
    margin-right: 8px;
}

/* 修正①: PCナビゲーションのスタイル変更 */
.header-nav a {
    color: var(--color-text-dark);
    padding: 0 15px;
    font-weight: 400;
    border-bottom: none; 
    transition: color 0.3s;
}

.header-nav a.active {
    color: var(--color-main); 
    font-weight: 700;
    border-bottom: 3px solid var(--color-main); 
}
.header-nav a:hover:not(.active) {
    color: var(--color-text-mid);
}

/* 💡 ガイドメニューのレイアウト (グリッド) */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); 
    gap: 15px;
    padding-right: 20px;
    padding-left:20px;
    max-width: 900px; 
    margin: 0 auto;
}

.guide-item {
    background-color: var(--color-background-light);
    border-radius: 12px; 
    box-shadow: 0 4px 12px var(--color-shadow-card); 
    padding: 15px;
    text-align: left;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    color: var(--color-text-dark);
    border: 1px solid #e0e0e0; 
}

/* 修正②: Font Awesomeアイコンが表示されない問題の解消 */
.guide-icon-fa {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands';
    font-weight: 900; 
    font-size: 28px;
    /* color: #004D99; <-- このデフォルト色は削除またはコメントアウト */
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.guide-item:hover {
    box-shadow: 0 4px 12px var(--color-shadow-card-hover); 
}

.guide-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

/* 修正②: メインタイトルとサブタイトルのスタイル */
.guide-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-dark);
    text-align: left;
    display: flex;
    flex-direction: column; 
}

.guide-text small {
    display: block; 
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-mid);
    margin-top: 2px;
}

/* --- 3. Q&A カテゴリから探す --- */
.search-box {
    display: flex;
    margin-bottom: 30px;
}

#qa-search-input {
    flex-grow: 1;
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid var(--color-border-mid);
    border-right: none;
    border-radius: 4px 0 0 4px;
}

/* --- Q&A: カテゴリバッジの装飾 --- */
.qa-cat-badge {
    display: inline-block;
    font-size: 11px;        /* 文字を小さく */
    color: #666;            /* 文字色をグレーに */
    background-color: #f0f0f0; /* 背景を薄いグレーに */
    border: 1px solid #ddd; /* 薄い枠線 */
    border-radius: 4px;     /* 角を丸く */
    padding: 2px 6px;       /* 内側の余白 */
    margin-right: 8px;      /* 質問文との間隔 */
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;    /* バッジ内の改行を防ぐ */
}

#qa-search-button {
    padding: 10px 20px;
    background-color: var(--color-button-default);
    color: var(--color-background-light);
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#qa-search-button:hover {
    background-color: var(--color-button-default-hover);
}

/* Q&A カテゴリリスト */
.qa-category-item {
    background-color: var(--color-background-light);
    border: 1.5px solid var(--color-border-mid);
    border-radius: 4px;
    margin-bottom: 10px;
}

.qa-category-header {
    display: flex;
    align-items: center;
    /* パディングは維持: 15px */
    padding: 15px; 
    cursor: pointer;
    background-color: var(--color-background-light);
    border-bottom: 1px solid var(--color-border-mid);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-dark);
    transition: background-color 0.2s;
    
    /* ★追加: スクロール追従設定 */
    position: sticky;
    top: 60px; /* 固定ヘッダー(60px)のすぐ下に張り付く */
    z-index: 10; /* コンテンツより手前に表示 */
}

.qa-category-header i {
    font-size: 20px;
    color: var(--color-main);
    
    /* 修正: 左側のマージンをゼロにし、パディングで位置を調整する */
    margin-right: 15px; /* アイコンとテキストの間隔 */
    margin-left: 0; 
    
    /* 修正: アイコンの領域の幅を固定して、テキストの開始位置を揃える */
    min-width: 25px; 
    text-align: left;
}

.qa-category-header:hover {
    background-color: var(--color-background-hover); 
}

/* Q&Aリストが開いている時のヘッダーのスタイル */
.qa-category-header[aria-expanded="true"] {
    background-color: var(--color-background-active);
    border-bottom: 1px solid var(--color-border-mid);
}

.qa-category-header img {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    /* フィルタのカラーは直接維持 */
    filter: invert(33%) sepia(87%) saturate(303%) hue-rotate(180deg) brightness(97%) contrast(92%);
}

.qa-category-header span.arrow {
    margin-left: auto;
    font-size: 20px;
    transition: transform 0.3s;
}

.qa-category-header[aria-expanded="true"] span.arrow {
    transform: rotate(90deg);
}

.qa-list {
    list-style: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.qa-list li:first-child a {
    border-top: none; 
}
.qa-list li:last-child a {
    border-bottom: none; 
}
.qa-list li a {
    display: block;
    padding: 10px 15px 10px 55px;
    font-size: 15px;
    border-top: 1px dotted var(--color-border-light);
    color: var(--color-text-q-list);
    position: relative;
}

.qa-list li a:before {
    content: "Q.";
    color: var(--color-accent-green); 
    font-weight: 700;
    position: absolute;
    left: 20px;
}

.qa-list li a:hover {
    background-color: var(--color-background-active);
    color: var(--color-main);
}

/* 検索結果エリア */
.qa-results-area {
    background-color: var(--color-background-light);
    padding: 15px;
    border: 1px solid var(--color-border-mid);
    border-radius: 4px;
    margin-bottom: 20px;
}

#qa-result-list {
    list-style: none;
    padding: 0;
}
#qa-result-list li a {
    display: block;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dotted var(--color-border-light);
    color: var(--color-text-q-result);
}

.search-info {
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border-light);
}

/* --- 4. アプリダウンロード --- */

.download-section {
    background-color: var(--color-background-light);
    padding: 20px 0;
    /* ★追加: セクション全体のはみ出し防止 */
    overflow: hidden;
}

.download-asset {
    position: relative; 
    width: 100%;
}

.app-screenshot-download {
    width: 100%;
    max-width: 100%;
}

.download-asset.sp-view { 
    display: none; 
} 

/* 修正: ボタンオーバーレイのスタイル - 絶対配置ボタンのコンテナとして使用 */
.download-buttons-overlay {
    position: absolute;
    width: 100%; 
    height: 100%;
    top: 0;
    left: 0;
    display: block; 
}

.download-btn-img-apple img,
.download-btn-img-google img {
    height:2.5vw; 
    max-height:30px;
    min-height:20px;
    width: auto;
    display: block;
}

/* Appleボタン (基準点) */
.apple-btn-abs {
    position: absolute;
    top: 63%; 
    left: 20.2%; 
}

/* Androidボタン (Appleボタンの横に配置) */
.android-btn-abs {
    position: absolute;
    top: 63%; 
    left: 38%; 
}

.download-buttons-overlay.pc-view.sp-view {
    display: none;
}

/* --- レスポンシブ対応 (モバイル向け) --- */
@media (max-width: 768px) {
    /* Appleボタン (基準点) */
    .apple-btn-abs {
        position: absolute;
        top: 63%; 
        left: 22%; 
    }

    /* Androidボタン (Appleボタンの横に配置) */
    .android-btn-abs {
        position: absolute;
        top: 63%; 
        left: 40%; 
    }
    .qa-category-header {
        top:47px
    }

    .download-asset.pc-view {
        display: none !important;
    }
    
    .download-asset.sp-view {
        display: block !important;
    }
}


/* --- 5. お問い合わせ先 --- */
.contact-box {
    text-align: center;
    background-color: var(--color-background-light);
    padding: 30px;
    border: 1px solid var(--color-border-mid);
    border-radius: 8px;
}

.contact-office {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 5px;
}

.contact-hours {
    font-size: 14px;
    color: var(--color-text-mid);
    margin-bottom: 15px;
}

.contact-note {
    font-size: 14px;
    margin-bottom: 5px;
}

.contact-email {
    font-size: 20px;
    font-weight: 700;
    padding: 10px 0;
    border: 2px solid var(--color-main);
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
}

.contact-email a {
    color: var(--color-main);
}

/* --- 6 & 7. リンク集 --- */
#links-container {
    display: block;
    margin: 0;
    padding: 0;
}

.link-group {
    background-color: var(--color-background-light);
    border: 1px solid var(--color-border-mid);
    border-radius: 4px;
    margin-bottom: 10px;
}

.link-group h3 {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    background-color: var(--color-background-light);
    color: var(--color-text-dark);
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--color-border-mid); 
}

.link-group h3 span.arrow {
    margin-left: auto;
    font-size: 20px;
    transition: transform 0.3s;
}

.link-group h3[aria-expanded="true"] span.arrow {
    transform: rotate(90deg);
}

.link-group ul {
    list-style: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: var(--color-background-light);
}

.link-group ul li a {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    color: var(--color-text-dark);
    border-bottom: 1px dotted var(--color-border-light);
    font-size: 15px;
}

.link-group ul li:last-child a {
    border-bottom: none;
}

.link-group ul li a:after {
    content: '›'; 
    font-size: 18px;
    color: var(--color-button-default);
}

.link-group ul li a:hover {
    background-color: var(--color-background-hover);
}


/* --- 8. フッター --- */
#main-footer {
    background-color: var(--color-main-footer);
    color: var(--color-background-light);
    padding: 20px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
    text-align: center;
}

/* 修正⑤: フッターロゴのスタイル */
.footer-app-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer-logo {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

.copyright {
    font-size: 12px;
    color: var(--color-text-light);
}

/* 修正①: モバイルメニューボタン */
.menu-btn {
    display: none; 
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-dark);
    cursor: pointer;
    padding: 5px 10px;
    z-index: 101;
}

/* 修正①: モバイル用サイドメニュー */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 250px; 
    height: 100%;
    background-color: var(--color-background-light);
    box-shadow: -2px 0 5px var(--color-shadow);
    z-index: 200;
    transform: translateX(100%); 
    transition: transform 0.3s ease-out;
    padding: 20px;
}

.mobile-menu.open {
    transform: translateX(0); 
}

.mobile-menu .close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-dark);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    margin-top: 40px;
}

.mobile-nav a {
    color: var(--color-text-dark);
    padding: 15px 0;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--color-border-light);
}

.mobile-nav a.active {
    color: var(--color-main);
}

/* --- レスポンシブ対応 (モバイル向け) --- */
@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }
    #main-header {
        height: 50px;
    }
    .app-title {
        font-size: 16px;
    }
    .header-nav {
        display: none; 
    }
    .header-content{
        padding:0;
    }
    
    .app-title{
        padding-left: 15px;
    }

    .menu-btn{
        padding-right: 15px;
    }

    .section-title {
        font-size: 20px;
    }

    /* ダウンロードセクションのレイアウト変更 */
    .download-content {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .app-screenshot {
        width: 180px;
    }

    .download-buttons {
        max-width: 100%;
    }

    /* Q&A 検索ボタンの幅を調整 */
    #qa-search-button {
        padding: 10px 15px;
    }

    /* リンク集のグリッド調整 */
    #links-container {
        grid-template-columns: 1fr;
    }
    /* モバイルでメニューボタンを表示し、PCナビゲーションを非表示 */
    #pc-nav {
        display: none;
    }
    .menu-btn {
        display: block;
    }

    /* ダウンロードセクション (SP) */
    .download-asset.pc-view { 
        display: none; 
    }
    .download-asset.sp-view { 
        display: block; 
    }
    
    .download-buttons-overlay.sp-view {
        display: flex;
        justify-content: space-between; 
        
        /* 中央寄せを維持 */
        left: 75%;
        top: 21%; 
        transform: translateX(-50%);
        
        width: 200%;
        min-width: 250px; 
        
        background: none; 
        padding: 0;
    }
    
    .download-buttons-overlay.sp-view .download-btn-img img {
        height: 8vw; 
        max-height: 900px; 
        min-height: 30px;
        
        width: auto;
        flex-shrink: 0; 
    }
}

/* --- ページトップボタンのスタイル --- */
.to-top-button {
    /* 修正: 固定位置に配置 */
    position: fixed;
    bottom: 10%;
    right: 5%;
    
    /* 修正: 初期状態は非表示 */
    display: none; 
    
    /* スタイル設定 */
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: var(--color-main);
    color: var(--color-background-light);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px var(--color-shadow);
    transition: opacity 0.3s, background-color 0.3s;
    z-index: 99; /* 他の要素より手前に表示 */
    font-size: 18px;
    opacity: 0.5;
}

.to-top-button:hover {
    background-color:var(--color-main-footer); /* メインカラーより少し濃い色 */
}

/* 修正: モバイルでの調整 (任意) */
@media (max-width: 768px) {
    .to-top-button {
        width: 40px;
        height: 40px;
        bottom: 5%;
        right: 5%;
        font-size: 16px;
    }
}
/* --- 詳細ページ用スタイル --- */

/* パンくずリスト */
.breadcrumb {
    font-size: 14px;
    color: var(--color-text-mid);
    margin-bottom: 20px;
    padding: 10px 0;
}
.breadcrumb a {
    color: var(--color-text-mid);
    text-decoration: underline;
}
.breadcrumb a:hover {
    color: var(--color-main);
}

/* 記事コンテンツ */
.article-content {
    background: var(--color-background-light);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--color-border-mid);
    margin-bottom: 40px;
    
    /* 修正: 幅を明示的に100%に設定し、親要素(.container)いっぱいに広げる */
    width: 100%; 
    box-sizing: border-box; /* paddingを含めた幅計算にする */
    
    /* 念のため、floatやflexの影響を排除 */
    float: none;
    display: block;
}

.article-header .article-title {
    font-size: 20px; /* 24pxから縮小 */
    color: var(--color-text-dark);
    line-height: 1.5;
    display: flex;
    align-items: flex-start; /* アイコンとテキストの上揃え */
}

.article-title {
    font-size: 28px;
    color: var(--color-main);
    display: flex;
    align-items: center;
    gap: 15px;
    line-height: 1.4;
}

/* アイコンサイズ調整 */
.article-header .article-title i {
    font-size: 24px; /* アイコンも少し小さく */
    margin-top: 2px; /* テキストとの位置合わせ */
}
/* 回答(A)エリア */
.qa-answer-box {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dotted var(--color-border-mid);
}

/* 回答ラベル */
.qa-answer-label {
    font-weight: 700;
    color: var(--color-main);
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
}
/* 回答ラベル */
.qa-answer-label {
    font-weight: 700;
    color: var(--color-main);
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

/* 修正: 回答(A)本文のサイズ調整 */
.qa-answer-content {
    font-size: 18px; /* 読みやすいサイズに拡大 */
    line-height: 1.8;
    color: var(--color-text-dark);
}

.qa-answer-content p {
    margin-bottom: 17px;
}

.article-body h3 {
    font-size: 20px;
    color: var(--color-text-dark);
    border-left: 5px solid var(--color-main);
    padding-left: 15px;
    margin: 40px 0 20px;
    background-color: var(--color-background-page);
    padding: 10px 15px;
}
.article-body h3:first-child {
    margin-top: 0;
}

.article-body p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--color-text-dark);
}

/* 修正③: 記事内の関連Q&Aスタイル */
.related-qa-section {
    margin-top: 60px;
    padding-top: 20px;
}

/* 修正: 関連Q&Aリストのスタイル調整（はみ出し防止） */
.related-qa-section .qa-list {
    border: 1px solid var(--color-border-mid);
    border-radius: 4px;
    /* リストアイテムの幅を確保 */
    width: 100%;
}

/* --- 詳細ページ用: 現在のガイドのハイライト --- */
.guide-item.current-guide {
    background-color: var(--color-background-active); 
    border: 2px solid var(--color-main); 
    box-shadow: none; 
    pointer-events: none; 
    cursor: default;
}

.guide-item.current-guide .guide-text {
    font-weight: 700;
    color: var(--color-main);
}

.guide-item.current-guide small {
    color: var(--color-main);
}

/* スマホ対応 */
@media (max-width: 768px) {
    .article-content {
        padding: 20px;
    }
    .article-title {
        font-size: 22px;
    }
}
/* --- ガイド詳細: ステップ表示エリア --- */

/* 修正: .article-body 直下の指定にすることで詳細度を上げ、他のpタグと分離 */
.article-body .guide-description {
    font-size: 16px;
    margin-bottom: 30px;
    color: var(--color-text-dark);
    font-weight: normal;
}

/* ステップ全体のグリッドレイアウト */
.step-grid {
    display: grid;
    /* PC: 3列等分 */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* アイテム間の隙間 */
    margin-top: 20px;
}

/* 各ステップのカードスタイル */
.step-item {
    display: flex;
    flex-direction: column;
    background-color: var(--color-background-page); /* 少し色をつけて区分け */
    border-radius: 6px;
    padding: 10px;
    border: 1px solid var(--color-border-light);
}


.step-badge {
    display: inline-block;
    background-color: var(--color-main);
    color: #fff;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
}

/* 画像エリア */
.step-image-box {
    /* margin-bottom: 15px; */
    text-align: center;
    background:  var(--color-background-page); /* 少し色をつけて区分け */
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    padding: 10px;
}

.step-image {
    width: 100%;
    height: auto;
    display: block;
    /* アプリ画面っぽく少し影をつける */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 説明文 */
/* 修正: 親クラス(.step-item)を含めて詳細度を上げ、descriptionの色と分離する */
.step-item .step-text {
    font-size: 15px;
    line-height: 1.6;
    /* 明示的に色を指定 */
    color: var(--color-text-dark-2); /* 濃い黒 (#333) */
    margin: 0;
    /* テキストの幅確保 */
    width: 100%;
}

/* --- ガイド詳細: 中項目タイトル --- */
.guide-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-dark);
    
    /* デザイン装飾（左線と背景） */
    border-left: 6px solid var(--color-main);
    background-color: var(--color-background-page);
    padding: 12px 15px;
    
    /* 余白調整 */
    margin-top: 50px; /* 前のセクションとの間隔 */
    margin-bottom: 20px; /* ステップグリッドとの間隔 */
}

/* 最初のセクションだけ上の余白を詰める */
.guide-section-title:first-of-type {
    margin-top: 30px;
}

/* --- ガイド詳細: アコーディオン UI --- */

.guide-accordion {
    margin-top: 30px;
}

.accordion-item {
    border: 1px solid var(--color-border-mid);
    border-radius: 8px;
    margin-bottom: 15px;
    /* overflow: hidden; */
    background-color: var(--color-background-light);
}

/* ヘッダーボタン */
.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--color-background-page);
    border: none;
    border-bottom: 1px solid transparent; /* 閉じたときは線なし */
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: left;
    /* ★追加: スクロール追従設定 */
    position: sticky;
    top: 60px; /* 固定ヘッダー(60px)のすぐ下に張り付く */
    z-index: 10; /* コンテンツより手前に表示 */
}

.accordion-header:hover {
    background-color: #eaeaea;
}

/* 開いている状態のヘッダー */
.accordion-header.active {
    border-bottom: 1px solid var(--color-border-mid);
    background-color: var(--color-background-active); /* 薄い青 */

}

.accordion-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-dark);
    /* 左側の青い線 */
    border-left: 5px solid var(--color-main);
    padding-left: 10px;
}

.accordion-icon {
    font-size: 16px;
    color: var(--color-text-mid);
    transition: transform 0.3s;
}

/* 開いている時のアイコン回転 */
.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
    color: var(--color-main);
}

/* コンテンツエリア */
.accordion-content {
    padding: 20px;
    /* デフォルトはJS/EJSで制御するためここでは指定しない */
    background-color: #fff;
}

/* 中身のステップグリッドのマージン調整 */
.accordion-content .step-grid {
    margin-top: 0;
}

/* スマホ調整 */
@media (max-width: 768px) {
    .accordion-header {
        padding: 10px;
    }
    .accordion-title {
        font-size: 16px;
    }
}
/* --- スマホ表示の最適化 (768px以下) --- */
@media (max-width: 768px) {

    /* ヘッダーボタン */
    .accordion-header {
        top: 47px; /* 固定ヘッダー(60px)のすぐ下に張り付く */
    }
        
    /* 1. 全体の余白調整 */
    /* 記事の左右余白を少し詰めて、コンテンツ幅を確保 */
    .article-content {
        padding: 10px; 
    }



    /* 2. ステップ（グレーのカード）の調整 */
    .step-item {
        /* 余白をPCの24pxから大幅に縮小し、テキストエリアを広げる */
        padding: 10px; 
        /* 角丸を少し小さくしてスッキリさせる */
        border-radius: 8px;
    }

    /* 3. 画像エリア（白い箱）の調整 */
    .step-image-box {
        /* 画像周りの余白をPCの20pxから縮小 */
        padding-left: 20px;
        padding-right:20px;        
        /* 画像の白枠が画面を圧迫しないよう、最大幅を少し抑えるか、あるいは100%にする */
        /* ここでは自然な幅になるよう調整 */
        max-width: 100%;
    }

    /* 4. STEPバッジ周りの調整 */
    .step-header {
        text-align: left;
    }
    
    .step-badge {
        font-size: 13px; /* スマホでは少し小さく */
        padding: 4px 12px;
    }

    /* 5. テキストの調整 */
    .step-item .step-text {
        font-size: 15px; /* 16pxだと大きすぎる場合があるため微調整（お好みで16pxでもOK） */
        line-height: 1.7; /* 行間を適度に */
        margin-top: 0;    /* 余計な上部余白を削除 */
        
        /* テキストの幅を確保するため、左右の詰めをなくす */
        width: 100%;
        text-align: left;
    }

    /* 6. グリッドの隙間調整 */
    .step-grid {
        /* 縦並びの隙間を40pxから縮小して、スクロール量を減らす */
        gap: 24px;
        grid-template-columns: 1fr; /* 確実に1列にする */
    }
}