/**
 * ロードマップ スタイル — E案（横フェーズロード）
 * HOMEページの成長ログ内に表示。フロントページ専用 CSS。
 * CSS変数は各テーマバリアントの variables-*.css から自動適用。
 *
 * @package SaiyaLog
 * @since 3.3.0
 */

/* ===== 外枠 ===== */
.roadmap {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--c-border);
}
.roadmap__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 6px;
}
.roadmap__sub {
    font-size: 0.85rem;
    color: var(--c-text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}
.roadmap__note {
    font-size: 0.78rem;
    color: var(--c-text-muted);
    margin-top: 18px;
    text-align: right;
}

/* ===== data-animate フェードイン ===== */
.roadmap[data-animate] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.roadmap[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== カテゴリブロック ===== */
.roadmap__cat {
    margin-bottom: 28px;
}
.roadmap__cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.roadmap__cat-icon  { font-size: 1.1rem; line-height: 1; }
.roadmap__cat-title { font-size: 0.9rem; font-weight: 700; color: var(--c-text); }
.roadmap__cat-count {
    font-size: 0.78rem;
    color: var(--c-text-muted);
    margin-left: auto;
}

/* ===== 進捗バー ===== */
.roadmap__prog-bg {
    height: 4px;
    background: var(--c-border);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}
.roadmap__prog-fill {
    height: 100%;
    background: var(--c-primary);
    border-radius: 2px;
    transition: width 0.7s ease;
}

/* ===== 横スクロールレーン ===== */
.roadmap__scroll-outer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    /* スクロールバーを細く（webkit） */
    scrollbar-width: thin;
    scrollbar-color: var(--c-border) transparent;
}
.roadmap__scroll-outer::-webkit-scrollbar { height: 4px; }
.roadmap__scroll-outer::-webkit-scrollbar-track { background: transparent; }
.roadmap__scroll-outer::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }

.roadmap__scroll-hint {
    font-size: 0.72rem;
    color: var(--c-text-muted);
    text-align: center;
    margin-top: 6px;
}

/* ===== ロード本体 ===== */
.roadmap__road {
    display: flex;
    align-items: center;
    min-width: max-content;
    padding: 32px 12px 8px;
}

/* ===== コネクタ（駅間の線） ===== */
.roadmap__connector {
    width: 40px;
    height: 4px;
    flex-shrink: 0;
}
.roadmap__connector--done {
    background: var(--c-primary);
}
.roadmap__connector--next {
    background: linear-gradient(90deg, var(--c-primary) 0%, #f59e0b 100%);
}
.roadmap__connector--todo {
    background: repeating-linear-gradient(
        90deg,
        var(--c-border) 0,
        var(--c-border) 6px,
        transparent 6px,
        transparent 12px
    );
}

/* ===== ステーション（ノード＋ラベル） ===== */
.roadmap__station {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

/* ===== ミニキャラ（挑戦中ステーション上でバウンス） ===== */
.roadmap__char {
    position: absolute;
    top: -30px;
    font-size: 1.3rem;
    line-height: 1;
    animation: rm-bounce 1.2s ease-in-out infinite;
    user-select: none;
}
@keyframes rm-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* ===== ノード（丸アイコン） ===== */
.roadmap__node {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--c-border);
    background: var(--c-surface);
}
.roadmap__node-icon { font-size: 1.1rem; line-height: 1; }

/* DONE（達成済み） */
.roadmap__node--done {
    background: var(--c-primary);
    border-color: var(--c-primary);
}
.roadmap__node--done .roadmap__node-icon {
    filter: grayscale(1) brightness(10);
}

/* NEXT（挑戦中）— ゴールド */
.roadmap__node--next {
    background: #f59e0b;
    border-color: #d97706;
    animation: rm-node-pulse 1.8s ease-in-out infinite;
}
@keyframes rm-node-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.45); }
    50%       { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
}

/* TODO（未達成） */
.roadmap__node--todo {
    opacity: 0.45;
}

/* ===== ラベル部分 ===== */
.roadmap__label-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    max-width: 82px;
    text-align: center;
}

/* バッジ */
.roadmap__badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.4;
}
.roadmap__badge--done { background: var(--c-primary); color: #fff; }
.roadmap__badge--next { background: #f59e0b; color: #fff; }
.roadmap__badge--todo { background: var(--c-border); color: var(--c-text-muted); }

/* ラベルテキスト */
.roadmap__label {
    font-size: 11px;
    line-height: 1.35;
    color: var(--c-text);
    word-break: keep-all;
    overflow-wrap: break-word;
}
.roadmap__station--done .roadmap__label {
    color: var(--c-text-muted);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}
.roadmap__station--todo .roadmap__label { color: var(--c-text-muted); }
.roadmap__station--next .roadmap__label { font-weight: 700; }

/* ===== 終点フラグ ===== */
.roadmap__end {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-left: 4px;
    line-height: 1;
}

/* ===== スマホ最適化 ===== */
@media (max-width: 480px) {
    .roadmap__node         { width: 38px; height: 38px; }
    .roadmap__node-icon    { font-size: 0.95rem; }
    .roadmap__label-wrap   { max-width: 70px; }
    .roadmap__label        { font-size: 10px; }
    .roadmap__badge        { font-size: 9px; padding: 2px 5px; }
    .roadmap__connector    { width: 26px; }
    .roadmap__char         { font-size: 1.1rem; top: -26px; }
    .roadmap__scroll-hint  { display: block; }
}
@media (min-width: 481px) {
    .roadmap__scroll-hint  { display: none; }
}
