/* Neiht Piano — /tin-tuc.html */

:root {
  --nh-accent: #2563eb;
  --nh-accent-dark: #1d4ed8;
  --nh-ink: #0f172a;
  --nh-muted: #64748b;
  --nh-line: #e2e8f0;
  --nh-surface: #ffffff;
  --nh-radius: 1rem;
  --nh-radius-lg: 1.35rem;
}

.nh-page-bg {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(99, 102, 241, 0.07), transparent),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 38%, #f1f5f9 100%);
}

.nh-main {
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
}

/* ——— Hero danh sách ——— */
.nh-list-hero {
  position: relative;
  margin-bottom: 1.25rem;
  overflow: hidden;
  border-radius: var(--nh-radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92);
  padding: 1.35rem 1.15rem 1.25rem;
  box-shadow: 0 20px 50px -24px rgba(15, 23, 42, 0.12);
}

@media (min-width: 640px) {
  .nh-list-hero {
    margin-bottom: 2.5rem;
    padding: 2.5rem 2rem 2.25rem;
    border-radius: 1.75rem;
  }
}

.nh-list-hero-glow {
  pointer-events: none;
  position: absolute;
  border-radius: 9999px;
  filter: blur(48px);
}

.nh-list-hero-glow--a {
  right: -3rem;
  top: -3rem;
  height: 11rem;
  width: 11rem;
  background: rgba(59, 130, 246, 0.14);
}

.nh-list-hero-glow--b {
  bottom: -4rem;
  left: 28%;
  height: 9rem;
  width: 9rem;
  background: rgba(99, 102, 241, 0.1);
}

.nh-list-hero-kicker {
  position: relative;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nh-accent);
}

.nh-list-hero-title {
  position: relative;
  margin-top: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--nh-ink);
}

@media (min-width: 640px) {
  .nh-list-hero-title {
    font-size: 2.25rem;
  }
}

.nh-list-hero-desc {
  position: relative;
  margin-top: 0.65rem;
  max-width: 36rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--nh-muted);
}

@media (min-width: 640px) {
  .nh-list-hero-desc {
    font-size: 1rem;
  }
}

/* ——— Lưới 2 cột mobile ——— */
.nh-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .nh-grid {
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .nh-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
}

.nh-skeleton {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 1024px) {
  .nh-skeleton {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.nh-skel-card {
  overflow: hidden;
  border-radius: var(--nh-radius);
  border: 1px solid #f1f5f9;
  background: #fff;
  padding: 0.25rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.nh-skel-img {
  aspect-ratio: 5 / 4;
  border-radius: 0.65rem;
  background: #e2e8f0;
}

.nh-skel-line {
  margin: 0.5rem 0.45rem 0.65rem;
  height: 0.65rem;
  border-radius: 0.35rem;
  background: #e2e8f0;
}

.nh-skel-line--short {
  width: 55%;
  height: 0.5rem;
  margin-top: 0.35rem;
}

/* ——— Thẻ tin ——— */
.nh-list-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--nh-radius);
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: var(--nh-surface);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.2s ease;
}

@media (min-width: 640px) {
  .nh-list-card {
    border-radius: 1.25rem;
    padding: 0.25rem;
  }
}

.nh-list-card:hover {
  transform: translateY(-3px);
  border-color: rgba(147, 197, 253, 0.9);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.1);
}

.nh-card-media {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border-radius: 0.65rem;
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
}

@media (min-width: 640px) {
  .nh-card-media {
    aspect-ratio: 1 / 1;
    border-radius: 1rem;
    margin: 0.25rem;
  }
}

.nh-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}

.nh-list-card:hover .nh-card-media img {
  transform: scale(1.04);
}

.nh-card-tag {
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  z-index: 1;
  max-width: calc(100% - 0.8rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.94);
  padding: 0.2rem 0.45rem;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nh-accent-dark);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

@media (min-width: 640px) {
  .nh-card-tag {
    left: 0.65rem;
    top: 0.65rem;
    font-size: 0.625rem;
    padding: 0.25rem 0.55rem;
  }
}

.nh-card-placeholder {
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 1.75rem;
}

.nh-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.5rem 0.45rem 0.6rem;
}

@media (min-width: 640px) {
  .nh-card-body {
    padding: 0.85rem 1rem 1rem;
  }
}

.nh-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--nh-ink);
  transition: color 0.2s ease;
}

@media (min-width: 640px) {
  .nh-card-title {
    -webkit-line-clamp: 2;
    font-size: 1.05rem;
    line-height: 1.3;
  }
}

.nh-list-card:hover .nh-card-title {
  color: var(--nh-accent);
}

.nh-card-date {
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--nh-muted);
}

@media (min-width: 640px) {
  .nh-card-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.65rem;
    margin-top: 0.65rem;
    font-size: 0.75rem;
  }
}

.nh-card-date i {
  display: none;
  color: var(--nh-accent);
}

@media (min-width: 640px) {
  .nh-card-date i {
    display: inline;
  }
}

.nh-empty,
.nh-error {
  grid-column: 1 / -1;
  border-radius: var(--nh-radius-lg);
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.nh-empty {
  border: 1px dashed var(--nh-line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--nh-muted);
}

.nh-error {
  border: 1px solid #fecaca;
  background: linear-gradient(180deg, #fef2f2, #fff);
  color: #b91c1c;
}

/* ——— Chi tiết bài viết ——— */
.nh-detail {
  width: 100%;
  padding-bottom: 2.5rem;
}

.nh-detail-toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: -0.25rem 0 0.75rem;
  padding: 0.35rem 0;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 70%, rgba(248, 250, 252, 0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nh-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 9999px;
  border: 1px solid var(--nh-line);
  background: rgba(255, 255, 255, 0.95);
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}

.nh-detail-back:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--nh-accent-dark);
}

.nh-detail-back i {
  font-size: 0.7rem;
  color: var(--nh-accent);
}

.nh-detail-sheet {
  overflow: hidden;
  border-radius: var(--nh-radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: var(--nh-surface);
  box-shadow: 0 28px 80px -32px rgba(15, 23, 42, 0.18);
}

@media (min-width: 640px) {
  .nh-detail-sheet {
    border-radius: 1.75rem;
  }
}

.nh-detail-cover {
  position: relative;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

.nh-detail-cover img {
  display: block;
  width: 100%;
  max-height: min(52vh, 440px);
  object-fit: cover;
  object-position: center;
}

.nh-detail-cover-fade {
  pointer-events: none;
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.92), transparent);
}

.nh-detail-main {
  position: relative;
  margin-top: 0;
  padding: 1.15rem 1rem 1.35rem;
}

.nh-detail-cover:not(.hidden) + .nh-detail-main {
  margin-top: -1.25rem;
  padding-top: 0;
}

@media (min-width: 640px) {
  .nh-detail-main {
    padding: 1.75rem 2rem 2rem;
  }

  .nh-detail-cover:not(.hidden) + .nh-detail-main {
    margin-top: -2rem;
    padding: 0 2rem 2.25rem;
  }
}

.nh-detail-head {
  position: relative;
  border-radius: 1.15rem 1.15rem 0 0;
  background: #fff;
  padding: 1.1rem 1rem 1rem;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.04);
}

.nh-detail-cover:not(.hidden) + .nh-detail-main .nh-detail-head {
  border-radius: 1.15rem;
}

@media (min-width: 640px) {
  .nh-detail-head {
    padding: 1.35rem 1.35rem 1.15rem;
  }
}

.nh-detail-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  padding: 0.3rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nh-accent-dark);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.nh-detail-title {
  margin-top: 0.85rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--nh-ink);
}

@media (min-width: 640px) {
  .nh-detail-title {
    font-size: 1.85rem;
    line-height: 1.18;
  }
}

@media (min-width: 1024px) {
  .nh-detail-title {
    font-size: 2.15rem;
  }
}

.nh-detail-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--nh-muted);
}

.nh-detail-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 9999px;
  background: #f8fafc;
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  box-shadow: inset 0 0 0 1px var(--nh-line);
}

.nh-detail-date-pill i {
  display: inline-flex;
  height: 1.5rem;
  width: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #fff;
  font-size: 0.7rem;
  color: var(--nh-accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.nh-detail-divider {
  height: 1px;
  margin: 0;
  border: none;
  background: linear-gradient(90deg, transparent, var(--nh-line), transparent);
}

.nh-prose-wrap {
  padding: 1.15rem 1rem 1.5rem;
}

@media (min-width: 640px) {
  .nh-prose-wrap {
    padding: 1.35rem 1.35rem 1.75rem;
  }
}

.nh-prose {
  line-height: 1.78;
  font-size: 0.9375rem;
  color: #334155;
}

@media (min-width: 640px) {
  .nh-prose {
    font-size: 1.0625rem;
  }
}

.nh-prose > p:first-of-type {
  margin-top: 0;
}

.nh-prose p {
  margin-bottom: 1em;
}

.nh-prose h2 {
  margin: 1.65em 0 0.55em;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--nh-ink);
}

.nh-prose h3 {
  margin: 1.35em 0 0.45em;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
}

.nh-prose ul,
.nh-prose ol {
  margin: 0.5em 0 1em 1.2em;
  padding-left: 0.35em;
}

.nh-prose li {
  margin-bottom: 0.35em;
}

.nh-prose a {
  color: var(--nh-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nh-prose a:hover {
  color: var(--nh-accent-dark);
}

.nh-prose blockquote {
  margin: 1.15em 0;
  border-left: 4px solid var(--nh-accent);
  padding: 0.65rem 0 0.65rem 1rem;
  background: #f8fafc;
  border-radius: 0 0.5rem 0.5rem 0;
  color: #475569;
  font-style: italic;
}

.nh-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem auto;
  border-radius: 0.75rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.nh-detail-cover .nh-zoomable,
.nh-prose img.nh-zoomable {
  cursor: zoom-in;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.nh-detail-cover .nh-zoomable:hover,
.nh-prose img.nh-zoomable:hover {
  opacity: 0.92;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.18);
}

.nh-detail-cover .nh-zoomable:focus-visible,
.nh-prose img.nh-zoomable:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 3px;
}

/* Lightbox ảnh full màn hình */
.nh-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

.nh-image-lightbox.hidden {
  display: none !important;
}

body.nh-lightbox-open {
  overflow: hidden;
}

.nh-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.94);
  cursor: zoom-out;
}

.nh-image-lightbox__close {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.nh-image-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.nh-image-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: -1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.nh-image-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.nh-image-lightbox__nav--prev {
  left: max(0.5rem, env(safe-area-inset-left, 0px));
}

.nh-image-lightbox__nav--next {
  right: max(0.5rem, env(safe-area-inset-right, 0px));
}

.nh-image-lightbox__stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 3.5rem 3rem 2.5rem;
  pointer-events: none;
}

.nh-image-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.35rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.nh-image-lightbox__counter {
  position: absolute;
  bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 3;
  margin: 0;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nh-detail-footer-cta {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

.nh-detail-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 9999px;
  background: var(--nh-accent);
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.28);
  transition: background 0.2s;
}

.nh-detail-cta-btn:hover {
  background: var(--nh-accent-dark);
}

.nh-loading {
  color: #94a3b8;
  animation: nh-pulse 1.2s ease-in-out infinite;
}

@keyframes nh-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.hidden {
  display: none !important;
}
