/* =================================== */
/* 基本設定 & 全体レイアウト           */
/* =================================== */
:root {
    --primary-gold: #FFD700;
    --dark-gold: #B8860B;
    --hover-gold: #DAA520;
    --dark-bg: #000000;
    --card-bg: #1A1A1A;
    --text-light: #E0E0E0;
    --text-medium: #AAAAAA;
    --font-body: 'Noto Sans JP', sans-serif;
    --font-heading: 'Playfair Display', serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--dark-bg);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.05)"/></svg>');
    background-repeat: repeat;
    background-size: 20px 20px;
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-gold);
    margin-top: 0;
    margin-bottom: 0.5em;
}

a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--hover-gold);
}

a:focus,
.buy-button:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 3px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =================================== */
/* ヘッダー & ナビゲーション          */
/* =================================== */
.site-header {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px 0;
    border-bottom: 1px solid var(--dark-gold);
    text-align: center;
}

.site-title {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.site-title a {
    color: var(--primary-gold);
    text-decoration: none;
    letter-spacing: 2px;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.main-nav a {
    font-size: 1.1em;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.main-nav a:hover {
    background-color: rgba(255, 215, 0, 0.1);
}

.main-nav a.active-nav {
    color: var(--primary-gold);
    font-weight: bold;
    background-color: rgba(255, 215, 0, 0.1);
}
/* =================================== */
/* メインコンテンツ (書籍一覧)         */
/* =================================== */
.book-listing-page {
    padding: 40px 0;
}

.section-title {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 40px;
    color: var(--primary-gold);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--dark-gold);
    margin: 10px auto 0;
}

.kindle-unlimited-info {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
    color: var(--text-light);
}

.kindle-unlimited-info .highlight {
    color: var(--primary-gold);
    font-weight: bold;
}

/* フィルタリング機能 */
.filter-controls {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid var(--dark-gold);
    color: var(--text-medium);
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.9em;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: var(--primary-gold);
    border-color: var(--primary-gold);
}

.filter-btn.active {
    background-color: var(--primary-gold);
    color: var(--dark-bg);
    border-color: var(--primary-gold);
    font-weight: bold;
}

/* 書籍グリッド & カード */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    justify-content: center;
}

.book-card {
    background-color: var(--card-bg);
    border: 1px solid var(--dark-gold);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* アニメーション用プロパティ */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInCard 0.6s ease-out forwards;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(255, 215, 0, 0.2);
}

/* フィルタリングで非表示にするカードのスタイル */
.book-card.hidden {
    display: none;
}

@keyframes fadeInCard {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-cover {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.book-title {
    font-size: 1.5em;
    color: var(--primary-gold);
    margin-bottom: 5px;
}

.book-author {
    font-size: 0.9em;
    color: var(--text-medium);
    margin-bottom: 10px;
}

.book-description {
    font-size: 0.95em;
    color: var(--text-light);
    margin-bottom: 15px;
    flex-grow: 1;
    text-align: left;
}

.buy-button {
    display: inline-block;
    background-color: var(--primary-gold);
    color: var(--dark-bg);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin-top: 10px;
}

.buy-button:hover {
    background-color: var(--hover-gold);
    transform: translateY(-2px);
    color: #1A1A1A;
}

/* =================================== */
/* 著者紹介ページ (about.html)          */
/* =================================== */
.author-profile-page {
    padding: 40px 0;
}

.author-profile-card {
    background-color: var(--card-bg);
    border: 1px solid var(--dark-gold);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.author-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    flex-shrink: 0;
}

.author-info {
    text-align: center;
    flex-grow: 1;
}

.author-name {
    font-size: 2.5em;
    color: var(--primary-gold);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.author-tagline {
    font-size: 1.1em;
    color: var(--text-medium);
    margin-bottom: 20px;
    line-height: 1.8;
}

.author-bio p {
    font-size: 1em;
    color: var(--text-light);
    margin-bottom: 1em;
    text-align: left;
}

.social-links {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a img {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.social-links a:hover img {
    transform: translateY(-5px) scale(1.1);
}

.back-link-container {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 30px;
}

.back-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: transparent;
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.back-button:hover {
    background-color: var(--primary-gold);
    color: var(--dark-bg);
    transform: translateY(-2px);
}

/* =================================== */
/* フッター                         */
/* =================================== */
.site-footer {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--text-medium);
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--dark-gold);
    font-size: 0.9em;
}

/* =================================== */
/* レスポンシブ対応 (メディアクエリ)    */
/* =================================== */
@media (max-width: 768px) {
    .site-title {
        font-size: 2em;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .section-title {
        font-size: 1.8em;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    /* 著者紹介ページの横並びを解除 */
    .author-profile-card {
        flex-direction: column;
        align-items: center;
    }
    .author-info { text-align: center; }
    .social-links { justify-content: center; }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.8em;
    }

    .main-nav ul {
        gap: 5px;
    }

    .section-title {
        font-size: 1.5em;
    }

    .book-card {
        padding: 15px;
    }
    
    .book-title {
        font-size: 1.3em;
    }

    .back-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .author-profile-card {
        padding: 20px;
    }

    .author-avatar {
        width: 150px;
        height: 150px;
    }

    .author-name {
        font-size: 2em;
    }
}

/* 著者紹介ページの横並び（768px以上） */
@media (min-width: 768px) {
    .author-profile-card {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }
    .author-info { text-align: left; }
    .social-links { justify-content: flex-start; }
}

/* =================================== */
/* ユーティリティ & コンポーネント      */
/* =================================== */

/* トップへ戻るボタン */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-gold);
    color: var(--dark-bg);
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px; /* 高さと同じ値で垂直中央揃え */
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.2);
    z-index: 1000; /* 他の要素より手前に表示 */
    
    /* 初期状態は非表示 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-5px); /* 少し浮き上がる */
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.3);
}

/* 表示するときのスタイル */
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-btn[data-filter="occult"] {
    display: none;
}