/**
 * Candle Bookshelf, Single Book, and My Library Styles
 * Designed for beautiful portrait (vertical) book covers.
 */

.candle-bookshelf-container,
.candle-my-library,
.candle-book-single-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Meiryo", sans-serif;
    box-sizing: border-box;
    color: #1e293b;
}

.candle-shelf-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 12px;
}

.candle-shelf-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    letter-spacing: 0.05em;
}

.candle-no-books {
    text-align: center;
    padding: 50px 20px;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
    font-size: 15px;
    border: 1px dashed #cbd5e1;
}

/* ==========================================================================
   Responsive Grid & Book Cards
   ========================================================================== */
.candle-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .candle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .candle-grid.candle-cols-4,
    .candle-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .candle-grid.candle-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .candle-grid.candle-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Card */
.candle-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    padding: 15px;
    box-sizing: border-box;
}

.candle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

.candle-card-cover-link {
    display: block;
    text-decoration: none;
    margin-bottom: 15px;
}

/* 縦長・本らしい立体的な書影コンテナ */
.candle-card-cover-wrap {
    position: relative;
    width: 100%;
    max-width: 180px;
    height: 250px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.candle-card-cover-wrap img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.candle-card:hover .candle-card-cover-wrap img {
    transform: scale(1.03);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.candle-card-format-tag,
.candle-badge-sample {
    position: absolute;
    top: 0;
    right: -6px;
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    backdrop-filter: blur(4px);
    z-index: 5;
}

.candle-badge-sample {
    left: -6px;
    right: auto;
    background: #0284c7;
}

.candle-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    width: 100%;
}

.candle-card-catch {
    font-size: 11px;
    font-weight: 700;
    color: #c4a484;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.candle-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}

.candle-card-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.candle-card-title a:hover {
    color: #c4a484;
}

.candle-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.candle-card-price {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.candle-card-price small {
    font-size: 10px;
    font-weight: normal;
    color: #64748b;
}

.candle-free {
    color: #0284c7;
}

.candle-card-actions {
    display: flex;
    gap: 6px;
}

.candle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.candle-btn-buy {
    background: #0f172a;
    color: #ffffff !important;
}

.candle-btn-buy:hover {
    background: #334155;
}

.candle-btn-sample {
    background: #e0f2fe;
    color: #0369a1 !important;
}

.candle-btn-sample:hover {
    background: #bae6fd;
}

/* My Library Read Button */
.candle-card-read-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 0;
    margin-top: 12px;
    background: #1a1a1a !important;
    color: #ffffff !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.candle-card-read-btn:hover {
    background: #334155 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.candle-arrow {
    font-size: 10px;
}

/* ==========================================================================
   Single Book Page Layout (single-candle_book.php)
   ========================================================================== */
.candle-book-single-container {
    max-width: 1080px;
    margin: 40px auto 80px;
}

.candle-book-single-breadcrumbs {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 30px;
}

.candle-book-single-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
}

.candle-book-single-breadcrumbs a:hover {
    color: #0f172a;
    text-decoration: underline;
}

.candle-book-single-main {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.candle-book-single-visual {
    flex: 0 0 380px;
    max-width: 100%;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 45px 30px;
    box-sizing: border-box;
}

.candle-book-single-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    object-fit: contain;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18), 0 4px 10px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    display: block;
}

.candle-book-single-info {
    flex: 1;
    min-width: 0;
}

.candle-book-single-catch {
    font-size: 14px;
    font-weight: 700;
    color: #c4a484;
    margin-bottom: 8px;
}

.candle-book-single-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 20px;
    color: #0f172a;
}

.candle-book-single-description {
    font-size: 15px;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 30px;
}

.candle-book-single-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.candle-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-align: center;
}

.candle-btn-digital {
    background: #0f172a;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.candle-btn-digital:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3);
}

.candle-btn-sample-lg {
    background: #e0f2fe;
    color: #0369a1 !important;
}

.candle-btn-sample-lg:hover {
    background: #bae6fd;
}

.candle-btn-paper {
    background: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
}

.candle-btn-paper:hover {
    background: #e2e8f0;
}

.candle-btn-amazon {
    background: #fffbeb;
    color: #b45309 !important;
    border: 1px solid #fde68a;
}

.candle-btn-amazon:hover {
    background: #fef3c7;
}

@media (max-width: 860px) {
    .candle-book-single-main {
        flex-direction: column;
        gap: 35px;
    }
    .candle-book-single-visual {
        width: 100%;
        max-width: 100%;
        padding: 30px 20px;
    }
    .candle-book-single-image {
        max-width: 220px;
    }
}
