/**
 * assets/css/archive.css – ThemeSanBong
 * Styles cho trang Archive (Category, Tag), Search và Author
 * Enqueue có điều kiện: is_archive() || is_search()
 */

/* ── Author Profile Card ──────────────────────────────────── */
.author-card {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

.author-avatar { flex-shrink: 0; }
.author-avatar-img {
    width: 120px !important;
    height: 120px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f3f4f6;
}

.author-info { flex: 1; min-width: 0; }

.author-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: .2rem;
    line-height: 1.3;
}

.author-job {
    font-size: .875rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: .5rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.author-postcount {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: #6b7280;
    margin-bottom: .75rem;
}

.author-bio {
    font-size: .9rem;
    color: #4b5563;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.author-socials { display: flex; flex-wrap: wrap; gap: .5rem; }

.author-social-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .85rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: opacity .2s, transform .15s;
}
.author-social-btn:hover { opacity: .85; transform: translateY(-1px); }

@media (max-width: 600px) {
    .author-card { flex-direction: column; align-items: center; text-align: center; }
    .author-socials { justify-content: center; }
}

/* ── Archive header ────────────────────────────────────────────── */
.archive-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #dc2626;
    line-height: 1.2;
    margin-bottom: .4rem;
}
.archive-desc { font-size: .9rem; color: #6b7280; margin-top: .4rem; line-height: 1.6; }

/* ── Breadcrumb (shared) ───────────────────────────────────────── */
.breadcrumb { display:flex; flex-wrap:wrap; align-items:center; gap:.3rem; font-size:.82rem; color:#6b7280; }
.breadcrumb a { color:#6b7280; }
.breadcrumb a:hover { color:#dc2626; }
.breadcrumb .sep { color:#d1d5db; }

/* ── Article card (horizontal) ─────────────────────────────────── */
.arc-card {
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    margin-bottom: 1rem;
    transition: box-shadow .2s;
}
.arc-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); }

/* Thumbnail */
.arc-thumb {
    flex-shrink: 0;
    width: 220px;
    min-height: 160px;
    align-self: stretch;        /* fill full card height */
    border-radius: 0;           /* card overflow:hidden xử lý bo góc trái */
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}
.arc-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .35s ease;
}
.arc-card:hover .arc-thumb img { transform: scale(1.04); }

.arc-thumb-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #d1d5db;
}

/* Badge MỚI NHẤT */
.badge-new {
    position: absolute; top: 8px; left: 8px;
    background: #dc2626; color: #fff;
    font-size: .68rem; font-weight: 700;
    padding: 2px 9px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: .06em;
    z-index: 1;
}

/* Card body */
.arc-body { flex: 1; min-width: 0; padding: 1rem; }

.arc-meta {
    display: flex; align-items: center; gap: .45rem;
    margin-bottom: .5rem; font-size: .78rem;
}
.arc-cat { color: #2563eb; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.arc-cat:hover { color: #dc2626; }
.arc-sep { color: #d1d5db; }
.arc-date { color: #9ca3af; }

.arc-title {
    font-size: 1.05rem; font-weight: 700;
    color: #111827; line-height: 1.45;
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.arc-title a { color: inherit; transition: color .15s; }
.arc-title a:hover { color: #dc2626; }

.arc-excerpt {
    font-size: .875rem; color: #6b7280; line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile */
@media (max-width: 580px) {
    .arc-card { flex-direction: column; }
    .arc-thumb { width: 100%; min-height: 195px; align-self: auto; }
    .arc-body { padding: .9rem 1rem; }
}

/* ── Pagination ─────────────────────────────────────────────────── */
.arc-pagination {
    display: flex; justify-content: center;
    align-items: center; gap: .4rem;
    margin-top: 2rem; flex-wrap: wrap;
}
.arc-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 .5rem;
    border-radius: 6px; font-size: .9rem; font-weight: 600;
    background: #fff; border: 1.5px solid #e5e7eb;
    color: #374151; text-decoration: none;
    transition: all .15s;
}
.arc-pagination a.page-numbers:hover {
    background: #fff5f5; border-color: #dc2626; color: #dc2626;
}
.arc-pagination .current {
    background: #dc2626; border-color: #dc2626; color: #fff;
}
.arc-pagination .dots {
    border: none; background: none; color: #9ca3af;
}

/* ── Search re-query form ───────────────────────────────────────── */
.search-again {
    display: flex; gap: .5rem; margin-bottom: 1.5rem;
}
.search-again input[type="search"] {
    flex: 1; padding: .65rem 1rem;
    border: 1.5px solid #e5e7eb; border-radius: 6px;
    font-size: .9rem; color: #111827; outline: none;
    transition: border-color .2s;
}
.search-again input:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.search-again button {
    padding: .65rem 1.25rem; background: #dc2626;
    color: #fff; border: none; border-radius: 6px;
    font-weight: 700; cursor: pointer; transition: background .2s;
    white-space: nowrap;
}
.search-again button:hover { background: #b91c1c; }

/* ── Sidebar Categories List widget ──────────────────────── */
.sb-cat-list { list-style: none; padding: 0; margin: 0; }

.sb-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 0;
    border-bottom: 1px solid #f3f4f6;
    gap: .75rem;
}
.sb-cat-item:last-child { border-bottom: none; }

.sb-cat-link {
    flex: 1;
    font-size: .875rem;
    font-weight: 600;
    color: #1e293b;
    transition: color .15s;
}
.sb-cat-item:hover .sb-cat-link { color: #2563eb; }
.sb-cat-item.current-cat .sb-cat-link { color: #2563eb; }

.sb-cat-count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    font-size: .75rem;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 6px;
    margin-right: .25rem;
    transition: color .15s, background .15s;
}
.sb-cat-item:hover .sb-cat-count { color: #2563eb; background: #eff6ff; }
.sb-cat-item.current-cat .sb-cat-count { color: #2563eb; background: #eff6ff; }
