/*
Theme Name: TechZone
Theme URI: https://techzone.vn
Author: TechZone Team
Author URI: https://techzone.vn
Description: TechZone - Tin tức - Chia sẻ - Công nghệ. A modern tech news WordPress theme with responsive design.
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: techzone
Tags: blog, news, technology, responsive, custom-menu, featured-images, post-formats, translation-ready
*/

/* =========================================
   CSS CUSTOM PROPERTIES (TOKENS)
   ========================================= */
:root {
  /* Colors */
  --color-primary: #1565C0;
  --color-primary-dark: #0D47A1;
  --color-primary-light: #1976D2;
  --color-secondary: #2196F3;
  --color-accent: #FF6B35;
  --color-breaking: #E53935;

  --color-bg: #F5F7FA;
  --color-bg-white: #FFFFFF;
  --color-bg-dark: #0A0E1A;
  --color-bg-card: #FFFFFF;

  --color-text-primary: #1A1A2E;
  --color-text-secondary: #555770;
  --color-text-muted: #8892A4;
  --color-text-white: #FFFFFF;

  --color-border: #E8ECF0;
  --color-border-light: #F0F3F6;

  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Layout */
  --container-max: 1200px;
  --sidebar-width: 300px;
  --header-height: 64px;
}

/* =========================================
   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);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary); }

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

ul, ol { list-style: none; }

button { cursor: pointer; border: none; background: none; font-family: inherit; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

input:focus, textarea:focus { border-color: var(--color-primary); }

/* =========================================
   LAYOUT UTILITIES
   ========================================= */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; padding: var(--space-8) 0; }

.content-area {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-8);
  align-items: start;
}

.content-area.full-width { grid-template-columns: 1fr; }

/* =========================================
   BREAKING NEWS BAR
   ========================================= */
.breaking-bar {
  background: var(--color-primary);
  color: white;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  overflow: hidden;
}

.breaking-bar .container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.breaking-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary-dark);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.breaking-label .icon-bolt::before { content: '⚡'; }

.breaking-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.breaking-ticker-inner {
  display: flex;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
}

.breaking-ticker-inner a {
  color: white;
  padding-right: var(--space-16);
  opacity: 0.95;
}

.breaking-ticker-inner a:hover { opacity: 1; text-decoration: underline; }

.breaking-bar-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
  font-size: var(--text-xs);
  opacity: 0.85;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =========================================
   SITE HEADER
   ========================================= */
.site-header {
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: var(--header-height);
  justify-content: space-between;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg { width: 24px; height: 24px; fill: white; }

.logo-text { line-height: 1.1; }
.logo-text .name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  display: block;
}
.logo-text .tagline {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: block;
}

/* Search bar in header */
.header-search {
  flex: 1;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.header-search input {
  padding-right: 48px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  border-color: transparent;
}

.header-search input:focus { border-color: var(--color-primary); background: white; }

.header-search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.header-search-btn:hover { background: var(--color-primary-dark); }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.mobile-search-toggle { display: none !important; }

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all 0.2s;
  cursor: pointer;
  background: white;
}

.btn-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(21, 101, 192, 0.05);
}

.btn-login {
  background: var(--color-primary);
  color: white;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: background 0.2s;
}

.btn-login:hover { background: var(--color-primary-dark); color: white; }

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text-primary);
}

/* =========================================
   NAVIGATION
   ========================================= */
.main-nav {
  background: var(--color-bg-white);
  border-bottom: 2px solid var(--color-border-light);
}

.main-nav .container {
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-item.current-menu-item .nav-link,
.nav-item.current-menu-ancestor .nav-link {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.nav-link .dropdown-arrow {
  font-size: var(--text-xs);
  opacity: 0.6;
  transition: transform 0.2s;
}

.nav-item:hover .dropdown-arrow { transform: rotate(180deg); }

/* Mega Menu */
.nav-item.has-mega-menu { position: relative; }
.nav-item.has-mega-menu:hover .mega-menu { display: grid; }

.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 800px;
  padding: var(--space-6);
  gap: var(--space-6);
  grid-template-columns: 180px 1fr 200px;
  z-index: 999;
}

.nav-item:hover .mega-menu { display: grid; }

.mega-menu-col h4 {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.mega-menu-links { display: flex; flex-direction: column; gap: var(--space-1); }

.mega-menu-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: all 0.15s;
}

.mega-menu-link:hover {
  background: rgba(21, 101, 192, 0.06);
  color: var(--color-primary);
}

.mega-menu-link.active {
  background: rgba(21, 101, 192, 0.08);
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}

.mega-menu-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.mega-posts { display: flex; flex-direction: column; gap: var(--space-4); }

.mega-post {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.mega-post-img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.mega-post-info { flex: 1; }
.mega-post-info h5 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  margin-bottom: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mega-post-info .date { font-size: var(--text-xs); color: var(--color-text-muted); }

.mega-cat-list { display: flex; flex-direction: column; gap: var(--space-2); }
.mega-cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  padding: var(--space-1) 0;
  color: var(--color-text-secondary);
}
.mega-cat-item:hover { color: var(--color-primary); }
.mega-cat-count {
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.mega-menu-footer {
  grid-column: 1 / -1;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.mega-menu-footer a {
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

/* Simple dropdown */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: var(--space-2) 0;
  z-index: 999;
}

.nav-item:hover .dropdown-menu { display: block; }

.dropdown-item {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: rgba(21, 101, 192, 0.06);
  color: var(--color-primary);
  padding-left: calc(var(--space-4) + 4px);
}

/* =========================================
   HERO SLIDER
   ========================================= */
.hero-section { margin-bottom: var(--space-8); }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-4);
  height: 420px;
}

.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
}

.hero-slide { position: relative; height: 100%; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-6);
  color: white;
}

.post-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.badge-ai { background: #7C3AED; }
.badge-cong-nghe { background: #0891B2; }
.badge-thu-thuat { background: #059669; }
.badge-huong-dan { background: #D97706; }
.badge-wordpress { background: #1E40AF; }
.badge-tin-tuc { background: var(--color-breaking); }
.badge-review { background: #9333EA; }
.badge-phan-cung { background: #EA580C; }
.badge-di-dong { background: #16A34A; }
.badge-phan-mem { background: #0284C7; }
.badge-bao-mat { background: #DC2626; }
.badge-internet { background: #2563EB; }
.badge-xu-huong { background: #7C3AED; }

.hero-content h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  margin-bottom: var(--space-2);
}

.hero-meta {
  font-size: var(--text-xs);
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.hero-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 var(--space-3);
  pointer-events: none;
}

.hero-btn {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  pointer-events: all;
  transition: background 0.2s;
  border: 1px solid rgba(255,255,255,0.3);
}
.hero-btn:hover { background: rgba(255,255,255,0.35); }

.hero-dots {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  gap: var(--space-2);
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s;
}
.hero-dot.active { background: white; width: 24px; }

.hero-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: var(--space-3);
}

.hero-side-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hero-side-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-side-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 60%);
}

.hero-side-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3);
  color: white;
}

.hero-side-content h3 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  margin-top: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-side-content .date { font-size: var(--text-xs); opacity: 0.75; }

/* =========================================
   TOPIC ICONS ROW
   ========================================= */
.topics-row {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-8);
}

.topics-grid {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: space-between;
}

.topics-grid::-webkit-scrollbar { display: none; }

.topic-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 72px;
  text-align: center;
  flex: 1;
}

.topic-item:hover {
  background: rgba(21, 101, 192, 0.06);
}

.topic-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(21, 101, 192, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
}

.topic-item:hover .topic-icon {
  background: var(--color-primary);
  color: white;
}

.topic-name {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

/* =========================================
   SECTION HEADERS
   ========================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border-light);
}

.section-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-extrabold);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.section-link {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: var(--weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.section-link:hover { color: var(--color-primary-dark); }

/* =========================================
   ARTICLE CARDS
   ========================================= */

/* Card - horizontal large */
.post-card-horizontal {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.post-card-horizontal:last-child { border-bottom: none; }

.post-card-horizontal .card-img {
  width: 160px;
  height: 110px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.post-card-horizontal .card-body { flex: 1; }

/* Ảnh trong card horizontal: cố định desktop, full-width mobile */
.card-img--hori {
  width: 210px;
  height: 145px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

/* Card - vertical grid */
.post-card-vertical {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card-vertical:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-card-vertical .card-img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  flex-shrink: 0;
}

.post-card-vertical .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card-vertical:hover .card-img-wrap img { transform: scale(1.03); }

.post-card-vertical .card-body {
  padding: var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-vertical .card-meta {
  margin-top: auto;
  padding-top: var(--space-2);
}

/* Card - compact list */
.post-card-compact {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.post-card-compact:last-child { border-bottom: none; }

.post-card-compact .card-img {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.post-card-compact .card-body h4 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card body shared styles */
.card-category {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  line-height: 1.35;
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title:hover { color: var(--color-primary); }

.card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-tags {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.card-tag {
  padding: 3px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

.card-tag:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Nút +N mở rộng tags */
.card-tag--more {
  background: transparent;
  border-style: dashed;
  color: var(--color-primary);
  font-weight: var(--weight-bold);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.card-tag--more:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  border-style: solid;
  color: white;
}

/* Tags ẩn — dùng display:contents để giữ layout flex */
.tags-hidden { display: contents; }

/* =========================================
   NUMBERED POSTS (Bài viết nổi bật)
   ========================================= */
.ranked-posts { display: flex; flex-direction: column; gap: 0; }

.ranked-post {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
  align-items: flex-start;
}

.ranked-post:last-child { border-bottom: none; }

.rank-number {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
  color: white;
}

.rank-1 { background: #EF4444; }
.rank-2 { background: #F97316; }
.rank-3 { background: #EAB308; }
.rank-4, .rank-5 { background: var(--color-text-muted); }

.ranked-post-img {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.ranked-post-info { flex: 1; }
.ranked-post-info h4 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  margin-bottom: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ranked-post-info .date { font-size: var(--text-xs); color: var(--color-text-muted); }

/* =========================================
   GRID LAYOUTS
   ========================================= */
.posts-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.posts-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.posts-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

/* Featured + list layout */
.featured-list-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-6);
}

.featured-post { position: relative; border-radius: var(--radius-lg); overflow: hidden; }
.featured-post img { width: 100%; height: 260px; object-fit: cover; }
.featured-post-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.featured-post-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
  color: white;
}
.featured-post-content h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  margin-top: var(--space-2);
}

/* =========================================
   CATEGORY FILTERS
   ========================================= */
.category-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.cat-filter-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-filter-btn:hover,
.cat-filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* =========================================
   FOLLOW BUTTON
   ========================================= */
.btn-follow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-follow:hover,
.btn-follow.following {
  background: var(--color-primary);
  color: white;
}

/* =========================================
   PAGINATION
   ========================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) 0;
}

.page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.page-btn.next-btn {
  width: auto;
  padding: 0 var(--space-4);
  gap: var(--space-2);
}

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar { display: flex; flex-direction: column; gap: var(--space-6); }

.sidebar-widget {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.widget-title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  margin-bottom: 0;
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
  justify-content: space-between;
}

.widget-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 16px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.widget-title-text {
  flex: 1;
}

.widget-toggle-icon {
  font-size: 20px;
  color: var(--color-text-secondary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  line-height: 1;
}

.widget-title.is-open .widget-toggle-icon {
  transform: rotate(180deg);
}

.widget-title.is-open {
  margin-bottom: var(--space-4);
}

.widget-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  opacity: 0;
}

.widget-body.is-open {
  max-height: 1000px;
  opacity: 1;
}

/* Search widget */
.widget-search {
  display: flex;
  gap: var(--space-2);
}

.widget-search input { flex: 1; }

.btn-search {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

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

/* Category list */
.cat-list { display: flex; flex-direction: column; gap: 0; }

.cat-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  justify-content: space-between;
}

.cat-list-item:last-child { border-bottom: none; }

.cat-list-item:hover { color: var(--color-primary); }

.cat-list-item .bullet { color: var(--color-primary); font-size: 10px; }

.cat-list-left { display: flex; align-items: center; gap: var(--space-2); }

.cat-count {
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Tags cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 5px;
  align-content: flex-start;
  line-height: 1;
}

/* Tag cloud thông minh: kích thước theo số bài viết */
.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid;
  border-radius: var(--radius-full);
  color: var(--color-primary);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.18s, color 0.18s, transform 0.15s;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}

.tag-cloud-item:hover {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: white;
  transform: translateY(-1px);
}

/* Newsletter widget */
.newsletter-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

.newsletter-form { display: flex; flex-direction: column; gap: var(--space-3); }

.btn-subscribe {
  background: var(--color-primary);
  color: white;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  text-align: center;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-subscribe:hover { background: var(--color-primary-dark); }

.newsletter-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* Ad / Banner widget */
.ad-banner {
  background: linear-gradient(135deg, #1565C0 0%, #0D47A1 40%, #1a237e 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  color: white;
  position: relative;
  overflow: hidden;
}

.ad-banner::before {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.ad-banner h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.ad-banner .price {
  font-size: var(--text-sm);
  opacity: 0.9;
  margin-bottom: var(--space-3);
}

.ad-banner ul { margin-bottom: var(--space-4); }

.ad-banner li {
  font-size: var(--text-sm);
  opacity: 0.9;
  padding: var(--space-1) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ad-banner li::before { content: '✓'; font-weight: bold; }

.btn-ad {
  display: inline-block;
  background: white;
  color: var(--color-primary);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.btn-ad:hover {
  background: var(--color-bg);
  color: var(--color-primary-dark);
}

/* Downloads widget */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.download-item {
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.download-item:hover { transform: translateY(-2px); }

.download-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.download-name { font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.download-version { font-size: 10px; color: var(--color-text-muted); }
.download-label {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}

/* =========================================
   SINGLE POST
   ========================================= */
.single-post-header { margin-bottom: var(--space-6); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--color-primary); }
.breadcrumb-sep { opacity: 0.5; }

.post-category-label {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.post-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  line-height: 1.2;
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.post-description {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.post-meta-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.post-featured-img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

/* Article content */
.post-content {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text-primary);
}

.post-content h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin: var(--space-8) 0 var(--space-4);
  padding-left: var(--space-4);
  border-left: 4px solid var(--color-primary);
  color: var(--color-text-primary);
}

.post-content h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin: var(--space-6) 0 var(--space-3);
}

.post-content p { margin-bottom: var(--space-4); }

.post-content img {
  border-radius: var(--radius-md);
  margin: var(--space-4) 0;
}

.post-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--space-4) var(--space-6);
  background: rgba(21, 101, 192, 0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.post-content ul, .post-content ol {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

.post-content li {
  margin-bottom: var(--space-2);
  list-style: disc;
}

.post-content ol li { list-style: decimal; }

/* Info box */
.info-box {
  background: rgba(33, 150, 243, 0.08);
  border: 1px solid rgba(33, 150, 243, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-5) 0;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.info-box.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Check list */
.check-list { list-style: none !important; padding: 0 !important; }
.check-list li {
  padding: var(--space-2) 0;
  padding-left: var(--space-6);
  position: relative;
  list-style: none !important;
}
.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: bold;
}

/* Post tags */
.post-tags-section { margin: 0; }
.post-tags-section h4 {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* === Tags + Share unified bar === */
.post-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  margin: var(--space-5) 0;
  flex-wrap: wrap;
}

.post-meta-bar__tags {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.post-meta-bar__tags-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-meta-bar .card-tag {
  font-size: 11px;
  padding: 2px 9px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.post-meta-bar .card-tag:not(.card-tag--more)::before {
  content: '#';
  color: var(--color-primary);
  font-weight: 700;
  margin-right: 1px;
}

.post-meta-bar .card-tag:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.post-meta-bar .card-tag:not(.card-tag--more):hover::before { color: white; }

.post-meta-bar__share {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.post-meta-bar__share-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Share section (standalone fallback) */
.post-share {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: var(--space-5) 0;
  flex-wrap: wrap;
}

.share-label {
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
  margin-right: var(--space-1);
}

/* Các nút chia sẻ: mặc định chỉ icon, nhỏ gọn */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  color: white;
  flex-shrink: 0;
}

.share-btn span { display: none; }

.share-fb { background: #1877F2; }
.share-tw { background: #1DA1F2; }
.share-li { background: #0A66C2; }
.share-pi { background: #E60023; }
.share-more { background: var(--color-text-muted); }

.share-btn:hover { opacity: 0.88; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }

/* Author box */
.author-box {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-1);
}

.author-bio {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.author-social { display: flex; gap: var(--space-2); }

.social-link {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: all 0.2s;
}

.social-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(21, 101, 192, 0.05);
}

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.post-nav-item {
  padding: var(--space-4);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.post-nav-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.post-nav-direction {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.post-nav-item.next { text-align: right; }
.post-nav-item.next .post-nav-direction { justify-content: flex-end; }

.post-nav-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Related posts */
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* =========================================
   SEARCH PAGE
   ========================================= */
.search-header {
  margin-bottom: var(--space-6);
}

.search-headline {
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  margin-bottom: var(--space-4);
  color: var(--color-text-primary);
}

.search-headline span { color: var(--color-primary); }

.search-bar-large {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.search-bar-large input {
  flex: 1;
  padding: var(--space-4);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-search-lg {
  background: var(--color-primary);
  color: white;
  padding: 0 var(--space-6);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  transition: background 0.2s;
  flex-shrink: 0;
}

.btn-search-lg:hover { background: var(--color-primary-dark); }

.search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.sort-select {
  padding: var(--space-2) var(--space-4);
  width: auto;
  cursor: pointer;
  font-size: var(--text-sm);
}

/* =========================================
   CATEGORY PAGE
   ========================================= */
.category-header {
  margin-bottom: var(--space-6);
}

.category-page-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.category-description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
  line-height: 1.6;
}

.category-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.85);
  margin-top: var(--space-6);
}

.footer-top {
  padding: var(--space-6) 0 var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: 280px 1fr 1fr 1fr;
  gap: var(--space-6);
}

.footer-brand {}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.footer-logo .logo-icon { background: rgba(255,255,255,0.1); }
.footer-logo .name { color: white; }
.footer-logo .tagline { color: rgba(255,255,255,0.5); }

.footer-about {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-3);
}

.footer-social { display: flex; gap: var(--space-3); }

.footer-social-link {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  transition: all 0.2s;
}

.footer-social-link:hover {
  background: var(--color-primary);
  color: white;
}

.footer-col-title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: white;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links { display: flex; flex-direction: column; gap: var(--space-2); }

.footer-link {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color 0.2s;
}

.footer-link::before { content: '•'; color: var(--color-primary); font-size: 10px; }
.footer-link:hover { color: rgba(255,255,255,0.9); }

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-3);
}

.footer-contact-icon {
  width: 20px;
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 2px;
}

.footer-bottom {
  padding: var(--space-4) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.4);
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-4);
}

.footer-bottom-links a {
  color: rgba(255,255,255,0.4);
  transition: color 0.2s;
}

.footer-bottom-links a:hover { color: rgba(255,255,255,0.8); }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  border: none;
  font-size: 20px;
}

.back-to-top.visible { opacity: 1; pointer-events: all; }
.back-to-top:hover { background: var(--color-primary-dark); transform: translateY(-2px); }

/* =========================================
   MOBILE NAV
   ========================================= */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: white;
  z-index: 2001;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.open { transform: translateX(0); }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.mobile-nav-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 20px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: none;
}

.mobile-nav-items { padding: var(--space-3) 0; }

.mobile-nav-item { border-bottom: 1px solid var(--color-border-light); }

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  cursor: pointer;
}

.mobile-nav-link.active {
  color: var(--color-primary);
  background: rgba(21, 101, 192, 0.05);
}

.mobile-nav-link svg { width: 20px; height: 20px; margin-right: var(--space-3); }

.mobile-sub-items {
  display: none;
  background: var(--color-bg);
  padding: var(--space-2) 0;
}

.mobile-sub-items.open { display: block; }

.mobile-sub-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.mobile-sub-item:hover { color: var(--color-primary); }

.mobile-sub-item-info h5 { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.mobile-sub-item-info p { font-size: var(--text-xs); color: var(--color-text-muted); }

.mobile-sub-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-nav-footer {
  padding: var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.mobile-theme-toggle {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.theme-btn {
  flex: 1;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

.theme-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

.mobile-social { display: flex; gap: var(--space-3); justify-content: center; margin-bottom: var(--space-4); }

.mobile-copyright { text-align: center; font-size: var(--text-xs); color: var(--color-text-muted); }

/* =========================================
   BOTTOM NAV (mobile)
   ========================================= */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: white;
  border-top: 1px solid var(--color-border);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-2) 0 var(--space-3);
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: var(--weight-medium);
  transition: color 0.2s;
  background: none;
  border: none;
}

.bottom-nav-btn.active { color: var(--color-primary); }
.bottom-nav-btn svg { width: 22px; height: 22px; }
.bottom-nav-btn > i,
.bottom-nav-btn i.ri-home-fill,
.bottom-nav-btn i.ri-home-line,
.bottom-nav-btn i[class^="ri-"],
.bottom-nav-btn i[class*=" ri-"] { font-size: 22px; line-height: 1; display: block; }
a.bottom-nav-btn { text-decoration: none; }
button.bottom-nav-btn { font-family: var(--font-body); font-size: 10px; }
button.bottom-nav-btn > i { font-size: 22px; }

/* =========================================
   UTILITIES & HELPERS
   ========================================= */
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }
.text-white { color: white; }
.fw-bold { font-weight: var(--weight-bold); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.section-spacing { margin-bottom: var(--space-10); }

/* =========================================
   RESPONSIVE
   ========================================= */
/* =========================================
   RESPONSIVE – TABLET (≤ 1024px)
   ========================================= */
@media (max-width: 1024px) {
  .content-area { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  .hero-grid { grid-template-columns: 1fr; height: auto; }
  .hero-side { display: none; }
  .hero-main { height: 320px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }

  .posts-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .posts-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .related-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-list-layout { grid-template-columns: 1fr; }
}

/* =========================================
   RESPONSIVE – MOBILE (≤ 768px)
   ========================================= */
@media (max-width: 768px) {
  /* ---- Header ---- */
  .header-inner { gap: var(--space-3); position: relative; }
  .header-search { display: none; }
  .mobile-search-toggle { display: flex !important; }
  .btn-login { display: none; }
  .main-nav { display: none; }
  .mobile-menu-toggle { display: flex; flex-shrink: 0; }
  .breaking-bar-meta { display: none; }
  .logo-text .tagline { display: none; }
  .logo-text .name { font-size: var(--text-base); }
  .header-actions { gap: var(--space-2); }
  .header-actions .btn-icon { width: 36px; height: 36px; }

  /* ---- Layout ---- */
  .bottom-nav { display: flex; }
  /* Khoảng cách trên + dưới cho bottom nav */
  .site-content { padding-top: var(--space-4); padding-bottom: 70px; }
  .back-to-top { bottom: 80px; }

  /* ---- Post card horizontal → dọc trên mobile ---- */
  .post-card-horizontal {
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4) 0;
  }
  .post-card-horizontal > a:first-child {
    width: 100% !important;
  }
  .post-card-horizontal .card-img {
    width: 100% !important;
    height: 180px !important;
    border-radius: var(--radius-md);
    object-fit: cover;
    display: block;
  }
  .card-img--hori {
    width: 100% !important;
    height: 190px !important;
    flex-shrink: unset;
  }
  .post-card-horizontal .card-excerpt { display: none; }
  .post-card-horizontal .card-title {
    font-size: var(--text-sm);
    -webkit-line-clamp: 2;
  }
  .post-card-horizontal .card-tags { display: none; }

  /* Search page */
  .search-meta { flex-direction: column; gap: var(--space-2); align-items: flex-start; }
  .sort-select { width: 100%; }

  /* Category header */
  .category-header-top { flex-direction: column; gap: var(--space-3); align-items: flex-start; }
  .category-filters { gap: var(--space-2); flex-wrap: wrap; }

  /* ---- Hero ---- */
  .hero-section { margin-bottom: var(--space-5); }
  .hero-main { height: 260px; }
  .hero-content { padding: var(--space-4); }
  .hero-content h2 { font-size: var(--text-lg); line-height: 1.35; }

  /* ---- Topics ---- */
  .topics-row { padding: var(--space-3) var(--space-2); }
  .topics-grid { gap: 0; justify-content: flex-start; }
  .topic-item { min-width: 64px; padding: var(--space-2) var(--space-3); flex: 0 0 auto; }
  .topic-icon { width: 36px; height: 36px; font-size: 18px; }

  /* ---- Grids ---- */
  .posts-grid-3 { grid-template-columns: 1fr; }
  .posts-grid-4 { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .related-posts-grid { grid-template-columns: 1fr 1fr; }
  .post-nav { grid-template-columns: 1fr; }

  /* ---- Downloads ---- */
  .downloads-grid { grid-template-columns: repeat(3, 1fr) !important; gap: var(--space-3); }

  /* ---- Footer ---- */
  .footer-grid { grid-template-columns: 1fr; }

  /* ---- Single post ---- */
  .post-title { font-size: var(--text-2xl); }
  .post-share { gap: var(--space-2); padding: var(--space-2) 0; }
  .share-label { display: none; }

  /* Meta bar mobile: stack tags trên, share dưới */
  .post-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
  }
  .post-meta-bar__share-label { display: none; }
  .post-meta-bar__tags { gap: var(--space-2); }

  /* ---- Section spacing ---- */
  .section-spacing { margin-bottom: var(--space-6); }
}

/* =========================================
   RESPONSIVE – SMALL MOBILE (≤ 480px)
   ========================================= */
@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }

  /* ---- Header ---- */
  .header-inner { gap: var(--space-2); }
  .logo-icon { width: 32px; height: 32px; }
  .logo-icon svg { width: 18px; height: 18px; }
  .logo-text .name { font-size: var(--text-sm); }
  .header-actions .btn-icon { width: 32px; height: 32px; }

  /* ---- Hero ---- */
  .hero-main { height: 220px; }
  .hero-content h2 { font-size: var(--text-base); }

  /* ---- Grids ---- */
  .posts-grid-4 { grid-template-columns: 1fr 1fr; }
  .downloads-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .related-posts-grid { grid-template-columns: 1fr; }

  /* ---- Topics ---- */
  .topic-item { min-width: 56px; }
  .topic-name { font-size: 10px; }
}

/* =========================================
   DARK MODE
   ========================================= */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0F1117;
    --color-bg-white: #1A1D27;
    --color-bg-card: #1A1D27;
    --color-text-primary: #E8EAF0;
    --color-text-secondary: #9AA0B2;
    --color-border: #2A2D3E;
    --color-border-light: #222535;
  }
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease-out forwards; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-border-light) 50%, var(--color-bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
