﻿/* ═══════════════════════════════════════════════════════
   Prima Gateway — Style chuyên nghiệp
   ═══════════════════════════════════════════════════════ */

:root {
    --prima-primary: #2563eb;
    --prima-primary-dark: #1e40af;
    --prima-accent: #0ea5e9;
    --prima-gray: #64748b;
    --prima-light: #f8fafc;
    --prima-border: #e2e8f0;
    --prima-text: #1e293b;
}

body.prima-body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--prima-text);
    background: #fff;
}

/* ── Gradient ── */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--prima-primary) 0%, var(--prima-accent) 100%) !important;
}

/* ── Header ── */
.prima-header .navbar {
    padding-top: .75rem;
    padding-bottom: .75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.prima-header .navbar-brand {
    font-weight: 700;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: .4rem;
}

    .prima-header .navbar-brand i {
        font-size: 1.4rem;
    }

.prima-header .brand-text {
    font-size: 1.15rem;
}

.prima-header-search .input-group {
    min-width: 280px;
}

.prima-header-search .form-control {
    border-right: 0;
}

.prima-header .nav-link {
    font-weight: 500;
    padding: .5rem 1rem !important;
    border-radius: .4rem;
    transition: background .15s ease;
}

    .prima-header .nav-link:hover {
        background: rgba(255, 255, 255, .12);
    }

/* ── Hero ── */
.prima-hero {
    border-bottom: 4px solid var(--prima-primary-dark);
}

/* ── Content ── */
.prima-content {
    /*max-width: 1280px;*/
}

/* ── Sidebar ── */
.prima-sidebar .card-header {
    padding: .75rem 1rem .25rem;
}

.prima-sidebar .badge {
    font-weight: 400;
    color: var(--prima-text);
    transition: background .15s ease;
}

    .prima-sidebar .badge:hover {
        background: var(--prima-border);
    }

/* ── Article Card ── */
.prima-card {
    border-radius: .75rem;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

    .prima-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 .75rem 1.5rem rgba(15, 23, 42, .12) !important;
    }

.prima-card-thumb-link {
    display: block;
    overflow: hidden;
}

.prima-card-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f1f5f9;
    transition: transform .35s ease;
}

.prima-card:hover .prima-card-thumb {
    transform: scale(1.04);
}

.prima-card-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #cbd5e1;
}

.prima-card-title {
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 600;
    min-height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    .prima-card-title a {
        color: var(--prima-text);
        text-decoration: none;
    }

        .prima-card-title a:hover {
            color: var(--prima-primary);
        }

.prima-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.6em;
}

.prima-card-cats .badge,
.prima-card-tags .badge {
    font-size: .7rem;
    font-weight: 500;
    padding: .3rem .5rem;
}

/* ── Detail ── */
.prima-detail-hero {
    background: #0f172a !important;
}

    .prima-detail-hero .breadcrumb-item + .breadcrumb-item::before {
        color: rgba(255, 255, 255, .4);
    }

    .prima-detail-hero .breadcrumb-item a:hover {
        color: #fff !important;
    }

.prima-detail-thumb {
    max-height: 520px;
    object-fit: cover;
}

/* ── Article body ── */
.prima-article-body {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #334155;
    word-wrap: break-word;
}

    .prima-article-body h2,
    .prima-article-body h3 {
        margin-top: 1.75rem;
        margin-bottom: .75rem;
        font-weight: 700;
    }

    .prima-article-body h2 {
        font-size: 1.5rem;
    }

    .prima-article-body h3 {
        font-size: 1.25rem;
    }

    .prima-article-body p {
        margin-bottom: 1rem;
    }

    .prima-article-body img {
        max-width: 100%;
        height: auto;
        border-radius: .5rem;
        margin: 1rem auto;
        display: block;
    }

    .prima-article-body a {
        color: var(--prima-primary);
    }

    .prima-article-body blockquote {
        border-left: 4px solid var(--prima-primary);
        padding: .5rem 1rem;
        background: var(--prima-light);
        border-radius: 0 .35rem .35rem 0;
        font-style: italic;
        color: var(--prima-gray);
    }

    .prima-article-body table {
        width: 100%;
        border-collapse: collapse;
        margin: 1rem 0;
        font-size: .95rem;
    }

        .prima-article-body table th,
        .prima-article-body table td {
            border: 1px solid var(--prima-border);
            padding: .5rem .75rem;
        }

        .prima-article-body table th {
            background: var(--prima-light);
        }

    .prima-article-body iframe {
        max-width: 100%;
        border-radius: .5rem;
        margin: 1rem 0;
    }

/* ── Pagination ── */
.prima-pagination .page-link {
    color: var(--prima-primary);
    border-color: var(--prima-border);
}

.prima-pagination .page-item.active .page-link {
    background-color: var(--prima-primary);
    border-color: var(--prima-primary);
}

.prima-pagination .page-link:hover {
    color: var(--prima-primary-dark);
}

/* ── Empty state ── */
.prima-empty {
    border-radius: .75rem;
    background: var(--prima-light);
}

/* ── Line clamp helper ── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Back to top ── */
.prima-backtop {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    z-index: 1000;
}

    .prima-backtop.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* ── Footer ── */
.prima-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 2rem 0;
    margin-top: 3rem;
}

    .prima-footer a {
        color: #93c5fd;
    }

        .prima-footer a:hover {
            color: #dbeafe;
        }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .prima-header-search {
        width: 100%;
        margin-top: .5rem;
    }

        .prima-header-search .input-group {
            min-width: 0;
        }

    .prima-hero h1 {
        font-size: 1.5rem;
    }

    .prima-card-thumb {
        height: 200px;
    }
}

@media (max-width: 575.98px) {
    .prima-card-thumb {
        height: 180px;
    }

    .prima-card-title {
        font-size: .95rem;
    }

    .prima-article-body {
        font-size: 1rem;
    }

    .prima-detail-hero .breadcrumb {
        font-size: .85rem;
    }
}

/* ── In ấn ── */
@media print {
    .prima-header, .prima-footer, .prima-backtop, .prima-sidebar, aside {
        display: none !important;
    }

    .prima-detail-hero {
        background: #fff !important;
        color: #000 !important;
    }

        .prima-detail-hero a {
            color: #000 !important;
        }
}


/* ── Logo trong header ── */
.prima-header .prima-logo {
    display: block;
    /*width: 36px;*/
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    /*background: rgba(255, 255, 255, .12);*/ /* nền mờ nếu logo trong suốt */
    padding: 2px;
    transition: transform .2s ease, background .2s ease;
}

.prima-header .navbar-brand:hover .prima-logo {
    transform: scale(1.06);
    /*background: rgba(255, 255, 255, .22);*/
}

/* Mobile: logo nhỏ hơn 1 chút */
@media (max-width: 575.98px) {
    .prima-header .prima-logo {
        width: 30px;
        height: 30px;
    }

    .prima-header .brand-text {
        font-size: 1rem;
    }
}

/* Nếu logo là ảnh chữ nhật ngang (wordmark) */
.prima-header .prima-logo--wide {
    width: auto;
    height: 36px;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

/* ── Số thứ tự cho "Xem nhiều nhất" ── */
.prima-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
    line-height: 1;
}

/* Item trong sidebar: title không tràn */
.prima-detail-hero + .prima-content .list-group-item {
    border-left: 3px solid transparent;
    transition: border-color .15s ease, background .15s ease;
}

    .prima-detail-hero + .prima-content .list-group-item:hover {
        border-left-color: #2563eb;
        background: #f8fafc;
    }

.min-w-0 {
    min-width: 0;
}
