
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

/* ===== News Grid (4 per row, matches Publications spacing) ===== */
.news-grid-4col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.2rem;
}
@media (min-width: 1180px) {
  .news-grid-4col {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== Filter Buttons ===== */
.news-filter-btn {
  padding: 10px 20px;
  border: 1.5px solid #ddd8d0;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
  color: #18131e;
  font-size: 0.9rem;
  font-family: inherit;
}
.news-filter-btn:hover {
  border-color: #6b3fa0;
  color: #6b3fa0;
}
.news-filter-btn.active {
  background: #6b3fa0;
  color: white;
  border-color: #6b3fa0;
}

/* ===== News Cards ===== */
.news-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(24,19,30,0.08);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  border-top: 4px solid #6b3fa0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.news-card:hover {
  box-shadow: 0 8px 32px rgba(107,63,160,0.15);
  transform: translateY(-8px);
}
.news-card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #f1eeea 0%, #ddd8d0 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(107,63,160,0.15);
}
.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.news-card:hover .news-card-image img {
  transform: scale(1.05);
}

/* ===== Branded category fallback (shown when image missing or fails) ===== */
.news-card-fallback {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  padding: 1rem;
}
.news-card-fallback .ncf-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 28%, rgba(255,255,255,0.16) 0%, transparent 42%),
    radial-gradient(circle at 82% 75%, rgba(255,255,255,0.10) 0%, transparent 45%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 12px);
  pointer-events: none;
}
.news-card-fallback .ncf-mark {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.85rem;
  backdrop-filter: blur(4px);
}
.news-card-fallback .ncf-cat {
  position: relative;
  z-index: 1;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0,0,0,0.18);
}
.news-card-fallback .ncf-brand {
  position: relative;
  z-index: 1;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-top: 0.6rem;
  font-weight: 600;
}
.news-card:hover .news-card-fallback .ncf-mark {
  transform: scale(1.08);
  transition: transform 0.4s ease;
}

/* Branded fallback inside the news modal header needs an explicit height */
#modalImageContainer .news-card-fallback {
  height: 220px;
}
#modalImageContainer .news-card-fallback .ncf-cat {
  font-size: 2.4rem;
}
.news-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.news-card-category {
  background: #ddd0f0;
  color: #6b3fa0;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
  width: fit-content;
}
.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #18131e;
  margin-bottom: 0.8rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: #8a8298;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.news-card-meta i {
  margin-right: 0.3rem;
}
.news-card-excerpt {
  color: #8a8298;
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.2rem;
  flex: 1;
}
.news-card-cta {
  margin-top: auto;
}
.news-card-btn {
  padding: 8px 18px;
  border: 1.5px solid #6b3fa0;
  background: white;
  color: #6b3fa0;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}
.news-card-btn:hover {
  background: #6b3fa0;
  color: white;
}

/* ===== Pagination ===== */
.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.news-pg-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid #e8e4de;
  background: white;
  color: #18131e;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.news-pg-btn:hover:not(.disabled):not(.active) {
  border-color: #6b3fa0;
  color: #6b3fa0;
  transform: translateY(-1px);
}
.news-pg-btn.active {
  background: #6b3fa0;
  color: white;
  border-color: #6b3fa0;
  cursor: default;
}
.news-pg-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: #b8b3c0;
}
.news-pg-prev, .news-pg-next {
  padding: 0 16px;
  color: #b8892e;
}
.news-pg-prev:hover:not(.disabled), .news-pg-next:hover:not(.disabled) {
  color: #6b3fa0;
}
.news-pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 40px;
  color: #8a8298;
  font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .news-pg-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.85rem;
  }
  .news-pg-prev, .news-pg-next {
    padding: 0 12px;
    font-size: 0.8rem;
  }
}

/* Modal close hover */
#newsModal button[onclick="closeNewsModal()"]:hover {
  background: #f1eeea !important;
  color: #18131e !important;
}
#modalReadBtn:hover {
  background: #5a2e90 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(107,63,160,0.3);
}
