/* --- CSS SYSTEM --- */
:root { 
  --primary: #0284C7; --primary-hover: #0369A1; --secondary: #38BDF8; 
  --bg-body: #F8FAFC; --bg-card: #FFFFFF; --text-head: #0F172A; --text-body: #475569; 
  --border: #E2E8F0; --radius: 20px; 
  --font-head: 'Plus Jakarta Sans', sans-serif; --font-body: 'Inter', sans-serif; 
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
* { box-sizing: border-box; }

body { 
  margin: 0; background-color: var(--bg-body); font-family: var(--font-body); color: var(--text-body); line-height: 1.6;
  display: flex; flex-direction: column; min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--text-head); margin-top: 0; font-weight: 700; letter-spacing: -0.02em; }
a { text-decoration: none; transition: 0.3s ease; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* HEADER */
header.site-header { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; padding: 18px 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-head); font-weight: 800; font-size: 26px; color: var(--primary); letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 36px; font-weight: 600; align-items: center; }
.nav-links a { color: var(--text-head); font-size: 15px; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

/* DROPDOWN */
.dropdown { position: relative; display: inline-block; }
.dropbtn { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.dropdown-content { display: none; position: absolute; background-color: white; min-width: 240px; box-shadow: var(--shadow-lg); border-radius: 16px; padding: 8px; z-index: 1001; top: 140%; left: -20px; border: 1px solid var(--border); }
.dropdown-content::before { content: ""; position: absolute; top: -20px; left: 0; width: 100%; height: 20px; background: transparent; }
.dropdown-content a { color: var(--text-body); padding: 12px 16px; display: block; font-size: 14px; border-radius: 10px; font-weight: 500; margin-bottom: 2px; }
.dropdown-content a:hover { background-color: #F0F9FF; color: var(--primary); transform: translateX(4px); }
.dropdown:hover .dropdown-content { display: block; }

/* HERO */
.hero { text-align: center; padding: 60px 0; background: linear-gradient(180deg, #EFF6FF 0%, var(--bg-body) 100%); }
.hero h1 { font-size: 42px; margin-bottom: 16px; color: #1E293B; }
.search-wrapper { max-width: 500px; margin: 0 auto; position: relative; }
.search-input { width: 100%; padding: 14px 20px 14px 46px; border-radius: 50px; border: 1px solid #CBD5E1; outline: none; transition: 0.3s; }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15); }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #94A3B8; font-size: 18px; }

/* LAYOUT CHUNG */
.main-layout { display: grid; grid-template-columns: 3fr 1fr; gap: 40px; padding: 60px 0 100px; flex: 1; }

/* CARDS (Trang chủ) - SỬA LỖI ẢNH VỠ */
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); display: flex; flex-direction: column; transition: 0.3s; height: 100%; }
.card:hover { transform: translateY(-5px); box-shadow: 0 15px 20px -5px rgba(0,0,0,0.1); }
/* Quan trọng: Quy định chiều cao ảnh cố định để không bị méo */
.card-thumb { width: 100%; height: 240px; object-fit: cover; } 
.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 18px; margin-bottom: 10px; font-family: var(--font-head); line-height: 1.4; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 700; text-transform: uppercase; background: #E0F2FE; color: #0369A1; margin-bottom: 12px; width: fit-content; }
.excerpt { font-size: 14px; color: var(--text-body); margin-bottom: 16px; flex-grow: 1; }

/* SIDEBAR */
.sidebar-widget { background: white; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,0.02); position: sticky; top: 100px; }
.widget-title { font-size: 18px; margin-bottom: 20px; border-bottom: 2px solid #F1F5F9; padding-bottom: 12px; }
.cat-list li { margin-bottom: 12px; }
.cat-list a { display: flex; justify-content: space-between; font-weight: 500; font-size: 14px; color: var(--text-body); }
.cat-list a:hover { color: var(--primary); transform: translateX(5px); }
.cat-list span { background: #F1F5F9; padding: 2px 8px; border-radius: 20px; font-size: 11px; color: #64748B; font-weight: 700; }

/* === STYLE CHO CHI TIẾT BÀI VIẾT (SỬA LỖI GIAO DIỆN XẤU) === */
/* Căn đều văn bản trong bài viết */
.article-content p {
  text-align: justify;
  margin-bottom: 24px;
}
.article-header { text-align: center; margin-bottom: 40px; }
.article-header h1 { font-size: 36px; line-height: 1.3; margin-top: 10px; color: var(--text-head); }
.meta { font-size: 13px; color: #64748B; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

/* Ảnh bìa bài viết: Giới hạn chiều cao để không chiếm hết màn hình */
.featured-image { width: 100%; height: 400px; object-fit: cover; border-radius: var(--radius); margin-bottom: 40px; box-shadow: var(--shadow-lg); }

/* Nội dung bài viết: Căn chỉnh chữ, khoảng cách */
.article-content { font-size: 18px; line-height: 1.8; color: #334155; }
.article-content h2 { font-size: 24px; margin-top: 40px; margin-bottom: 16px; color: var(--text-head); }
.article-content h3 { font-size: 20px; margin-top: 30px; margin-bottom: 12px; color: var(--text-head); }
.article-content p { margin-bottom: 24px; }
.article-content img.content-image { width: 100%; height: auto; border-radius: 12px; margin: 30px 0; }

/* Box ghi chú trong bài viết */
.clinical-box { background: #E0F2FE; border-left: 4px solid var(--primary); padding: 24px; border-radius: 8px; margin: 30px 0; }
.warning-box { background: #FEF2F2; border-left: 4px solid #EF4444; padding: 24px; border-radius: 8px; margin: 30px 0; }

/* FOOTER */
footer { background: #0F172A; padding: 60px 0; text-align: center; color: #94A3B8; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; text-align: left; }
.footer-col h4 { color: white; margin-bottom: 20px; font-size: 16px; }
.footer-col a:hover { color: white; }

@media (max-width: 900px) { 
  .main-layout { grid-template-columns: 1fr; } 
  .cards-grid { grid-template-columns: 1fr; }
  .sidebar-widget { margin-top: 40px; }
  .featured-image { height: 250px; }
  .article-header h1 { font-size: 28px; }
}
/* --- STYLE CHO TRANG POST (MỚI) --- */

/* Breadcrumbs */
.breadcrumbs { font-size: 13px; color: #64748B; margin-bottom: 15px; font-weight: 500; }
.breadcrumbs a { color: #64748B; text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }

/* Hàng thông tin tác giả */
.post-meta-row { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.author-avatar { width: 40px; height: 40px; border-radius: 50%; background-color: #eee; } /* Bạn có thể thay bằng thẻ img thật */
.meta-info { font-size: 14px; color: #475569; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.author-name { color: #0F172A; font-weight: 700; }
.meta-divider { color: #CBD5E1; }

/* Chỉnh lại ảnh bìa cho đẹp hơn */
.featured-image { 
  width: 100%; 
  height: auto; /* Để ảnh hiển thị tự nhiên */
  max-height: 500px; 
  object-fit: cover; 
  border-radius: 24px; /* Bo tròn mạnh như ảnh mẫu */
  margin-bottom: 40px;
}

/* Chỉnh lại nội dung bài viết */
.article-content { font-size: 18px; line-height: 1.8; color: #334155; }
.article-content h2 { margin-top: 40px; font-size: 26px; color: #0F172A; }
