/* ==========================================================================
   アコーディオン機能 - 完全修正版（初期状態：閉じている）
   デスクトップでもモバイルでも初期状態は閉じた状態
   ========================================================================== */

/* 基本スタイル */
.accordion-section {
    margin-bottom: 16px;
    border: none;
}

.accordion-section-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    border-radius: 12px;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.accordion-section-header:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.accordion-section-header h2 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.5rem;                                     
    border: none !important;
    line-height: 1.4;
}

.accordion-section-header h2::after {
    display: none !important;
}

.accordion-section-toggle {
    width: 32px;
    height: 32px;
    background:#cbcbcb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4A90E2;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.accordion-section-header.active .accordion-section-toggle {
    background: white;
    color: var(--main-color);
    transform: rotate(180deg);
}

/* アコーディオンコンテンツ - 重要！初期状態は閉じる */
.accordion-section-content {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 開いた状態 */
.accordion-section-content.expanded {
    max-height: 10000px !important;
    overflow: visible !important;
    transition: max-height 0.6s ease-in-out;
}

/* 通常のセクションスタイルをリセット */
.accordion-section .container {
    padding: 0;
}

/* desktop-onlyクラスは削除されたので非表示 */
.desktop-only {
    display: none !important;
}

/* デスクトップ（769px以上） */
@media (min-width: 769px) {
    .accordion-section {
        margin-bottom: 20px;
    }
    
    .accordion-section-header {
        padding: 24px;
        margin-bottom: 0;
    }
    
    .accordion-section-header h2 {
        font-size: 1.8rem;
    }
    
    .accordion-section-toggle {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* モバイル（768px以下） */
@media (max-width: 768px) {
    .accordion-section {
        margin-bottom: 12px;
    }
    
    .accordion-section-header {
        padding: 16px;
        margin: 0 0 0 0;
    }
    
    .accordion-section-header h2 {
        font-size: 1.2rem;
    }
    
    .accordion-section-toggle {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* 480px以下 */
@media (max-width: 480px) {
    .accordion-section-header {
        padding: 14px;
    }
    
    .accordion-section-header h2 {
        font-size: 1.1rem;
    }
    
    .accordion-section-toggle {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.accordion-section-content.expanded {
    animation: fadeIn 0.3s ease;
}



/* ==========================================================================
   pillar-interactions.js のデザイン部分のみ（修正版）
   デスクトップでも閉じた状態になるように修正
   ========================================================================== */

/* アコーディオン基本スタイル */
.accordion-wrapper {
    transition: all 0.3s ease;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.accordion-toggle-icon {
    display: block;
    transition: all 0.3s ease;
}

.accordion-toggle-icon span {
    display: inline-block;
    transition: transform 0.3s ease;
}

.accordion-content {
    overflow: hidden;
    transition: max-height 0.4s ease;
    max-height: 0;
}

.accordion-content > .container {
    padding: 0 20px 32px 20px;
}

/* モバイルスタイル */
@media (max-width: 768px) {
    .accordion-wrapper.mobile-mode .accordion-header {
        cursor: pointer;
    }

    .accordion-wrapper.mobile-mode .accordion-header:hover {
        background: #e9ecef;
    }

    .accordion-wrapper.mobile-mode .accordion-header:active {
        background: #dee2e6;
    }

    .accordion-wrapper.mobile-mode .accordion-toggle-icon {
        display: block;
    }

    /* 開いた状態のスタイルのみ */
    .accordion-wrapper.mobile-mode.is-open .accordion-content {
        max-height: none;
    }

    .accordion-wrapper.mobile-mode .accordion-content > .container {
        padding: 0 12px 24px 12px;
    }
}

/* デスクトップスタイル（修正版：閉じた状態） */
@media (min-width: 769px) {
    .accordion-wrapper.desktop-mode .accordion-header {
        cursor: pointer;
    }

    .accordion-wrapper.desktop-mode .accordion-toggle-icon {
        display: block;
    }

    /* 閉じた状態 */
    .accordion-wrapper.desktop-mode .accordion-content {
        max-height: 0 !important;
        overflow: hidden !important;
    }

    /* 開いた状態 */
    .accordion-wrapper.desktop-mode.is-open .accordion-content {
        max-height: none !important;
        overflow: visible !important;
    }

    .accordion-section {
        border-bottom: none;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.accordion-wrapper.is-open .accordion-content {
    animation: fadeIn 0.3s ease;
}

/* 背景色の調整 */
.content-section.bg-light .accordion-wrapper.mobile-mode .accordion-header {
    background: #fff;
}

.content-section.bg-light .accordion-wrapper.mobile-mode .accordion-header:hover {
    background: #f8f9fa;
}

/* スクロール進捗バー */
#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #4A90E2, #5CB85C);
    z-index: 10000;
    transition: width 0.1s ease;
}

/* ページトップボタン */
#back-to-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #4A90E2, #5CB85C);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74,144,226,0.3);
    z-index: 9999;
}

#back-to-top-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(74,144,226,0.4);
}