/* =============================================
   News & News Detail Pages — Shared Styles
   Used by: news.php, news-detail.php
   ============================================= */

/* ----- Shared Section ----- */
.news-section {
  background: #f8f9fa;
}

.nd-section {
  background: #f8f9fa;
  padding: 50px 0;
}

/* ----- News Listing Page (news.php) ----- */

/* Section header */
.news-section-eyebrow {
  color: #f26522;
  letter-spacing: 3px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.news-section-heading {
  color: #1a1b2e;
  font-weight: 800;
}

.news-section-heading-accent {
  color: #f26522;
}

.news-section-subtitle {
  color: #888;
  max-width: 650px;
  margin: 1px auto 0;
}

/* Grid row gap */
.news-grid-row {
  row-gap: 30px;
}

/* Empty state */
.news-empty {
  text-align: center;
  padding: 60px 0;
}

.news-empty-icon {
  font-size: 3rem;
  color: #ddd;
  margin-bottom: 15px;
  display: block;
}

.news-empty-text {
  color: #999;
  font-size: 1rem;
}

/* News card */
.news-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
}

.news-img-wrap {
  position: relative;
  overflow: hidden;
  height: 220px;
}

.news-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}

.news-card:hover .news-img-wrap img {
  transform: scale(1.06);
}

.news-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1b2e, #2a2b45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(242, 101, 34, 0.3);
}

.news-category {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #f26522;
  color: #fff;
  padding: 5px 14px;
  border-radius: 25px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(242, 101, 34, 0.3);
}

.news-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.news-meta span {
  color: #999;
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-meta i {
  color: #f26522;
}

.news-title {
  color: #1a1b2e;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.news-card:hover .news-title {
  color: #f26522;
}

.news-excerpt {
  color: #777;
  line-height: 1.7;
  margin: 0;
  flex-grow: 1;
  font-size: 0.88rem;
}

.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f26522;
  font-weight: 600;
  text-decoration: none;
  margin-top: 16px;
  transition: gap 0.3s;
  font-size: 0.88rem;
}

.news-read-more:hover {
  gap: 10px;
  color: #d4541a;
  text-decoration: none;
}

/* ----- News Detail Page (news-detail.php) ----- */

.nd-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.nd-img-wrap {
  position: relative;
  overflow: hidden;
}

.nd-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.nd-category {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #f26522;
  color: #fff;
  padding: 5px 14px;
  border-radius: 25px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nd-body {
  padding: 30px;
}

.nd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}

.nd-meta span {
  font-size: 0.82rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nd-meta i {
  color: #f26522;
}

.nd-title {
  color: #1a1b2e;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.4;
  margin-bottom: 20px;
}

.nd-content {
  color: #555;
  line-height: 1.9;
}

.nd-source {
  margin-top: 25px;
  padding: 14px 18px;
  background: #f8f9fa;
  border-left: 3px solid #f26522;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nd-source a {
  color: #f26522;
  font-weight: 600;
}

/* Sidebar cards */
.nd-sidebar-card {
  background: #fff;
  border-radius: 14px;
  padding: 25px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.06);
  margin-bottom: 25px;
}

.nd-sidebar-title {
  color: #1a1b2e;
  font-weight: 700;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f26522;
  display: inline-block;
  font-size: 1rem;
}

/* Recent items */
.nd-recent-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  transition: all 0.2s;
}

.nd-recent-item:last-child {
  border-bottom: none;
}

.nd-recent-item:hover {
  text-decoration: none;
}

.nd-recent-thumb {
  width: 65px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.nd-recent-placeholder {
  width: 65px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a1b2e, #2a2b45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nd-recent-placeholder i {
  color: rgba(242, 101, 34, 0.4);
  font-size: 0.9rem;
}

.nd-recent-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1a1b2e;
  line-height: 1.4;
  transition: color 0.2s;
}

.nd-recent-item:hover .nd-recent-title {
  color: #f26522;
}

.nd-recent-date {
  color: #999;
  font-size: 0.72rem;
}

.nd-recent-date i {
  margin-right: 3px;
}

/* Categories */
.nd-cat-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.nd-cat-item:last-child {
  border-bottom: none;
}

.nd-cat-name {
  color: #555;
  font-size: 0.88rem;
}

.nd-cat-count {
  background: rgba(242, 101, 34, 0.1);
  color: #f26522;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== Sticky Sidebar =====
   Override html/body overflow-x: hidden from navbar-responsive.css —
   it breaks position: sticky by changing the scroll container.
   overflow-x: clip clips visually without creating a scroll container. */
html,
body {
  overflow-x: clip;
}

@media (min-width: 992px) {
  .news-sidebar-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    z-index: 10;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .nd-title {
    font-size: 1.3rem;
  }

  .nd-body {
    padding: 20px;
  }
}
