/*
Theme Name: vnEtraffic
Theme URI: 
Author: Bảo Long
Author URI: 
Description: A custom WordPress theme for PN New Theme.
Version: 2.8
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pn-new-theme
*/

html {
  box-sizing: border-box;
  overflow-x: hidden;
}
*, *:before, *:after {
  box-sizing: inherit;
}

body {
  font-family: "Roboto", sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #f9fafb;
  /* Gray background for single posts mostly */
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 8px;
}

.module-section-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 900;
  color: #0f172a;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  display: block;
}
.module-section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: #df2029;
  border-radius: 2px;
}

/* =========================================
   Header Styles (Vanilla fallback)
   ========================================= */
:root {
  --primary-blue: #2563eb;
  --border-color: #e5e7eb;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

/* Base states (Desktop) */
.header-actions {
  order: 3;
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 80px;
  margin: 0;
  padding: 0;
}

.site-branding {
  order: 1;
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  height: 80px;
  margin: 0;
  padding: 0;
}

.main-navigation {
  order: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
  margin: 0;
  padding: 0;
}

.menu-toggle {
  display: none;
}

.custom-logo {
  max-height: 48px;
  width: auto;
  display: block;
  margin: 0;
}

.site-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-blue);
  text-transform: uppercase;
  margin: 0;
  text-decoration: none;
  line-height: 1;
}

.site-title a {
  text-decoration: none;
  color: inherit;
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: auto;
}
.search-btn svg, .menu-toggle svg { display: block; }

.search-btn:hover {
  color: var(--primary-blue);
}

.desktop-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 32px;
  align-items: center;
}

.desktop-menu li a {
  text-decoration: none;
  color: #4b5563;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.15s;
  padding: 8px 0;
}

.desktop-menu li a:hover,
.desktop-menu li.current-menu-item>a {
  color: var(--primary-blue);
}

/* Dropdown Search */
.search-dropdown {
  position: absolute;
  top: 80px;
  left: 0;
  width: 100%;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 900;
}

.search-dropdown.active {
  display: block;
}

.search-form-dropdown {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 15px;
}

.search-input-dropdown {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  outline: none;
  font-size: 15px;
  background: #fff;
}

.search-input-dropdown:focus {
  border-color: var(--primary-blue);
}

.search-submit-btn {
  height: 44px;
  padding: 0 24px;
  background: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Mobile Dropdown Menu */
.mobile-navigation {
  position: absolute;
  top: 80px;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 900;
}

.mobile-navigation.active {
  display: block;
}

.mobile-menu {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  display: flex !important;
  flex-direction: column !important;
}

.mobile-menu li {
  width: 100%;
  display: block;
  margin: 0;
  border: none;
}

.mobile-menu li a {
  display: block;
  text-decoration: none;
  color: #4b5563;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  text-align: left;
  text-transform: uppercase;
}

.mobile-menu li:last-child a {
  border-bottom: none;
}

.mobile-menu li a:hover,
.mobile-menu li.current-menu-item>a {
  color: var(--primary-blue);
  background: #f9fafb;
}

/* Mobile View adjustments */
@media (max-width: 1024px) {
  .header-actions {
    order: 1;
    flex: 0 1 auto;
    justify-content: flex-start;
    align-items: center;
    height: 80px;
    margin: 0;
    padding: 0;
  }

  .site-branding {
    order: 2;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    flex: 0 1 auto;
    margin: 0;
    padding: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 3;
    background: none;
    border: none !important;
    color: #4b5563;
    padding: 8px;
    cursor: pointer;
    flex: 0 1 auto;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    height: 80px;
    margin: 0;
  }

  .menu-toggle:focus {
    outline: none !important;
    border: none !important;
  }

  .main-navigation {
    display: none;
  }
}

/* =========================================
   BCA Footer Styles (New 3-Column Layout)
   ========================================= */

body {
  overflow-x: hidden;
}

.site-footer {
  position: relative;
  width: 100%;
  background-color: #172136; /* Deep dark blue matching user's image */
  color: #caddf0; /* Soft blue-gray for text */
  padding-top: 40px;
  padding-bottom: 30px;
  box-sizing: border-box;
}

.site-footer .container {
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* --- Top Grid --- */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr;
  gap: 50px;
  margin-bottom: 40px;
}

.footer-col {
  text-align: left !important;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* Brand Column (Col 1) */
.footer-brand .footer-logo-area {
  margin-bottom: 25px;
}

.footer-custom-logo {
  max-height: 44px;
  width: auto;
  display: block;
}

.footer-logo-svg {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo-svg .icon-shield svg {
  display: block;
}

.footer-logo-svg .logo-text {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.footer-logo-svg .logo-text strong {
  font-weight: 800;
  color: #60a5fa; /* Light blue accent for "TRAFFIC" */
}

.footer-desc {
  font-size: 15px;
  line-height: 1.8;
  color: #94a3b8; /* Slate-400 */
}

.footer-desc p { margin: 0; }
.footer-desc a { color: #60a5fa; text-decoration: none; }
.footer-desc a:hover { text-decoration: underline; }

.footer-compliance {
  margin-top: 20px;
  padding-left: 15px;
  border-left: 3px solid #3b82f6;
  font-size: 14px;
}

.footer-compliance em {
  font-style: italic;
  font-weight: bold;
  color: #60a5fa;
}

/* Links Columns (Col 2 & 3) */
.footer-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 12px;
}

.footer-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 3px;
  background-color: #3b82f6; /* bright blue */
  border-radius: 2px;
}

.footer-menu-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.footer-menu-list li { margin: 0 !important; border: none !important; padding: 0 !important; }

.footer-menu-list li a {
  color: #e2e8f0; /* Lighter slate */
  text-decoration: none !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  text-transform: none !important;
  transition: color 0.2s ease;
  display: flex !important;
  align-items: center;
}

.footer-menu-list.has-arrows li a::before {
  content: "\203A"; /* Right angle mark › */
  margin-right: 12px;
  font-size: 20px;
  color: #64748b;
  line-height: 1;
}

.footer-menu-list li a:hover {
  color: #ffffff !important;
}

/* App Buttons */
.app-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.app-btn.bg-white {
  display: flex;
  align-items: center;
  background-color: #ffffff !important;
  padding: 8px 14px;
  border-radius: 12px;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s;
  width: max-content;
  min-width: 145px;
  text-align: left;
}

.app-btn.bg-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.app-btn .app-icon {
  width: 28px;
  height: 28px;
  margin-right: 12px;
}

.app-btn .app-text {
  display: flex;
  flex-direction: column;
}

.app-btn .app-sub {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.app-btn .app-main {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

/* --- Bottom Copyright Area --- */
.footer-bottom-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  margin-bottom: 30px;
}

.footer-copyright-content {
  text-align: center;
  font-size: 14px;
  color: #64748b; /* Slate-500 */
  line-height: 1.6;
}

.footer-copyright-content p {
  margin: 5px 0;
}

/* =========================================
   NEW SINGLE POST STYLES (70/30)
   ========================================= */

.single-page-wrapper {
  background-color: #f9fafb;
  padding-top: 30px;
  padding-bottom: 0;
}

.single-main-content {
  background-color: transparent;
}

.single-content-box {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.03);
}

.bca-breadcrumb {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 25px;
  font-weight: 500;
}

.bca-breadcrumb a {
  color: #64748b;
  text-decoration: none;
}

.bca-breadcrumb a:hover {
  color: #2563eb;
}

.entry-header-new {
  margin-bottom: 30px;
}

/* Title */
.entry-title-new {
  font-size: 36px;
  font-weight: 800;
  color: #ba0a30;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

/* Meta Below Title */
.entry-meta-below-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  font-size: 14px;
  color: #64748b;
  margin-bottom: 35px;
}

.entry-meta-below-title .meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-meta-below-title .meta-item a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.entry-meta-below-title .meta-item a:hover {
  text-decoration: underline;
}

.entry-meta-below-title .meta-separator {
  color: #cbd5e1;
}

/* Featured Image */
.single-featured-image {
  margin-bottom: 35px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.single-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Content Body */
.entry-content-new {
  font-size: 17px;
  line-height: 1.8;
  color: #334155;
}

.entry-content-new h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 40px;
  margin-bottom: 20px;
}

.entry-content-new h3 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 30px;
  margin-bottom: 15px;
}

.entry-content-new p {
  margin-bottom: 20px;
}

/* Blockquote Style (Intro Text) */
.entry-content-new blockquote {
  margin: 30px 0;
  padding: 15px 25px;
  border-left: 4px solid #2563eb;
  background-color: #f8fafc;
  font-size: 18px;
  font-style: italic;
  font-weight: 600;
  color: #1e293b;
  border-radius: 0 8px 8px 0;
}

.entry-content-new blockquote p {
  margin-bottom: 0;
}

/* Image overrides */
.entry-content-new figure,
.entry-content-new .wp-caption {
  max-width: 90% !important; /* Force to 90% of content */
  width: auto !important; /* Override arbitrary WP inline styles */
  margin: 0 auto 30px auto !important;
  display: block;
}

.entry-content-new img {
  max-width: 100% !important; /* Image fills the 90% figure container */
  height: auto !important;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* Caption spacing and style */
.wp-caption-text,
.entry-content-new figcaption {
  text-align: center;
  font-style: italic;
  color: #64748b;
  margin-top: 12px;
  font-size: 14px;
}

/* Unordered list */
.entry-content-new ul {
  padding-left: 20px;
  margin-bottom: 25px;
}

.entry-content-new ul li {
  margin-bottom: 10px;
  list-style-type: disc;
}

/* Ordered list as Blue Steps */
.entry-content-new ol {
  counter-reset: bca-step;
  list-style: none;
  padding-left: 0;
  margin-top: 35px;
  margin-bottom: 35px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 30px;
  background-color: #ffffff;
}

.entry-content-new ol li {
  position: relative;
  padding-left: 45px;
  margin-bottom: 25px;
}

.entry-content-new ol li:last-child {
  margin-bottom: 0;
}

.entry-content-new ol li::before {
  counter-increment: bca-step;
  content: counter(bca-step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 28px;
  height: 28px;
  background-color: #3b82f6;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.entry-content-new ol li strong {
  display: block;
  font-size: 18px;
  color: #0f172a;
  margin-bottom: 4px;
}

/* Bottom Actions (Tags & Share) */
.single-bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.single-tags {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
}

.single-tags strong {
  color: #94a3b8;
  font-weight: 600;
}

.single-tags a {
  background-color: #f1f5f9;
  color: #475569;
  padding: 4px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}

.single-tags a:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.single-share {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-text {
  font-size: 14px;
  color: #64748b;
  margin-right: 5px;
}

.share-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  text-decoration: none;
  transition: transform 0.2s;
  border: none;
  cursor: pointer;
}

.share-btn svg {
  width: 14px;
  height: 14px;
}

.share-btn:hover {
  transform: translateY(-2px);
}

.share-fb { background-color: #3b82f6; }
.share-x { background-color: #0f172a; }
.share-link { background-color: #e2e8f0; color: #475569 !important; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .category-layout {
    flex-direction: column;
  }
  .category-layout .category-main, 
  .category-layout .category-sidebar {
    flex: 0 0 100% !important;
    width: 100% !important;
  }
  .single-content-box {
    padding: 15px;
  }
  .entry-title-new {
    font-size: 26px;
  }
  .single-bottom-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}


/* Related Posts */
.related-posts {
  margin-top: 50px;
  padding-top: 30px;
}

.related-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ba0a30;
  border-left: 4px solid #ba0a30;
  padding-left: 10px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  /* Equal gap */
}

/* 3. Related Posts Grid Styling */
.related-item {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  /* Light shadow */
  border: 1px solid #f0f0f0;
  /* Thin border */
  overflow: hidden;
  /* To verify image border-radius works with container */
  padding-bottom: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.related-thumb {
  width: 100%;
  height: auto !important;
  aspect-ratio: 21/14;
  object-fit: cover;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
  display: block;
}

.related-item h3 {
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
  padding: 0 15px;
  /* Add padding for text inside the card */
}

.related-item h3 a {
  color: #333;
  text-decoration: none;
  font-weight: 600;
}

.related-item h3 a:hover {
  color: #ba0a30;
}

/* Comments */
.comments-area {
  margin-top: 40px;
  padding-top: 30px;
}

.comments-title,
.comment-reply-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ba0a30;
  border-left: 4px solid #ba0a30;
  padding-left: 10px;
}

/* =========================================
   SIDEBAR & WIDGETS
   ========================================= */

.widget-area-dynamic {
  padding: 0;
}

.widget {
  background-color: transparent;
  padding: 0;
  margin-bottom: 40px;
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-size: 20px;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 25px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: none;
  padding-left: 0;
}

.widget-title::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 4px;
  background-color: #ba0a30;
  border-radius: 2px;
}

/* Fallback for standard widgets (if used) */
.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget ul li {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
}
.widget ul li:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}
.widget ul li a {
  color: #334155;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}
.widget ul li a:hover {
  color: #2563eb;
}

/* =========================================
   CUSTOM RECENT POSTS WIDGET UI
   ========================================= */
.bca-recent-widget-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bca-recent-widget-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.bca-recent-thumb {
  flex: 0 0 85px;
  width: 85px;
  height: 85px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #e2e8f0; /* Light slate placeholder */
}

.bca-recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bca-recent-thumb .no-thumb {
  width: 100%;
  height: 100%;
  background-color: #e2e8f0;
}

.bca-recent-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bca-recent-title {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: #0f172a;
}

.bca-recent-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.bca-recent-title a:hover {
  color: #2563eb;
}

.bca-recent-meta {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8; /* Slate-400 */
}

/* ... previous code ... */

/* =========================================
   CATEGORY PAGE STYLES
   ========================================= */

.category-page-wrapper {
  background-color: #f9fafb;
  width: 100%;
}

.category-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 0 40px 0;
}

/* Layout 70/30 */
.category-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.category-main {
  width: 70%;
  /* Ensure it doesn't shrink */
  flex: 0 0 70%;
}

.category-sidebar {
  width: 30%;
  flex: 0 0 30%;
  min-height: 10px;
  /* Placeholder height */
}

/* Category Header */
.category-header {
  margin-bottom: 20px;
}

.category-header .page-title {
  font-size: 28px;
  font-weight: bold;
  color: #ba0a30;
  margin: 0 0 10px 0;
  text-transform: uppercase;
}

.category-header .title-divider {
  width: 60px;
  height: 3px;
  background-color: #ba0a30;
  display: block;
  margin-top: 10px;
  /* Adjust if needed relative to text */
}

/* Post List Item (Card) */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
  /* Increase gap slightly */
}

.post-list-item {
  display: flex;
  background-color: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  align-items: stretch;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-list-item:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.category-post-thumbnail {
  flex: 0 0 40%;
  max-width: 40%;
  position: relative;
}

.category-post-thumbnail a {
  display: block;
  width: 100%;
  height: 100%;
}

.category-post-thumbnail img.category-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  display: block;
}

.category-post-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 30px 24px 30px;
}

.post-list-title {
  margin: 0 0 12px 0;
  font-size: 24px;
  /* Larger and Bolder */
  font-weight: 800;
  line-height: 1.3;
  font-family: sans-serif;
}

.post-list-title a {
  color: #111;
  text-decoration: none;
  transition: color 0.2s;
}

.post-list-title a:hover {
  color: #ba0a30;
}

.post-list-excerpt {
  font-size: 16px;
  color: #333;
  /* Darker for readability */
  line-height: 1.6;
  /* Comfortable spacing */
  margin-bottom: 15px;

  /* Clamp to 4 lines */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
  /* Strict left align */
}

.post-list-meta {
  font-size: 14px;
  color: #777;
  font-weight: 500;
  margin-top: auto;
  text-align: left;
}

/* Pagination */
.bca-pagination {
  margin-top: 40px;
  text-align: center;
}

.bca-pagination .nav-links {
  display: inline-flex;
  gap: 8px;
}

.bca-pagination .page-numbers {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  background-color: #fff;
  border: 1px solid #e2e8f0;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.bca-pagination .page-numbers:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background-color: #eff6ff;
}

.bca-pagination .page-numbers.current {
  background-color: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-list li {
  margin-bottom: 20px;
}

/* Comment Body Layout */
.comment-body {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

/* Avatar */
.comment-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

/* Content Wrapper */
.comment-content-wrapper {
  flex: 1;
  background-color: #f1f1f1;
  /* Optional: very subtle bg for contrast or keep white */
  padding: 16px;
  border-radius: 8px;
  /* Keep minimal if using white */
}

/* Meta: Name & Time */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.comment-author cite,
.comment-author a {
  font-style: normal;
  font-weight: bold;
  color: #111;
  text-decoration: none;
}

.comment-time {
  font-size: 13px;
  color: #888;
}

/* Comment Text */
.comment-text p {
  margin: 5px 0 10px 0;
  font-size: 15px;
  color: #333;
  line-height: 1.5;
}

/* Reply Link */
.comment-reply a {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  text-decoration: none;
}

.comment-reply a:hover {
  color: #ba0a30;
  text-decoration: underline;
}

/* Threaded Comments / Nested Levels */
.comment-list .children {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-left: 50px;
  /* Vertical Line */
  padding-left: 20px;
}

/* Remove bullets if they appear */
.comment-list,
.children {
  list-style: none !important;
}

/* Comment Form Styling */
.comment-form-comment label,
.comment-form-author label,
.comment-form-email label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.form-submit .submit {
  background: #ba0a30;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.form-submit .submit:hover {
  background: #900825;
}

/* Responsive */
@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr;
  }

  .single-content-box {
    padding: 20px;
  }
}

.editor-content-wrapper li {
  margin-bottom: 0.8em;
}

.editor-content-wrapper figure,
.editor-content-wrapper figure img {
  margin-top: 2rem;
}

.editor-content-wrapper figure img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.faq-content-wrapper,
.editor-content-wrapper {
  /* Removed white card wrapper per user request */
}

.single-content-box .editor-content-wrapper {
  background-color: transparent;
  box-shadow: none;
  padding: 0;
}

.site-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --- Desktop: Ẩn nút toggle --- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

/* --- Mobile: Thiết lập Responsive --- */
@media screen and (max-width: 991px) {

  /* Hiển thị nút toggle trên mobile */
  .menu-toggle {
    display: block;
    z-index: 1001;
  }

  /* Container của Menu chính */
  .bca-navbar {
    position: fixed;
    top: 0;
    left: -100%;
    /* Giấu menu sang trái */
    width: 280px;
    /* Chiều rộng menu mobile */
    height: 100vh;
    background: #fff;
    /* Màu nền menu mobile */
    z-index: 1000;
    transition: all 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    padding-top: 80px;
    /* Chừa chỗ cho header */
    display: block;
    /* Đè lên layout cũ */
  }

  /* Khi Menu được kích hoạt */
  .mobile-menu-active .bca-navbar {
    left: 0;
    /* Đẩy menu ra */
  }

  /* Biến danh sách menu thành cột dọc */
  .main-menu {
    flex-direction: column;
    display: flex;
    padding: 0 20px;
  }

  .main-menu li {
    /* margin: 10px 0; */
    list-style: none;
  }

  .main-menu a {
    color: #333;
    font-weight: bold;
    text-decoration: none;
    font-size: 16px;
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
  }

  /* Lớp phủ mờ phía sau khi mở menu */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .mobile-menu-active .mobile-menu-overlay {
    display: block;
  }
}

/* --- RESPONSIVE MOBILE TỐI ƯU --- */
@media (max-width: 1024px) {
  .container {
    padding: 0 12px !important;
  }

  /* 1. Chỉnh lại Banner */
  .bca-banner {
    height: 80px;
    justify-content: space-between;
    padding: 0 15px;
  }

  .menu-toggle {
    display: block;
    /* Hiện nút hamburger */
    order: -1;
  }

  .bca-logo-img {
    max-height: 60px;
  }

  /* 2. Biến Navbar thành Sidebar trượt */
  .bca-navbar {
    position: fixed;
    top: 0;
    left: -100%;
    /* Giấu menu sang trái */
    width: 80%;
    /* Chiều rộng sidebar */
    max-width: 300px;
    height: 100vh;
    background-color: #fff;
    /* Nền trắng cho sạch sẽ */
    z-index: 9999;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    /* Hủy flex của desktop */
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  /* Khi Menu mở */
  .mobile-menu-active .bca-navbar {
    left: 0;
  }

  /* 3. Chỉnh lại Container bên trong Navbar */
  .bca-navbar .container {
    flex-direction: column;
    /* Xếp dọc */
    height: auto;
    padding: 20px;
    justify-content: flex-start;
    align-items: flex-start;
  }

  /* 4. Định dạng lại Menu Items */
  .main-menu-container {
    width: 100%;
    /* margin-top: 20px; */
  }

  .main-menu {
    flex-direction: column;
    /* Xếp dọc các mục menu */
    gap: 0;
    width: 100%;
    height: auto;
  }

  .main-menu li {
    width: 100%;
    height: auto;
    border-bottom: 1px solid #eee;
  }

  .main-menu li a {
    padding: 15px 0;
    width: 100%;
    height: auto;
    font-size: 14px;
    color: #333 !important;
    /* Chữ tối trên nền trắng */
    border-bottom: none;
    justify-content: flex-start;
  }



  /* 6. Lớp phủ mờ khi mở menu */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
  }

  .mobile-menu-active .mobile-menu-overlay {
    display: block;
  }
}

/* ---------------------------------------------------------
   IMAGE STYLING IN CONTENT (90% width + frame)
   --------------------------------------------------------- */
.editor-content-wrapper figure,
.editor-content-wrapper .wp-caption,
.editor-content-wrapper p > img,
.editor-content-wrapper > img {
  width: 90% !important;
  max-width: 90% !important;
  height: auto !important;
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
  clear: both;
}

.editor-content-wrapper figure img,
.editor-content-wrapper .wp-caption img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

.editor-content-wrapper img, 
.editor-content-wrapper figure img,
.editor-content-wrapper .wp-caption img {
  border-radius: 8px;
  box-sizing: border-box;
}

.editor-content-wrapper figcaption.wp-caption-text,
.editor-content-wrapper .wp-caption-text {
  text-align: center;
  font-size: 14px;
  color: #64748b;
  margin-top: 8px;
  font-style: italic;
}

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

/* ---------------------------------------------------------
   CATEGORY SIDEBAR STYLES (Mockup layout 7/3)
   --------------------------------------------------------- */
.category-sidebar .widget {
  margin-bottom: 40px;
}

.category-sidebar .widget-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  border-bottom: none;
  padding-bottom: 0;
  text-transform: none;
}

.category-sidebar .widget-title::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 4px;
  background-color: #ba0a30;
  border-radius: 2px;
}

.category-sidebar .widget_categories ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-sidebar .widget_categories ul li {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-sidebar .widget_categories ul li:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.category-sidebar .widget_categories ul li a {
  color: #334155;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.2s;
}

.category-sidebar .widget_categories ul li a:hover {
  color: #2563eb;
}

.category-sidebar .widget_categories ul li .cat-count {
  background: #f1f5f9;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.popular-post-info h4 a:hover {
  color: #3b82f6 !important;
}

/* ---------------------------------------------------------
   CATEGORY ARCHIVE MOBILE TWEAKS
   --------------------------------------------------------- */
@media (max-width: 768px) {
  .post-list-item {
    flex-direction: column;
  }
  .category-post-thumbnail {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
  }
  .category-post-thumbnail a {
    height: auto;
  }
  .category-post-thumbnail img.category-img {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .category-post-content {
    padding: 20px;
  }
}