/* =========================================
   BLOG.CSS — Styles cho trang blog, single post, archive
   ========================================= */

/* ── BLOG HERO ──────────────────────────────────────────── */
.blog-hero {
  background: linear-gradient(135deg, var(--secondary) 0%, #2A5280 100%);
  padding: 64px 0 56px;
  text-align: center;
}
.blog-hero-icon {
  width: 64px; height: 64px;
  background: rgba(245,166,35,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.blog-hero h1 { color: var(--white); font-size: 36px; margin-bottom: 12px; }
.blog-hero p  { color: rgba(255,255,255,0.7); font-size: 16px; max-width: 560px; margin: 0 auto; }

/* ── ARCHIVE HERO ───────────────────────────────────────── */
.archive-hero {
  background: linear-gradient(135deg, var(--secondary) 0%, #2A5280 100%);
  padding: 60px 0;
  text-align: center;
}
.archive-hero-icon {
  width: 56px; height: 56px;
  background: rgba(245,166,35,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.archive-hero h1 { color: white; font-size: 30px; margin-bottom: 8px; }
.archive-hero p  { color: rgba(255,255,255,0.7); font-size: 15px; }
.post-count {
  display: inline-block;
  background: rgba(245,166,35,0.2);
  color: var(--primary);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
}

.archive-cats-nav { background: var(--bg-light); border-bottom: 1px solid var(--border); padding: 16px 0; }

.archive-subservices {
  padding: 52px 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.archive-subservices-head {
  max-width: 700px;
  margin: 0 auto 28px;
  text-align: center;
}
.archive-subservices-head span {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(245,166,35,0.14);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}
.archive-subservices-head h2 {
  margin: 0 0 10px;
  color: var(--secondary);
  font-size: 30px;
}
.archive-subservices-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}
.archive-subservice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.archive-subservice-card {
  display: block;
  padding: 24px;
  min-height: 178px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: linear-gradient(180deg, var(--white), var(--bg-light));
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.archive-subservice-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.archive-subservice-card h3 {
  margin: 0 0 10px;
  color: var(--secondary);
  font-size: 17px;
  line-height: 1.35;
}
.archive-subservice-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ── BLOG MAIN ──────────────────────────────────────────── */
.blog-main { padding: 56px 0; background: var(--white); }

/* Category filter */
.blog-cats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  justify-content: center;
}
.cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
}
.cat-btn:hover, .cat-btn.active {
  background: var(--primary);
  color: var(--secondary);
  border-color: var(--primary);
}
.cat-count {
  font-size: 11px;
  background: rgba(0,0,0,0.08);
  padding: 2px 6px;
  border-radius: 10px;
}
.cat-btn.active .cat-count, .cat-btn:hover .cat-count {
  background: rgba(26,60,94,0.15);
}

/* ── POSTS GRID ─────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 48px;
}
.post-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.post-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 200px;
  background: var(--bg-light);
}
.post-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-img img { transform: scale(1.04); }
.post-card-img-placeholder { background: var(--bg-light); }

.post-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.post-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-decoration: none;
}
.post-cat:hover { color: var(--primary); }
.post-card-body h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.4;
  margin: 0;
}
.post-card-body h2 a { color: inherit; }
.post-card-body h2 a:hover { color: var(--primary); }
.post-card-body > p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.post-date {
  display: flex;
  align-items: center;
  gap: 5px;
}
.read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  transition: color var(--transition);
  text-decoration: none;
}
.read-more:hover { color: var(--primary-dark); }

/* ── PAGINATION ─────────────────────────────────────────── */
.blog-pagination { display: flex; justify-content: center; margin-top: 48px; }
.blog-pagination .nav-links { display: flex; gap: 8px; align-items: center; }
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  text-decoration: none;
}
.page-numbers:hover, .page-numbers.current {
  background: var(--primary);
  color: var(--secondary);
  border-color: var(--primary);
}
.page-numbers.dots { border: none; background: none; pointer-events: none; }

/* ── NO POSTS ───────────────────────────────────────────── */
.no-posts {
  text-align: center;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
}
.no-posts h3 { font-size: 20px; color: var(--secondary); }

/* ── BLOG CTA SECTION ────────────────────────────────────── */
.blog-cta-section { padding: 48px 0; background: var(--bg-light); border-top: 1px solid var(--border); }
.blog-cta-box {
  background: linear-gradient(135deg, var(--secondary) 0%, #2A5280 100%);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.blog-cta-text h3 { color: white; font-size: 22px; margin-bottom: 8px; }
.blog-cta-text p  { color: rgba(255,255,255,0.75); margin: 0; }
.blog-cta-btns { display: flex; gap: 14px; flex-shrink: 0; flex-wrap: wrap; }
.btn-white {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.3);
}
.btn-white:hover { background: rgba(255,255,255,0.25); }

/* ── SINGLE POST ─────────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--primary);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

.single-main { padding: 48px 0 64px; background: var(--white); }

.single-post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

/* Post header */
.post-header { margin-bottom: 32px; }
.post-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.25;
  margin: 12px 0 20px;
}
.post-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.post-author-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.meta-sep { color: var(--border); }
.post-header-meta time,
.post-header-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Featured image */
.post-featured-img {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
}
.post-featured-img img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  display: block;
}

/* Highlight excerpt box */
.post-highlight-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(245,166,35,0.07);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 20px;
  margin-bottom: 32px;
}
.post-highlight-box p { font-size: 15px; color: var(--secondary); font-style: italic; margin: 0; line-height: 1.7; }

/* Post content typography */
.post-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}
.post-content h2 { font-size: 26px; color: var(--secondary); margin: 44px 0 16px; padding-top: 8px; }
.post-content h3 { font-size: 20px; color: var(--secondary); margin: 32px 0 12px; }
.post-content h4 { font-size: 17px; color: var(--secondary); margin: 24px 0 10px; }
.post-content p  { margin-bottom: 20px; }
.post-content ul, .post-content ol { margin: 16px 0 20px 24px; }
.post-content li { margin-bottom: 10px; }
.post-content strong { color: var(--secondary); font-weight: 700; }
.post-content a { color: var(--sec-light); text-decoration: underline; }
.post-content a:hover { color: var(--primary); }
.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 18px 24px;
  margin: 32px 0;
  background: rgba(245,166,35,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--secondary);
  font-size: 16px;
}
.post-content blockquote p { margin: 0; }
.post-content img {
  border-radius: var(--radius);
  max-width: 100%;
  margin: 24px auto;
  display: block;
  box-shadow: var(--shadow);
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  overflow: hidden;
  border-radius: var(--radius);
}
.post-content th {
  background: var(--secondary);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.post-content td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.post-content tr:nth-child(even) td { background: var(--bg-light); }
.post-content .wp-caption { text-align: center; max-width: 100%; }
.post-content .wp-caption-text { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* Tags */
.post-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.post-tags-label { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.tag-item {
  display: inline-block;
  padding: 5px 14px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  transition: all var(--transition);
  text-decoration: none;
}
.tag-item:hover { background: var(--primary); color: var(--secondary); border-color: var(--primary); }

/* Article CTA */
.article-cta {
  background: linear-gradient(135deg, var(--secondary) 0%, #2A5280 100%);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin: 48px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.article-cta-text h3 { color: white; font-size: 22px; margin-bottom: 8px; }
.article-cta-text p  { color: rgba(255,255,255,0.75); margin: 0; font-size: 15px; }

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-nav-prev, .post-nav-next {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.post-nav-prev:hover, .post-nav-next:hover { border-color: var(--primary); background: rgba(245,166,35,0.04); }
.post-nav-next { text-align: right; }
.post-nav a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.post-nav-label { font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; }
.post-nav-title { font-size: 14px; font-weight: 600; color: var(--secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.post-sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 88px; }

.sidebar-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* Author card */
.author-card { display: flex; gap: 14px; align-items: flex-start; }
.author-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}
.author-card strong { display: block; font-size: 15px; color: var(--secondary); margin-bottom: 6px; }
.author-card p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* Sidebar CTA */
.sidebar-cta {
  background: linear-gradient(135deg, var(--secondary) 0%, #2A5280 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: white;
}
.sidebar-cta h4 { color: white; font-size: 16px; margin-bottom: 8px; }
.sidebar-cta p  { color: rgba(255,255,255,0.75); font-size: 14px; margin-bottom: 16px; }
.sidebar-cta .btn-ghost {
  border-color: rgba(255,255,255,0.4);
  color: white;
  background: rgba(255,255,255,0.1);
}
.sidebar-cta .btn-ghost:hover { background: rgba(255,255,255,0.2); }

/* Sidebar categories */
.sidebar-cats { display: flex; flex-direction: column; gap: 0; }
.sidebar-cats li { border-bottom: 1px solid var(--border); }
.sidebar-cats li:last-child { border-bottom: none; }
.sidebar-cats a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  font-size: 14px;
  color: var(--text);
  transition: color var(--transition);
  text-decoration: none;
}
.sidebar-cats a:hover { color: var(--primary); }
.sidebar-cats span {
  font-size: 12px;
  background: var(--bg-light);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Sidebar recent posts */
.sidebar-recent { display: flex; flex-direction: column; gap: 0; }
.sidebar-recent li { border-bottom: 1px solid var(--border); }
.sidebar-recent li:last-child { border-bottom: none; }
.sidebar-recent a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  text-decoration: none;
}
.recent-thumb {
  width: 56px; height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-light);
}
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-recent span { display: block; font-size: 13px; font-weight: 600; color: var(--secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sidebar-recent small { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: block; }
.sidebar-recent a:hover span { color: var(--primary); }

/* Sidebar calculator promo */
.sidebar-calc-promo {
  background: rgba(245,166,35,0.08);
  border: 1.5px solid rgba(245,166,35,0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.sidebar-calc-promo h4 { font-size: 16px; color: var(--secondary); }
.sidebar-calc-promo p  { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ── RELATED POSTS ────────────────────────────────────────── */
.related-posts { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--border); }
.related-posts h3 { font-size: 22px; color: var(--secondary); margin-bottom: 28px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ── PAGE STYLES ─────────────────────────────────────────── */
.page-main { padding: 60px 0; }
.page-wrap { max-width: 860px; margin: 0 auto; }
.page-content h1 { font-size: 36px; color: var(--secondary); margin-bottom: 32px; padding-bottom: 20px; border-bottom: 2px solid var(--border); }

/* ── 404 ──────────────────────────────────────────────────── */
.error-404-page { padding: 80px 0; }
.error-404-wrap { text-align: center; max-width: 480px; margin: 0 auto; }
.error-404-code { font-size: 120px; font-weight: 800; color: rgba(245,166,35,0.2); line-height: 1; margin-bottom: 24px; }
.error-404-wrap h1 { font-size: 30px; color: var(--secondary); margin-bottom: 12px; }
.error-404-wrap p  { font-size: 16px; color: var(--text-muted); margin-bottom: 32px; }
.error-404-btns { display: flex; gap: 14px; justify-content: center; }

/* ── BREADCRUMB ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border); font-size: 16px; }
.breadcrumb-current { color: var(--text); font-weight: 500; }
