/* =========================================================
   blog.css – CSS cho phần NỘI DUNG trang Blog
   (không gồm navigation / footer)

   Mọi class có tiền tố .bl- và mọi biến màu/font nằm trong .bl
   nên không ảnh hưởng tới các trang khác của website.
   Bộ lọc danh mục (All / Guides / Trends / ...) chạy bằng CSS
   thuần, không cần JavaScript.
   ========================================================= */

/* =========================================================
   1. TOKENS + RESET NHẸ
   ========================================================= */
.bl {
  --green:    #244336;
  --ink:      #141414;
  --muted:    #766d66;
  --line:     rgba(20, 20, 20, 0.12);
  --bg-page:  #f7f4f0;   /* nền khu vực bài viết */
  --bg-light: #faf7f4;   /* nền hero + nhãn danh mục + nút lọc */

  --font-ui:      "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bodoni Moda", "Playfair Display", "Didot", "Times New Roman", serif; /* Playfair bù glyph tiếng Việt */

  position: relative;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* specificity 0 để không đè các style bên dưới */
:where(.bl) *,
:where(.bl) *::before,
:where(.bl) *::after { box-sizing: border-box; }

:where(.bl) :is(h1, h2, h3, p, figure) { margin: 0; }
:where(.bl) a { color: inherit; text-decoration: none; }
:where(.bl) a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.bl-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 56px);
}

/* =========================================================
   2. HERO
   ========================================================= */
.bl-hero {
  padding: 48px 0 56px;
  text-align: center;
  background: var(--bg-light);
}
@media (min-width: 1024px) {
  .bl-hero { padding: 64px 0 72px; }
}

.bl-eyebrow {
  margin-bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3a3733;
}

.bl-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--ink);
}
.bl-title em {
  display: block;
  font-style: italic;
  text-transform: none;
}

.bl-lead {
  max-width: 580px;
  margin: 22px auto 0;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}

/* =========================================================
   3. TIÊU ĐỀ SECTION + NÚT
   ========================================================= */
.bl-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.2;                /* đủ chỗ cho dấu tiếng Việt viết hoa */
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
}
.bl-head__sub {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 300;
  text-align: center;
  color: var(--muted);
}

.bl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--green);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  transition: background-color .2s;
}
.bl-btn:hover { background: #1b3329; }
.bl-btn--sm {
  min-height: 28px;
  padding: 0 14px;
  font-size: 10.5px;
}

.bl-icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Ảnh thật: <figure class="bl-media"><img src="..." alt="..."></figure> */
.bl-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e9e9e8;           /* màu giữ chỗ */
}
.bl-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

/* Dòng thông tin: nhãn danh mục + ngày + số */
.bl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
}
.bl-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--bg-light);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3a3733;
}
.bl-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bl-meta .bl-icon { width: 14px; height: 14px; stroke-width: 1.6; }

/* =========================================================
   4. FEATURED POST
   ========================================================= */
.bl-featured { padding: 56px 0 40px; }
@media (min-width: 1024px) {
  .bl-featured { padding: 72px 0 56px; }
}

.bl-featured__grid {
  display: grid;
  gap: 28px;
  margin-top: 40px;
}
.bl-featured__media { order: -1; }   /* mobile: ảnh nằm trên chữ */

@media (min-width: 900px) {
  .bl-featured__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    margin-top: 48px;
  }
  .bl-featured__media { order: 0; }
}

.bl-featured .bl-meta { margin-bottom: 18px; }

.bl-featured__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--ink);
}
.bl-featured__title a:hover { color: var(--green); }

.bl-featured__excerpt {
  max-width: 30em;
  margin: 20px 0 24px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted);
}

.bl-featured__media:hover img { transform: scale(1.03); }

/* =========================================================
   5. THANH LỌC DANH MỤC (radio ẩn + label dạng nút)
   ========================================================= */
/* Radio ẩn khỏi mắt nhưng vẫn focus được bằng bàn phím */
.bl-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.bl-filterbar {
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--line);
}
.bl-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.bl-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #e4dfd8;
  border-radius: 8px;
  background: var(--bg-light);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6d645c;
  cursor: pointer;
  user-select: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.bl-chip:hover { border-color: var(--green); color: var(--green); }

/* Danh mục đang chọn */
#bl-f-all:checked       ~ .bl-filterbar label[for="bl-f-all"],
#bl-f-guides:checked    ~ .bl-filterbar label[for="bl-f-guides"],
#bl-f-trends:checked    ~ .bl-filterbar label[for="bl-f-trends"],
#bl-f-locations:checked ~ .bl-filterbar label[for="bl-f-locations"],
#bl-f-tips:checked      ~ .bl-filterbar label[for="bl-f-tips"],
#bl-f-planning:checked  ~ .bl-filterbar label[for="bl-f-planning"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Viền focus khi dùng bàn phím (phím mũi tên đổi giữa các nút) */
#bl-f-all:focus-visible       ~ .bl-filterbar label[for="bl-f-all"],
#bl-f-guides:focus-visible    ~ .bl-filterbar label[for="bl-f-guides"],
#bl-f-trends:focus-visible    ~ .bl-filterbar label[for="bl-f-trends"],
#bl-f-locations:focus-visible ~ .bl-filterbar label[for="bl-f-locations"],
#bl-f-tips:focus-visible      ~ .bl-filterbar label[for="bl-f-tips"],
#bl-f-planning:focus-visible  ~ .bl-filterbar label[for="bl-f-planning"] {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Ẩn bài viết không thuộc danh mục đang chọn (khớp với data-cat trong HTML) */
#bl-f-guides:checked    ~ .bl-latest .bl-post:not([data-cat="guides"]),
#bl-f-trends:checked    ~ .bl-latest .bl-post:not([data-cat="trends"]),
#bl-f-locations:checked ~ .bl-latest .bl-post:not([data-cat="locations"]),
#bl-f-tips:checked      ~ .bl-latest .bl-post:not([data-cat="tips"]),
#bl-f-planning:checked  ~ .bl-latest .bl-post:not([data-cat="planning"]) {
  display: none;
}

/* Thông báo khi danh mục chưa có bài (tự nhận biết, không cần sửa CSS khi thêm bài) */
.bl-empty {
  display: none;
  padding: 24px 0;
  font-size: 14px;
  font-weight: 300;
  text-align: center;
  color: var(--muted);
}
#bl-f-guides:checked    ~ .bl-latest:not(:has([data-cat="guides"]))    .bl-empty,
#bl-f-trends:checked    ~ .bl-latest:not(:has([data-cat="trends"]))    .bl-empty,
#bl-f-locations:checked ~ .bl-latest:not(:has([data-cat="locations"])) .bl-empty,
#bl-f-tips:checked      ~ .bl-latest:not(:has([data-cat="tips"]))      .bl-empty,
#bl-f-planning:checked  ~ .bl-latest:not(:has([data-cat="planning"]))  .bl-empty {
  display: block;
}

/* =========================================================
   6. LATEST POSTS
   ========================================================= */
.bl-latest {
  padding: 48px 0 72px;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 1024px) {
  .bl-latest { padding: 64px 0 96px; }
}

.bl-grid {
  display: grid;
  gap: 40px 16px;
  margin-top: 40px;
}
@media (min-width: 640px) {
  .bl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .bl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.bl-post { display: flex; flex-direction: column; align-items: flex-start; }
.bl-post .bl-media { width: 100%; }
.bl-post__media-link { display: block; width: 100%; overflow: hidden; }
.bl-post__media-link:hover img { transform: scale(1.04); }

.bl-post .bl-meta { margin-top: 16px; }

.bl-post__title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--ink);
}
.bl-post__title a:hover { color: var(--green); }

.bl-post__excerpt {
  margin: 14px 0 18px;
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--muted);
}

.bl-post .bl-btn { margin-top: auto; }

/* =========================================================
   7. GIẢM CHUYỂN ĐỘNG
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .bl-media img,
  .bl-chip,
  .bl-btn { transition: none; }
}