/* ============================================================
   NEWS-PAGE.CSS — SciencePreneur Events & News
   ============================================================ */

/* ── Section wrapper ── */
.news-section {
  padding: 72px 0;
  background: var(--neutral-50);
}

/* ── Filter bar ── */
.news-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  justify-content: center;
}

.news-filter-btn {
  padding: 7px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--neutral-300);
  background: var(--white);
  color: var(--neutral-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.news-filter-btn:hover,
.news-filter-btn.active {
  background: var(--primary-700);
  color: #fff;
  border-color: var(--primary-700);
}

/* ── Card grid ── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ── Individual card ── */
.news-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}

/* ── Card image ── */
.news-card-img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--neutral-200);
}

/* legacy — single img fallback (non-slideshow cards) */
.news-card-img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s;
}

.news-card:hover .news-card-img > img {
  transform: scale(1.04);
}

/* ── Slideshow (nc-slides) ─────────────────────────────── */
/* nc-slides fills its parent absolutely so aspect-ratio height works */
.nc-slides {
  position: absolute;
  inset: 0;
}

.nc-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.7s ease-in-out, transform 0.35s ease;
}

.nc-slide.active {
  opacity: 1;
}

.news-card:hover .nc-slide.active {
  transform: scale(1.04);
}

/* ── Dot indicators ────────────────────────────────────── */
.nc-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.nc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.6);
  transition: background 0.25s, transform 0.25s;
  cursor: pointer;
  flex-shrink: 0;
}

.nc-dot.active {
  background: #fff;
  transform: scale(1.4);
  border-color: #fff;
}

/* ── Prev / Next arrow buttons ─────────────────────────── */
.nc-prev,
.nc-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 11;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.nc-prev { left: 8px; }
.nc-next { right: 8px; }

.nc-prev:hover,
.nc-next:hover {
  background: rgba(0,0,0,0.62);
}

/* show arrows on card hover (desktop) */
.news-card:hover .nc-prev,
.news-card:hover .nc-next {
  opacity: 1;
}

/* always show on touch devices */
@media (hover: none) {
  .nc-prev, .nc-next { opacity: 0.7; }
}

/* ── Image placeholder (belum ada foto) ── */
.news-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 100%);
  font-size: 48px;
}

/* ── Category badge ── */
.news-card-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fff;
}

.news-card-cat--event      { background: var(--primary-700); }
.news-card-cat--news       { background: #0e7a55; }
.news-card-cat--partnership { background: #7c3aed; }
.news-card-cat--award      { background: #b45309; }
.news-card-cat--publication { background: #0369a1; }
.news-card-cat--research   { background: #0d7490; }

/* ── Card body ── */
.news-card-body {
  padding: 22px 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--neutral-400);
}

.news-card-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--neutral-300);
}

.news-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-900);
  line-height: 1.4;
  margin-bottom: 10px;
}

.news-card-excerpt {
  font-size: 13.5px;
  color: var(--neutral-500);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--neutral-100);
}

.news-card-location {
  font-size: 12px;
  color: var(--neutral-400);
}

.news-card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-700);
  text-decoration: none;
  transition: color 0.2s;
}

.news-card-link:hover { color: var(--primary-500); }

/* ── Featured card (full-width, first item) ── */
.news-card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
}

.news-card--featured .news-card-img {
  flex: 0 0 45%;
  aspect-ratio: unset;
}

.news-card--featured .news-card-body {
  padding: 32px 36px;
  justify-content: center;
}

.news-card--featured .news-card-title {
  font-size: 22px;
}

.news-card--featured .news-card-excerpt {
  font-size: 15px;
}

/* ── Empty state ── */
.news-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--neutral-400);
}

/* ── Submit news CTA ── */
.news-submit-cta {
  margin-top: 56px;
  padding: 36px 48px;
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 100%);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  color: #fff;
}

.news-submit-cta h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.news-submit-cta p {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
}

.news-submit-btn {
  padding: 12px 28px;
  background: var(--accent-500);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.news-submit-btn:hover {
  background: var(--accent-400);
  color: #fff;
  transform: translateY(-2px);
}

/* ── Responsive ── */
@media (max-width: 992px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .news-card--featured {
    flex-direction: column;
    grid-column: 1 / -1;
  }
  .news-card--featured .news-card-img {
    flex: none;
    aspect-ratio: 16 / 9;
  }
  .news-card--featured .news-card-body {
    padding: 22px 24px;
  }
  .news-card--featured .news-card-title {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .news-card--featured {
    grid-column: 1 / -1;
  }
  .news-card-title {
    font-size: 14px;
  }
  .news-submit-cta h3 {
    font-size: 17px;
  }
}

@media (max-width: 640px) {
  .news-section {
    padding: 48px 0;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-submit-cta {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }
  .news-submit-btn {
    width: 100%;
    text-align: center;
  }
}

/* ── Hero visual: floating category badges ──────────────── */
.news-hero-tags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 370px;
}

.news-hero-tag {
  padding: 10px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  font-weight: 500;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s;
  animation: floatTag 3s ease-in-out infinite;
}

.news-hero-tag:hover { background: rgba(255,255,255,0.14); }
.news-hero-tag:nth-child(2) { animation-delay: 0.4s; }
.news-hero-tag:nth-child(3) { animation-delay: 0.8s; }
.news-hero-tag:nth-child(4) { animation-delay: 1.2s; }
.news-hero-tag:nth-child(5) { animation-delay: 0.2s; }
.news-hero-tag:nth-child(6) { animation-delay: 0.6s; }
.news-hero-tag:nth-child(7) { animation-delay: 1.0s; }

@keyframes floatTag {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

.news-hero-tag--accent {
  background: rgba(46,196,182,0.18);
  border-color: rgba(46,196,182,0.35);
  color: #5eead4;
}
