﻿/* =========================================================
   NEWS DETAIL PAGE
   ========================================================= */
.news-detail-page {
  padding: 42px 0 0;
  background:
    radial-gradient(circle at 14% 0%, rgba(0, 147, 205, .12), transparent 320px),
    radial-gradient(circle at 92% 12%, rgba(0, 37, 202, .12), transparent 360px),
    linear-gradient(180deg, #f3f8ff 0%, #fff 280px);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--motion-fast);
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb-sep {
  color: var(--border);
  font-weight: 300;
}
.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

/* Article layout */
.news-detail-article {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 0 40px;
}
.news-detail-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.news-detail-title {
  margin: 0;
  color: var(--primary);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.news-detail-cover {
  margin: 0 0 28px;
  overflow: hidden;
  background: var(--surface);
}
.news-detail-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
}

/* Rich content body */
.news-detail-body {
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  word-break: break-word;
}
.news-detail-body > *:first-child { margin-top: 0; }
.news-detail-body > *:last-child { margin-bottom: 0; }
.news-detail-body p { margin: 0 0 16px; }

/* Heading styles */
.news-detail-body h1,
.news-detail-body h2,
.news-detail-body h3,
.news-detail-body h4,
.news-detail-body h5,
.news-detail-body h6 {
  margin: 32px 0 12px;
  color: var(--primary);
  line-height: 1.3;
  font-weight: 700;
}
.news-detail-body h1 {
  font-size: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.news-detail-body h2 {
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}
.news-detail-body h3 { font-size: 20px; }
.news-detail-body h4 { font-size: 18px; }
.news-detail-body h5 { font-size: 16px; color: var(--text-muted); }
.news-detail-body h6 { font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Bold / Strong */
.news-detail-body strong,
.news-detail-body b,
.news-detail-body [style*="font-weight: bold"],
.news-detail-body [style*="font-weight:bold"],
.news-detail-body [style*="font-weight: 700"],
.news-detail-body [style*="font-weight:700"] {
  font-weight: 700;
}

/* Links */
.news-detail-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--motion-fast), text-decoration-color var(--motion-fast);
}
.news-detail-body a:hover { color: var(--accent-hover); }

/* Images */
.news-detail-body img,
.news-detail-body video {
  max-width: 100%;
  height: auto;
  display: block;
}
.news-detail-body p:has(img:only-child),
.news-detail-body p:has(.w-e-image-container:only-child),
.news-detail-body .w-e-image-container {
  margin: 0;
}
.news-detail-body p:has(img:only-child) img,
.news-detail-body p:has(.w-e-image-container:only-child) img,
.news-detail-body .w-e-image-container img {
  display: block;
  margin: 0;
}

.news-detail-body p[style*="text-align: center"]:has(img:only-child) img,
.news-detail-body p.text-center:has(img:only-child) img,
.news-detail-body p[style*="text-align: center"]:has(.w-e-image-container:only-child) img,
.news-detail-body p.text-center:has(.w-e-image-container:only-child) img,
.news-detail-body p[style*="text-align: center"] .w-e-image-container img,
.news-detail-body p.text-center .w-e-image-container img {
  margin: 0 auto;
}

/* Horizontal rule */
.news-detail-body hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 32px 0;
}

/* Code */
.news-detail-body code {
  font-family: "SF Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--accent);
}
.news-detail-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}
.news-detail-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

/* Tables */
.news-detail-body .table-wrap,
.news-detail-body table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.news-detail-body .table-wrap {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.news-detail-body th,
.news-detail-body td {
  padding: 12px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.news-detail-body th {
  background: var(--surface);
  font-weight: 600;
  color: var(--primary);
}
.news-detail-body tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5);
}
.news-detail-body tr:hover {
  background: var(--surface);
}

/* Blockquote */
.news-detail-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}
.news-detail-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Lists */
.news-detail-body ul,
.news-detail-body ol {
  margin: 16px 0;
  padding-left: 24px;
}
.news-detail-body ul { list-style-type: disc; }
.news-detail-body ol { list-style-type: decimal; }
.news-detail-body li {
  margin: 8px 0;
  padding-left: 4px;
}
.news-detail-body li > ul,
.news-detail-body li > ol {
  margin: 4px 0;
}

/* Text alignments */
.news-detail-body [style*="text-align: center"],
.news-detail-body .text-center { text-align: center; }
.news-detail-body [style*="text-align: right"],
.news-detail-body .text-right { text-align: right; }
.news-detail-body [style*="text-align: justify"],
.news-detail-body .text-justify { text-align: justify; }

/* Sub / Sup */
.news-detail-body sub,
.news-detail-body sup {
  font-size: 0.75em;
  line-height: 0;
}

/* Definition list */
.news-detail-body dl {
  margin: 16px 0;
}
.news-detail-body dt {
  font-weight: 600;
  color: var(--primary);
  margin-top: 12px;
}
.news-detail-body dd {
  margin-left: 24px;
  color: var(--text-muted);
}

/* Figure / Caption */
.news-detail-body figure {
  margin: 20px 0;
}
.news-detail-body figcaption {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

/* Text indent (from editor) */
.news-detail-body [style*="text-indent: 2em"],
.news-detail-body .indent-2 {
  text-indent: 2em;
}

/* Strikethrough / Delete */
.news-detail-body s,
.news-detail-body del {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Highlight / Mark */
.news-detail-body mark {
  background: rgba(30, 64, 175, 0.15);
  color: var(--primary);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
}

/* Keyboard */
.news-detail-body kbd {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 0.85em;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--border);
}

/* Address */
.news-detail-body address {
  font-style: italic;
  color: var(--text-muted);
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
}

/* Abbreviation */
.news-detail-body abbr {
  border-bottom: 1px dotted var(--text-muted);
  cursor: help;
}

/* Details / Summary */
.news-detail-body details {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.news-detail-body summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  outline: none;
}
.news-detail-body summary:hover {
  color: var(--accent);
}

/* Print styles */
@media print {
  .news-detail-body a {
    color: var(--text);
    text-decoration: none;
  }
  .news-detail-body a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: var(--text-muted);
  }
  .news-detail-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
  }
}

/* Footer actions */
.news-detail-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
}
.news-detail-neighbor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.neighbor-item {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color var(--motion-fast), box-shadow var(--motion), transform var(--motion);
}
.neighbor-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.neighbor-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.neighbor-item a,
.neighbor-item em {
  display: block;
  color: var(--primary);
  font-size: 15px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5;
}
.neighbor-item a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--motion-fast);
}
.neighbor-item a:hover {
  color: var(--accent);
}
.neighbor-item em {
  color: var(--text-muted);
  font-weight: 500;
}
.news-detail-actions {
  display: flex;
  justify-content: center;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition), transform var(--motion-fast), box-shadow var(--motion);
}
.btn-back:hover {
  color: #fff;
  border-color: transparent;
  background: var(--brand-gradient);
  box-shadow: 0 12px 24px rgba(0, 37, 202, .18);
  transform: translateY(-2px);
}

/* Related news */
.news-related-section {
  padding: 40px 0 56px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.news-related-title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.news-related-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.news-related-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color var(--motion-fast), box-shadow var(--motion), transform var(--motion);
}
.news-related-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}
.news-related-card a { display: block; }
.news-related-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  transition: transform var(--motion-slow);
}
.news-related-card:hover img {
  transform: scale(1.04);
}
.news-related-body {
  padding: 14px 16px 16px;
}
.news-related-body h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.news-related-body time {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .news-related-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .news-detail-article { padding: 24px 0 32px; }
  .news-detail-header { margin-bottom: 22px; padding-bottom: 18px; }
  .breadcrumb { font-size: 12px; margin-bottom: 20px; }
  .news-detail-title { font-size: 20px; }
  .news-detail-cover { margin-bottom: 20px; }
  .news-detail-cover img { max-height: 240px; }
  .news-detail-body { font-size: 15px; }
  .news-detail-body h1 { font-size: 22px; padding-bottom: 10px; }
  .news-detail-body h2 { font-size: 20px; padding-bottom: 6px; }
  .news-detail-body h3 { font-size: 18px; }
  .news-detail-body h4 { font-size: 16px; }
  .news-detail-body h5 { font-size: 15px; }
  .news-detail-body h6 { font-size: 13px; }
  .news-detail-body pre { padding: 14px; font-size: 13px; }
  .news-detail-body blockquote { padding: 12px 16px; }
  .news-detail-body ul,
  .news-detail-body ol { padding-left: 20px; }
  .news-detail-footer { margin-top: 28px; padding-top: 18px; }
  .news-detail-neighbor { grid-template-columns: 1fr; gap: 10px; }
  .neighbor-item { padding: 12px 14px; }
  .neighbor-item a,
  .neighbor-item em {
    font-size: 14px;
    white-space: normal;
  }
  .btn-back { padding: 8px 18px; font-size: 13px; }
  .news-related-list { grid-template-columns: 1fr; gap: 12px; }
  .news-related-section { padding: 32px 0 48px; }
  .news-related-title { font-size: 16px; margin-bottom: 16px; }
  .news-related-card img { height: 140px; }
  .news-related-body { padding: 12px 14px 14px; }
  .news-related-body h3 { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .breadcrumb a,
  .news-detail-body a,
  .neighbor-item,
  .neighbor-item a,
  .btn-back,
  .news-related-card,
  .news-related-card img {
    transition: none;
  }
}

@media (hover: none) {
  .neighbor-item:hover,
  .btn-back:hover,
  .news-related-card:hover {
    transform: none;
  }
}
