/*
Theme Name: TinNews247
Theme URI: https://tinnews247.com
Author: TinNews247
Description: Theme tin tuc nhe, khong phu thuoc page builder. Toi uu toc do, SEO va vi tri quang cao AdSense.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tinnews247
*/

/* ===== 0. Bien & nen tang ===== */
:root {
  --tn-blue: #0a4d9e;
  --tn-blue-dark: #083b7a;
  --tn-red: #d71920;
  --tn-text: #1b1b1b;
  --tn-muted: #6b7280;
  --tn-line: #e5e7eb;
  --tn-bg: #ffffff;
  --tn-soft: #f4f6f9;
  --tn-wrap: 1200px;
  --tn-radius: 6px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--tn-text);
  background: var(--tn-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--tn-blue); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; }
.tn-wrap { max-width: var(--tn-wrap); margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute; left: -9999px; }
.tn-skip:focus { left: 8px; top: 8px; z-index: 999; background: #fff; padding: 8px 12px; }

/* ===== 1. Header ===== */
.tn-topbar { background: var(--tn-soft); border-bottom: 1px solid var(--tn-line); font-size: 13px; color: var(--tn-muted); }
.tn-topbar .tn-wrap { display: flex; justify-content: space-between; align-items: center; min-height: 32px; gap: 12px; }
.tn-topbar a { margin-left: 14px; }
.tn-head .tn-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.tn-logo { display: flex; align-items: center; font-size: 28px; font-weight: 800; color: var(--tn-blue); letter-spacing: -.5px; }
.tn-logo img { height: 56px; width: auto; }
/* Logo hien tai (1536x1024) co nhieu khoang trong quanh chu: cat bot bang object-fit. */
.tn-logo img[src*="logo-xoas"] { width: 250px; height: 84px; object-fit: cover; object-position: 50% 46%; margin: -8px 0 -8px -28px; }
.tn-logo span b { color: var(--tn-red); }
.tn-search { display: flex; border: 1px solid var(--tn-line); border-radius: 999px; overflow: hidden; background: #fff; }
.tn-search input { border: 0; outline: 0; padding: 8px 14px; width: 220px; background: transparent; }
.tn-search button { border: 0; background: var(--tn-blue); color: #fff; padding: 0 16px; cursor: pointer; }
.tn-burger { display: none; border: 0; background: none; padding: 8px; cursor: pointer; }
.tn-burger span { display: block; width: 24px; height: 2px; background: var(--tn-text); margin: 5px 0; }

.tn-nav { background: var(--tn-blue); position: sticky; top: 0; z-index: 50; }
.admin-bar .tn-nav { top: 32px; }
.tn-nav ul.tn-menu { display: flex; flex-wrap: wrap; }
.tn-nav li { position: relative; }
.tn-nav a { display: block; padding: 11px 14px; color: #fff; font-size: 14px; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.tn-nav a:hover, .tn-nav .current-menu-item > a, .tn-nav .current-menu-parent > a { background: var(--tn-blue-dark); color: #fff; }
.tn-nav li ul { display: none; position: absolute; left: 0; top: 100%; min-width: 200px; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.12); border-radius: 0 0 var(--tn-radius) var(--tn-radius); z-index: 60; }
.tn-nav li:hover > ul, .tn-nav li:focus-within > ul { display: block; }
.tn-nav li ul a { color: var(--tn-text); text-transform: none; font-weight: 500; border-bottom: 1px solid var(--tn-line); }
.tn-nav li ul a:hover { background: var(--tn-soft); color: var(--tn-blue); }

/* ===== 2. Thanh phan chung ===== */
.tn-main { padding: 20px 0 40px; }
.tn-sec-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--tn-blue); margin: 0 0 16px; }
.tn-sec-title h2, .tn-sec-title .tn-h { font-size: 18px; text-transform: uppercase; background: var(--tn-blue); color: #fff; padding: 6px 14px; border-radius: var(--tn-radius) var(--tn-radius) 0 0; margin: 0; }
.tn-sec-title h2 a:hover { color: #fff; }
.tn-sec-title .tn-more { font-size: 13px; color: var(--tn-muted); }
.tn-thumb { display: block; position: relative; overflow: hidden; border-radius: var(--tn-radius); background: linear-gradient(135deg, #0a4d9e, #3b82c4); aspect-ratio: 16 / 9; }
.tn-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tn-card:hover .tn-thumb img { transform: scale(1.04); }
.tn-thumb .tn-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); font-weight: 800; font-size: 18px; }
.tn-cat { display: inline-block; font-size: 12px; font-weight: 700; color: var(--tn-red); text-transform: uppercase; letter-spacing: .3px; }
.tn-meta { font-size: 12.5px; color: var(--tn-muted); }
.tn-meta .tn-cat { margin-right: 8px; }
.tn-card h3 { font-size: 16px; margin: 8px 0 4px; }
.tn-card p { font-size: 14px; color: #4b5563; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tn-card--row { display: grid; grid-template-columns: 38% 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--tn-line); }
.tn-card--row:first-child { padding-top: 0; }
.tn-card--row h3 { margin-top: 0; font-size: 17px; }
.tn-card--mini { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--tn-line); }
.tn-card--mini h3 { font-size: 14px; margin: 0; font-weight: 600; }
.tn-card--mini .tn-thumb { aspect-ratio: 4 / 3; }

/* ===== 3. Trang chu ===== */
.tn-hero { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; margin-bottom: 28px; }
.tn-hero-main h2 { font-size: 28px; margin: 12px 0 8px; }
.tn-hero-main p { font-size: 16px; color: #374151; -webkit-line-clamp: 3; }
.tn-hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.tn-hero-side h3 { font-size: 15px; }
.tn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
.tn-block { margin-bottom: 32px; }
.tn-catgrid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.tn-catgrid .tn-lead h3 { font-size: 20px; }
.tn-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ===== 4. Sidebar ===== */
.tn-side .tn-widget { margin-bottom: 28px; }
.tn-rank { counter-reset: r; }
.tn-rank li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--tn-line); font-size: 14.5px; font-weight: 600; }
.tn-rank li::before { content: counter(r); font-size: 26px; font-weight: 800; color: #cbd5e1; line-height: 1; }
.tn-rank li:nth-child(-n+3)::before { color: var(--tn-red); }
.tn-sticky { position: sticky; top: 60px; }

/* ===== 5. Quang cao ===== */
.tn-ad { margin: 20px auto; text-align: center; clear: both; overflow: hidden; }
.tn-ad::before { content: "Quảng cáo"; display: block; font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.tn-ad--head { margin: 14px auto 0; }

/* ===== 6. Bai viet ===== */
.tn-bc { font-size: 13px; color: var(--tn-muted); margin-bottom: 12px; }
.tn-bc a { color: var(--tn-blue); }
.tn-bc .sep { margin: 0 6px; color: #cbd5e1; }
.tn-article h1 { font-size: 32px; line-height: 1.25; margin: 6px 0 12px; }
.tn-article .tn-byline { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13.5px; color: var(--tn-muted); padding-bottom: 14px; border-bottom: 1px solid var(--tn-line); margin-bottom: 18px; }
.tn-byline strong { color: var(--tn-text); }
.tn-sapo { font-size: 18px; font-weight: 600; color: #111827; margin-bottom: 18px; }
.tn-feature { margin: 0 0 20px; }
.tn-feature img { width: 100%; border-radius: var(--tn-radius); }
.tn-feature figcaption { font-size: 13px; color: var(--tn-muted); text-align: center; padding-top: 6px; }
.tn-content { font-size: 18px; line-height: 1.75; color: #1f2937; overflow-wrap: break-word; }
.tn-content p { margin-bottom: 1.15em; }
.tn-content h2 { font-size: 24px; margin: 1.4em 0 .6em; }
.tn-content h3 { font-size: 20px; margin: 1.3em 0 .5em; }
.tn-content a { color: var(--tn-blue); text-decoration: underline; }
.tn-content ul, .tn-content ol { margin: 0 0 1.15em 1.4em; padding: 0; list-style: revert; }
.tn-content img, .tn-content video, .tn-content iframe { max-width: 100%; border-radius: var(--tn-radius); margin: 0 auto; }
.tn-content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.tn-content figure { margin: 1.2em 0; max-width: 100%; }
.tn-content figcaption { font-size: 13.5px; color: var(--tn-muted); text-align: center; padding-top: 6px; }
.tn-content blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--tn-blue); background: var(--tn-soft); font-style: italic; }
.tn-content table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 .6em; }
.tn-content th { background: var(--tn-soft); text-align: left; }
.tn-content td, .tn-content th { border: 1px solid var(--tn-line); padding: 8px 10px; }
.tn-tags { margin: 22px 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.tn-tags a { background: var(--tn-soft); border: 1px solid var(--tn-line); padding: 4px 10px; border-radius: 999px; }
.tn-share { display: flex; gap: 8px; margin: 18px 0; font-size: 13.5px; font-weight: 600; }
.tn-share a, .tn-share button { border: 1px solid var(--tn-line); background: #fff; border-radius: var(--tn-radius); padding: 7px 14px; cursor: pointer; }
.tn-share .fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.tn-author { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; background: var(--tn-soft); border-radius: var(--tn-radius); padding: 16px; margin: 24px 0; font-size: 14px; }
.tn-author img { border-radius: 50%; }
.tn-related { margin-top: 32px; }

/* ===== 7. Chuyen muc / tim kiem / trang ===== */
.tn-archive-head { margin-bottom: 20px; }
.tn-archive-head h1 { font-size: 28px; color: var(--tn-blue); }
.tn-archive-head p { color: var(--tn-muted); margin-top: 6px; }
.tn-pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 28px; }
.tn-pager .page-numbers { border: 1px solid var(--tn-line); padding: 7px 13px; border-radius: var(--tn-radius); font-weight: 600; font-size: 14px; }
.tn-pager .current { background: var(--tn-blue); border-color: var(--tn-blue); color: #fff; }
.tn-page { max-width: 820px; margin: 0 auto; }
.tn-page h1 { font-size: 30px; margin-bottom: 18px; }
.tn-empty { padding: 40px 0; text-align: center; color: var(--tn-muted); }

/* ===== 8. Footer ===== */
.tn-foot { background: #0f172a; color: #cbd5e1; font-size: 14px; margin-top: 20px; }
.tn-foot a:hover { color: #fff; }
.tn-foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; padding: 36px 16px 28px; }
.tn-foot h4 { color: #fff; font-size: 15px; text-transform: uppercase; margin-bottom: 12px; }
.tn-foot li { margin-bottom: 8px; }
.tn-foot .tn-logo { color: #fff; margin-bottom: 10px; font-size: 24px; }
.tn-foot-bottom { border-top: 1px solid #1e293b; text-align: center; padding: 14px 16px; font-size: 13px; color: #94a3b8; }
.tn-totop { position: fixed; right: 16px; bottom: 16px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--tn-blue); color: #fff; font-size: 18px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.tn-totop.show { opacity: 1; pointer-events: auto; }

/* ===== 9. Responsive ===== */
@media (max-width: 1024px) {
  .tn-layout { grid-template-columns: 1fr; }
  .tn-sticky { position: static; }
  .tn-hero { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .tn-topbar .tn-links { display: none; }
  .tn-burger { display: block; }
  .tn-head .tn-search { display: none; }
  .tn-logo img { height: 44px; }
  .tn-logo img[src*="logo-xoas"] { width: 190px; height: 64px; margin: -6px 0 -6px -12px; }
  .tn-head .tn-wrap { justify-content: flex-start; }
  .tn-nav { position: static; }
  .tn-nav .tn-wrap { padding: 0; }
  .tn-nav ul.tn-menu { display: none; flex-direction: column; }
  .tn-nav.open ul.tn-menu { display: flex; }
  .tn-nav li ul { display: block; position: static; box-shadow: none; background: var(--tn-blue-dark); border-radius: 0; }
  .tn-nav li ul a { color: #e5e7eb; padding-left: 30px; border-bottom: 0; }
  .tn-nav .tn-search-m { display: block; padding: 10px 16px; }
  .tn-nav .tn-search-m .tn-search input { width: 100%; flex: 1; }
  .tn-hero-main h2 { font-size: 22px; }
  .tn-catgrid { grid-template-columns: 1fr; }
  .tn-grid3 { grid-template-columns: 1fr 1fr; gap: 14px; }
  .tn-article h1 { font-size: 25px; }
  .tn-content { font-size: 17px; }
  .tn-foot-grid { grid-template-columns: 1fr; gap: 22px; }
  .tn-card--row { grid-template-columns: 42% 1fr; }
  .tn-card--row h3 { font-size: 15px; }
  .tn-card--row p { display: none; }
}
@media (min-width: 769px) { .tn-search-m { display: none; } }
@media (max-width: 480px) {
  .tn-hero-side { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tn-hero-side h3 { font-size: 14px; }
}
