/*
Theme Name:  7MCN
Theme URI:   https://bongdalu.fun
Description: Theme nhẹ cho website bóng đá, tích hợp plugin Bongda Live.
Version:     1.0.1
Author:      Custom Dev
Text Domain: bongdalu
*/

/* =====================================================
   CSS VARIABLES
   ===================================================== */
:root {
  --c-bg:        #f3f4f6;
  --c-surface:   #ffffff;
  --c-surface2:  #f9fafb;
  --c-border:    #e5e7eb;
  --c-text:      #1f2937;
  --c-text-mute: #6b7280;
  --c-accent:    #dc2626;
  --c-accent2:   #ea580c;
  --c-green:     #16a34a;
  --c-white:     #ffffff;
  --c-nav-bg:    #1e293b;
  --c-nav-hover: rgba(220,38,38,.1);

  --font-main:   'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
  --radius:      6px;
  --shadow:      0 2px 8px rgba(0,0,0,.4);
  --transition:  .18s ease;

  --sidebar-w:   300px;
  --content-max: 1200px;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-accent2); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

button { cursor: pointer; font-family: inherit; }

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
  color: #111827;
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h2 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h3 { font-size: clamp(1rem, 2vw, 1.2rem); }

p { margin-bottom: .85rem; }
p:last-child { margin-bottom: 0; }

/* =====================================================
   LAYOUT
   ===================================================== */
.bd-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px;
}

.bd-wrap {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 20px;
  align-items: start;
  padding: 20px 0;
}

@media (max-width: 900px) {
  .bd-wrap {
    grid-template-columns: 1fr;
  }
  .bd-sidebar { order: 2; }
}

/* =====================================================
   HEADER
   ===================================================== */
.bd-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow);
}

/* Logo bar */
.bd-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  max-width: var(--content-max);
  margin: 0 auto;
  gap: 12px;
}

.bd-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.bd-logo__icon {
  width: 36px;
  height: 36px;
  background: var(--c-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.bd-logo__text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -.5px;
}
.bd-logo__text span { color: var(--c-accent); }

/* Nav 1 — main */
.bd-nav {
  background: var(--c-nav-bg);
  border-bottom: 1px solid var(--c-border);
}
.bd-nav__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bd-nav__inner::-webkit-scrollbar { display: none; }

.bd-nav__inner ul {
  display: flex;
  white-space: nowrap;
}
.bd-nav__inner ul li a {
  display: block;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: .3px;
  transition: all var(--transition);
  position: relative;
}
.bd-nav__inner ul li a:hover,
.bd-nav__inner ul li.current-menu-item > a,
.bd-nav__inner ul li.current_page_item > a {
  color: var(--c-accent);
  background: var(--c-nav-hover);
}
.bd-nav__inner ul li.current-menu-item > a::after,
.bd-nav__inner ul li.current_page_item > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--c-accent);
  border-radius: 2px 2px 0 0;
}

/* Nav 2 — secondary */
.bd-nav2 {
  background: #2d3f55;
  border-bottom: 1px solid var(--c-border);
}
.bd-nav2__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bd-nav2__inner::-webkit-scrollbar { display: none; }
.bd-nav2__inner ul {
  display: flex;
  white-space: nowrap;
}
.bd-nav2__inner ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  transition: color var(--transition);
}
.bd-nav2__inner ul li a:hover,
.bd-nav2__inner ul li.current-menu-item > a {
  color: #ffffff;
}

/* =====================================================
   HERO / PAGE TITLE
   ===================================================== */
.bd-page-title {
  background: #ffffff;
  border-bottom: 1px solid var(--c-border);
  padding: 14px 16px;
}
.bd-page-title .bd-container { }

.bd-page-title h1 {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 800;
  line-height: 1.25;
  color: #111827;
  position: relative;
  padding-left: 14px;
}
.bd-page-title h1::before {
  content: '';
  position: absolute;
  left: 0; top: 2px; bottom: 2px;
  width: 4px;
  background: var(--c-accent);
  border-radius: 2px;
}

.bd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-text-mute);
  margin-top: 6px;
  flex-wrap: wrap;
}
.bd-breadcrumb a { color: var(--c-text-mute); }
.bd-breadcrumb a:hover { color: var(--c-accent); }
.bd-breadcrumb .sep { opacity: .5; }

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.bd-main { min-width: 0; }

/* Shortcode container */
.bd-shortcode-block {
  margin-bottom: 20px;
}

/* Content block (from page editor) */
.bd-content-block {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: #374151;
}
.bd-content-block h2,
.bd-content-block h3 {
  margin: 1.2em 0 .5em;
  font-size: 1.05em;
  color: #111827;
}
.bd-content-block h2:first-child,
.bd-content-block h3:first-child { margin-top: 0; }
.bd-content-block ul,
.bd-content-block ol {
  list-style: disc;
  padding-left: 1.4em;
  margin-bottom: .8rem;
}
.bd-content-block ol { list-style: decimal; }
.bd-content-block a { color: var(--c-accent); }
.bd-content-block strong { color: #111827; }

/* =====================================================
   SECTION HEADING
   ===================================================== */
.bd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.bd-section-head h2, .bd-section-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  position: relative;
}
.bd-section-head h2::before, .bd-section-head h3::before {
  content: '';
  position: absolute;
  left: 0; top: 2px; bottom: 2px;
  width: 3px;
  background: var(--c-accent);
  border-radius: 2px;
}
.bd-section-head a.bd-view-all {
  font-size: 12px;
  color: var(--c-text-mute);
  white-space: nowrap;
}
.bd-section-head a.bd-view-all:hover { color: var(--c-accent); }

/* =====================================================
   POST CARDS — Latest 4 Posts
   ===================================================== */
.bd-posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .bd-posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .bd-posts-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

.bd-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition);
}
.bd-card:hover {
  border-color: rgba(230,57,70,.4);
  transform: translateY(-2px);
}

.bd-card__thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--c-surface2);
  flex-shrink: 0;
}
.bd-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.bd-card:hover .bd-card__thumb img { transform: scale(1.04); }

.bd-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.bd-card__cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--c-accent);
}
.bd-card__title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bd-card__title a { color: inherit; }
.bd-card__title a:hover { color: var(--c-accent); }
.bd-card__meta {
  font-size: 11px;
  color: var(--c-text-mute);
  margin-top: auto;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.bd-sidebar {
  position: sticky;
  top: 130px; /* height of header */
}

.bd-sidebar-widget {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.bd-sidebar-widget__title {
  background: #f3f4f6;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.bd-sidebar-widget__body { padding: 0; }

/* Sidebar post list — 6 bài cùng chuyên mục */
.bd-sidebar-posts { }
.bd-sidebar-post {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
  transition: background var(--transition);
}
.bd-sidebar-post:last-child { border-bottom: none; }
.bd-sidebar-post:hover { background: var(--c-surface2); }

.bd-sidebar-post__thumb {
  width: 68px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--c-surface2);
}
.bd-sidebar-post__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.bd-sidebar-post__info {
  flex: 1;
  min-width: 0;
}
.bd-sidebar-post__title {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bd-sidebar-post__title a { color: inherit; }
.bd-sidebar-post__title a:hover { color: var(--c-accent); }
.bd-sidebar-post__date {
  font-size: 11px;
  color: var(--c-text-mute);
  margin-top: 3px;
}

/* =====================================================
   SINGLE POST
   ===================================================== */
.bd-single {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.bd-single__feat {
  aspect-ratio: 16/7;
  overflow: hidden;
  background: var(--c-surface2);
}
.bd-single__feat img { width: 100%; height: 100%; object-fit: cover; }
.bd-single__body { padding: 20px 22px 24px; }
.bd-single__title {
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  font-weight: 800;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 10px;
}
.bd-single__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--c-text-mute);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.bd-single__meta .cat-label {
  background: rgba(230,57,70,.15);
  color: var(--c-accent);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 11px;
}
.bd-single__content {
  font-size: 15px;
  line-height: 1.85;
  color: #374151;
}
.bd-single__content h2,
.bd-single__content h3 {
  margin: 1.5em 0 .6em;
  color: #111827;
}
.bd-single__content p { margin-bottom: 1rem; }
.bd-single__content a { color: var(--c-accent); text-decoration: underline; }
.bd-single__content img {
  border-radius: var(--radius);
  margin: 1rem 0;
}
.bd-single__content blockquote {
  border-left: 3px solid var(--c-accent);
  padding: .8rem 1rem;
  margin: 1rem 0;
  background: #fef2f2;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}
.bd-single__content ul, .bd-single__content ol {
  padding-left: 1.5em;
  margin-bottom: 1rem;
}
.bd-single__content ul { list-style: disc; }
.bd-single__content ol { list-style: decimal; }
.bd-single__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 13px;
}
.bd-single__content th,
.bd-single__content td {
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  text-align: left;
}
.bd-single__content th {
  background: #f3f4f6;
  font-weight: 700;
  color: #111827;
}

/* Tags */
.bd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
}
.bd-tags a {
  font-size: 11px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 3px 9px;
  border-radius: 20px;
  color: #6b7280;
  transition: all var(--transition);
}
.bd-tags a:hover {
  background: rgba(230,57,70,.15);
  border-color: var(--c-accent);
  color: var(--c-accent);
}

/* =====================================================
   ARCHIVE / CATEGORY
   ===================================================== */
.bd-archive-list { display: flex; flex-direction: column; gap: 12px; }
.bd-archive-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  padding: 12px;
  transition: border-color var(--transition);
}
.bd-archive-item:hover { border-color: rgba(230,57,70,.4); }
.bd-archive-item__thumb {
  width: 110px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--c-surface2);
}
.bd-archive-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.bd-archive-item__body { flex: 1; min-width: 0; }
.bd-archive-item__title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bd-archive-item__title a { color: inherit; }
.bd-archive-item__title a:hover { color: var(--c-accent); }
.bd-archive-item__excerpt {
  font-size: 12px;
  color: var(--c-text-mute);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bd-archive-item__meta {
  font-size: 11px;
  color: var(--c-text-mute);
  margin-top: 5px;
}

/* Pagination */
.bd-pagination {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 20px 0;
  list-style: none;
  margin: 0;
}
.bd-pagination ul {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.bd-pagination li { display: block; }
.bd-pagination a,
.bd-pagination span,
.bd-pagination li a,
.bd-pagination li span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #374151;
  text-decoration: none;
}
.bd-pagination a:hover,
.bd-pagination li a:hover { border-color: var(--c-accent); color: var(--c-accent); }
.bd-pagination .current,
.bd-pagination li .current,
.bd-pagination li span.current {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

/* =====================================================
   FOOTER
   ===================================================== */
.bd-footer {
  background: #1e293b;
  border-top: 1px solid #2d3f55;
  margin-top: 40px;
}
.bd-footer__custom {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px 16px 20px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #94a3b8;
}
.bd-footer__custom a { color: #94a3b8; text-decoration: none; }
.bd-footer__custom a:hover { color: #f1f5f9; }
.bd-footer__custom p { margin: 0 0 .6em; }
.bd-footer__custom strong, .bd-footer__custom b { color: #f1f5f9; }
.bd-footer__custom h2, .bd-footer__custom h3, .bd-footer__custom h4 {
  color: #f1f5f9; font-size: 13px; font-weight: 700;
  margin: 1em 0 .4em;
}
.bd-footer__bottom {
  border-top: 1px solid #2d3f55;
  padding: 12px 16px;
  max-width: var(--content-max);
  margin: 0 auto;
  text-align: center;
}
.bd-footer__copy {
  font-size: 12px;
  color: #64748b;
}
.bd-footer__copy a { color: #64748b; }
.bd-footer__copy a:hover { color: #94a3b8; }


/* =====================================================
   UTILITIES
   ===================================================== */
.bd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.bd-badge--live { background: var(--c-accent); color: #fff; }
.bd-badge--cat  { background: rgba(230,57,70,.15); color: var(--c-accent); }

.bd-dot-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
  animation: bd-blink 1s infinite;
  display: inline-block;
}
@keyframes bd-blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* =====================================================
   PLUGIN INTEGRATION — override plugin widget colors
   ===================================================== */
[data-bl-widget] {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #1f2937 !important;
  border-radius: var(--radius) !important;
}
[data-bl-widget] .bl-match {
  background: transparent !important;
  border-color: #f3f4f6 !important;
}
[data-bl-widget] .bl-match:hover {
  background: #fafafa !important;
}

/* =====================================================
   RESPONSIVE EXTRAS
   ===================================================== */
@media (max-width: 480px) {
  .bd-header__top { padding: 8px 12px; }
  .bd-content-block { padding: 14px 14px; }
  .bd-single__body { padding: 14px 14px 18px; }
}

/* =====================================================
   SCROLLBAR GLOBAL
   ===================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
