/* AIHOT-inspired 3-column editorial news reader detail page.
 * Fully compatible with emerald / sepia / ocean / dark / midnight themes.
 */

.news-detail-shell {
  max-width: 1360px;
}

.news-detail-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 220px;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.75rem;
  padding-bottom: 3.5rem;
}

.news-detail-rail {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  font-size: 0.84rem;
}

.news-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: color 0.16s ease;
}

.news-back-link:hover {
  color: var(--accent);
}

.news-rail-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.news-rail-block:last-child {
  border-bottom: none;
}

.news-rail-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.news-rail-value {
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}

.news-rail-sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.news-rail-time {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.news-origin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease, transform 0.14s ease;
}

.news-origin-btn-block {
  width: 100%;
}

.news-origin-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.news-detail-score {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.news-detail-score.is-high {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.news-rail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.news-rail-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.08);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 500;
  transition: background-color 0.16s ease, color 0.16s ease;
}

[data-theme="dark"] .news-rail-tag,
[data-theme-palette="midnight"] .news-rail-tag {
  background: rgba(255, 255, 255, 0.08);
}

.news-rail-tag:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Center editorial column */
.news-detail-main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem 2.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  min-width: 0;
}

.news-detail-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
}

.news-detail-original-title {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.news-detail-guide {
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.news-guide-eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}

.news-guide-summary {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--text);
}

.news-guide-context {
  margin: 0.65rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.62;
  color: var(--muted);
}

.news-detail-body-section {
  margin-top: 1.75rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}

.news-body-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.news-body-eyebrow {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 0;
}

.news-body-lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  gap: 0.15rem;
}

.news-lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.news-lang-btn.is-active {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.news-detail-body {
  font-size: 0.96rem;
  line-height: 1.8;
  color: var(--text);
  overflow-wrap: break-word;
}

.news-detail-body p {
  margin: 0 0 1.05rem;
}

.news-detail-body h2,
.news-detail-body h3,
.news-detail-body h4 {
  margin: 1.5rem 0 0.65rem;
  line-height: 1.38;
  color: var(--text);
}

.news-detail-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-detail-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.25rem auto;
  border: 1px solid var(--border);
}

.news-detail-body blockquote {
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--accent-border);
  background: var(--surface-subtle);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}

.news-detail-body pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.news-detail-body-fallback {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.news-detail-body-fallback p {
  margin: 0;
}

.news-detail-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.news-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.news-pager-link:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.news-pager-next {
  text-align: right;
}

.news-pager-label {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.news-pager-title {
  font-size: 0.86rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .news-detail-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .news-detail-rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.25rem;
  }

  .news-back-link,
  .news-rail-block {
    border-bottom: none;
    padding-bottom: 0;
  }

  .news-origin-btn-block {
    width: auto;
  }

  .news-detail-main {
    padding: 1.35rem 1.25rem;
  }
}

@media (max-width: 640px) {
  .news-detail-pager {
    grid-template-columns: 1fr;
  }

  .news-pager-next {
    text-align: left;
  }
}
