/* 共通設定 */
.dict-main, .detail-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 20px;
    text-align: center;
}

.dict-title {
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    margin-bottom: 60px;
}

/* 絞り込みセクション */
.filter-section {
    margin-bottom: 40px;
}

.filter-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 20px;
}

.filter-label {
    font-size: 1.1rem;
    padding-top: 5px;
}

/* --- 絞り込みボタンを3列にする設定（上書き） --- */
.radio-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列指定：男神(4つ目)が2行目にきます */
    gap: 15px 30px;
    text-align: left;
}

/* --- お気に入り（星マーク）とご利益のスタイル（ファイルの末尾に追記） --- */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
}
.list-item a { flex-grow: 1; }

.fav-btn {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ccc;
    background: none;
    border: none;
    transition: 0.2s;
    margin-left: 10px;
}
.fav-btn.active { color: #f1c40f; } /* 登録時は金色 */


/* お気に入りボタン（星マーク）のスタイル */
.fav-btn {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ccc; /* 通常時はグレー */
    background: none;
    border: none;
    transition: 0.2s;
    vertical-align: middle;
    margin-left: 10px;
}

.fav-btn.active {
    color: #f1c40f; /* お気に入り時は金色 */
}

/* 一覧ページでの星マークの配置 */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
}

.list-item a {
    flex-grow: 1;
}

/* お気に入り専用ページのスタイル */
.fav-section-title {
    text-align: left;
    margin: 40px 0 20px;
    font-size: 1.5rem;
    color: #AE1F1F;
    border-bottom: 2px solid #AE1F1F;
    padding-bottom: 5px;
}

#filter-form{
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-btn {
    background: transparent;
    border: 1px solid #333;
    padding: 8px 40px;
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s;
    margin: 10px 0 0 40px;
}

.filter-btn:hover {
    background: #333;
    color: #fff;
}

.dict-line {
    border: none;
    border-top: 1px solid #333;
    margin: 20px 0;
}

/* リスト */
.deity-list {
    min-height: 400px; /* ページ切り替え時にガタつかないように高さを確保 */
}

.list-item {
    border-bottom: 1px solid #ccc;
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.list-item a {
    display: block;
    padding: 25px 40px;
    text-decoration: none;
    color: #333;
    font-size: 1.1rem;
    transition: 0.2s;
}

.list-item a:hover {
    background: rgba(0,0,0,0.02);
    padding-left: 50px;
}

/* ページネーション */
.pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.page-num { 
    cursor: pointer; 
    padding: 5px 10px;
    transition: 0.3s;
}
.page-num.active { 
    border-bottom: 2px solid #333; 
    font-weight: bold;
}

.page-arrow {
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    cursor: pointer;
}

.page-arrow.disabled {
    opacity: 0.2;
    pointer-events: none;
}

/* 詳細ページ */
.deity-detail-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    margin: 80px 0;
    text-align: left;
}

.deity-image img {
    width: 350px;
    height: auto;
}

.deity-info {
    width: 450px;
}

.deity-name {
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.deity-line {
    border: none;
    border-top: 1px solid #333;
    margin: 20px 0 40px;
}

.deity-description p {
    margin-bottom: 15px;
    line-height: 2;
    font-size: 16px;
}

.detail-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 100px;
}

.nav-btn {
    border: 1px solid #333;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.back-to-list {
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #333;
}
/* 切り替えリンクのスタイル */
.dic-switch {
    margin: -40px 0 60px; /* タイトルと絞り込みの間の余白調整 */
}

.switch-link {
    text-decoration: none;
    color: #333;
    border: 1px solid #333;
    padding: 8px 25px;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: 0.3s;
    display: inline-block;
}

.switch-link:hover {
    background: #333;
    color: #fff;
    padding-right: 30px; /* 少し伸びるアニメーション */
}


/* --- インデックス（あいうえお順）のスタイル --- */
.index-section {
    margin-bottom: 30px;
    padding: 0 5%;
}

.index-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 0;
}

.index-btn {
    background: #fff;
    border: 1px solid #333;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
}

.index-btn:hover, .index-btn.active {
    background: #333;
    color: #fff;
}

/* --- 詳細ページ：ご利益セクションのスタイル --- */
.deity-blessings {
    margin-top: 30px;
    padding: 20px;
}

.blessings-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;

}

.deity-blessings p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* --- お気に入りボタン（星マーク）の共通スタイル --- */
.fav-btn {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ccc; /* 保存前：グレー */
    background: none;
    border: none;
    transition: 0.2s;
    vertical-align: middle;
    padding: 0 10px;
}

.fav-btn.active {
    color: #f1c40f; /* 保存後：金色 */
}

/* 一覧ページでの配置調整 */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- スマホ・タブレット対応 (768px以下) --- */
@media (max-width: 768px) {
    /* 全体の余白調整 */
    .dict-main, .detail-main {
        padding: 60px 20px;
    }

    .dict-title {
        font-size: 1.8rem;
        margin-bottom: 40px;
    }

    /* 絞り込みセクション */
    #filter-form {
        flex-direction: column; /* タイトルと実行ボタンを縦に */
        align-items: center;
        gap: 20px;
    }

    .filter-container {
        flex-direction: column; /* 項目名と選択肢を縦に */
        align-items: center;
        gap: 15px;
    }

    .radio-group {
        grid-template-columns: repeat(2, 1fr); /* 3列から2列に変更 */
        gap: 10px 20px;
    }

    .filter-btn {
        margin: 10px 0;
        width: 100%; /* ボタンを横いっぱいに */
    }

    /* 五十音インデックス */
    .index-list {
        gap: 8px;
    }

    .index-btn {
        padding: 8px 15px; /* ボタンを少し大きくして押しやすく */
        font-size: 1rem;
    }

    /* 詳細ページ（神さま・用語） */
    .deity-detail-container {
        flex-direction: column; /* 画像と説明文を縦に並べる */
        gap: 40px;
        margin: 40px 0;
    }

    .deity-image img {
        width: 100%; /* 画面幅に合わせる */
        max-width: 280px; /* 大きくなりすぎないよう制限 */
    }

    .deity-info {
        width: 100%; /* 幅いっぱい使う */
    }

    .deity-name {
        font-size: 1.5rem;
        text-align: center;
    }

    .deity-name p {
        text-align: center;
    }

    .deity-description p {
        font-size: 15px;
    }

    /* お気に入り一覧 */
    .list-item a {
        padding: 20px 15px; /* 余白を少し詰める */
        font-size: 1rem;
    }

.detail-nav {
        gap: 20px;
        margin-top: 60px;
    }

    /* スマホ用ページネーションの調整 */
    .pagination {
        margin-top: 50px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px; /* スマホでは間隔を狭く */
        flex-wrap: wrap;
    }

    .page-num {
        cursor: pointer;
        padding: 5px 8px; /* スマホで押しやすいサイズ */
        min-width: 35px;
        text-align: center;
        transition: 0.3s;
        user-select: none;
        font-size: 0.9rem;
    }

    .page-arrow {
        padding: 0 10px;
    }
}