/* =============================================
   reader.css — サンプルリーダー専用スタイル
   ============================================= */

/* --- 作品詳細ヘッダー --- */
.item-detail-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 14px;
}

.item-detail-header__thumb {
    flex-shrink: 0;
    width: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.item-detail-header__thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.item-detail-header__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-detail-header__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-detail-header__circle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.item-detail-header__price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-light);
}

.item-detail-header__sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.item-detail-header__genres {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* --- 購入CTAボタン --- */
.cta-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
    margin: 16px 0;
    border: none;
}

.cta-buy:hover {
    background: var(--accent-dark);
    color: #fff;
}

.cta-buy:active {
    transform: scale(0.98);
}

.cta-buy--large {
    padding: 20px;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

/* --- リーダーコンテナ --- */
.reader-wrap {
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
}

/* --- リーダーツールバー（reader-wrap の外・上に配置） --- */
.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 8px;
}

.reader-toolbar__title {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
}

.reader-toolbar__controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.reader-mode-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    min-height: 36px;
}

.reader-mode-btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.reader-mode-btn:hover:not(.is-active) {
    border-color: var(--border-light);
    color: var(--text);
}

.reader-counter {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 60px;
    text-align: center;
}

/* =============================================
   縦スクロールモード
   ============================================= */
.reader-scroll {
    display: block;
}

.reader-scroll__images {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reader-scroll__img {
    width: 100%;
    height: auto;
    display: block;
    background: #1a1a1a;
    min-height: 200px;
}

.reader-scroll__img[data-src]:not([src]) {
    background: var(--bg-surface);
}

/* =============================================
   見開き（横スワイプ）モード
   ============================================= */
.reader-spread {
    display: none;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
}

.reader-spread.is-active {
    display: block;
}

.reader-scroll.is-hidden {
    display: none;
}

.reader-spread__track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.reader-spread__page {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 60vw;
}

.reader-spread__img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

/* スワイプ中のフィードバック */
.reader-spread.is-dragging .reader-spread__track {
    transition: none;
}

/* 前/次ボタン（見開きモード） */
.reader-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), opacity var(--transition);
    border: none;
    cursor: pointer;
}

.reader-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
}

.reader-nav--prev { left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.reader-nav--next { right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

.reader-nav.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* =============================================
   CTA エリア（サンプル末尾）
   ============================================= */
.reader-cta {
    background: linear-gradient(to bottom, #000, var(--bg));
    padding: 32px 24px;
    text-align: center;
}

.reader-cta__text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.reader-cta__text strong {
    color: var(--text);
}

/* --- 画像ローディングプレースホルダー --- */
.img-placeholder {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
