/*
Theme Name: BóngĐá VN
Theme URI: https://bongda.vn
Author: BóngĐá VN
Author URI: https://bongda.vn
Description: Giao diện tin tức bóng đá tiếng Việt - Tối ưu SEO, responsive, tốc độ cao.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bongdavn
Tags: news, sports, football, vietnamese, responsive, seo
*/

/* ==================== CSS VARIABLES ==================== */
:root {
  --green: #00a651;
  --green-dark: #007a3d;
  --green-light: #e6f7ee;
  --red: #e8002d;
  --black: #0a0a0a;
  --gray-900: #111111;
  --gray-800: #1c1c1c;
  --gray-700: #2e2e2e;
  --gray-600: #444444;
  --gray-400: #888888;
  --gray-200: #e8e8e8;
  --gray-100: #f4f4f4;
  --white: #ffffff;
  --font-head: 'Georgia', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 4px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --max-w: 1200px;
  --transition: 0.18s ease;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ==================== UTILITY ==================== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.tag {
  display: inline-block; padding: 3px 10px; font-size: 11px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; border-radius: 2px;
  background: var(--green); color: #fff; transition: background var(--transition);
}
.tag:hover { background: var(--green-dark); color: #fff; }
.badge-red { display:inline-block; padding: 2px 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; border-radius: 2px;
  background: var(--red); color: #fff; }

/* ==================== TOP BAR ==================== */
.topbar {
  background: var(--black); color: var(--gray-400);
  font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--gray-700);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-date { font-size: 12px; color: var(--gray-400); }
.live-badge { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--red); text-transform: uppercase; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-search-btn { background: none; border: none; padding: 0; color: var(--gray-400); cursor: pointer; transition: color var(--transition); display: flex; align-items: center; }
.topbar-search-btn:hover { color: var(--white); }

/* ==================== HEADER ==================== */
.site-header {
  background: var(--white); border-bottom: 3px solid var(--green);
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.site-logo { font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: -.5px; flex-shrink: 0; }
.site-logo a { color: inherit; }
.logo-sub { font-size: 10px; font-weight: 400; color: var(--gray-400); letter-spacing: .1em; text-transform: uppercase; display: block; line-height: 1; }
.main-nav { display: flex; align-items: center; }
.main-nav a {
  display: flex; align-items: center; padding: 0 14px; height: 60px;
  font-size: 13px; font-weight: 600; color: var(--gray-700);
  border-bottom: 3px solid transparent; margin-bottom: -3px;
  transition: color var(--transition), border-color var(--transition); white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-cat > a { color: var(--green); border-bottom-color: var(--green); }
.main-nav .menu-hot > a { color: var(--red); }
.main-nav .menu-hot > a:hover { border-bottom-color: var(--red); }
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--gray-700); border-radius: 2px; transition: all 0.2s; }
.mobile-menu { display: none; background: var(--white); border-top: 1px solid var(--gray-200); }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 13px 16px; font-size: 14px; font-weight: 600; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); }
.mobile-menu a:hover { color: var(--green); background: var(--green-light); }

/* ==================== TICKER ==================== */
.ticker-wrap { background: var(--green); color: var(--white); overflow: hidden; height: 34px; display: flex; align-items: center; }
.ticker-label { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 0 14px; height: 34px; display: flex; align-items: center; flex-shrink: 0; white-space: nowrap; }
.ticker-content { flex: 1; overflow: hidden; position: relative; mask-image: linear-gradient(to right, transparent, black 60px, black calc(100% - 60px), transparent); -webkit-mask-image: linear-gradient(to right, transparent, black 60px, black calc(100% - 60px), transparent); }
.ticker-track { display: flex; animation: ticker 50s linear infinite; white-space: nowrap; }
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 0 32px; }
.ticker-item::before { content: '⚽'; font-size: 12px; }
.ticker-item a { color: #fff; font-weight: 500; }
.ticker-item a:hover { text-decoration: underline; }
@keyframes ticker { from{transform:translateX(0)} to{transform:translateX(-50%)} }

/* ==================== HERO ==================== */
.hero { padding: 20px 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 340px; grid-template-rows: auto auto; gap: 2px; border-radius: var(--radius); overflow: hidden; }
.hero-main { grid-column: 1; grid-row: 1/3; position: relative; overflow: hidden; }
.hero-main .card-img-wrap { aspect-ratio: 16/10; overflow: hidden; }
.hero-main .card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.hero-main:hover .card-img-wrap img { transform: scale(1.03); }
.hero-main .card-body { padding: 20px; background: var(--white); }
.hero-main .card-title { font-family: var(--font-head); font-size: 24px; font-weight: 700; line-height: 1.3; margin: 8px 0; }
.hero-main .card-excerpt { font-size: 14px; color: var(--gray-600); line-height: 1.6; }
.hero-sub { background: var(--white); display: flex; flex-direction: column; overflow: hidden; }
.hero-sub-1 { grid-column: 2; grid-row: 1; border-left: 2px solid var(--gray-100); }
.hero-sub-2 { grid-column: 2; grid-row: 2; border-left: 2px solid var(--gray-100); border-top: 2px solid var(--gray-100); }
.hero-sub .sub-img-wrap { aspect-ratio: 16/9; overflow: hidden; }
.hero-sub .sub-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.hero-sub:hover .sub-img-wrap img { transform: scale(1.04); }
.hero-sub .sub-body { padding: 14px 16px; flex: 1; }
.hero-sub .sub-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; line-height: 1.4; margin-top: 6px; }
.hero-sub .sub-meta { font-size: 11px; color: var(--gray-400); margin-top: 6px; }

/* ==================== SECTION HEADER ==================== */
.section-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; border-bottom: 2px solid var(--green); padding-bottom: 10px; }
.section-hd h2 { font-family: var(--font-head); font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-hd h2 span { color: var(--green); }
.see-all { font-size: 12px; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 4px; }
.see-all:hover { color: var(--green-dark); }
.see-all::after { content: '›'; font-size: 16px; }

/* ==================== LAYOUT ==================== */
.main-wrap { padding: 0 0 40px; }
.content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; margin-top: 24px; }
.news-section { margin-bottom: 32px; }

/* ==================== CARD LIST ==================== */
.card-list { display: flex; flex-direction: column; }
.card-item { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-200); align-items: start; }
.card-item:last-child { border-bottom: none; }
.card-thumb { width: 120px; height: 80px; overflow: hidden; border-radius: var(--radius); flex-shrink: 0; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card-item:hover .card-thumb img { transform: scale(1.05); }
.card-meta { font-size: 11px; color: var(--gray-400); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-h { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--gray-900); transition: color var(--transition); }
.card-item:hover .card-h { color: var(--green); }
.card-desc { font-size: 12px; color: var(--gray-600); line-height: 1.5; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ==================== CARD GRID ==================== */
.card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.card-box { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow var(--transition), transform var(--transition); }
.card-box:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-box-img { aspect-ratio: 16/10; overflow: hidden; }
.card-box-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card-box:hover .card-box-img img { transform: scale(1.04); }
.card-box-body { padding: 12px; }
.card-box-h { font-size: 14px; font-weight: 700; line-height: 1.4; margin: 6px 0 4px; }
.card-box-meta { font-size: 11px; color: var(--gray-400); }

/* ==================== FEATURED CARD ==================== */
.card-featured { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-featured-img { aspect-ratio: 16/9; overflow: hidden; }
.card-featured-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card-featured:hover .card-featured-img img { transform: scale(1.03); }
.card-featured-body { padding: 16px; }
.card-featured-h { font-family: var(--font-head); font-size: 20px; font-weight: 700; line-height: 1.35; margin: 8px 0; }
.card-featured-h:hover { color: var(--green); }
.card-featured-desc { font-size: 13px; color: var(--gray-600); line-height: 1.6; }

/* ==================== VIDEO ==================== */
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.video-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow var(--transition); }
.video-card:hover { box-shadow: var(--shadow-md); }
.video-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.video-card:hover .video-thumb img { transform: scale(1.04); }
.video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-play-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(0,166,81,.9); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: transform var(--transition), background var(--transition); }
.video-card:hover .video-play-btn { transform: scale(1.1); background: var(--green-dark); }
.video-body { padding: 12px; }
.video-title { font-size: 13px; font-weight: 700; line-height: 1.4; }
.video-meta { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ==================== SIDEBAR ==================== */
.sidebar-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.sidebar-hd { background: var(--green); color: #fff; padding: 10px 14px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.sidebar-list { padding: 0; }
.sidebar-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--gray-100); align-items: start; }
.sidebar-item:last-child { border-bottom: none; }
.sidebar-num { font-size: 18px; font-weight: 800; color: var(--gray-200); line-height: 1; flex-shrink: 0; width: 24px; text-align: center; font-family: var(--font-head); }
.sidebar-item:nth-child(1) .sidebar-num,
.sidebar-item:nth-child(2) .sidebar-num,
.sidebar-item:nth-child(3) .sidebar-num { color: var(--green); }
.sidebar-h { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--gray-900); transition: color var(--transition); }
.sidebar-item:hover .sidebar-h { color: var(--green); }
.sidebar-meta { font-size: 11px; color: var(--gray-400); margin-top: 3px; }
.cat-list { padding: 8px 0; }
.cat-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--gray-100); font-size: 13px; font-weight: 500; color: var(--gray-700); transition: all var(--transition); }
.cat-item:last-child { border-bottom: none; }
.cat-item:hover { background: var(--green-light); color: var(--green); }
.cat-count { font-size: 11px; background: var(--gray-100); padding: 2px 7px; border-radius: 10px; color: var(--gray-400); }
.cat-item:hover .cat-count { background: var(--green); color: #fff; }
.ad-block { background: var(--gray-100); border: 1px dashed var(--gray-200); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--gray-400); font-size: 12px; text-align: center; }
.ad-block-300x250 { width: 100%; height: 250px; }
.tag-cloud-wrap { padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ==================== SINGLE POST ==================== */
.article-body { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.article-header { border-bottom: 1px solid var(--gray-200); padding-bottom: 16px; margin-bottom: 20px; }
.article-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.article-title { font-family: var(--font-head); font-size: 28px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.article-lead { font-size: 16px; color: var(--gray-700); line-height: 1.7; font-weight: 500; }
.article-meta { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.author-info { display: flex; align-items: center; gap: 8px; }
.author-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.author-name { font-size: 13px; font-weight: 600; }
.author-date { font-size: 11px; color: var(--gray-400); }
.article-share { display: flex; gap: 8px; margin-left: auto; }
.share-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 3px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: opacity var(--transition); }
.share-btn:hover { opacity: .85; }
.share-fb { background: #1877f2; color: #fff; }
.share-tw { background: #1da1f2; color: #fff; }
.article-img { border-radius: var(--radius); overflow: hidden; margin: 20px 0; }
.article-img img { width: 100%; }
.article-img figcaption { font-size: 12px; color: var(--gray-400); padding: 8px 0 0; text-align: center; }
.entry-content h2 { font-family: var(--font-head); font-size: 20px; font-weight: 700; margin: 24px 0 10px; }
.entry-content p { font-size: 15px; line-height: 1.8; color: var(--gray-800); margin-bottom: 16px; }
.entry-content blockquote { border-left: 3px solid var(--green); padding: 12px 18px; margin: 20px 0; background: var(--green-light); border-radius: 0 var(--radius) var(--radius) 0; font-size: 15px; font-style: italic; color: var(--gray-700); }
.entry-content img { border-radius: var(--radius); margin: 16px 0; max-width: 100%; }
.article-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.article-tags-label { font-size: 12px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .05em; }

/* ==================== RELATED POSTS ==================== */
.related-posts { margin-top: 32px; }

/* ==================== PAGINATION ==================== */
.pagination, .woocommerce-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 24px 0; }
.page-numbers { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-700); cursor: pointer; transition: all var(--transition); }
.page-numbers:hover, .page-numbers.current { background: var(--green); color: #fff; border-color: var(--green); }
.page-numbers.dots { border: none; background: none; width: auto; cursor: default; }

/* ==================== ARCHIVE / CATEGORY ==================== */
.archive-header { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 20px; border-left: 4px solid var(--green); }
.archive-title { font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.archive-desc { font-size: 14px; color: var(--gray-600); margin-top: 6px; }

/* ==================== SEARCH RESULTS ==================== */
.search-header { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 20px; }
.search-header h1 { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.search-header span { color: var(--green); }

/* ==================== FOOTER ==================== */
.site-footer { background: var(--gray-900); color: var(--gray-400); }
.footer-top { padding: 40px 0 28px; border-bottom: 1px solid var(--gray-700); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand {}
.footer-logo { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--white); margin-bottom: 10px; }
.footer-logo span { color: var(--green); }
.footer-desc { font-size: 13px; line-height: 1.7; color: var(--gray-400); margin-bottom: 16px; }
.footer-social { display: flex; gap: 8px; }
.social-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--gray-700); color: var(--gray-400); display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all var(--transition); }
.social-btn:hover { background: var(--green); color: #fff; }
.footer-col h4 { font-size: 13px; font-weight: 700; color: var(--white); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .06em; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 13px; color: var(--gray-400); transition: color var(--transition); }
.footer-links a:hover { color: var(--green); }
.footer-bottom { padding: 16px 0; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--gray-600); flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: var(--gray-600); transition: color var(--transition); }
.footer-bottom a:hover { color: var(--green); }

/* ==================== SEARCH OVERLAY ==================== */
.search-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-overlay.open { display: flex; }
.search-box { width: 100%; max-width: 600px; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); display: flex; align-items: center; margin: 0 16px; }
.search-input { flex: 1; border: none; outline: none; padding: 16px 18px; font-size: 16px; font-family: inherit; }
.search-submit { background: var(--green); color: #fff; border: none; padding: 0 20px; height: 54px; font-size: 20px; cursor: pointer; transition: background var(--transition); }
.search-submit:hover { background: var(--green-dark); }
.search-close { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; background: none; border: none; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .card-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-main { grid-row: auto; }
  .hero-sub-1,.hero-sub-2 { grid-column: 1; grid-row: auto; border-left: none; border-top: 2px solid var(--gray-100); }
  .video-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .hero-main .card-title { font-size: 18px; }
  .article-title { font-size: 22px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .card-item { grid-template-columns: 100px 1fr; }
  .card-thumb { width: 100px; height: 68px; }
}

/* ==================== WP CORE ==================== */
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: var(--gray-400); margin-top: 6px; }
.alignleft { float: left; margin: 0 20px 16px 0; }
.alignright { float: right; margin: 0 0 16px 20px; }
.aligncenter { margin: 16px auto; display: block; }
.sticky { position: relative; }
.gallery { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 16px 0; }
.gallery-item img { width: 100%; height: auto; border-radius: var(--radius); }
