/* ================================================================
   NSG.CSS — Người Sài Gòn v1.0
   © 2026 nguoisaigon.vn — All rights reserved
   ================================================================ */

/* ----------------------------------------------------------------
   1. CSS VARIABLES
   ---------------------------------------------------------------- */
:root {
    --nsg-red:    #c0392b;
    --nsg-gold:   #f39c12;
    --nsg-dark:   #1a1a2e;
    --nsg-light:  #fff8f0;
    --nsg-gray:   #f8f9fa;
    --nsg-text:   #2c2c2c;
    --radius:     10px;
    --shadow:     0 2px 16px rgba(0,0,0,.09);
    --cat-color:  #c0392b; /* overridden per-page for category views */
}

/* ----------------------------------------------------------------
   2. BASE
   ---------------------------------------------------------------- */
* { box-sizing: border-box; }

body {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 16px;
    color: var(--nsg-text);
    background: #fff;
    line-height: 1.7;
}

/* ----------------------------------------------------------------
   3. TOPBAR
   ---------------------------------------------------------------- */
.topbar {
    background: var(--nsg-dark);
    color: #ccc;
    font-size: 13px;
    padding: 6px 0;
}
.topbar a { color: #ccc; text-decoration: none; }
.topbar a:hover { color: var(--nsg-gold); }

/* ----------------------------------------------------------------
   4. NAVBAR
   ---------------------------------------------------------------- */
.main-navbar {
    background: #fff;
    border-bottom: 3px solid var(--nsg-red);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}
.navbar-brand .brand-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--nsg-red);
    letter-spacing: -0.5px;
}
.navbar-brand .brand-sub {
    font-size: 0.7rem;
    color: #888;
    display: block;
    line-height: 1;
}
.main-navbar .nav-link {
    font-weight: 600;
    font-size: 15px;
    color: var(--nsg-dark) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: .2s;
}
.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    color: var(--nsg-red) !important;
    background: #fff5f5;
}
.btn-login {
    background: var(--nsg-red);
    color: #fff !important;
    border-radius: 20px;
    padding: 6px 20px !important;
    font-size: 14px !important;
}
.btn-login:hover { background: #a93226; }

/* ----------------------------------------------------------------
   5. HERO BANNER
   ---------------------------------------------------------------- */
.hero-banner {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 480px;
}
.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.8) 40%, rgba(0,0,0,.1) 100%);
}
.hero-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 2rem;
    color: #fff;
}
.hero-category {
    background: var(--nsg-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: inline-block;
    margin-bottom: .5rem;
}
.hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: .5rem;
}
.hero-title a { color: #fff; text-decoration: none; }
.hero-title a:hover { text-decoration: underline; }
.hero-meta { font-size: 13px; color: #ddd; }

/* ----------------------------------------------------------------
   6. NEWS TICKER
   ---------------------------------------------------------------- */
.news-ticker {
    background: var(--nsg-red);
    color: #fff;
    padding: 8px 0;
    overflow: hidden;
}
.ticker-label {
    background: var(--nsg-dark);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 0 14px;
    white-space: nowrap;
}
.ticker-scroll {
    display: flex;
    animation: ticker 40s linear infinite;
    white-space: nowrap;
}
.ticker-scroll:hover { animation-play-state: paused; }
.ticker-item {
    font-size: 13px;
    padding: 0 30px;
    color: #fff;
    text-decoration: none;
}
.ticker-item:hover { color: var(--nsg-gold); }
.ticker-item::before { content: '●  '; font-size: 8px; }
@keyframes ticker { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ----------------------------------------------------------------
   7. FOOTER
   ---------------------------------------------------------------- */
.main-footer {
    background: var(--nsg-dark);
    color: #ccc;
    padding: 50px 0 20px;
    margin-top: 60px;
}
.footer-brand { font-size: 1.8rem; font-weight: 800; color: #fff; }
.footer-desc { font-size: 14px; color: #aaa; margin-top: 8px; line-height: 1.7; }
.footer-title {
    font-size: 15px; font-weight: 700; color: #fff;
    margin-bottom: 14px; padding-bottom: 8px;
    border-bottom: 2px solid var(--nsg-red);
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #aaa; font-size: 14px; text-decoration: none; transition: .2s; }
.footer-links a:hover { color: var(--nsg-gold); padding-left: 4px; }
.footer-bottom {
    border-top: 1px solid #333;
    margin-top: 30px; padding-top: 20px;
    font-size: 13px; color: #777;
}
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: #333; color: #ccc; text-decoration: none;
    margin-right: 8px; transition: .2s; font-size: 16px;
}
.footer-social a:hover { background: var(--nsg-red); color: #fff; }

/* ----------------------------------------------------------------
   8. SECTION TITLE
   ---------------------------------------------------------------- */
.section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--nsg-dark);
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--nsg-red);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title i { color: var(--nsg-red); }

/* ----------------------------------------------------------------
   9. POST CARD (grid)
   ---------------------------------------------------------------- */
.post-card {
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    height: 100%;
    background: #fff;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,.14);
}
.post-card .card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
}
.post-card .card-img-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #f5c6cb 0%, #f8d7da 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--nsg-red);
}
.post-card .card-body { padding: 1rem; }
.post-card .card-category {
    font-size: 11px;
    font-weight: 700;
    color: var(--nsg-red);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.post-card .card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin: .3rem 0;
}
.post-card .card-title a { color: var(--nsg-dark); text-decoration: none; }
.post-card .card-title a:hover { color: var(--nsg-red); }
.post-card .card-excerpt {
    font-size: 13px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card .card-meta {
    font-size: 12px;
    color: #999;
    margin-top: .5rem;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.post-card .card-meta i { color: var(--nsg-red); }

/* ----------------------------------------------------------------
   10. LIST POST (sidebar / latest)
   ---------------------------------------------------------------- */
.list-post-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.list-post-item:last-child { border-bottom: none; }
.list-post-thumb {
    width: 90px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.list-post-thumb-placeholder {
    width: 90px; height: 70px;
    border-radius: 8px;
    background: #f5c6cb;
    display: flex; align-items: center; justify-content: center;
    color: var(--nsg-red); font-size: 1.3rem;
    flex-shrink: 0;
}
.list-post-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--nsg-dark);
    text-decoration: none;
}
.list-post-title:hover { color: var(--nsg-red); }
.list-post-meta { font-size: 12px; color: #999; margin-top: 4px; }

/* ----------------------------------------------------------------
   11. CATEGORY BLOCK
   ---------------------------------------------------------------- */
.category-header {
    background: var(--nsg-red);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.category-block {
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}
.category-block .list-post-item { padding: 10px 14px; }
.category-block .list-post-item:not(:last-child) { border-bottom: 1px solid #f0f0f0; }

/* ----------------------------------------------------------------
   12. POPULAR SIDEBAR
   ---------------------------------------------------------------- */
.popular-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}
.popular-item:last-child { border-bottom: none; }
.popular-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: #e0e0e0;
    line-height: 1;
    min-width: 28px;
}
.popular-item:nth-child(1) .popular-num { color: var(--nsg-red); }
.popular-item:nth-child(2) .popular-num { color: var(--nsg-gold); }
.popular-item:nth-child(3) .popular-num { color: #95a5a6; }
.popular-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--nsg-dark);
    text-decoration: none;
}
.popular-title:hover { color: var(--nsg-red); }
.popular-meta { font-size: 12px; color: #aaa; }

/* ----------------------------------------------------------------
   13. BREADCRUMB
   ---------------------------------------------------------------- */
.breadcrumb {
    background: #fff8f0;
    border: 1px solid #fde8d8;
    border-radius: 30px;
    padding: 7px 16px;
    display: inline-flex;
    margin: 0;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    color: #ccc;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    padding: 0 4px;
}
.breadcrumb-item.active { color: #888; }

/* ----------------------------------------------------------------
   14. POST BODY (article content)
   ---------------------------------------------------------------- */
.post-body { font-size: 1.05rem; line-height: 1.85; color: #2c2c2c; }
.post-body h2 { font-size: 1.4rem; font-weight: 800; margin: 1.5rem 0 .75rem; color: var(--nsg-dark); }
.post-body h3 { font-size: 1.2rem; font-weight: 700; margin: 1.2rem 0 .6rem;  color: var(--nsg-dark); }
.post-body p  { margin-bottom: 1rem; }
.post-body img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.post-body a  { color: var(--nsg-red); text-decoration: underline; }
.post-body blockquote {
    border-left: 4px solid var(--nsg-red);
    background: #fff8f0;
    padding: 12px 18px;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
    margin: 1rem 0;
}
.post-body ul,
.post-body ol  { padding-left: 1.5rem; margin-bottom: 1rem; }
.post-body li  { margin-bottom: .4rem; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.post-body table th,
.post-body table td { padding: 8px 12px; border: 1px solid #ddd; }
.post-body table th { background: var(--nsg-red); color: #fff; }
.post-body table tr:nth-child(even) { background: #fafafa; }

/* ----------------------------------------------------------------
   15. RELATED POSTS
   ---------------------------------------------------------------- */
.related-posts-section {
    border-top: 3px solid var(--nsg-red);
    padding-top: 1.5rem;
}
.related-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1.25rem;
}
.related-icon {
    width: 42px; height: 42px;
    background: var(--nsg-red);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem;
    flex-shrink: 0;
}
.related-title { font-size: 1.2rem; font-weight: 800; color: var(--nsg-dark); line-height: 1.2; }
.related-sub   { font-size: 12px; color: #999; margin-top: 3px; }
.related-sub strong { color: var(--nsg-red); }
.related-sub em     { color: #555; font-style: normal; font-weight: 600; }

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.related-card {
    display: flex; flex-direction: column;
    background: #fff; border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    border: 1px solid #f0f0f0;
    text-decoration: none; color: inherit;
    transition: transform .2s, box-shadow .2s;
}
.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    text-decoration: none; color: inherit;
}
.related-card-img {
    position: relative; overflow: hidden;
    aspect-ratio: 16/9; background: #f5f5f5;
}
.related-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.related-card:hover .related-card-img img { transform: scale(1.05); }
.rel-badge {
    position: absolute; bottom: 8px; left: 8px;
    padding: 3px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px;
    max-width: calc(100% - 16px);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rel-badge-category { background: var(--nsg-red); color: #fff; }
.rel-badge-tag      { background: rgba(0,0,0,.65); color: #fff; backdrop-filter: blur(4px); }
.related-card-body  { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.related-cat-label  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--nsg-red); }
.related-card-title {
    font-size: 14px; font-weight: 700;
    color: var(--nsg-dark); line-height: 1.45; margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.related-card:hover .related-card-title { color: var(--nsg-red); }
.related-card-excerpt {
    font-size: 12px; color: #888; margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.5;
}
.related-card-meta {
    display: flex; gap: 10px;
    font-size: 11px; color: #aaa;
    margin-top: auto; padding-top: 8px;
}
.related-card-meta i { color: var(--nsg-red); }

/* ----------------------------------------------------------------
   16. TAG PAGE
   ---------------------------------------------------------------- */
.tag-page-header {
    border-bottom: 3px solid var(--nsg-red);
    padding-bottom: 1rem;
}
.tag-icon-box {
    width: 52px; height: 52px;
    background: var(--nsg-red); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.5rem; flex-shrink: 0;
}
.tag-page-title { font-size: 1.6rem; font-weight: 900; color: var(--nsg-dark); margin: 0; line-height: 1.2; }
.tag-page-meta  { font-size: 13px; color: #888; margin-top: 4px; }

.tag-post-card {
    display: flex; flex-direction: column;
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    border: 1px solid #f0f0f0;
    text-decoration: none; color: inherit;
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}
.tag-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.tag-post-img {
    position: relative; overflow: hidden;
    aspect-ratio: 16/9; background: #f5f5f5;
}
.tag-post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tag-post-card:hover .tag-post-img img { transform: scale(1.05); }
.tag-cat-badge {
    position: absolute; bottom: 8px; left: 8px;
    background: var(--nsg-red); color: #fff;
    padding: 3px 8px; border-radius: 12px;
    font-size: 10px; font-weight: 700;
}
.tag-post-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tag-post-title {
    font-size: 14px; font-weight: 700;
    color: var(--nsg-dark); margin: 0; line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tag-post-card:hover .tag-post-title { color: var(--nsg-red); }
.tag-post-excerpt {
    font-size: 12px; color: #888; margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tag-post-meta {
    display: flex; gap: 10px; font-size: 11px;
    color: #aaa; margin-top: auto; padding-top: 8px;
}
.tag-post-meta i { color: var(--nsg-red); }

/* ----------------------------------------------------------------
   17. CATEGORY PAGE  (dynamic --cat-color set inline per-page)
   ---------------------------------------------------------------- */
.cat-hero {
    background: linear-gradient(135deg, var(--cat-color) 0%, color-mix(in srgb, var(--cat-color) 73%, transparent) 100%);
    border-radius: 16px;
    padding: 3rem 2rem;
    color: #fff;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.cat-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='25' fill='none' stroke='rgba(255,255,255,.08)' stroke-width='1'/%3E%3C/svg%3E") repeat;
    opacity: .5;
}
.cat-hero-icon { font-size: 4rem; opacity: .9; margin-bottom: .5rem; }
.cat-hero h1   { font-size: 2.2rem; font-weight: 800; margin-bottom: .3rem; }
.cat-hero p    { font-size: 15px; opacity: .85; margin: 0; }
.cat-hero .badge-count {
    display: inline-block;
    background: rgba(255,255,255,.25);
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px; font-weight: 600;
    backdrop-filter: blur(4px);
    margin-top: .75rem;
}

.cat-post-card {
    border: none; border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,.08);
    transition: transform .22s, box-shadow .22s;
    height: 100%; background: #fff;
}
.cat-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 32px rgba(0,0,0,.14);
}
.cat-post-card .thumb-wrap { height: 200px; overflow: hidden; position: relative; }
.cat-post-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.cat-post-card:hover .thumb-wrap img { transform: scale(1.06); }
.cat-post-card .thumb-label {
    position: absolute; top: 10px; left: 10px;
    background: var(--cat-color);
    color: #fff; font-size: 10px; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: .4px;
}
.cat-post-card .card-body { padding: 1rem 1.1rem 1.1rem; }
.cat-post-card .card-title-link {
    font-size: 15px; font-weight: 700;
    color: var(--nsg-dark); text-decoration: none;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-post-card .card-title-link:hover { color: var(--cat-color); }
.cat-post-card .card-excerpt {
    font-size: 13px; color: #777; margin-top: .4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-post-card .card-meta {
    font-size: 12px; color: #aaa; margin-top: .6rem;
    display: flex; gap: 12px; flex-wrap: wrap;
}
.cat-post-card .card-meta i { color: var(--cat-color); }

.popular-cat-item {
    display: flex; align-items: flex-start;
    gap: 10px; padding: 10px 0;
    border-bottom: 1px dashed #eee;
}
.popular-cat-item:last-child { border-bottom: none; }
.popular-cat-num { font-size: 1.3rem; font-weight: 800; min-width: 28px; line-height: 1; color: #e0e0e0; }
.popular-cat-item:nth-child(1) .popular-cat-num { color: var(--cat-color); }
.popular-cat-item:nth-child(2) .popular-cat-num { color: #f39c12; }
.popular-cat-item:nth-child(3) .popular-cat-num { color: #95a5a6; }

.other-cat-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-radius: 8px;
    transition: background .15s;
    text-decoration: none; color: var(--nsg-dark);
    font-size: 14px; font-weight: 600; margin-bottom: 4px;
}
.other-cat-item:hover { background: #fff5f5; color: var(--nsg-red); }
.other-cat-item .badge {
    background: #f0f0f0; color: #888;
    font-size: 11px; font-weight: 600;
    border-radius: 12px; padding: 2px 8px;
}

.cat-breadcrumb { font-size: 13px; color: #888; margin-bottom: 1.5rem; }
.cat-breadcrumb a { color: var(--cat-color); text-decoration: none; font-weight: 600; }
.cat-breadcrumb a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   18. PAGINATION
   ---------------------------------------------------------------- */
.pagination .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    font-size: 14px; font-weight: 600;
    color: var(--nsg-dark);
    border: 1px solid #e0e0e0;
}
.pagination .page-item.active .page-link {
    background: var(--cat-color, var(--nsg-red));
    border-color: var(--cat-color, var(--nsg-red));
    color: #fff;
}
.pagination .page-link:hover {
    background: #fff5f5;
    color: var(--cat-color, var(--nsg-red));
    border-color: var(--cat-color, var(--nsg-red));
}

/* ----------------------------------------------------------------
   19. MISC / PLACEHOLDERS
   ---------------------------------------------------------------- */
.img-placeholder {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    display: flex; align-items: center; justify-content: center;
    color: var(--nsg-red); font-size: 2.5rem;
}

/* ----------------------------------------------------------------
   20. RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-banner { height: 300px; }
    .hero-title  { font-size: 1.2rem; }
    .section-title { font-size: 1rem; }
    .related-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .hero-banner { height: 240px; }
    .topbar      { display: none; }
}
@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
}

