/* ====================================================
   HEADER - TRẠNG THÁI ACTIVE TẠI TRANG CHUYÊN MỤC
   ==================================================== */
.nav-link.active {
  color: var(--accent-orange);
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-orange);
}

/* ====================================================
   PAGE HERO (CATEGORY HEADER)
   ==================================================== */
.page-hero {
  padding: 80px max(24px, 4vw) 60px;
  display: flex;
  align-items: flex-start;
  gap: 40px;
  position: relative;
  background-color: var(--bg-primary);
}

.page-hero .hero__meta-left {
  position: relative;
  top: 0;
  left: 0;
  padding-top: 20px;
  width: 90px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-condensed);
}

.page-hero .hero__meta-left::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 9px;
  width: 1px;
  height: 80px;
  background-color: #111;
}

.page-hero .hero__meta-left .meta-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 2px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.page-hero .hero__meta-left .meta-number {
  color: var(--accent-orange);
  font-size: 24px;
  font-weight: 700;
}

.page-title {
  font-family: var(--font-condensed);
  font-size: clamp(80px, 13vw, 260px);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -2px;
  color: #111;
  text-transform: uppercase;
}

.page-desc {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
  color: #333;
  max-width: 320px;
}

/* ====================================================
   FEATURED GRID (1 LỚN TRÁI - 2 NHỎ PHẢI)
   ==================================================== */
.featured-grid {
  padding: 0 max(24px, 4vw) 60px;
  display: grid;
  grid-template-columns: 1.25fr 1fr; /* Trái to hơn phải */
  gap: 24px;
  background-color: var(--bg-primary);
}

.featured-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ====================================================
   POST CARD (COMPONENT CHUNG)
   ==================================================== */
.post-card {
  display: flex;
  flex-direction: column;
  background-color: #EBE8E1; /* Màu nền be tối hơn màu trang một chút */
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.post-media {
  overflow: hidden;
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-media img {
  transform: scale(1.05);
}

.post-content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-num {
  font-family: var(--font-condensed);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-orange);
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
  margin-bottom: 12px;
}

.post-num .line {
  width: 32px;
  height: 2px;
  background-color: var(--accent-orange);
}

.post-title {
  font-family: var(--font-condensed);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: #111;
}

.post-exc {
  font-size: 13px;
  line-height: 1.5;
  color: #444;
  margin-bottom: 30px;
}

.post-footer {
  margin-top: auto; /* Tự động đẩy phần meta xuống đáy */
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding-top: 16px;
}

.post-meta {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
}

.post-meta .sep {
  margin: 0 4px;
  opacity: 0.5;
}

.read-more {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.read-more:hover {
  color: var(--accent-orange);
}

/* --- CÁC BIẾN THỂ CỦA POST CARD --- */

/* 1. Thẻ to bên trái */
.post-card--large .post-title { font-size: 42px; }
.post-card--large .post-exc { font-size: 15px; }

/* 2. Thẻ ngang (Hình bên phải, chữ bên trái) */
.post-card--row {
  flex-direction: row;
  height: 100%;
}
.post-card--row .post-content { width: 55%; padding: 24px; }
.post-card--row .post-media { width: 45%; }
.post-card--row .post-title { font-size: 22px; }

/* 3. Thẻ nền đen (Dark Mode) */
.post-card--dark {
  background-color: #111;
  color: #fff;
  border: none;
}
.post-card--dark .post-title { color: #fff; }
.post-card--dark .post-exc { color: #aaa; }
.post-card--dark .post-meta { color: #888; }
.post-card--dark .post-footer { border-top-color: rgba(255,255,255,0.15); }

/* ====================================================
   FILTER TABS BARS (Thanh lọc và sắp xếp)
   ==================================================== */
.filter-bar {
  padding: 0 max(24px, 4vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 40px;
  background-color: var(--bg-primary);
}

.filter-tabs {
  display: flex;
  gap: 32px;
}

.filter-tabs a {
  font-weight: 600;
  font-size: 12px;
  padding: 16px 0;
  color: #666;
  position: relative;
  text-transform: uppercase;
}

.filter-tabs a:hover {
  color: #111;
}

.filter-tabs a.active {
  color: var(--accent-orange);
}

.filter-tabs a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-orange);
}

.filter-sort {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ====================================================
   MAIN ARTICLES GRID (LƯỚI 3 CỘT BÊN DƯỚI)
   ==================================================== */
.main-grid {
  padding: 0 max(24px, 4vw) 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  background-color: var(--bg-primary);
}

/* Ép ảnh ở card dark lùn xuống một chút để text không bị tràn so với card sáng */
.main-grid .post-card--dark .post-media { height: 220px; }
.main-grid .post-card:not(.post-card--dark) .post-media { height: 260px; }


/* ====================================================
   RESPONSIVE CHO TRANG CHUYÊN MỤC
   ==================================================== */
@media (max-width: 1024px) {
  .featured-grid { grid-template-columns: 1fr; }
  .post-card--row { flex-direction: column-reverse; } /* Lật ảnh lên trên, chữ xuống dưới */
  .post-card--row .post-content, .post-card--row .post-media { width: 100%; }
  .post-card--row .post-media { height: 300px; }
  .main-grid { grid-template-columns: repeat(2, 1fr); }
  .page-hero { flex-direction: column; gap: 20px; }
  .page-title { font-size: 120px; }
  .page-desc { padding-top: 0; }
  .page-hero .hero__meta-left { flex-direction: row; width: 100%; padding-top: 0; gap: 10px;}
  .page-hero .hero__meta-left::before { display: none; }
  .page-hero .hero__meta-left .meta-label { writing-mode: horizontal-tb; transform: none; margin-bottom: 0; }
}

@media (max-width: 768px) {
  .main-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: 16px; }
  .filter-tabs { flex-wrap: wrap; gap: 16px; }
  .page-title { font-size: 80px; }
  .main-grid .post-card--dark .post-media, 
  .main-grid .post-card:not(.post-card--dark) .post-media { height: 240px; }
}
