/* ══════════════════════════════════════
   news-detail.css
   ══════════════════════════════════════ */

/* ── Layout: 2-column ────────────────── */
.nd-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  padding: 2.5rem 1.5rem 5rem;
  align-items: start;
}
@media (max-width: 991px) {
  .nd-layout { grid-template-columns: 1fr; }
}

/* ── Article ─────────────────────────── */
.nd-article {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  overflow: hidden;
  padding-bottom: 2rem;
}

/* Cover image */
.nd-cover {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  background: #e8eceb;
}
.nd-cover img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* Meta bar */
.nd-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem .9rem;
  padding: 1.25rem 2rem .5rem;
}
.nd-cat {
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  background: #2d6a4f;
  padding: .2rem .8rem;
  border-radius: 20px;
  text-decoration: none;
  letter-spacing: .02em;
}
.nd-cat:hover { background: #1d4e38; color: #fff; }
.nd-meta-item {
  font-size: .78rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.nd-badge-ita {
  font-size: .72rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  padding: .2rem .65rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* Title */
.nd-title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 400;
  color: #1a1a2e;
  line-height: 1.55;
  padding: .5rem 2rem 1rem;
  margin: 0;
}

/* SDG row */
.nd-sdg-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 0 2rem .75rem;
}
.nd-sdg-label {
  font-size: .75rem;
  color: #9ca3af;
  white-space: nowrap;
}
.nd-sdg-badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.nd-sdg-badge {
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform .15s;
  overflow: hidden;
}
.nd-sdg-badge img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 5px;
}
.nd-sdg-badge:hover { transform: scale(1.15); }

/* Divider */
.nd-divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: .5rem 2rem 1.5rem;
}

/* Content */
.nd-content {
  padding: 0 2rem;
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.9;
  color: #333;
}
.nd-content p  { margin-bottom: 1.1rem; }
.nd-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1rem 0;
}
.nd-content h2, .nd-content h3 {
  font-weight: 700;
  color: #1a1a2e;
  margin: 1.5rem 0 .5rem;
}
.nd-content ul, .nd-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.nd-content a { color: #2d6a4f; text-decoration: underline; }

/* Gallery */
.nd-gallery {
  padding: 2rem 2rem 0;
}
.nd-gallery-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 1rem;
}
.nd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.nd-gallery-item {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #e8eceb;
}
.nd-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.nd-gallery-item:hover img { transform: scale(1.07); }

/* Share bar */
.nd-share {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.75rem 2rem 0;
  position: relative;
}
.nd-share-label { font-size: .8rem; color: #9ca3af; }
.nd-share-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; text-decoration: none;
  border: none; cursor: pointer;
  transition: opacity .2s;
}
.nd-share-btn:hover { opacity: .8; }
.nd-share-fb   { background: #1877f2; color: #fff; }
.nd-share-copy { background: #f3f4f6; color: #555; }
.nd-copy-msg {
  font-size: .75rem; color: #2d6a4f;
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.nd-copy-msg.show { opacity: 1; }

/* Prev / Next */
.nd-prevnext {
  display: flex;
  gap: 1rem;
  padding: 1.75rem 2rem 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 1.5rem;
}
.nd-prevnext-side { flex: 1; }
.nd-prevnext-right { text-align: right; }

.nd-nav-link {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  text-decoration: none;
  color: #1a1a2e;
  font-size: .83rem;
  font-weight: 500;
  line-height: 1.45;
  transition: color .2s;
}
.nd-nav-link:hover { color: #2d6a4f; }
.nd-nav-next { justify-content: flex-end; }
.nd-nav-link small {
  display: block;
  font-size: .7rem;
  color: #9ca3af;
  font-weight: 400;
  margin-bottom: .15rem;
}
.nd-nav-link i { flex-shrink: 0; margin-top: .1rem; }

/* Back button */
.nd-back-btn {
  display: inline-flex;
  align-items: center;
  margin: 1.5rem 2rem 0;
  padding: .55rem 1.4rem;
  border-radius: 8px;
  background: #f3f4f6;
  color: #555;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.nd-back-btn:hover { background: #2d6a4f; color: #fff; }

/* ── Sidebar ─────────────────────────── */
.nd-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.nd-sidebar-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  padding: 1.25rem;
}

.nd-sidebar-title {
  font-size: .9rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid #f0f0f0;
}

.nd-related-list { display: flex; flex-direction: column; gap: .85rem; }

.nd-related-item {
  display: flex;
  gap: .75rem;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
}
.nd-related-item:hover .nd-related-title { color: #2d6a4f; }

.nd-related-img {
  width: 80px; height: 60px;
  border-radius: 8px; overflow: hidden;
  flex-shrink: 0; background: #e8eceb;
}
.nd-related-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.nd-related-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #ccc; font-size: 1.3rem;
}
.nd-related-body { flex: 1; }
.nd-related-title {
  font-size: .82rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}
.nd-related-date {
  font-size: .7rem;
  color: #9ca3af;
  margin-top: .3rem;
}

.nd-sidebar-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1rem;
  border-radius: 8px;
  background: #f8faf8;
  color: #333;
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  transition: background .2s, color .2s;
}
.nd-sidebar-all-btn:hover { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }

/* ── Lightbox ────────────────────────── */
.nd-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.nd-lightbox.open { opacity: 1; pointer-events: auto; }
.nd-lightbox img {
  max-width: 90vw; max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}
.nd-lb-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: rgba(255,255,255,.15); border: none;
  color: #fff; width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.nd-lb-close:hover { background: rgba(255,255,255,.3); }
.nd-lb-prev, .nd-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none;
  color: #fff; width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.nd-lb-prev { left: 1.25rem; }
.nd-lb-next { right: 1.25rem; }
.nd-lb-prev:hover, .nd-lb-next:hover { background: rgba(255,255,255,.3); }

/* ── Responsive ──────────────────────── */
@media (max-width: 991px) {
  .nd-layout { padding: 1.5rem 1rem 3rem; }
}
@media (max-width: 576px) {
  .nd-title   { font-size: 1.15rem; padding: .5rem 1.25rem 1rem; }
  .nd-meta    { padding: 1rem 1.25rem .5rem; }
  .nd-content { padding: 0 1.25rem; }
  .nd-divider { margin: .5rem 1.25rem 1.25rem; }
  .nd-gallery { padding: 1.5rem 1.25rem 0; }
  .nd-share   { padding: 1.5rem 1.25rem 0; }
  .nd-prevnext { padding: 1.5rem 1.25rem 0; flex-direction: column; }
  .nd-back-btn { margin: 1.25rem 1.25rem 0; }
  .nd-sdg-row { padding: 0 1.25rem .75rem; }
}
