/* ==========================================================================
   VUI KHỎE 247 — vk-magazine.css
   Lớp style bố cục tạp chí: 1 hero lớn (bài đầu) + lưới 3 cột card.
   Tự viết bằng CSS Grid — KHÔNG phụ thuộc row/col của bootstrap.
   Nạp SAU vuikhoe247.css để ghi đè có chủ đích.
   ========================================================================== */

/* ------------------------------------------------------- khung 2 cột ---- */
.vk-layout { display: block; }
.vk-layout--aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: start;
}
.vk-layout--aside > .vk-sidebar { position: sticky; top: 18px; }

/* --------------------------------------------- tiêu đề khu vực trang chủ ---- */
.vk-mag-section > .vk-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.vk-mag-section > .vk-section-head .vk-section-title { margin: 0; }
.vk-section-note {
  font-size: 13px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--vk-muted);
}

/* trang chủ: bỏ lưới 2 cột mặc định của .view-content, dùng .vk-mag ---- */
body.path-frontpage .vk-content-col .view-content {
  display: block !important;
  gap: 0;
}
body.path-frontpage .view-empty { padding: 26px 0; color: var(--vk-muted); }

/* Ẩn hoàn toàn form exposed (Items per page / Apply) trên trang chủ ---- */
body.path-frontpage .views-exposed-form,
body.path-frontpage .views-exposed-form.views-exposed-form { display: none !important; }

/* ------------------------------------------------- bố cục tạp chí gốc ---- */
.vk-mag { display: block; }

/* --- HERO: bài đầu tiên ------------------------------------------------ */
.vk-hero-feature { margin-bottom: 34px; }
.vk-hero-feature .vk-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--vk-shadow-lg);
  border-color: var(--vk-line);
}
.vk-hero-feature .vk-card-image { height: 100%; }
.vk-hero-feature .vk-card-image img {
  height: 100%; aspect-ratio: 4 / 3; object-fit: cover;
}
.vk-hero-feature .vk-card-body {
  padding: 34px 34px 30px;
  gap: 14px;
  justify-content: center;
}
.vk-hero-feature .vk-card-body .vk-badge {
  align-self: flex-start;
  font-size: 12px; padding: 7px 15px; letter-spacing: .8px;
}
.vk-hero-feature .vk-card-title {
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.22;
  letter-spacing: -.3px;
  margin: 0;
}
.vk-hero-feature .vk-card-summary {
  font-size: 16.5px;
  line-height: 1.66;
  color: var(--vk-ink-soft);
}
.vk-hero-feature .vk-card-summary p { margin: 0; }
.vk-hero-feature .vk-card-meta { margin-top: 4px; }

/* --- LƯỚI 3 CỘT ------------------------------------------------------- */
.vk-mag-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  align-items: stretch;
}
.vk-mag-grid > .vk-card { margin-bottom: 0; height: 100%; }
.vk-mag-grid .vk-card-body { padding: 16px 18px 18px; gap: 9px; }
.vk-mag-grid .vk-card-title { font-size: 17.5px; line-height: 1.38; }
.vk-mag-grid .vk-card-summary {
  font-size: 14.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vk-mag-grid .vk-card-image img { aspect-ratio: 16 / 10; }
.vk-mag-grid .vk-readmore { font-size: 13.5px; }

/* --- hero responsive --------------------------------------------------- */
@media (max-width: 991px) {
  .vk-mag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vk-hero-feature .vk-card { grid-template-columns: 1fr; }
  .vk-hero-feature .vk-card-image img { aspect-ratio: 16 / 10; height: auto; }
  .vk-hero-feature .vk-card-body { padding: 24px 22px 24px; }
  .vk-layout--aside { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .vk-layout--aside > .vk-sidebar { position: static; }
}
@media (max-width: 600px) {
  .vk-mag-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .vk-hero-feature { margin-bottom: 26px; }
  .vk-hero-feature .vk-card-title { font-size: 22px; }
  .vk-hero-feature .vk-card-summary { font-size: 15.5px; }
}

/* --------------------------------------------- topbar: ô tìm kiếm gọn ---- */
.vk-topbar-right { min-width: 0; }
.vk-topbar .vk-search-form { width: 240px; max-width: 46vw; }
.vk-topbar .vk-search-form input[type="search"],
.vk-topbar .vk-search-form input[type="text"] {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
  padding: 7px 42px 7px 16px;
  font-size: 13.5px;
}
.vk-topbar .vk-search-form input::placeholder { color: rgba(255, 255, 255, .72); }
.vk-topbar .vk-search-form input:focus { background: #fff; color: var(--vk-ink); }
.vk-topbar .vk-search-form .form-submit,
.vk-topbar .vk-search-form button { width: 30px; height: 30px; }

/* ---------------------------------------------------- logo nền trắng ---- */
.vk-branding .vk-logo {
  max-height: 54px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 6px;
}

/* ------------------------------------------------------- pager gọn ---- */
body.path-frontpage .pager { margin-top: 34px; }

/* -------------------------------------- hero băng giới thiệu trang chủ ---- */
.vk-hero--front { padding: 38px 0 42px; }
.vk-hero--front .vk-hero-inner { max-width: 820px; }
.vk-hero--front .vk-hero-title { margin-bottom: 12px; }
.vk-hero--front + .vk-crumbbar { display: none; }

body.path-frontpage .vk-main { padding-top: 34px; }

/* 4) Desktop: card chuyên mục dạng NGANG — ảnh trái, text dồn vào chỗ trống bên phải */
@media (min-width: 992px) {
  body.path-taxonomy .vk-content-col .view-content {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px;
  }
  body.path-taxonomy .vk-content-col .vk-card {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: stretch;
    margin-bottom: 0;
    height: auto;
  }
  body.path-taxonomy .vk-card-image { height: 100%; }
  body.path-taxonomy .vk-card-image .vk-figure,
  body.path-taxonomy .vk-card-image .vk-figure__item,
  body.path-taxonomy .vk-card-image .vk-figure__item > a {
    display: block; height: 100%; margin: 0;
  }
  body.path-taxonomy .vk-card-image img {
    width: 100%; height: 100%; aspect-ratio: auto;
    object-fit: cover; object-position: center;
  }
  body.path-taxonomy .vk-card-body {
    padding: 16px 22px 16px 20px;
    gap: 8px;
    justify-content: center;
  }
  body.path-taxonomy .vk-card-title { font-size: 19px; line-height: 1.36; }
  body.path-taxonomy .vk-card-summary { font-size: 14.5px; line-height: 1.58; -webkit-line-clamp: 3; }
  body.path-taxonomy .vk-card-meta { margin-top: 0; padding-top: 9px; }
}

/* ================= 6) LÀM LẠI (25/10 c): grid chuẩn, KHÔNG absolute, selector đúng markup thật ================= */

/* 6.1 Reset mọi rule absolute cũ có thể làm ảnh không paint */
body.path-taxonomy .vk-card-image,
body.path-taxonomy .vk-card-image * ,
.vk-mag-grid .vk-card-image * ,
.vk-hero-feature .vk-card-image * {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* 6.2 GAP: markup thật là .views-element-container > div.js-view-dom-id-* > .views-row */
body.path-taxonomy .views-element-container > div {
  display: flex !important;
  flex-direction: column;
  gap: 18px !important;
}
body.path-taxonomy .views-row {
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}
body.path-taxonomy .views-row > .vk-card { margin: 0 !important; }

/* 6.3 Card NGANG desktop: grid 300px + text, ảnh phủ kín cột bằng grid stretch */
@media (min-width: 992px) {
  body.path-taxonomy .views-row > .vk-card {
    display: grid !important;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
    margin: 0 !important;
  }
  body.path-taxonomy .views-row > .vk-card > .vk-card-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 176px;
    align-self: stretch;
    overflow: hidden;
    background: var(--vk-bg-soft);
  }
  body.path-taxonomy .views-row > .vk-card .vk-figure,
  body.path-taxonomy .views-row > .vk-card .vk-figure__item,
  body.path-taxonomy .views-row > .vk-card .vk-figure__item > a {
    display: block !important;
    height: 100% !important;
    margin: 0 !important;
  }
  body.path-taxonomy .views-row > .vk-card img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 176px;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    aspect-ratio: auto !important;
  }
  body.path-taxonomy .views-row > .vk-card > .vk-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 20px 14px 18px;
    min-width: 0;
  }
}

/* 6.4 Trang chủ: ảnh card + hero có chiều cao tường minh, không co */
.vk-mag-grid .vk-card-image,
.vk-hero-feature .vk-card-image { display: block !important; overflow: hidden; background: var(--vk-bg-soft); }
.vk-mag-grid .vk-card-image img {
  display: block !important;
  width: 100% !important;
  height: 190px !important;
  max-width: none !important;
  object-fit: cover !important;
  aspect-ratio: auto !important;
}
.vk-hero-feature .vk-card-image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 320px !important;
  max-width: none !important;
  object-fit: cover !important;
  aspect-ratio: auto !important;
}
.vk-mag-grid .vk-card-image .vk-figure,
.vk-mag-grid .vk-card-image .vk-figure__item,
.vk-mag-grid .vk-card-image .vk-figure__item > a { display: block; height: auto; margin: 0; }

/* ===== 7) FIX 25/10 PROD: thumbnail trang chuyên mục — chiều cao TƯỜNG MINH (không dùng % qua parent auto) ===== */
@media (min-width: 992px) {
  body.path-taxonomy .vk-content-col .vk-card { height: auto !important; min-height: 0 !important; }
  body.path-taxonomy .vk-card-image,
  body.path-taxonomy .vk-card-image .vk-figure,
  body.path-taxonomy .vk-card-image .vk-figure__item,
  body.path-taxonomy .vk-card-image .vk-figure__item > a {
    display: block !important;
    height: 180px !important; min-height: 180px !important; max-height: 180px !important;
    margin: 0 !important; padding: 0 !important; overflow: hidden !important;
  }
  body.path-taxonomy .vk-card-image img {
    display: block !important; width: 100% !important;
    height: 180px !important; max-height: 180px !important;
    object-fit: cover !important; object-position: center !important; margin: 0 !important;
  }
  body.path-taxonomy .vk-card-body { padding: 14px 20px !important; gap: 6px !important; justify-content: center !important; }
  body.path-taxonomy .vk-card-summary { -webkit-line-clamp: 2 !important; }
  body.path-taxonomy .vk-content-col .view-content { gap: 14px !important; }
}
@media (max-width: 991px) {
  body.path-taxonomy .vk-card-image,
  body.path-taxonomy .vk-card-image .vk-figure,
  body.path-taxonomy .vk-card-image .vk-figure__item,
  body.path-taxonomy .vk-card-image .vk-figure__item > a { display: block !important; height: auto !important; overflow: hidden !important; }
  body.path-taxonomy .vk-card-image img { display: block !important; width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; object-fit: cover !important; }
}
/* ---------- 8. HERO THUMBNAIL CÂN ĐỐI (25/10) --- */
@media (min-width: 1025px) {
  .vk-hero-feature .vk-card { align-items: center; }
  .vk-hero-feature .vk-card-image {
    height: auto;
    align-self: center;
    border-radius: 14px;
    overflow: hidden;
    max-width: 520px;
  }
  .vk-hero-feature .vk-card-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    max-height: 340px;
    object-fit: cover;
    border-radius: 14px;
  }
  .vk-hero-feature .vk-card-summary {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .vk-hero-feature .vk-card-title { font-size: clamp(22px, 2.1vw, 30px); }
}
@media (max-width: 1024px) {
  .vk-hero-feature .vk-card-image img { aspect-ratio: 16 / 10; height: auto; max-height: 300px; }
}
