@charset "UTF-8";

.NewBookContainer {
    margin-top: 10px;
}

/* ==================================================
   日付スクロールナビゲーション
================================================== */
.date-scroll-container {
    width: 100%;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.date-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}

.date-tabs::-webkit-scrollbar { height: 6px; display: block; }
.date-tabs::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.date-tabs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.date-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 8px 10px;
    background: #f8f9f9;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    transition: 0.2s;
    border: 1px solid #e0e6ed;
    user-select: none;
}

.date-item.active a {
    background: #ff9900;
    color: #fff;
    border-color: #ff9900;
    font-weight: bold;
}

.CategorySection {
    margin-bottom: 50px;
}

/* ==================================================
   基本：カード表示 (最大8枚)
================================================== */
#NewBookContent:not(.is-list-view) .book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

#NewBookContent:not(.is-list-view) .book-card:nth-child(n+9) {
    display: none;
}

.book-card {
    position: relative;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.book-thumb {
    width: 100%;
    aspect-ratio: 3/4;
    background-color: #fdfdfd;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
}

.book-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.15));
}

.book-title {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* ==================================================
   リスト表示切り替え時
================================================== */
#NewBookContent.is-list-view .book-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
    border-top: 2px solid #232f3e;
}

#NewBookContent.is-list-view .book-card:nth-child(n+9) {
    display: flex;
}

#NewBookContent.is-list-view .book-card {
    flex-direction: row;
    align-items: center;
    padding: 12px 8px; /* 縦幅と横幅を少し広げました（元：8px 5px） */
    text-align: left;
    border: none;
    border-bottom: 1px dashed #ddd;
    border-radius: 0;
    box-shadow: none;
}

#NewBookContent.is-list-view .book-card:hover {
    transform: none;
    background-color: #f4f6f6;
    box-shadow: none;
    z-index: 1;
}

#NewBookContent.is-list-view .book-thumb {
    display: none;
}

#NewBookContent.is-list-view .book-title {
    font-size: 14px;
    font-weight: bold; /* 太字に変更して主張を強くしました（元：normal） */
    color: #007185;
    line-height: 1.4;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

#NewBookContent.is-list-view .book-card:hover .book-title {
    text-decoration: underline;
    color: #cc0c39;
}

/* ==================================================
   Amazon詳細ボタン
================================================== */
.AmazonBtnArea {
    margin-top: 10px;
}

.AmazonLinkBtn {
    display: block;
    width: 100%;
    padding: 15px;
    background: #fff;
    border: 2px solid #ff9900;
    color: #cc7a00;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    transition: 0.2s;
}

.AmazonLinkBtn:hover {
    background: #ff9900;
    color: #fff;
    box-shadow: 0 4px 10px rgba(255,153,0,0.3);
}

/* ==================================================
   その他のカテゴリタグ
================================================== */
.OtherCategorySection {
    margin-top: 50px; /* PHPからインラインスタイルを統合 */
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cat-tag {
    display: inline-block;
    padding: 8px 18px;
    background: #f4f6f6;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}

.cat-tag:hover {
    border-color: #ff9900;
    color: #ff9900;
    background-color: #fff7ed;
}

.NoDataMessage {
    background: #fff;
    padding: 40px 20px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #ddd;
    color: #666;
    font-weight: bold;
}

/* ==================================================
   レスポンシブ対応
================================================== */
@media screen and (max-width: 819px) {
    .date-scroll-container { top: 70px; }
}

@media screen and (max-width: 559px) {
    #NewBookContent:not(.is-list-view) .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .book-card { padding: 10px; border-radius: 8px; }
    .book-title { font-size: 12px; }
    
    #NewBookContent.is-list-view .book-title {
        font-size: 13px;
    }
    
    .AmazonLinkBtn {
        font-size: clamp(11px, 3.5vw, 15px);
        padding: 12px 5px;
        white-space: nowrap;
        letter-spacing: -0.5px;
    }
}