/*
Theme Name: Tin24h Pro Lite
Theme URI: http://tin24honline.com/
Author: Tin24h Pro Lite
Description: Giao diện báo điện tử siêu nhẹ tông Xanh Navy – Đỏ thiết kế riêng cho tin24honline.com. Bố cục 4 cột đầu trang, tiêu đề chuyên mục cắt vát chéo, khối Video YouTube, không cần Page Builder, tương thích PHP 8.4 và Tin24h News Core Lite.
Version: 1.0.3
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tin24h-pro-lite
*/

:root {
  --t24p-navy: #133a6b;
  --t24p-navy-dark: #0e2c52;
  --t24p-blue: #2463a6;
  --t24p-red: #d92027;
  --t24p-text: #1c2430;
  --t24p-muted: #64748b;
  --t24p-border: #e2e8f0;
  --t24p-soft: #f8fafc;
  --t24p-bg: #ffffff;
  --t24p-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--t24p-text);
  background: var(--t24p-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .15s ease, background-color .15s ease; }
a:hover { color: var(--t24p-red); }
img { max-width: 100%; height: auto; display: block; }

.tp-container {
  width: 100%;
  max-width: var(--t24p-max);
  margin: 0 auto;
  padding: 0 14px;
}

/* Top Date Bar */
.tp-topbar {
  background: #f1f5f9;
  border-bottom: 1px solid var(--t24p-border);
  font-size: 12px;
  color: var(--t24p-muted);
  padding: 4px 0;
}
.tp-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Main Header */
.tp-header {
  background: #fff;
  padding: 12px 0;
}
.tp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.tp-brand .custom-logo-link img {
  max-height: 54px;
  width: auto;
}
.tp-logo-text {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.6px;
  color: var(--t24p-navy);
}
.tp-logo-text span { color: var(--t24p-red); }
.tp-slogan {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--t24p-muted);
  font-weight: 500;
}
.tp-search-bar {
  flex: 1;
  max-width: 440px;
  display: flex;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}
.tp-search-bar input[type="search"] {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 13.5px;
  outline: none;
}
.tp-search-bar button {
  background: var(--t24p-navy);
  color: #fff;
  border: 0;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tp-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tp-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t24p-navy);
  background: #fff;
}
.tp-btn-outline:hover {
  border-color: var(--t24p-navy);
  background: var(--t24p-soft);
  color: var(--t24p-navy);
}

/* Primary Navy Navigation Bar */
.tp-nav-wrap {
  background: var(--t24p-navy);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 2px 8px rgba(19, 58, 107, 0.22);
}
.tp-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.tp-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.tp-menu > li { position: relative; }
.tp-menu > li > a {
  display: block;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  letter-spacing: 0.2px;
}
.tp-menu > li.current-menu-item > a,
.tp-menu > li.current-category-ancestor > a,
.tp-menu > li > a:hover {
  background: var(--t24p-blue);
  color: #ffffff;
}
.tp-menu ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--t24p-border);
  border-top: 3px solid var(--t24p-red);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  z-index: 70;
}
.tp-menu li:hover > ul.sub-menu { display: block; }
.tp-menu ul.sub-menu a {
  display: block;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t24p-text);
}
.tp-menu ul.sub-menu a:hover {
  background: var(--t24p-soft);
  color: var(--t24p-red);
}
.tp-menu-toggle {
  display: none;
  background: var(--t24p-blue);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Section Heading cắt vát chéo màu Xanh Navy đúng ảnh mẫu */
.tp-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 2px solid var(--t24p-navy);
  margin: 0 0 14px;
}
.tp-head-title {
  margin: 0 0 -2px;
  display: inline-block;
  background: var(--t24p-navy);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 6px 26px 6px 12px;
  line-height: 1.25;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
}
.tp-head-title a { color: #fff; }
.tp-head-title a:hover { color: #dbeafe; }

.tp-badge-hot {
  display: inline-block;
  background: var(--t24p-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  line-height: 1.2;
}

/* Meta & Thumbnails */
.tp-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: #e2e8f0;
}
.tp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tp-meta {
  font-size: 11.5px;
  color: var(--t24p-muted);
  margin-top: 4px;
}

/* =========================================================================
 * HÀNG 1: HERO 4 CỘT (HERO LỚN | 4 BÀI PHỤ | TIN NÓNG 24H | ĐỌC NHIỀU)
 * ========================================================================= */
.tp-row-hero {
  display: grid;
  grid-template-columns: 1.65fr 1.15fr 0.95fr 0.85fr;
  gap: 16px;
  margin: 18px 0 24px;
  align-items: start;
}
.tp-hero-feature {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  min-height: 360px;
  background: #0f172a;
}
.tp-hero-feature img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tp-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 20, 38, 0.92) 0%, rgba(10, 20, 38, 0.25) 55%, rgba(0, 0, 0, 0.05) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  color: #fff;
}
.tp-hero-feature .tp-badge-hot {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.tp-hero-overlay h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.32;
  font-weight: 800;
  color: #fff;
}
.tp-hero-overlay h2 a:hover { color: #ffd166; }
.tp-hero-overlay p {
  margin: 0;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Cột 2: 4 bài phụ ảnh nhỏ bên trái */
.tp-mid-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tp-mid-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--t24p-border);
}
.tp-mid-item:last-child { border-bottom: 0; padding-bottom: 0; }
.tp-mid-thumb {
  flex: 0 0 96px;
  aspect-ratio: 16 / 11;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
}
.tp-mid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tp-mid-item h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.36;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Cột 3: TIN NÓNG 24H */
.tp-hot24-box {
  background: var(--t24p-soft);
  border: 1px solid var(--t24p-border);
  border-radius: 5px;
  padding: 12px;
}
.tp-hot24-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--t24p-red);
  padding-bottom: 7px;
  margin-bottom: 10px;
}
.tp-hot24-head span.tp-hot24-lbl {
  font-size: 14px;
  font-weight: 800;
  color: var(--t24p-navy);
  text-transform: uppercase;
}
.tp-hot24-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tp-hot24-list li {
  padding: 7px 0;
  border-bottom: 1px dashed #cbd5e1;
}
.tp-hot24-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.tp-hot24-list a {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.38;
}

/* Cột 4: Tin đọc nhiều nhất (số 1 đỏ, 2-5 xanh navy) */
.tp-rank-box {
  border: 1px solid var(--t24p-border);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}
.tp-rank-head {
  background: var(--t24p-navy);
  color: #fff;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
}
.tp-rank-list {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
}
.tp-rank-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.tp-rank-list li:last-child { border-bottom: 0; padding-bottom: 2px; }
.tp-rank-num {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 3px;
  background: var(--t24p-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.tp-rank-list li:first-child .tp-rank-num { background: var(--t24p-red); }
.tp-rank-list a {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.38;
}

/* =========================================================================
 * HÀNG 2: 3 CỘT NGANG (THỜI SỰ | KINH DOANH | TIN MỚI NHẤT & BANNER)
 * ========================================================================= */
.tp-row-3col {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1fr;
  gap: 20px;
  margin-bottom: 26px;
  align-items: start;
}
.tp-2card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tp-card h3 {
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.38;
}

/* =========================================================================
 * HÀNG 3: CHUYÊN MỤC TOÀN CHIỀU RỘNG 4 CỘT (THẾ GIỚI)
 * ========================================================================= */
.tp-row-wide {
  margin-bottom: 28px;
}
.tp-wide-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.25fr 0.9fr 0.9fr;
  gap: 16px;
  align-items: start;
}
.tp-wide-hero {
  position: relative;
  min-height: 250px;
  border-radius: 5px;
  overflow: hidden;
  background: #0f172a;
}
.tp-wide-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tp-wide-hero .tp-hero-overlay { padding: 14px; }
.tp-wide-hero .tp-hero-overlay h3 {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.35;
  color: #fff;
}

/* =========================================================================
 * HÀNG 4 & 5: 2 CHUYÊN MỤC SONG SONG (THỂ THAO | CÔNG NGHỆ & GIẢI TRÍ | VIDEO)
 * ========================================================================= */
.tp-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
  align-items: start;
}
.tp-split-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
  align-items: start;
}
.tp-lead-card h3 {
  margin: 10px 0 4px;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.35;
}

/* Video Box (Hàng 5 bên phải) */
.tp-video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tp-video-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.tp-video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  overflow: hidden;
  background: #000;
  display: block;
}
.tp-video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tp-play-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(217, 32, 39, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid #fff;
}
.tp-video-item h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.38;
}

/* Archive / Single Layout */
.tp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  margin: 22px 0 38px;
  align-items: start;
}
.tp-main { min-width: 0; overflow-x: hidden; }
.tp-sidebar { position: sticky; top: 58px; }
.tp-widget { margin-bottom: 24px; }

.tp-feed-list { display: flex; flex-direction: column; gap: 18px; }
.tp-feed-item {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--t24p-border);
}
.tp-feed-item h3 { margin: 0 0 6px; font-size: 17.5px; line-height: 1.35; }
.tp-excerpt { margin: 6px 0 0; font-size: 14px; color: #475569; }

/* Single Post (Anti-overflow for images & captions) */
.tp-single-title {
  margin: 8px 0 10px;
  font-size: 28px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--t24p-navy-dark);
}
.tp-entry-content {
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
}
.tp-entry-content p { margin: 0 0 16px; }
.tp-entry-content img,
.tp-entry-content figure,
.tp-entry-content .wp-caption,
.tp-entry-content .wp-block-image,
.tp-entry-content iframe,
.tp-entry-content video,
.tp-entry-content table {
  max-width: 100% !important;
}
.tp-entry-content img { height: auto !important; margin: 14px auto; border-radius: 4px; }
.tp-entry-content .wp-caption,
.tp-entry-content figure { width: auto !important; margin: 18px auto; text-align: center; }
.tp-entry-content .wp-caption-text,
.tp-entry-content figcaption { font-size: 13px; color: var(--t24p-muted); font-style: italic; margin-top: 6px; text-align: center; }
.tp-entry-content blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--t24p-navy);
  background: var(--t24p-soft);
}
.tp-tags { margin: 20px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tp-tags a { background: var(--t24p-soft); border: 1px solid var(--t24p-border); padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }

/* Pagination */
.tp-pagination { margin: 24px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tp-pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--t24p-border); border-radius: 4px; font-size: 13px; font-weight: 700; }
.tp-pagination .page-numbers.current { background: var(--t24p-navy); border-color: var(--t24p-navy); color: #fff; }

/* Footer Xanh Navy đậm đúng ảnh mẫu */
.tp-footer {
  background: var(--t24p-navy-dark);
  color: #cbd5e1;
  padding: 36px 0 0;
  margin-top: 32px;
  font-size: 13.5px;
}
.tp-footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
}
.tp-footer h4 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}
.tp-footer-logo {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  margin: 0 0 10px;
}
.tp-footer-logo span { color: var(--t24p-red); }
.tp-footer p { margin: 0 0 6px; color: #cbd5e1; font-size: 13px; }
.tp-footer-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.tp-footer-cats a { color: #e2e8f0; font-size: 13px; }
.tp-footer-cats a:hover { color: #93c5fd; }
.tp-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 14px 0;
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Responsive Mobile (Gọn gàng, không khoảng trống) */
@media (max-width: 1080px) {
  .tp-row-hero { grid-template-columns: 1.4fr 1fr; }
  .tp-wide-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .tp-row-3col,
  .tp-row-2col,
  .tp-layout,
  .tp-footer-grid { grid-template-columns: 1fr; }
  .tp-sidebar { position: static; }
}
@media (max-width: 768px) {
  .tp-topbar { display: none; }
  .tp-header { padding: 8px 0; }
  .tp-header-inner { flex-wrap: wrap; gap: 10px; }
  .tp-header-actions { display: none; }
  .tp-search-bar { order: 3; max-width: 100%; width: 100%; }
  .tp-menu-toggle { display: inline-block; }
  .tp-menu { display: none; flex-direction: column; align-items: stretch; width: 100%; padding: 6px 0; }
  .tp-menu.is-open { display: flex; }
  .tp-nav-inner { flex-wrap: wrap; padding: 6px 0; }
  .tp-row-hero,
  .tp-wide-grid,
  .tp-split-inner,
  .tp-2card-grid,
  .tp-feed-item,
  .tp-video-item { grid-template-columns: 1fr; }
  .tp-hero-feature { min-height: 240px; }
  .tp-hero-overlay h2 { font-size: 17.5px; }
  .tp-single-title { font-size: 22px; }
}


/* Tin Liên Quan 3 cột & Tin Nổi Bật 9 bài kiểu mới ở cuối bài viết */
.tp-rel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tp-featured-end {
  margin-top: 34px;
  background: #f4f7fb;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px;
}
.tp-head-red {
  border-bottom-color: var(--t24p-red);
}
.tp-head-title-red {
  background: var(--t24p-red);
}
.tp-feat-lead {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 16px;
  align-items: center;
}
.tp-feat-cat {
  display: inline-block;
  background: var(--t24p-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.tp-feat-cat:hover { color: #fff; background: var(--t24p-navy); }
.tp-feat-lead-body h3 {
  margin: 0 0 6px;
  font-size: 18.5px;
  font-weight: 800;
  line-height: 1.35;
}
.tp-feat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tp-feat-card {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
}
.tp-feat-thumb {
  flex: 0 0 112px;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
}
.tp-feat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tp-feat-mini-cat {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--t24p-blue);
  margin-bottom: 3px;
}
.tp-feat-info h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.36;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 768px) {
  .tp-rel-grid,
  .tp-feat-lead,
  .tp-feat-grid { grid-template-columns: 1fr; }
}
