/* ===== Tin tức - front-end styles ===== */
:root {
  --primary: #d32f2f;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e5e5e5;
  --bg: #fff;
  --bg-alt: #f6f6f6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --content-w: 760px;
  --sidebar-w: 320px;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.hp { position: absolute; left: -9999px; }
.btn { display: inline-block; background: var(--primary); color: #fff; padding: 10px 18px; border-radius: var(--radius); border: 0; font-weight: 600; cursor: pointer; }
.btn:hover { background: #b71c1c; color: #fff; }
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; background: #e8f5e9; color: #1b5e20; }
.flash-error { background: #ffebee; color: #b71c1c; }
.flash-warning { background: #fff8e1; color: #7f6000; }
.empty { color: var(--muted); padding: 24px 0; }

/* Header */
.topbar { background: #111; color: #ccc; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.top-links a { margin-left: 14px; color: #ccc; }
.top-links a:hover { color: #fff; }
.header-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.brand-text { font-size: 30px; font-weight: 900; letter-spacing: -.5px; color: var(--primary); font-family: var(--serif); }
.brand-tagline { margin: 0; font-size: 12px; color: var(--muted); }
.search-form { display: flex; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.search-form input { border: 0; padding: 8px 14px; width: 220px; outline: none; font-size: 14px; }
.search-form button { border: 0; background: #fff; padding: 0 12px; cursor: pointer; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); font-size: 22px; padding: 4px 10px; border-radius: var(--radius); cursor: pointer; }
.main-nav { border-top: 2px solid var(--primary); border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 0; z-index: 50; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav a { display: block; padding: 11px 14px; font-weight: 600; font-size: 15px; white-space: nowrap; border-bottom: 3px solid transparent; }
.main-nav a:hover, .main-nav a.active { border-bottom-color: var(--cat, var(--primary)); color: var(--cat, var(--primary)); }

/* Layout */
.site-main { padding: 20px 16px 40px; min-height: 60vh; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar-w); gap: 36px; margin-top: 20px; }
.content { min-width: 0; }
.sidebar { min-width: 0; }
.sidebar-sticky { position: sticky; top: 60px; }
.widget { margin-bottom: 28px; }
.widget-title, .section-title { font-size: 18px; text-transform: uppercase; letter-spacing: .3px; border-left: 4px solid var(--cat, var(--primary)); padding-left: 10px; margin-bottom: 14px; }
.section-title a:hover { color: var(--cat, var(--primary)); }
.popular-list { list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.popular-list li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-weight: 600; font-size: 15px; }
.popular-list .num { color: var(--primary); font-size: 22px; font-weight: 900; line-height: 1; font-family: var(--serif); min-width: 22px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--bg-alt); border-radius: 14px; padding: 4px 12px; font-size: 13px; }
.tag:hover { background: var(--primary); color: #fff; }

/* Breaking */
.breaking { display: flex; align-items: center; background: #fff3f3; border-left: 4px solid var(--primary); padding: 8px 12px; margin-bottom: 18px; overflow: hidden; gap: 12px; }
.breaking-label { background: var(--primary); color: #fff; font-weight: 800; padding: 2px 10px; border-radius: 3px; font-size: 12px; text-transform: uppercase; flex-shrink: 0; }
.breaking-track { display: flex; gap: 32px; white-space: nowrap; overflow: hidden; }
.breaking-track a { font-weight: 600; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; margin-bottom: 30px; }
.hero-side { display: grid; gap: 14px; align-content: start; }

/* Cards */
.card { display: flex; flex-direction: column; }
.card-media { display: block; overflow: hidden; border-radius: var(--radius); background: var(--bg-alt); aspect-ratio: 16/9; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding-top: 10px; }
.card-cat { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 0; color: var(--cat, var(--primary)); color: color-mix(in srgb, var(--cat, var(--primary)) 70%, #000); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.card-title { font-size: 17px; margin: 0 0 6px; }
.card-title a:hover { color: var(--primary); }
.card-excerpt { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.card-meta { font-size: 12px; color: #666; }
.card-hero .card-title { font-size: 28px; }
.card-hero .card-excerpt { font-size: 15px; }
.card-small { flex-direction: row; gap: 12px; }
.card-small .card-media { width: 120px; flex-shrink: 0; aspect-ratio: 4/3; }
.card-small .card-body { padding-top: 0; }
.card-small .card-title { font-size: 15px; }
.card-list { flex-direction: row; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.card-list .card-media { width: 260px; flex-shrink: 0; }
.card-list .card-body { padding-top: 0; }
.card-list .card-title { font-size: 20px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.cat-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.cat-grid .card-small { grid-column: 2; }
.cat-grid .card-grid { grid-row: 1 / span 3; }
.section { margin-bottom: 36px; }
.more { text-align: center; margin-top: 20px; }

/* Archive */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb span { margin: 0 6px; }
.breadcrumb .current { margin: 0; color: var(--text); }
.archive-header { border-bottom: 3px solid var(--cat, var(--primary)); margin-bottom: 8px; padding-bottom: 12px; }
.archive-header h1 { font-size: 28px; margin-bottom: 4px; }
.archive-desc { color: var(--muted); margin: 0; }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.subcats a { background: var(--bg-alt); padding: 4px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.search-inline { display: flex; gap: 8px; margin-top: 12px; }
.search-inline input { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.search-inline button { padding: 10px 16px; background: var(--primary); color: #fff; border: 0; border-radius: var(--radius); cursor: pointer; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 28px 0; }
.page-link { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-dots { padding: 8px 4px; }

/* Single post */
.single-post { max-width: var(--content-w); }
.post-header { margin-bottom: 18px; }
.post-title { font-size: 34px; font-family: var(--serif); letter-spacing: -.3px; }
.post-excerpt { font-size: 18px; color: #444; font-weight: 500; margin: 0 0 12px; }
.post-meta { font-size: 13px; color: var(--muted); }
.post-meta a { font-weight: 600; color: var(--text); }
.post-image { margin: 0 0 20px; }
.post-image img { width: 100%; border-radius: var(--radius); }
.post-image figcaption { font-size: 12px; color: #666; margin-top: 6px; }
.post-content { font-size: 18px; line-height: 1.75; }
.post-content p { margin: 0 0 1.2em; }
.post-content h2 { font-size: 24px; margin-top: 1.5em; }
.post-content h3 { font-size: 20px; margin-top: 1.3em; }
.post-content img { margin: 1em auto; border-radius: var(--radius); }
.post-content blockquote { border-left: 4px solid var(--primary); margin: 1.2em 0; padding: 8px 18px; background: var(--bg-alt); font-style: italic; }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 15px; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px; }
.post-content pre { background: #1e1e1e; color: #eee; padding: 14px; overflow: auto; border-radius: var(--radius); font-size: 14px; }
.post-content a { color: #1565c0; text-decoration: underline; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; margin: 1.2em 0; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.toc { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; font-size: 15px; }
.toc-title { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc .toc-l3 { margin-left: 1em; list-style: circle; }
.post-source { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 12px; }
.post-source a { text-decoration: underline; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.post-content .read-next { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 24px; font-size: 15px; }
.tg-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; background: var(--bg-alt); border: 1px solid var(--border); border-left: 4px solid #229ed9; border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; }
.tg-follow-text { flex: 1 1 240px; min-width: 0; }
.tg-follow-text strong { display: block; font-size: 17px; }
.tg-follow-text span { color: var(--muted); font-size: 14px; }
.tg-follow .btn { background: #229ed9; white-space: nowrap; }
.tg-follow .btn:hover { background: #1a82b3; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0; font-size: 14px; }
.share a, .share button { padding: 6px 14px; border-radius: 16px; color: #fff; border: 0; cursor: pointer; font-size: 13px; font-weight: 600; }
.share-fb { background: #1877f2; } .share-x { background: #000; } .share-tg { background: #229ed9; } .share-copy { background: #555; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.post-nav a { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.post-nav small { color: var(--muted); display: block; }
.post-nav .next { text-align: right; }
.post-nav span { font-weight: 600; }
.related { margin-top: 30px; }
.comments { margin-top: 30px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment.reply { margin-left: 30px; }
.comment-head time { color: var(--muted); font-size: 12px; margin-left: 8px; }
.comment p { margin: 6px 0 0; }
.comment-form { margin-top: 18px; display: grid; gap: 10px; }
.comment-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; }
.comment-form .btn { justify-self: start; }
.error-page { text-align: center; padding: 60px 0; }
.error-page h1 { font-size: 90px; color: var(--primary); margin: 0; }
.error-page .search-inline { max-width: 420px; margin: 20px auto; }

/* Ads */
.ad-slot { text-align: center; margin: 16px 0; overflow: hidden; min-height: 50px; }
.ad-slot:empty { display: none; }
.ad-container { margin: 12px 0; }
.ad-in-feed { grid-column: 1 / -1; }
.sidebar-ad { margin-bottom: 24px; }
.ad-sticky-bottom { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; box-shadow: 0 -2px 8px rgba(0,0,0,.15); z-index: 90; padding: 4px 32px 4px 4px; }
.ad-sticky-bottom .ad-slot { margin: 0; }
.ad-close { position: absolute; right: 4px; top: 4px; background: #eee; border: 0; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
.consent-banner { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 640px; margin: 0 auto; background: #222; color: #eee; padding: 14px 18px; border-radius: var(--radius); display: flex; gap: 16px; align-items: center; z-index: 95; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.consent-banner p { margin: 0; }
.consent-banner a { color: #fff; text-decoration: underline; }
.consent-banner button { background: var(--primary); color: #fff; border: 0; padding: 8px 16px; border-radius: var(--radius); cursor: pointer; flex-shrink: 0; }

/* Footer */
.site-footer { background: #111; color: #bbb; margin-top: 40px; padding: 36px 0 20px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 32px; }
.site-footer h3 { color: #fff; font-size: 15px; text-transform: uppercase; }
.footer-brand { font-size: 22px !important; text-transform: none !important; font-family: var(--serif); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.social a { margin-right: 12px; }
.newsletter { margin-top: 12px; }
.newsletter label { display: block; margin-bottom: 6px; color: #fff; }
.newsletter-row { display: flex; }
.newsletter input { flex: 1; padding: 8px 10px; border: 0; border-radius: var(--radius) 0 0 var(--radius); min-width: 0; }
.newsletter button { background: var(--primary); color: #fff; border: 0; padding: 8px 14px; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.copyright { border-top: 1px solid #333; margin-top: 28px; padding-top: 16px; text-align: center; font-size: 13px; }

/* Responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar-sticky { position: static; }
  .hero { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar { display: none; }
  .header-main { flex-wrap: wrap; padding: 10px 16px; }
  .nav-toggle { display: block; order: 1; }
  .brand { order: 2; flex: 1; text-align: center; }
  .brand-text { font-size: 24px; }
  .brand-tagline { display: none; }
  .search-form { order: 3; width: 100%; margin-top: 8px; }
  .search-form input { width: 100%; }
  .main-nav { position: static; }
  .main-nav ul { display: none; flex-direction: column; }
  .main-nav.open ul { display: flex; }
  .grid, .grid-3, .cat-grid { grid-template-columns: 1fr; }
  .cat-grid .card-small { grid-column: auto; }
  .cat-grid .card-grid { grid-row: auto; }
  .card-list { flex-direction: column; gap: 10px; }
  .card-list .card-media { width: 100%; }
  .card-hero .card-title { font-size: 22px; }
  .post-title { font-size: 26px; }
  .post-content { font-size: 17px; }
  .post-nav, .comment-form .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .consent-banner { flex-direction: column; align-items: stretch; }
}
@media print {
  .site-header, .sidebar, .site-footer, .ad-slot, .share, .comments, .post-nav, .consent-banner { display: none !important; }
  .layout { grid-template-columns: 1fr; }
}
