/* ============================================================
   VI FEERIE — Blog (danh sách + chi tiết)
   Dùng chung .crumbbar từ css/shop.css
   ============================================================ */

/* ============================================================
   HERO (trang danh sách)
   ============================================================ */
.bloghero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
  background: var(--brand-deep);
}

.bloghero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Phủ tối để chữ trắng đọc rõ dù ảnh nền sáng tối thế nào */
.bloghero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    rgba(41, 24, 33, 0.82) 0%, rgba(41, 24, 33, 0.58) 52%, rgba(41, 24, 33, 0.30) 100%);
}

.bloghero__inner {
  position: relative;
  padding: 56px 15px;
  max-width: 680px;
  color: #fff;
}

.bloghero__crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.bloghero__crumb a {
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.2s var(--ease);
}

.bloghero__crumb a:hover {
  color: #fff;
}

.bloghero__crumb [aria-current] {
  color: #fff;
  font-weight: 600;
}

.bloghero__title {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.18;
}

.bloghero__desc {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.86);
}

/* ============================================================
   KHUNG NỘI DUNG + SIDEBAR
   ============================================================ */
.blogwrap__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 48px;
  align-items: start;
}

.blogmain {
  min-width: 0;
}

/* ---------------- Bộ lọc danh mục ---------------- */
.blogfilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.blogfilter {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.blogfilter:hover {
  border-color: var(--brand-light);
  color: var(--brand-deep);
}

.blogfilter.is-active {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #fff;
  font-weight: 600;
}

/* ---------------- Lưới bài viết ---------------- */
/* Lưới 3 cột. Sidebar ăn mất chiều ngang nên ở desktop thường
   đủ chỗ cho 3 thẻ vừa phải, không bị to như hồi 2 cột. */
.bloglist {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.bloglist--3 {
  grid-template-columns: repeat(3, 1fr);
}

.bloglist__item.is-hidden {
  display: none;
}

@keyframes blogIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.bloglist__item.is-entering {
  animation: blogIn 0.4s var(--ease) both;
}

/* ---------------- Thẻ bài viết ---------------- */
.blogcard {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.blogcard:hover {
  border-color: var(--brand-light);
  transform: translateY(-3px);
}

.blogcard__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-soft);
}

/* Ảnh khách khổ dọc có thẻ thông số ở đáy — cắt vùng trên như thẻ sản phẩm */
.blogcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transition: transform 0.5s var(--ease);
}

.blogcard__image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--brand-deep);
  font-family: var(--font-display);
  font-size: 20px;
}

.blogcard:hover .blogcard__media img {
  transform: scale(1.05);
}

.blogcard__cat {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-deep);
}

.blogcard__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 16px 18px 18px;
}

.blogcard__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.blogcard__desc {
  flex: 1;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blogcard__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.blogcard__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--brand-light);
}

/* ---------------- Không có bài ---------------- */
.bloglist__empty {
  padding: 50px 20px;
  text-align: center;
  font-size: 14.5px;
  color: var(--muted);
}

.bloglist__empty[hidden] {
  display: none;
}

/* ---------------- Phân trang ---------------- */
.blogpager {
  display: flex;
  gap: 7px;
  margin-top: 36px;
}

.blogpage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.blogpage:hover:not(.is-current) {
  border-color: var(--brand-light);
  color: var(--brand-deep);
}

.blogpage.is-current {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #fff;
  font-weight: 600;
}

.blogpage svg {
  width: 15px;
  height: 15px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.blogside {
  position: sticky;
  top: calc(var(--navbar-h) + 20px);
  display: grid;
  gap: 20px;
}

.blogside__box {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.blogside__title {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ---------------- Ô tìm kiếm ---------------- */
.blogside__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.2s var(--ease);
}

.blogside__search:focus-within {
  border-color: var(--brand-deep);
}

.blogside__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
}

.blogside__search input:focus {
  outline: none;
}

.blogside__search button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
}

.blogside__search svg {
  width: 16px;
  height: 16px;
}

/* ---------------- Danh mục ---------------- */
.blogside__cats {
  display: grid;
  gap: 2px;
}

.blogside__cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--text);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.blogside__cat:hover {
  background: var(--brand-tint);
  color: var(--brand-deep);
}

.blogside__cat.is-active {
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-weight: 700;
}

.blogside__cat b {
  flex-shrink: 0;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.blogside__cat.is-active b {
  background: var(--brand-deep);
  color: #fff;
}

/* ---------------- Bài mới nhất ---------------- */
.blogside__recents {
  display: grid;
  gap: 14px;
}

.blogside__recent {
  display: flex;
  gap: 12px;
  align-items: center;
}

.blogside__recent-img {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}

.blogside__recent-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.blogside__recent-img .blogcard__image-placeholder {
  font-size: 10px;
}

.blogside__recent-body {
  min-width: 0;
}

.blogside__recent-body b {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  transition: color 0.2s var(--ease);
}

.blogside__recent:hover .blogside__recent-body b {
  color: var(--brand-deep);
}

.blogside__recent-body em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

/* ---------------- Thẻ ---------------- */
.blogside__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.blogside__tag {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.blogside__tag:hover {
  border-color: var(--brand-light);
  color: var(--brand-deep);
}

/* ---------------- Hộp kêu gọi ---------------- */
.blogside__cta {
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--brand-deep);
  color: #fff;
}

.blogside__cta h3 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

.blogside__cta p {
  margin-bottom: 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.blogside__cta .btn--brand {
  background: #fff;
  color: var(--brand-deeper);
}

.blogside__cta .btn--brand:hover {
  background: var(--brand-tint);
}

/* ============================================================
   CHI TIẾT BÀI VIẾT
   ============================================================ */
.blogpost {
  min-width: 0;
}

.blogpost__head {
  margin-bottom: 22px;
}

.blogpost__cat {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--brand-tint);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-deep);
}

.blogpost__title {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.blogpost__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-size: 13.5px;
  color: var(--muted);
}

.blogpost__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.blogpost__ava {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-deeper);
}

.blogpost__cover {
  margin-bottom: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.blogpost__cover img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 20%;
}

/* ---------------- Nội dung bài ---------------- */
.blogpost__body {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text);
}

.blogpost__lead {
  margin-bottom: 22px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}

.blogpost__body h2 {
  margin: 34px 0 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.blogpost__body h3 {
  margin: 26px 0 10px;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink);
}

.blogpost__body > p:first-child {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}

.blogpost__body img,
.blogpost__body video,
.blogpost__body iframe {
  max-width: 100%;
  height: auto;
}

.blogpost__body figure {
  margin: 24px 0;
}

.blogpost__body figure img {
  border-radius: var(--radius);
}

.blogpost__body figcaption {
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
}

.blogpost__body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.blogpost__body ol li {
  list-style: decimal;
}

.blogpost__body table {
  display: block;
  max-width: 100%;
  margin: 24px 0;
  overflow-x: auto;
  border-collapse: collapse;
}

.blogpost__body th,
.blogpost__body td {
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.blogpost__pages {
  margin-top: 24px;
}

.blogpost__body p {
  margin-bottom: 18px;
}

.blogpost__body b {
  font-weight: 600;
  color: var(--ink);
}

.blogpost__body a {
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blogpost__body ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.blogpost__body li {
  margin-bottom: 9px;
  list-style: disc;
  line-height: 1.75;
}

.blogpost__body li::marker {
  color: var(--brand-deep);
}

.blogpost__body blockquote {
  margin: 24px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--brand-tint);
  font-size: 16px;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink);
}

.blogpost__fig {
  margin: 24px 0;
}

.blogpost__fig img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 20%;
}

.blogpost__fig figcaption {
  margin-top: 9px;
  font-size: 12.5px;
  text-align: center;
  color: var(--muted);
}

/* ---------------- Chân bài ---------------- */
.blogpost__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.blogpost__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blogpost__tags a {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--brand-deep);
  transition: background 0.2s var(--ease);
}

.blogpost__tags a:hover {
  background: var(--brand-tint);
}

.blogpost__share {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}

.blogpost__share a,
.blogpost__share button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--brand-deep);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.blogpost__share a:hover,
.blogpost__share button:hover {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #fff;
}

.blogpost__share svg {
  width: 16px;
  height: 16px;
}

.blogpost__share button.is-copied {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #fff;
}

/* ---------------- Thẻ tác giả ---------------- */
.blogpost__author-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 30px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.blogpost__ava--lg {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  font-size: 21px;
}

.blogpost__author-card b {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  color: var(--ink);
}

.blogpost__author-card p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------------- Bài liên quan ---------------- */
.blogrelated {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}

.blogrelated__head {
  margin-bottom: 28px;
  text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media screen and (max-width: 1100px) {
  .blogwrap__row {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 34px;
  }

  /* Còn sidebar bên cạnh thì 3 cột quá hẹp — hạ về 2 cột */
  .bloglist,
  .bloglist--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Sidebar xuống dưới nội dung */
@media screen and (max-width: 900px) {
  .blogwrap__row {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Sidebar rơi xuống, nội dung chiếm cả chiều ngang nên trả lại 3 cột */
  .bloglist,
  .bloglist--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .blogside {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }

  /* Ô tìm kiếm và CTA trải hết chiều ngang */
  .blogside__box:first-child,
  .blogside__cta {
    grid-column: 1 / -1;
  }

  .bloghero__title {
    font-size: 32px;
  }
}

@media screen and (max-width: 720px) {
  .bloglist,
  .bloglist--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .bloglist,
  .bloglist--3 {
    grid-template-columns: 1fr;
  }

  .blogside {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 560px) {
  .bloghero {
    min-height: 280px;
  }

  .bloghero__inner {
    padding: 40px 0;
  }

  .bloghero__title {
    font-size: 27px;
  }

  .blogpost__title {
    font-size: 26px;
  }

  .blogpost__lead {
    font-size: 15.5px;
  }

  .blogpost__body {
    font-size: 15px;
  }

  .blogpost__body h2 {
    font-size: 21px;
  }

  .blogpost__foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bloglist__item.is-entering,
  .blogcard,
  .blogcard__media img {
    animation: none !important;
    transition: none !important;
  }
}
