/**
 * News & Activities Dedicated Stylesheet
 * CCT District 20 - Church of Christ in Thailand
 * Covers: news.php (Page Title, Search Control, News Feed Grid, Cards, Modals, Pagination)
 */

/* ==========================================================
   1. NEWS SEARCH CONTROL (dùng trong toolbar dính)
========================================================== */
.news-search-wrapper {
  position: relative;
  width: 100%;
}

.news-search-icon {
  left: 14px;
  color: var(--church-text-muted, #64748b);
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
}

.news-search-input {
  padding-left: 42px;
  padding-right: 40px;
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid var(--church-border, #e2e8f0);
  font-size: 0.95rem;
  color: var(--church-navy-dark, #121634);
  background-color: #ffffff;
  transition: all 0.2s ease-in-out;
}

.news-search-input:focus {
  border-color: var(--church-ocean-deep, #0b7294);
  box-shadow: 0 0 0 3.5px rgba(11, 114, 148, 0.15);
  background-color: #ffffff;
  outline: none;
}

.news-clear-search {
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3;
  padding: 4px 6px;
}

.news-clear-search:hover i {
  color: var(--church-navy-primary, #1a2258);
}

/* ==========================================================
   2. NEWS FEED CARDS (EDITORIAL STYLE)
========================================================== */
.news-card {
  background: #ffffff;
  border: 1.5px solid var(--church-border, #e2e8f0);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  border-color: var(--church-navy-primary, #1a2258);
  box-shadow: 0 10px 24px rgba(18, 22, 52, 0.10);
  transform: translateY(-2px);
}

.news-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, var(--church-navy-dark, #121634) 0%, var(--church-navy-primary, #1a2258) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.news-card:hover .news-thumb-img {
  transform: scale(1.03);
}

.news-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 20px;
  text-align: center;
}

.news-thumb-placeholder i {
  font-size: 3rem;
  color: var(--church-gold-bright, #fbbf24);
  margin-bottom: 8px;
  opacity: 0.85;
}

.news-thumb-placeholder span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.news-date-badge {
  top: 12px;
  left: 12px;
  background: rgba(18, 22, 52, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.news-card-body {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--church-navy-primary, #1a2258);
  line-height: 1.45;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
}

.news-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-card-title a:hover {
  color: var(--church-ocean-deep, #0b7294);
}

.news-card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--church-border, #e2e8f0);
}

/* File Attachment Badges & Pills */
.news-attachments-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.news-file-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  background-color: var(--church-navy-soft, #f1f4fb);
  color: var(--church-navy-primary, #1a2258);
  border: 1px solid var(--church-border, #e2e8f0);
  transition: all 0.2s ease;
  max-width: 100%;
}

.news-file-pill:hover {
  background-color: #ffffff;
  border-color: var(--church-ocean-deep, #0b7294);
  color: var(--church-ocean-deep, #0b7294);
  transform: translateY(-1px);
}

.news-file-pill.pill-pdf i {
  color: #dc2626;
}

.news-file-pill.pill-word i {
  color: #2563eb;
}

.news-file-pill.pill-img i {
  color: #059669;
}

.news-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Khi kho chỉ có 1-2 bài, lưới 3 cột để trống phần lớn hàng và thẻ bị dồn
   hẳn sang trái. Thu cột lại + canh giữa để khối nội dung cân đối. */
.news-grid--sparse {
  justify-content: center;
}

.news-grid--sparse .news-item {
  max-width: 420px;
}

/* Nút chia sẻ chỉ có icon -> phải đủ 44×44 px để ngón tay chạm chính xác */
.news-action-bar .news-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.news-btn-detail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: var(--church-navy-soft, #f1f4fb);
  color: var(--church-navy-primary, #1a2258);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--church-border, #e2e8f0);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.news-btn-detail:hover {
  background: var(--church-navy-primary, #1a2258);
  color: #ffffff;
  border-color: var(--church-navy-primary, #1a2258);
}

/* ==========================================================
   3. DETAIL MODAL (RICH DIALOG)
========================================================== */
.news-detail-modal .modal-content {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--church-border, #e2e8f0);
}

.news-modal-img-container {
  width: 100%;
  max-height: 420px;
  background-color: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-modal-img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.news-modal-title {
  color: var(--church-navy-primary, #1a2258);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
}

.news-modal-files-card {
  background: #f8fafc;
  border: 1px solid var(--church-border, #e2e8f0);
  border-radius: 12px;
  padding: 14px;
}

.news-download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--church-border, #e2e8f0);
  border-radius: 8px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--church-navy-dark, #121634);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.news-download-item:hover {
  border-color: var(--church-ocean-deep, #0b7294);
  background-color: var(--church-navy-soft, #f1f4fb);
  color: var(--church-ocean-deep, #0b7294);
}

/* ==========================================================
   4. PAGINATION
========================================================== */
.news-pagination-wrapper {
  margin-top: 2rem;
}

.news-pagination-card {
  background: #ffffff;
  border: 1px solid var(--church-border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(18, 22, 52, 0.04);
}

.news-pagination-info {
  font-size: 0.9rem;
  color: var(--church-text-muted, #64748b);
}

.news-pagination .page-item .page-link {
  border: 1px solid var(--church-border, #e2e8f0);
  background-color: #ffffff;
  color: var(--church-navy-primary, #1a2258);
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  margin: 0 2px;
  transition: all 0.2s ease;
}

.news-pagination .page-item.active .page-link {
  background-color: var(--church-navy-primary, #1a2258);
  border-color: var(--church-navy-primary, #1a2258);
  color: #ffffff;
}

.news-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
  background-color: var(--church-navy-soft, #f1f4fb);
  border-color: var(--church-navy-primary, #1a2258);
}

/* ==========================================================
   5. RESPONSIVE OPTIMIZATIONS
========================================================== */
@media (max-width: 767.98px) {
  .news-thumb-wrapper {
    height: 180px;
  }
  .news-card-title {
    font-size: 1.05rem;
    min-height: auto;
  }
}

/* ==========================================================
   6. CATEGORY CHIP & CARD EXCERPT (News CMS 2026-10)
========================================================== */
.news-thumb-wrapper {
  text-decoration: none;
}

.news-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  padding: 3px 10px;
  border: 1px solid rgba(26, 34, 88, 0.12);
  border-radius: 999px;
  background: var(--church-navy-soft, #f1f4fb);
  color: var(--church-navy-primary, #1a2258);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.news-cat-chip i {
  font-size: 0.72rem;
  color: var(--church-gold-primary, #d97706);
}

.news-card-excerpt {
  margin: 0 0 12px;
  color: var(--church-text-muted, #64748b);
  font-size: 0.88rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Thanh lọc chuyên mục */
.news-cat-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.news-cat-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--church-border, #e2e8f0);
  border-radius: 999px;
  background: #ffffff;
  color: var(--church-navy-primary, #1a2258);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.news-cat-filter-item b {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--church-text-muted, #64748b);
}

.news-cat-filter-item.is-active {
  border-color: var(--church-navy-primary, #1a2258);
  background: var(--church-navy-primary, #1a2258);
  color: #ffffff;
}

.news-cat-filter-item.is-active b {
  color: var(--church-gold-bright, #fbbf24);
}

/* ==========================================================
   VIEWPORT GATES: DESKTOP (>= 1024px) vs MOBILE (< 1024px)
   ZERO !important directive strictly enforced
   ========================================================== */
@media (min-width: 1024px) {
  .mobile-news-view {
    display: none;
  }
}

@media (max-width: 1023.98px) {
  .desktop-news-view {
    display: none;
  }

  .mobile-news-view {
    display: block;
    padding: 12px 14px 24px;
    max-width: 680px;
    margin: 0 auto;
  }

  /* 1. Breaking News Ticker */
  .mobile-ticker-bar {
    background: #0d1127;
    padding: 8px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    margin-bottom: 12px;
  }

  .ticker-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .ticker-content-track {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ticker-text {
    font-size: 12px;
    color: #e2e8f0;
  }

  /* 2. Instant Search Section */
  .mobile-search-section {
    margin: 0 0 12px;
  }

  .mobile-search-box {
    position: relative;
    display: flex;
    align-items: center;
  }

  .mobile-search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
  }

  .mobile-search-input {
    width: 100%;
    height: 42px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    padding: 0 38px 0 36px;
    font-size: 13.5px;
    color: #0f172a;
    outline: none;
    transition: all 0.2s ease;
  }

  .mobile-search-input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
  }

  .mobile-search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-search-clear.d-none {
    display: none;
  }

  /* 3. Horizontal Category Capsule Track */
  .mobile-category-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 10px;
    scrollbar-width: none;
  }

  .mobile-category-track::-webkit-scrollbar {
    display: none;
  }

  .mobile-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 9999px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    text-decoration: none;
    flex-shrink: 0;
  }

  .mobile-cat-pill:hover {
    border-color: #cbd5e1;
    color: #0f172a;
  }

  .mobile-cat-pill.is-active {
    background: #121634;
    border-color: #121634;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(18, 22, 52, 0.15);
  }

  .mobile-cat-count {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
  }

  .mobile-cat-pill.is-active .mobile-cat-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
  }

  /* 4. Results Meta Bar */
  .mobile-results-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 2px 12px;
    font-size: 12px;
    color: #64748b;
  }

  .mobile-active-cat-badge {
    font-weight: 700;
    color: #d97706;
  }

  /* 5. Lead / Featured Story Card (16:9 Landscape) */
  .mobile-lead-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(18, 22, 52, 0.06);
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .mobile-lead-card:active {
    transform: scale(0.99);
  }

  .mobile-lead-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f172a;
  }

  .mobile-lead-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-lead-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(18, 22, 52, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .mobile-lead-content {
    padding: 16px;
  }

  .mobile-lead-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: #64748b;
  }

  .mobile-lead-tag {
    font-size: 11px;
    font-weight: 700;
    color: #d97706;
    background: #fffbeb;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #fef3c7;
  }

  .mobile-lead-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-lead-excerpt {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-lead-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
  }

  .mobile-lead-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .mobile-quick-share-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 16px;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .mobile-quick-share-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
  }

  /* 6. Section Subhead */
  .mobile-section-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 10px;
  }

  .mobile-section-subhead-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .subhead-decor-bar {
    width: 4px;
    height: 16px;
    background: #d97706;
    border-radius: 2px;
  }

  /* 7. Compact News Rows (16:10 Thumbnail) */
  .mobile-compact-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(18, 22, 52, 0.04);
  }

  .mobile-news-row {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
  }

  .mobile-news-row:last-child {
    border-bottom: none;
  }

  .mobile-news-row:active {
    background: #f8fafc;
  }

  .mobile-row-thumb-wrap {
    width: 96px;
    height: 66px;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #121634;
  }

  .mobile-row-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-thumb-attach-badge {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(18, 22, 52, 0.85);
    color: #fbbf24;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 4px;
  }

  .mobile-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .mobile-row-tag {
    font-size: 10.5px;
    font-weight: 700;
    color: #d97706;
    line-height: 1.1;
  }

  .mobile-row-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
    margin: 3px 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
  }

  .mobile-row-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  /* 8. Progressive Load More */
  .mobile-load-more-wrap {
    margin: 20px 0;
    text-align: center;
  }

  .mobile-load-more-btn {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #1a2258;
    font-size: 13.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(18, 22, 52, 0.04);
    font-family: inherit;
  }

  .mobile-load-more-btn:active {
    transform: scale(0.98);
    background: #f8fafc;
  }

  .mobile-load-more-btn.is-loading .load-more-spinner {
    display: inline-block;
  }

  .load-more-spinner {
    display: none;
    animation: mobileSpin 0.8s linear infinite;
  }

  @keyframes mobileSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  .mobile-all-loaded-banner {
    padding: 12px;
    font-size: 12px;
    color: #64748b;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  /* 9. Empty State */
  .mobile-empty-state {
    text-align: center;
    padding: 40px 16px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin: 16px 0;
    display: none;
  }

  .mobile-empty-state.is-visible {
    display: block;
  }

  .mobile-empty-icon {
    font-size: 40px;
    color: #cbd5e1;
    margin-bottom: 8px;
  }

  .mobile-empty-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
  }

  .mobile-empty-desc {
    font-size: 12.5px;
    color: #64748b;
    margin-bottom: 16px;
  }

  .mobile-empty-reset-btn {
    padding: 8px 18px;
    border-radius: 9999px;
    background: var(--cct-gold-gradient);
    color: #0a0d20;
    font-weight: 700;
    font-size: 12.5px;
    border: none;
    cursor: pointer;
  }
}

/* ==========================================================
   7. PHASE 1 — VÁ LỖI HIỂN THỊ (giữ nguyên bố cục)
   ========================================================== */

/* 7.1 Badge "ใหม่" trên ảnh bìa thẻ desktop (đối trọng với badge ngày) */
.news-new-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--church-gold-gradient);
  color: #432a00;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.28);
}

.news-new-badge i {
  font-size: 0.72rem;
}

/* 7.2 Placeholder dự phòng khi ảnh bìa lỗi — ẩn mặc định, chỉ hiện khi
   thẻ được gắn .is-noimg, nhờ vậy badge ngày/badge "ใหม่" không bị xoá. */
.news-thumb-fallback {
  display: none;
  width: 100%;
  height: 100%;
}

.news-thumb-wrapper.is-noimg picture,
.news-thumb-wrapper.is-noimg .news-thumb-img {
  display: none;
}

.news-thumb-wrapper.is-noimg .news-thumb-fallback {
  display: flex;
}

/* 7.3 Chip "ใหม่" bản mobile (dùng chung cho lead card và hàng tin) */
.mobile-new-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fef3c7;
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.mobile-row-tag .mobile-new-chip {
  margin-left: 5px;
}

/* 7.4 Placeholder ảnh cho mobile — thay cho việc mượn ảnh hero trang chủ */
.mobile-lead-img-ph,
.mobile-row-thumb-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--church-navy-dark, #121634) 0%, var(--church-navy-primary, #1a2258) 100%);
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  padding: 6px;
}

.mobile-lead-img-ph i {
  font-size: 26px;
  color: var(--church-gold-bright, #fbbf24);
}

.mobile-lead-img-ph span {
  font-size: 10.5px;
  line-height: 1.35;
}

.mobile-row-thumb-ph i {
  font-size: 20px;
  color: var(--church-gold-bright, #fbbf24);
}

/* 7.5 Các lớp trên tự đặt display nên phải nhường lại cho .d-none của Bootstrap
   (không dùng !important — chỉ nâng specificity bằng selector ghép) */
.mobile-new-chip.d-none,
.mobile-lead-img-ph.d-none,
.mobile-row-thumb-ph.d-none {
  display: none;
}

/* ==========================================================
   8. PHASE 2 — DESKTOP EDITORIAL
      Dải header gọn · toolbar dính · khối chủ đạo · lưới 3/2 cột
   ========================================================== */

/* 8.1 Dải header gọn */
.news-page-head {
  background: linear-gradient(135deg, var(--church-navy-dark, #121634) 0%, var(--church-navy-primary, #1a2258) 100%);
  color: #ffffff;
  border-bottom: 2.5px solid var(--church-gold-primary, #d97706);
  padding: 22px 0 20px;
}

.news-head-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

.news-head-crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--church-gold-bright, #fbbf24);
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-head-crumbs a:hover {
  color: #ffffff;
}

.news-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.news-head-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.news-head-stats {
  display: flex;
  align-items: center;
  margin: 0 0 2px;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
}

.news-head-stats li + li {
  padding-left: 14px;
  margin-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.news-head-stats b {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

/* 8.2 Khung trang — bỏ .section để không bị overflow:clip cắt toolbar dính */
.news-directory-section {
  background-color: var(--church-canvas, #f8fafc);
  min-height: 600px;
  padding: 0 0 56px;
}

.news-body {
  padding-top: 28px;
}

/* 8.3 Toolbar dính dưới header.
   Header sticky ở `top: -32px` (topbar cuộn đi) và co branding còn 58px khi
   `body.scrolled` → mép dưới thật của header = --header-scrolled-h.
   KHÔNG dùng --header-total-h (106px) vì đó là chiều cao lúc chưa cuộn. */
.news-toolbar {
  position: sticky;
  top: var(--header-scrolled-h, 58px);
  z-index: 30;
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--church-border, #e2e8f0);
}

.news-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.news-toolbar .news-cat-filter {
  flex: 1;
  flex-wrap: nowrap;
  margin: 0;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.news-toolbar .news-cat-filter::-webkit-scrollbar {
  display: none;
}

.news-toolbar .news-cat-filter-item {
  flex: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.news-toolbar .news-cat-filter-item:not(.is-active):hover {
  border-color: var(--church-navy-primary, #1a2258);
  color: var(--church-navy-primary, #1a2258);
}

.news-toolbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.news-toolbar .news-search-wrapper {
  width: 220px;
}

.news-toolbar .news-search-input {
  height: 40px;
  font-size: 0.86rem;
  border-radius: 10px;
}

.news-sort-select {
  height: 40px;
  padding: 0 10px;
  border: 1.5px solid var(--church-border, #e2e8f0);
  border-radius: 10px;
  background-color: #ffffff;
  color: var(--church-navy-primary, #1a2258);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.news-sort-select:focus {
  border-color: var(--church-ocean-deep, #0b7294);
  box-shadow: 0 0 0 3.5px rgba(11, 114, 148, 0.15);
  outline: none;
}

.news-toolbar-count {
  font-size: 0.8rem;
  color: var(--church-text-muted, #64748b);
  white-space: nowrap;
}

.news-toolbar-count b {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--church-navy-primary, #1a2258);
}

.news-toolbar-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--church-border, #e2e8f0);
  border-radius: 9px;
  background: #ffffff;
  color: var(--church-text-muted, #64748b);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.news-toolbar-reset:hover {
  color: var(--church-navy-primary, #1a2258);
  border-color: var(--church-navy-primary, #1a2258);
}

/* 8.4 Khối chủ đạo */
.news-featured {
  margin-bottom: 30px;
}

.news-featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 22px;
}

.news-lead {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--church-border, #e2e8f0);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.news-lead:hover {
  border-color: var(--church-navy-primary, #1a2258);
  box-shadow: 0 12px 28px rgba(18, 22, 52, 0.12);
  transform: translateY(-2px);
}

.news-lead-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--church-navy-dark, #121634) 0%, var(--church-navy-primary, #1a2258) 100%);
}

.news-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-lead:hover .news-lead-media img {
  transform: scale(1.03);
}

.news-lead-ph,
.news-side-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--church-navy-dark, #121634) 0%, var(--church-navy-primary, #1a2258) 100%);
  color: var(--church-gold-bright, #fbbf24);
}

.news-lead-ph i {
  font-size: 2rem;
  opacity: 0.85;
}

.news-side-ph i {
  font-size: 1.25rem;
  opacity: 0.85;
}

.news-lead-flag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 22, 52, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--church-gold-bright, #fbbf24);
  font-size: 0.74rem;
  font-weight: 700;
}

.news-lead-body {
  padding: 16px 20px 20px;
}

.news-lead-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.news-lead-kicker .news-cat-chip {
  margin-bottom: 0;
}

.news-lead-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--church-text-muted, #64748b);
}

.news-lead-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--church-navy-primary, #1a2258);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-lead-excerpt {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--church-text-muted, #64748b);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-lead-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--church-border, #e2e8f0);
  font-size: 0.78rem;
  color: var(--church-text-muted, #64748b);
}

.news-lead-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.news-featured-side {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.news-side-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-height: 0;
  padding: 11px;
  background: #ffffff;
  border: 1px solid var(--church-border, #e2e8f0);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.news-side-item:hover {
  border-color: var(--church-navy-primary, #1a2258);
  box-shadow: 0 8px 20px rgba(18, 22, 52, 0.1);
  transform: translateY(-2px);
}

/* Ảnh phụ kéo giãn hết chiều cao thẻ để cột phải không bị hụt hơi so với bài lớn */
.news-side-thumb {
  position: relative;
  flex: none;
  width: 124px;
  height: auto;
  min-height: 74px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--church-navy-primary, #1a2258);
}

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

.news-side-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.news-side-cat {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--church-gold-primary, #d97706);
  letter-spacing: 0.01em;
}

.news-side-cat .news-new-chip {
  margin-left: 6px;
}

.news-side-title {
  margin: 3px 0 5px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--church-navy-primary, #1a2258);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-side-date {
  font-size: 0.74rem;
  color: var(--church-text-muted, #64748b);
}

/* 8.5 Bài nằm trong khối chủ đạo thì rút khỏi lưới */
.news-item--featured {
  display: none;
}

/* 8.6 Các lớp tự đặt display phải nhường .d-none của Bootstrap */
.news-toolbar-reset.d-none,
.news-lead-ph.d-none,
.news-side-ph.d-none {
  display: none;
}

/* 8.7 Màn hẹp 1024–1199: thu gọn thanh công cụ để không xuống dòng */
@media (max-width: 1199.98px) {
  .news-toolbar .news-search-wrapper {
    width: 168px;
  }

  .news-toolbar-count {
    font-size: 0.75rem;
  }

  .news-head-title {
    font-size: 1.5rem;
  }

  .news-featured-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 16px;
  }

  .news-side-thumb {
    width: 96px;
  }
}
