/* ========= Base ========= */
:root{
  --container: min(1200px, calc(100% - 64px));
  --muted: #6b6b6b;
  --border: #e2e2e2;
  --accent: #ff6b2d;
  --accent-dark: #d8501d;
  --bg-soft: #f7f5f2;
  --card: #ffffff;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
  color:#1f1f1f;
  line-height:1.8;
  background:var(--bg-soft);
}
img{max-width:100%;height:auto;display:block}

/* ========= Layout ========= */
.container{max-width:var(--container);width:100%;margin:0 auto}
.container-wide{max-width:1240px;width:100%;margin:0 auto}
.site-header{padding:28px 0;border-bottom:1px solid rgba(0,0,0,.06);background:#fff}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:24px}
.logo a{font-family:'Poppins',system-ui,sans-serif;font-weight:800;font-size:28px;letter-spacing:-0.02em;color:#000;text-decoration:none}
.primary-nav .menu{list-style:none;display:flex;gap:24px;margin:0;padding:0}
.primary-nav a{font-size:14px;color:#666;text-decoration:none}
.primary-nav a:hover{color:#000}
.site-main{padding:0 0 60px;display:block;width:100%}
.site-footer{padding:28px 0;color:#777;font-size:12px;border-top:1px solid var(--border);background:#fff;margin-top:40px}
.site-footer a{color:inherit}

/* ========= Single ========= */
body.single .post-title{
  font-family:'Poppins',system-ui,sans-serif; font-weight:600;
  font-size:36px; line-height:1.2; margin:8px 0 18px;
}
.featured-image{margin:14px 0 22px}
body.single .entry-content{font-size:18px;line-height:1.8}
body.single .entry-content p{margin:0 0 18px}
body.single .entry-content h2, body.single .entry-content h3{
  font-family:'Poppins',system-ui,sans-serif;margin:24px 0 12px
}
.post-footer{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--border);padding-top:12px;margin-top:18px}
.post-tags a{font-size:12px;color:var(--muted);margin-right:8px}

/* Single max-width 820px (text zone only) */
body.single .post-title,
body.single .entry-content,
body.single .post-footer,
body.single .comments-area{
  max-width:820px;margin-left:auto;margin-right:auto
}

/* ========= Related Posts (desktop base) ========= */
.related-posts{margin-top:28px}
.related-posts h3{font-family:'Poppins',system-ui,sans-serif;margin-bottom:10px}
.related-grid{display:grid;gap:16px;grid-template-columns:repeat(3,1fr)}
.related-card{display:flex;flex-direction:column}
.related-card .thumb{margin-bottom:10px;border-radius:12px;overflow:hidden}
.related-card .thumb img{width:100%;height:100%;object-fit:cover}
.related-card .title a{
  font-family:'Poppins',system-ui,sans-serif;font-weight:600;font-size:15px;line-height:1.4;color:#000;text-decoration:none;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  word-break:break-word;hyphens:auto
}
.related-card .title a:hover{color:#333}
.related-card .excerpt{font-size:13px;color:#555;margin:6px 0 10px;line-height:1.6}
.related-card .read{font-size:12px;color:#888;text-decoration:none}
.related-card .read:hover{text-decoration:underline}

/* ========= Listing (Home + Category/Archive) ========= */
body.home .site-main.container,
body.blog .site-main.container,
body.archive .site-main.container{
  width:100%;
  max-width:none;
  padding-left:0;
  padding-right:0;
}

body.home .listing,
body.blog .listing,
body.archive .listing{max-width:1152px;margin-left:auto;margin-right:auto;padding:12px 0 36px}

/* ========= Homepage V2 ========= */
.homepage-v2{padding:48px 0 24px}
.hero-grid{
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:32px;
  align-items:start;
}
.hero-card{
  background:#000;
  border-radius:28px;
  overflow:hidden;
  position:relative;
  min-height:520px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}
.hero-card::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,rgba(2,6,23,0) 0%,rgba(2,6,23,.78) 100%);
  z-index:1;
}
.hero-card .hero-thumb{
  position:absolute;
  inset:0;
  z-index:0;
  display:block;
}
.hero-card .hero-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.hero-card .hero-content{
  position:relative;
  z-index:2;
  padding:36px;
  color:#fff;
  backdrop-filter:blur(0.5px);
}
.hero-title{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:44px;
  line-height:1.15;
  margin:12px 0;
}
.hero-title a{color:#fff;text-decoration:none}
.hero-title a:hover{opacity:.9}
.hero-excerpt{font-size:18px;line-height:1.7;margin:0 0 18px;max-width:640px}
.hero-meta{display:flex;align-items:center;justify-content:space-between;font-size:14px}
.read-more{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 18px;
  border-radius:999px;
  background:#fff;
  color:#111;
  text-decoration:none;
  font-weight:600;
}
.read-more::after{
  content:'→';
  font-size:16px;
}
.hero-secondary{
  background:#fff;
  border-radius:24px;
  padding:28px;
  box-shadow:0 24px 60px rgba(15,23,42,.08);
}
.section-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:20px;
}
.section-heading h2{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:24px;
  margin:0;
}
.section-heading a{
  font-size:14px;
  color:var(--accent);
  text-decoration:none;
  font-weight:600;
}
.spotlight-list{display:flex;flex-direction:column;gap:12px}
.spotlight-card{
  border:1px solid #f0f0f0;
  border-radius:18px;
  padding:18px;
  transition:transform .2s ease, box-shadow .2s ease;
  background:#fff;
}
.spotlight-card a{text-decoration:none;color:inherit;display:block}
.spotlight-card h3{
  font-family:'Poppins',system-ui,sans-serif;
  font-size:20px;
  margin:8px 0;
  color:#0f172a;
}
.spotlight-card p{margin:0 0 10px;color:#4b5563;font-size:14px;line-height:1.6}
.spotlight-card time{font-size:12px;color:#94a3b8}
.spotlight-card:hover{
  transform:translateY(-4px);
  box-shadow:0 14px 30px rgba(15,23,42,.08);
}
.category-pills{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:36px 0 12px;
}
.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 16px;
  border-radius:999px;
  font-size:12px;
  letter-spacing:0.04em;
  text-transform:uppercase;
  font-weight:600;
  gap:6px;
}
.pill a{color:inherit;text-decoration:none;font-size:inherit}
.pill-primary{background:var(--accent);color:#fff}
.pill-muted{background:rgba(15,23,42,.08);color:#111}
.pill-outline{
  border:1px solid rgba(15,23,42,.12);
  color:#111;
  background:#fff;
  text-decoration:none;
}
.topic-section{
  margin:48px 0;
  padding:32px;
  background:#fff;
  border-radius:32px;
  box-shadow:0 20px 60px rgba(15,23,42,.06);
}
.eyebrow{
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:0.12em;
  color:var(--accent);
  margin:0;
}
.topic-grid{
  margin-top:24px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:24px;
}
.topic-card{
  background:#fff;
  border-radius:24px;
  border:1px solid #f1f1f1;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:0 16px 40px rgba(15,23,42,.05);
}
.topic-thumb{
  display:block;
  aspect-ratio:16/10;
  overflow:hidden;
}
.topic-thumb img{width:100%;height:100%;object-fit:cover}
.topic-body{
  padding:22px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.topic-body h3{
  margin:0;
  font-family:'Poppins',system-ui,sans-serif;
  font-size:22px;
}
.topic-body h3 a{color:#111;text-decoration:none}
.topic-body h3 a:hover{color:var(--accent)}
.topic-body p{margin:0;color:#4b5563;font-size:15px;line-height:1.6}
.meta-date{font-size:13px;color:#94a3b8}
.link-more{
  font-size:14px;
  font-weight:600;
  color:#111;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.link-more::after{content:'↗';font-size:16px}
.editorial-section{
  margin:48px 0;
  padding:32px 0 0;
}
.editorial-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
}
.editorial-card{
  background:#fff;
  border-radius:22px;
  overflow:hidden;
  border:1px solid #f3f3f3;
  display:flex;
  flex-direction:column;
  min-height:100%;
}
.editorial-thumb{
  display:block;
  aspect-ratio:4/3;
  overflow:hidden;
}
.editorial-thumb img{width:100%;height:100%;object-fit:cover}
.editorial-body{
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.editorial-body h3{
  margin:0;
  font-size:18px;
  font-family:'Poppins',system-ui,sans-serif;
}
.editorial-body h3 a{color:#0f172a;text-decoration:none}
.editorial-body p{margin:0;color:#4b5563;font-size:14px;line-height:1.6}
.latest-section{
  margin:32px 0 0;
  padding:32px;
  background:#fff;
  border-radius:32px;
  box-shadow:0 16px 40px rgba(15,23,42,.05);
}
.latest-list{
  display:flex;
  flex-direction:column;
  gap:20px;
  margin-top:16px;
}
.latest-card{
  display:flex;
  gap:22px;
  padding:16px 0;
  border-bottom:1px solid #f1f1f1;
}
.latest-card:last-child{border-bottom:none;padding-bottom:0}
.latest-thumb{
  flex:0 0 180px;
  border-radius:18px;
  overflow:hidden;
  display:block;
}
.latest-thumb img{width:100%;height:100%;object-fit:cover}
.latest-body h3{
  margin:6px 0;
  font-size:22px;
  font-family:'Poppins',system-ui,sans-serif;
}
.latest-body h3 a{text-decoration:none;color:#111}
.latest-body p{margin:0;color:#4b5563;font-size:15px}
.no-posts{color:#777;font-style:italic}

/* Header của Category đồng bộ chiều rộng */
body.archive .archive-header{max-width:1152px;margin:0 auto 16px}
body.archive .archive-title{
  font-family:'Poppins',system-ui,sans-serif;font-weight:800;font-size:28px;line-height:1.2;
  margin:8px 0;word-break:break-word;hyphens:auto
}
.archive-description{color:#666;font-size:14px}

/* Grid 2 cột desktop */
body.home .posts-grid,
body.blog .posts-grid,
body.archive .posts-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:48px 60px;max-width:1152px;margin-left:auto;margin-right:auto
}

/* Card */
.grid-card{display:flex;flex-direction:column;margin-bottom:20px;padding-bottom:10px}
.grid-card .thumb{
  position:relative;aspect-ratio:16/9;border-radius:12px;overflow:hidden;display:block;background:#f4f4f4;margin:0 0 12px
}
.grid-card .thumb img{width:100%;height:100%;object-fit:cover;transition:transform .35s ease}
.grid-card:hover .thumb img{transform:scale(1.03)}
.grid-title{margin:6px 0}
.grid-title a{
  font-family:'Poppins',system-ui,sans-serif;font-weight:600;
  font-size:24px;line-height:1.35;color:#0b0b0b;text-decoration:none;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden
}
.grid-title a:hover{text-decoration:underline}
.grid-meta{color:#7a7a7a;font-size:14px;font-style:italic;margin:0 0 10px}
.grid-excerpt{
  font-size:15px;line-height:1.7;color:#444;margin:0 0 10px;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
  min-height:calc(1.7em * 3);max-height:calc(1.7em * 3)
}
.grid-tags a{color:#8a8a8a;font-size:12px;text-decoration:none;margin-right:8px}
.grid-tags a::before{content:'#'}

/* Pagination */
.pagination{display:flex;justify-content:center;margin-top:28px}
.pagination .nav-links{display:flex;gap:8px;align-items:center}
.pagination a,.pagination span{
  padding:6px 10px;border:1px solid var(--border);border-radius:6px;font-size:13px;color:#333;text-decoration:none
}
.pagination .current{background:#111;color:#fff;border-color:#111}

/* ========= Embeds ========= */
.entry-content iframe[src*="youtube.com"],
.entry-content iframe[src*="youtu.be"],
.entry-content iframe[src*="vimeo.com"]{width:100%!important;height:auto!important;aspect-ratio:16/9;display:block}

/* ========= Mobile styles ========= */
@media (max-width:1024px){
  .hero-grid{grid-template-columns:1fr;gap:24px}
  .hero-card{min-height:420px}
  .topic-grid{grid-template-columns:repeat(2,1fr)}
  .editorial-grid{grid-template-columns:repeat(2,1fr)}
  .latest-card{flex-direction:column}
  .latest-thumb{width:100%;flex:none}
  /* Grid 1 cột */
  body.home .posts-grid,
  body.blog .posts-grid,
  body.archive .posts-grid{grid-template-columns:1fr !important;gap:28px !important;max-width:100%!important}

  /* Card spacing */
  .grid-card{margin-bottom:12px;padding-bottom:8px}

  /* Thumb */
  .grid-card .thumb{border-radius:12px;margin-bottom:10px}

  /* Title/Meta/Excerpt nhỏ lại */
  .grid-title a{font-size:22px !important}
  .grid-meta{font-size:13px !important;margin-bottom:8px}
  .grid-excerpt{
    font-size:15px !important;line-height:1.7;color:#444;
    -webkit-line-clamp:2;min-height:calc(1.7em * 2);max-height:calc(1.7em * 2);margin-bottom:8px
  }

  /* Related -> card đơn */
  .related-grid{grid-template-columns:1fr !important;gap:16px !important}
  .related-card{
    background:#fff;border:1px solid var(--border);border-radius:14px;padding:14px;
    box-shadow:0 2px 8px rgba(0,0,0,.04)
  }
}
@media (max-width:640px){
  .header-inner{gap:12px}
  .primary-nav .menu{gap:14px}
  body.single .post-title{font-size:30px}
  .homepage-v2{padding:32px 0 12px}
  .hero-card{min-height:360px;border-radius:22px}
  .hero-card .hero-content{padding:24px}
  .hero-title{font-size:30px}
  .hero-excerpt{font-size:16px}
  .topic-section{padding:24px;border-radius:24px}
  .topic-grid{grid-template-columns:1fr}
  .editorial-grid{grid-template-columns:1fr}
  .latest-section{padding:24px}
  .latest-card{padding:12px 0}
  .category-pills{gap:8px}
}

/* Khung thumbnail luôn có tỉ lệ 16:9 và nền xám */
.posts-grid .grid-card .thumb{
  display:block;
  aspect-ratio:16/9;
  background:#eee;          /* nền xám */
  border-radius:12px;
  overflow:hidden;
}

/* Ảnh thật thì fill toàn khung */
.posts-grid .grid-card .thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Ẩn ảnh placeholder (không hiện gì, chỉ còn nền xám) */
.posts-grid .grid-card .thumb img[alt="no image"],
.posts-grid .grid-card .thumb img[src*="/assets/img/placeholder"],
.posts-grid .grid-card .thumb img[src$="placeholder.png"]{
  display:none !important;
}

/* Fallback cho trình duyệt cũ chưa hỗ trợ aspect-ratio */
@supports not (aspect-ratio: 1){
  .posts-grid .grid-card .thumb::before{
    content:"";
    display:block;
    padding-top:56.25%; /* 16:9 */
  }
}
/* Ảnh trong nội dung bài luôn căn giữa */
.entry-content img,
.entry-content a > img {
  display: block;
  margin: 16px auto;          /* căn giữa */
}

/* --- MOBILE HAMBURGER --- */
@media (max-width: 991px) {

  /* Để dropdown định vị theo header */
  .site-header .header-inner { position: relative; }

  /* Nút hamburger */
  .hamburger{
    display:inline-block;
    width:36px; height:26px;
    margin-left:auto;            /* đẩy nút sang phải */
    position:relative; cursor:pointer;
  }
  /* 3 gạch (dùng 2 pseudo + 1 bóng để làm gạch giữa) */
  .hamburger::before,
  .hamburger::after{
    content:"";
    position:absolute; left:0; right:0;
    height:2px; background:#111; border-radius:2px;
  }
  .hamburger::before{ top:4px; box-shadow:0 9px 0 #111; } /* gạch trên + giữa */
  .hamburger::after{ bottom:4px; }                         /* gạch dưới */

  /* Ẩn menu mặc định, dùng dạng dropdown */
  .primary-nav{
    position:absolute; top:100%; left:0; right:0;
    background:#fff; border-radius:12px;
    box-shadow:0 10px 24px rgba(0,0,0,.08);
    padding:10px; z-index:999;
    max-height:0; overflow:hidden; opacity:0;
    transition:max-height .25s ease, opacity .2s ease;
  }

  /* Dọc lại các item */
  .primary-nav .menu{
    display:flex; flex-direction:column; gap:8px;
    margin:0; padding:0; list-style:none;
  }
  .primary-nav .menu a{ display:block; padding:10px 8px; }

  /* Khi tick checkbox -> mở menu */
  .nav-toggle:checked ~ .primary-nav{
    max-height:70vh; opacity:1;
  }
}

/* Desktop giữ nguyên menu ngang, ẩn hamburger */
@media (min-width: 992px){
  .nav-toggle, .hamburger{ display:none !important; }
  .primary-nav{ position:static; max-height:none; opacity:1; overflow:visible; box-shadow:none; padding:0; }
  .primary-nav .menu{ display:flex; flex-direction:row; gap:24px; }
}

/* ========= Page ========= */
.page {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

.page .entry-title {
    font-family: 'Poppins', system-ui, sans-serif;
    font-weight: 600;
    font-size: 36px;
    line-height: 1.2;
    margin: 8px 0 18px;
    color: #000;
}

.page .entry-content {
    font-size: 18px;
    line-height: 1.8;
    color: #222;
}

.page .entry-content p {
    margin: 0 0 18px;
}

.page .entry-content h2,
.page .entry-content h3,
.page .entry-content h4 {
    font-family: 'Poppins', system-ui, sans-serif;
    font-weight: 600;
    margin: 24px 0 12px;
    color: #000;
}

.page .entry-content h2 {
    font-size: 28px;
}

.page .entry-content h3 {
    font-size: 24px;
}

.page .entry-content h4 {
    font-size: 20px;
}

/* Page responsive */
@media (max-width: 768px) {
    .page {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .page .entry-title {
        font-size: 28px;
        margin: 4px 0 16px;
    }
    
    .page .entry-content {
        font-size: 16px;
        line-height: 1.7;
    }
    
    .page .entry-content p {
        margin: 0 0 16px;
    }
    
    .page .entry-content h2 {
        font-size: 24px;
        margin: 20px 0 10px;
    }
    
    .page .entry-content h3 {
        font-size: 20px;
        margin: 18px 0 10px;
    }
    
    .page .entry-content h4 {
        font-size: 18px;
        margin: 16px 0 8px;
    }
}

@media (max-width: 640px) {
    .page {
        padding: 0 12px;
    }
    
    .page .entry-title {
        font-size: 24px;
        margin: 4px 0 14px;
        line-height: 1.3;
    }
    
    .page .entry-content {
        font-size: 15px;
        line-height: 1.7;
    }
    
    .page .entry-content p {
        margin: 0 0 14px;
    }
    
    .page .entry-content h2 {
        font-size: 22px;
        margin: 18px 0 10px;
    }
    
    .page .entry-content h3 {
        font-size: 19px;
        margin: 16px 0 8px;
    }
    
    .page .entry-content h4 {
        font-size: 17px;
        margin: 14px 0 8px;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 0 10px;
    }
    
    .page .entry-title {
        font-size: 22px;
        margin: 4px 0 12px;
    }
    
    .page .entry-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .page .entry-content p {
        margin: 0 0 12px;
    }
    
    .page .entry-content h2 {
        font-size: 20px;
        margin: 16px 0 8px;
    }
    
    .page .entry-content h3 {
        font-size: 18px;
        margin: 14px 0 8px;
    }
    
    .page .entry-content h4 {
        font-size: 16px;
        margin: 12px 0 6px;
    }

    .spotlight-card{padding:14px}
    .hero-meta{flex-direction:column;align-items:flex-start;gap:10px}
    .read-more{width:100%;justify-content:center}
}