/* ========================================
   NEWS SECTION - KTĐBCL
   File: css/components/news.css

   Frontpage layout:
   - 1 featured article bên trái
   - 5 compact articles bên phải
   - Featured: ảnh trên, nội dung dưới
   - Compact: ảnh trái, nội dung phải
   ======================================== */

.kt-news-section {
  width: 100%;
}

/* ========================================
   HEADER
======================================== */

.kt-news-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.kt-news-section .section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--crimson);
  display: flex;
  align-items: center;
  gap: 10px;
}

.kt-news-section .section-title::before {
  content: "";
  width: 5px;
  height: 22px;
  background: linear-gradient(to bottom, var(--gold), var(--crimson));
  border-radius: 3px;
}

.kt-news-section .view-all {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--crimson);
  text-decoration: none;
  font-weight: 700;
  border: 1.5px solid var(--crimson);
  padding: 6px 15px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.kt-news-section .view-all:hover {
  background: var(--crimson);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ========================================
   TABS
======================================== */

.kt-news-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 16px;
}

.kt-news-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-600);
  font-family: inherit;
  position: relative;
  text-decoration: none;
}

.kt-news-tab:hover,
.kt-news-tab.active {
  color: var(--crimson);
}

.kt-news-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--crimson);
}

.kt-news-tab .tab-star {
  color: var(--gold);
  font-size: 12px;
}

/* ========================================
   FRONT NEWS LAYOUT
   Expected Twig:
   .kt-news-layout
     .kt-news-featured
     .kt-news-side-list
       .kt-news-list-item x5
======================================== */

.kt-news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 18px;
  align-items: stretch;
}

.kt-news-featured {
  min-width: 0;
}

.kt-news-side-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

/* Fallback nếu Twig chưa có .kt-news-side-list */
.kt-news-layout > .kt-news-list-item {
  grid-column: 2;
}

/* Base article */
.kt-news-article {
  margin: 0 !important;
}

.kt-news-article > footer {
  display: none !important;
}

/* ========================================
   FEATURED ARTICLE
   Clean card: ảnh trên, nội dung dưới
======================================== */

.kt-news-featured .kt-news-article {
  height: 100%;
  min-height: 410px;
  background: #ffffff;
  border: 1px solid #eee3d7;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.kt-news-featured .kt-news-article:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 168, 76, 0.75);
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.12);
}

/* Reset kiểu overlay cũ nếu còn cache/markup */
.kt-news-featured .kt-news-article::after {
  display: none !important;
}

.kt-news-featured .kt-news-article.has-image .kt-news-thumb,
.kt-news-featured .kt-news-article.no-image .kt-news-thumb {
  position: relative;
  inset: auto;
  z-index: auto;
  pointer-events: auto;
}

/* Featured image */
.kt-news-featured .kt-news-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 230px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
  text-decoration: none;
}

.kt-news-featured .kt-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}

.kt-news-featured .kt-news-article:hover .kt-news-thumb img {
  transform: scale(1.04);
}

/* Featured fallback no image */
.kt-news-featured .kt-news-article.no-image .kt-news-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.18);
  font-size: 72px;
}

/* Featured body */
.kt-news-featured .kt-news-body {
  flex: 1;
  padding: 20px 22px 22px;
  position: relative;
  z-index: 2;
  max-width: none;
  display: flex;
  flex-direction: column;
}

/* Meta */
.kt-news-featured .kt-news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.kt-news-featured .kt-news-date {
  display: inline-flex;
  color: var(--gray-400);
  font-size: 12.5px;
  font-weight: 700;
}

/* Badge */
.kt-news-featured .kt-news-thumb .kt-news-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 5;

  display: inline-block;
  background: var(--gold);
  color: var(--crimson-dark);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 5px 11px;
  border-radius: 5px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}
/* Featured title */
.kt-news-featured .kt-news-title {
  margin: 0 0 10px;
}

.kt-news-featured .kt-news-title a {
  color: var(--gray-900) !important;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.32;
  text-decoration: none;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kt-news-featured .kt-news-title a:hover {
  color: var(--crimson) !important;
}

/* Featured summary */
.kt-news-featured .kt-news-summary {
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.68;
  margin-top: 0;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   COMPACT LIST ITEM - 5 bài bên phải
======================================== */

.kt-news-list-item {
  min-width: 0;
}

.kt-news-list-item .kt-news-article {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #eee3d7;
  box-shadow: 0 7px 18px rgba(17, 24, 39, 0.055);
  padding: 11px 12px;
  min-height: 78px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.kt-news-list-item .kt-news-article:hover {
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.1);
  transform: translateY(-2px);
  border-color: rgba(201, 168, 76, 0.75);
}

/* Thumbnail item nhỏ */
.kt-news-list-item .kt-news-thumb {
  width: 82px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 22px;
  text-decoration: none;
}

.kt-news-list-item .kt-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kt-news-list-item .kt-news-body {
  min-width: 0;
}

.kt-news-list-item .kt-news-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.kt-news-list-item .kt-news-date {
  color: var(--gray-400);
  font-size: 11.5px;
  font-weight: 650;
}

/* Ẩn badge ở item nhỏ để bên phải gọn hơn */
.kt-news-list-item .kt-news-badge {
  display: none;
}

.kt-news-list-item .kt-news-title {
  margin: 0;
}

.kt-news-list-item .kt-news-title a {
  color: var(--gray-900) !important;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.38;
  text-decoration: none;
  letter-spacing: -0.01em;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kt-news-list-item .kt-news-title a:hover {
  color: var(--crimson) !important;
}

/* List nhỏ ẩn summary để gọn */
.kt-news-list-item .kt-news-summary {
  display: none;
}

/* ========================================
   FALLBACK ICON COLORS BY CATEGORY
======================================== */

.kt-news-article.no-image.cat-thong-bao .kt-news-thumb {
  background: rgba(155, 28, 46, 0.12);
  color: var(--crimson);
}

.kt-news-article.no-image.cat-lich-thi .kt-news-thumb {
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
}

.kt-news-article.no-image.cat-khao-thi .kt-news-thumb {
  background: rgba(201, 168, 76, 0.16);
  color: #92700a;
}

.kt-news-article.no-image.cat-dam-bao-chat-luong .kt-news-thumb {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.kt-news-article.no-image.cat-van-ban-cong-khai .kt-news-thumb {
  background: rgba(201, 168, 76, 0.16);
  color: #92700a;
}

.kt-news-article.no-image.cat-hoat-dong-sinh-vien .kt-news-thumb {
  background: rgba(123, 63, 160, 0.12);
  color: #7b3fa0;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 992px) {
  .kt-news-layout {
    grid-template-columns: 1fr;
  }

  .kt-news-layout > .kt-news-list-item {
    grid-column: auto;
  }

  .kt-news-side-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kt-news-featured .kt-news-article {
    min-height: auto;
  }

  .kt-news-featured .kt-news-thumb {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .kt-news-section .section-header {
    align-items: flex-start;
  }

  .kt-news-tabs {
    overflow-x: auto;
  }

  .kt-news-tab {
    white-space: nowrap;
  }

  .kt-news-featured .kt-news-thumb {
    height: 200px;
  }

  .kt-news-featured .kt-news-body {
    padding: 18px;
  }

  .kt-news-featured .kt-news-title a {
    font-size: 18px;
  }

  .kt-news-featured .kt-news-summary {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .kt-news-side-list {
    grid-template-columns: 1fr;
  }

  .kt-news-list-item .kt-news-article {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .kt-news-list-item .kt-news-thumb {
    width: 76px;
    height: 58px;
  }
}