/* public/css/news.css */

/* === Header Halaman === */
.news-header {
  background: linear-gradient(to right, #0f3b2e, #1e694d);
  color: #fff;
  text-align: center;
  padding: 4rem 1.5rem;
}

.news-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.news-header p {
  font-size: 1.1rem;
  color: #d1e7dd;
  max-width: 600px;
  margin: 0 auto;
}

/* === Area Konten Utama === */
.news-content-area {
  padding: 3rem 0;
}

.news-content-area .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Artikel Unggulan (Featured) === */
.featured-news-card {
  display: flex;
  flex-direction: column; /* ✅ ubah jadi kolom */
  background-color: #f8fafc;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
  margin-bottom: 3rem;
}

.featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #e2e8f0;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-content {
  padding: 1.5rem 2rem;
}

.featured-tag {
  display: inline-block;
  background-color: #10b981;
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.featured-content h2 {
  font-size: 2rem;
  margin: 0;
}

.featured-content h2 a {
  color: #1a3d2c;
  text-decoration: none;
  transition: color 0.2s;
}

.featured-content h2 a:hover {
  color: #10b981;
}

.featured-content .subhead {
  font-size: 1.1rem;
  color: #4a5568;
  margin: 0.5rem 0 1rem 0;
}

.featured-content .excerpt {
  color: #2d3748;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* === Pemisah dan Judul Grid === */
.section-divider {
  border: 0;
  height: 1px;
  background-color: #e2e8f0;
  margin: 2rem 0;
}

.other-news-title {
  font-size: 1.8rem;
  color: #1a3d2c;
  margin-bottom: 2rem;
  text-align: center;
}

/* === Grid Artikel Lainnya === */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.news-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.news-card-image {
  aspect-ratio: 16 / 9;
  background-color: #e2e8f0;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-content {
  padding: 1.5rem;
}

.news-card-content h4 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
}

.news-card-content h4 a {
  color: #1a3d2c;
  text-decoration: none;
}

.news-card-content p {
  color: #4a5568;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.read-more-link {
  color: #1e694d;
  text-decoration: none;
  font-weight: 600;
}

/* === Placeholder untuk gambar yang tidak ada === */
.placeholder-image,
.placeholder-image-small {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e2e8f0;
  color: #a0aec0;
  font-weight: bold;
  font-size: 2rem;
}

.placeholder-image-small {
  font-size: 1.5rem;
}

/* === Media Query untuk Responsif === */
@media (max-width: 768px) {
  .featured-content h2 {
    font-size: 1.5rem;
  }
}

/* === MODAL NEWS POPUP === */
.news-modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-modal-content {
  background-color: #fff;
  margin: auto;
  padding: 2rem;
  border-radius: 16px;
  max-width: 1000px !important;  /* pakai !important supaya override */
  width: 95vw !important;        /* pakai hampir full screen */
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  position: relative;
  animation: modalFadeIn 0.2s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.news-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  color: #1e694d;
  cursor: pointer;
  font-weight: bold;
  transition: color 0.2s;
}

.news-modal-close:hover {
  color: #10b981;
}

#newsModalImage img {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: cover;
  border-radius: 8px;
  background: #e2e8f0;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .news-modal-content {
    padding: 0.7rem;
    max-width: 98vw;
    border-radius: 8px;
  }
  #newsModalImage img {
    max-height: 160px;
    border-radius: 6px;
  }
  #newsModalTitle {
    font-size: 1.2rem;
  }
  #newsModalSubhead {
    font-size: 1rem;
  }
  #newsModalFullContent {
    font-size: 0.95rem;
  }
  .news-modal-close {
    font-size: 1.5rem;
    top: 0.5rem;
    right: 0.7rem;
  }
}

@media (max-width: 400px) {
  .news-modal-content {
    padding: 0.3rem;
    border-radius: 4px;
  }
  #newsModalImage img {
    max-height: 100px;
  }
}
