/**
 * BookDrop Storefront - Tủ Sách Tác Giả (Author Showcase Styles)
 * Fully Responsive: Desktop (>=1024px) 5 books/row, Mobile (<=767px) 2 books/row
 */

/* ==========================================================================
   1. AUTHOR LINKS ON PRODUCT DETAIL
   ========================================================================== */
.sach89-author-link {
    color: var(--primary, #1e3a8a);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    border-bottom: 1px dotted rgba(30, 58, 138, 0.4);
}

.sach89-author-link:hover {
    color: var(--primary-light, #2563eb);
    text-decoration: underline;
    border-bottom-color: transparent;
}

.sach89-author-text {
    color: var(--text-main, #1e293b);
    font-weight: 500;
}

/* ==========================================================================
   2. AUTHOR SHOWCASE PAGE (/tac-gia/{slug}/)
   ========================================================================== */
.sach89-author-page {
    background-color: #f8fafc;
    min-height: 80vh;
    padding-bottom: 60px;
    color: #1e293b;
    font-family: inherit;
}

.sach89-author-container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Breadcrumbs */
.sach89-author-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    padding: 16px 0 20px 0;
}

.sach89-author-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.sach89-author-breadcrumbs a:hover {
    color: var(--primary, #1e3a8a);
}

.sach89-author-breadcrumbs .sep {
    color: #cbd5e1;
}

.sach89-author-breadcrumbs .current {
    color: var(--text-main, #1e293b);
    font-weight: 600;
}

/* Author Hero Section */
.sach89-author-hero {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04);
    margin-bottom: 32px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    align-items: center;
}

.sach89-author-hero-avatar-wrap {
    text-align: center;
}

.sach89-author-avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px -4px rgba(30, 58, 138, 0.15);
    background-color: #f1f5f9;
    display: block;
    margin: 0 auto;
}

.sach89-author-avatar-fallback {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #1e3a8a) 0%, #3b82f6 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px -4px rgba(30, 58, 138, 0.15);
    margin: 0 auto;
}

.sach89-author-hero-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sach89-author-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.sach89-author-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.sach89-author-pill-nation {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.sach89-author-pill-years {
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.sach89-author-pill-career {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.sach89-author-name {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-dark, #0f172a);
    line-height: 1.25;
}

.sach89-author-quote {
    margin: 4px 0 0 0;
    padding: 10px 16px;
    border-left: 3px solid var(--accent, #f59e0b);
    background-color: #fffbeb;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #92400e;
    font-size: 14px;
    line-height: 1.5;
}

.sach89-author-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.sach89-author-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.sach89-author-stat-item strong {
    color: var(--primary, #1e3a8a);
    font-weight: 700;
}

/* Author Content Section (Biography & Achievements) */
.sach89-author-content-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 32px;
    margin-bottom: 40px;
}

.sach89-author-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.sach89-author-card-title {
    margin: 0 0 18px 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark, #0f172a);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.sach89-author-card-title svg {
    color: var(--primary, #1e3a8a);
}

.sach89-author-bio-body {
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
}

.sach89-author-bio-body p {
    margin-bottom: 16px;
}

.sach89-author-bio-body p:last-child {
    margin-bottom: 0;
}

/* Achievements List */
.sach89-author-achievements-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sach89-author-achievements-list li {
    position: relative;
    padding-left: 28px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

.sach89-author-achievements-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    background-color: #dbeafe;
    color: var(--primary, #1e3a8a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

/* ==========================================================================
   3. AUTHOR BOOKS SECTION (PC 5/row, Mobile 2/row)
   ========================================================================== */
.sach89-author-books-wrap {
    margin-top: 40px;
}

.sach89-author-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.sach89-author-section-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.sach89-author-section-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark, #0f172a);
}

.sach89-author-book-count-badge {
    background-color: var(--primary-subtle, #eff6ff);
    color: var(--primary, #1e3a8a);
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
}

.sach89-author-books-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Single Book Card */
.sach89-book-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.sach89-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.1);
    border-color: #cbd5e1;
}

.sach89-book-card-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 133%; /* 3:4 Aspect ratio */
    background-color: #f8fafc;
    overflow: hidden;
}

.sach89-book-card-thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sach89-book-card:hover .sach89-book-card-thumb-wrap img {
    transform: scale(1.04);
}

.sach89-book-card-badge-discount {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    z-index: 2;
}

.sach89-book-card-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

.sach89-book-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main, #1e293b);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.sach89-book-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.sach89-book-card-title a:hover {
    color: var(--primary, #1e3a8a);
}

.sach89-book-card-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.sach89-book-card-price-current {
    font-size: 15px;
    font-weight: 700;
    color: #dc2626;
}

.sach89-book-card-price-regular {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: line-through;
}

.sach89-book-card-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #f1f5f9;
    color: var(--primary, #1e3a8a);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    margin-top: 6px;
}

.sach89-book-card-btn:hover {
    background-color: var(--primary, #1e3a8a);
    color: #ffffff;
}

/* Empty State */
.sach89-author-books-empty {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    color: #64748b;
}

.sach89-author-books-empty p {
    font-size: 16px;
    margin: 8px 0 0 0;
}

/* ==========================================================================
   4. RESPONSIVE BREAKPOINTS (Desktop >= 1024px, Mobile <= 767px)
   ========================================================================== */
@media (min-width: 1024px) {
    .sach89-author-books-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 20px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .sach89-author-hero {
        grid-template-columns: 160px 1fr;
        padding: 24px;
        gap: 24px;
    }

    .sach89-author-avatar,
    .sach89-author-avatar-fallback {
        width: 140px;
        height: 140px;
    }

    .sach89-author-name {
        font-size: 26px;
    }

    .sach89-author-content-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sach89-author-books-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .sach89-author-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .sach89-author-hero {
        grid-template-columns: 1fr;
        padding: 20px 16px;
        gap: 16px;
        text-align: center;
    }

    .sach89-author-avatar,
    .sach89-author-avatar-fallback {
        width: 120px;
        height: 120px;
        font-size: 38px;
    }

    .sach89-author-hero-info {
        align-items: center;
    }

    .sach89-author-pills {
        justify-content: center;
    }

    .sach89-author-name {
        font-size: 22px;
    }

    .sach89-author-quote {
        text-align: left;
        font-size: 13px;
    }

    .sach89-author-hero-stats {
        justify-content: center;
        gap: 12px;
    }

    .sach89-author-content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sach89-author-card {
        padding: 18px 14px;
    }

    .sach89-author-card-title {
        font-size: 18px;
    }

    .sach89-author-section-title {
        font-size: 20px;
    }

    /* Mobile: 2 books per row */
    .sach89-author-books-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .sach89-book-card-content {
        padding: 10px;
        gap: 6px;
    }

    .sach89-book-card-title {
        font-size: 13px;
        min-height: 36px;
    }

    .sach89-book-card-price-current {
        font-size: 14px;
    }

    .sach89-book-card-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}
