/* =========================================================
   news.css – trang chi tiết bài viết (cần main.css + common.css)
   Breakpoint: xs 460 | sm 640 | md 768 | lg 1024 | xl 1280
   ========================================================= */

/* ---------- Đầu trang: breadcrumb + tiêu đề ---------- */
.page-head {
  padding: 28px 0 36px;
  background:
    radial-gradient(circle at 0% 0%, rgba(240, 168, 36, 0.2), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(156, 10, 15, 0.1), transparent 45%),
    var(--color-cream);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: #6b6b73;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.breadcrumb li + li::before {
  content: "\f105";
  margin: 0 10px;
  font-family: "Font Awesome 6 Free";
  font-size: 11px;
  font-weight: 900;
  color: #b9b9c0;
}

.breadcrumb a:hover {
  color: var(--color-second);
}

.breadcrumb [aria-current="page"] {
  max-width: 60vw;
  overflow: hidden;
  font-weight: 600;
  color: var(--text-black);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-head__cat {
  display: inline-block;
  margin-top: 20px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--color-tint);
  color: var(--color-second);
  font-size: 13px;
  font-weight: 700;
}

.page-head__title {
  max-width: 860px;
  margin-top: 12px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  color: #1e1e1e;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  font-size: 14px;
  color: #6b6b73;
}

.post-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-meta i {
  color: var(--color-second);
}

@media (min-width: 640px) {
  .page-head__title {
    font-size: 32px;
  }
}

@media (min-width: 768px) {
  /* chừa 48px cho navbar trắng đè xuống */
  .page-head {
    padding: 76px 0 48px;
  }
}

@media (min-width: 1024px) {
  .page-head__title {
    font-size: 38px;
  }
}

/* ---------- Bố cục: bài viết + sidebar ---------- */
.article-layout {
  display: grid;
  gap: 48px;
  padding-block: 40px 64px;
}

.article__cover {
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.article__cover img {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    padding-block: 48px 80px;
  }
}

/* ---------- Nội dung bài viết (HTML từ trình soạn thảo CMS) ---------- */
.prose {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-black);
}

.prose > * + * {
  margin-top: 16px;
}

.prose .lead {
  font-size: 18px;
  color: #2b2b30;
}

.prose h2 {
  margin-top: 40px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: #1e1e1e;
  scroll-margin-top: 150px;
}

.prose h3 {
  margin-top: 28px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #1e1e1e;
  scroll-margin-top: 150px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 8px;
}

.prose li::marker {
  color: var(--color-second);
  font-weight: 700;
}

.prose a {
  color: var(--color-second);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--color-primary-dark);
}

.prose strong {
  color: #1e1e1e;
}

.prose blockquote {
  padding: 16px 20px;
  border-left: 4px solid var(--color-second);
  border-radius: 0 12px 12px 0;
  background: var(--color-cream);
  color: #2b2b30;
}

.prose figure {
  margin-block: 28px;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.prose figure img {
  width: 100%;
}

.prose figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: #8a8a93;
  text-align: center;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border: 1px solid var(--color-muted);
  text-align: left;
}

.prose th {
  background: var(--color-cream);
  color: #1e1e1e;
}

@media (min-width: 640px) {
  .prose h2 {
    font-size: 26px;
  }

  .prose h3 {
    font-size: 20px;
  }
}

/* mục lục */
.toc {
  padding: 20px 24px;
  border: 1px solid #f1e4c8;
  border-radius: 12px;
  background: #fffbf2;
}

.toc__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #1e1e1e;
}

.toc__title i {
  color: var(--color-second);
}

.prose .toc ol {
  margin-top: 12px;
}

.prose .toc a {
  color: inherit;
  text-decoration: none;
}

.prose .toc a:hover {
  color: var(--color-second);
}

/* ---------- Chân bài: từ khoá + chia sẻ ---------- */
.article__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-block: 20px;
  border-block: 1px solid var(--color-muted);
}

.tags,
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tags span,
.share span {
  margin-right: 4px;
  font-weight: 600;
  color: #1e1e1e;
}

.tags a {
  padding: 6px 12px;
  border-radius: 999px;
  background: #f4f4f6;
  font-size: 13px;
  transition: background-color 0.2s, color 0.2s;
}

.tags a:hover {
  background: var(--color-tint);
  color: var(--color-second);
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f4f4f6;
  color: var(--text-black);
  font-size: 16px;
  transition: background-color 0.2s, color 0.2s;
}

.share-btn:hover {
  background: var(--color-second);
  color: #fff;
}

.share-btn.is-copied {
  background: #16a34a;
  color: #fff;
}

/* ---------- Bài trước / bài sau ---------- */
.post-nav {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid var(--color-muted);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post-nav__item:hover {
  border-color: var(--color-main);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.post-nav__item span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #8a8a93;
}

.post-nav__item strong {
  font-weight: 700;
  line-height: 1.4;
  color: #1e1e1e;
}

.post-nav__item--next {
  align-items: flex-end;
  text-align: right;
}

@media (min-width: 640px) {
  .post-nav {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.widget__title {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-muted);
  font-size: 20px;
  font-weight: 700;
  color: #1e1e1e;
}

.widget__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-second);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* cả dòng bấm được nhưng chỉ 1 link cho SEO */
.recent {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.recent__thumb {
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 1200 / 630;
}

.recent__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.recent:hover .recent__thumb img {
  transform: scale(1.05);
}

.recent__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recent time {
  font-size: 12px;
  color: #8a8a93;
}

.recent__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #1e1e1e;
  transition: color 0.2s;
}

.recent__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.recent:hover .recent__title {
  color: var(--color-second);
}

/* ô ưu đãi */
.promo {
  position: relative;
  overflow: hidden;
  padding: 28px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
  color: #fff;
}

.promo::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.promo__label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

.promo__title {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}

.promo__title strong {
  font-size: 34px;
  color: var(--color-gold-light);
}

.promo__btn {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  border-radius: 999px;
  background: #fff;
  color: var(--color-second);
}

.promo__btn:hover {
  background: #1e1e1e;
  color: #fff;
}

/* tablet: sidebar chia cột dưới bài viết, tự giãn khi chỉ còn 1 khối */
@media (min-width: 768px) and (max-width: 1023px) {
  .sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 150px;
    align-self: start;
  }
}

/* ---------- Tin tức liên quan ---------- */
.related {
  border-top: 1px solid var(--color-muted);
  background: #fafafb;
}

.related__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.related__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-second);
  transition: gap 0.2s;
}

.related__all:hover {
  gap: 12px;
}

.related__grid {
  display: grid;
  gap: 24px;
}

.related__grid > li {
  display: flex;
}

.post-card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.1);
}

.post-card__thumb {
  overflow: hidden;
  aspect-ratio: 1200 / 630;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 20px;
}

.post-card__date {
  font-size: 13px;
  color: #8a8a93;
}

.post-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: #1e1e1e;
  transition: color 0.2s;
}

.post-card:hover .post-card__title {
  color: var(--color-second);
}

.post-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card__excerpt {
  font-size: 14px;
  color: #6b6b73;
}

@media (min-width: 640px) {
  .related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .related__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
