/* thread.php — professional news reading layout (hub-style header) */

.thread-page {
  --ink: #152033;
  --muted: #5f6b7a;
  --line: #e4e9f0;
  --navy: #0b3d6e;
  --teal: #0f766e;
  --amber: #b45309;
  --shadow: 0 10px 30px rgba(15, 30, 55, 0.08);
  --radius: 18px;
}

#layoutSidenav_content:has(.thread-page) {
  background:
    radial-gradient(1100px 400px at 8% -8%, rgba(11, 61, 110, 0.07), transparent 60%),
    radial-gradient(800px 360px at 100% 0%, rgba(15, 118, 110, 0.05), transparent 55%),
    #eef2f6;
}

.thread-page .hub-hero-card {
  background: linear-gradient(145deg, #0b3d6e 0%, #145a8c 55%, #0f766e 120%);
  color: #fff !important;
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.thread-page .hub-hero-card .hub-kicker {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .55rem;
  padding: .28rem .7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff !important;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.thread-page .hub-hero-card h1 {
  margin: 0 0 .55rem;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.35;
  color: #fff !important;
}

.thread-page .hub-hero-card .hub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: .95;
  font-size: .9rem;
  color: rgba(255, 255, 255, 0.95) !important;
}

.thread-page .hub-hero-card .hub-meta li,
.thread-page .hub-hero-card .hub-meta i {
  color: inherit !important;
}

.thread-page .hub-hero-card .hub-meta li {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.thread-page .breadcrumb {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .65rem 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.thread-page .breadcrumb a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
}

.thread-page .breadcrumb a:hover {
  text-decoration: underline;
}

.thread-page .thread-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: .7rem .9rem;
  margin-bottom: 1rem;
}

.thread-page .thread-toolbar .btn {
  border-radius: 10px;
  font-weight: 650;
}

.thread-page .thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.thread-page .thread-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.thread-page .thread-card,
.thread-page .thread-side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.thread-page .thread-card-body {
  padding: 1.25rem 1.35rem 1.5rem;
}

.thread-page .thread-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1rem;
}

.thread-page .thread-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: #f3f7fb;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}

.thread-page .thread-chip.is-navy {
  background: rgba(11, 61, 110, 0.08);
  border-color: rgba(11, 61, 110, 0.18);
  color: var(--navy);
}

.thread-page .thread-chip.is-teal {
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.2);
  color: var(--teal);
}

.thread-page .news-detail {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #334155;
}

.thread-page .news-detail img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1rem 0;
}

.thread-page .news-detail figure {
  margin: 1.25rem 0;
}

.thread-page .news-detail figcaption {
  text-align: center;
  font-style: italic;
  color: var(--muted);
  margin-top: .4rem;
  font-size: .9rem;
}

.thread-page .thread-side-sticky {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
  padding-right: 2px;
}

.thread-page .thread-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.thread-page .thread-side-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: .45rem;
}

.thread-page .thread-side-body {
  padding: .9rem 1rem 1.05rem;
}

.thread-page .file-row {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  margin-bottom: .65rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.thread-page .file-row:last-child {
  margin-bottom: 0;
}

.thread-page .file-row:hover {
  border-color: #b7c9dc;
  box-shadow: 0 8px 20px rgba(15, 30, 55, 0.06);
  background: #fff;
}

.thread-page .file-row-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef5fb;
  color: var(--navy);
  flex: 0 0 auto;
  font-size: 1.15rem;
}

.thread-page .file-row-icon.is-pdf { color: #b42318; background: #fef3f2; }
.thread-page .file-row-icon.is-doc { color: #175cd3; background: #eff4ff; }
.thread-page .file-row-icon.is-xls { color: #067647; background: #ecfdf3; }

.thread-page .file-row-name {
  margin: 0 0 .25rem;
  font-size: .9rem;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}

.thread-page .file-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  margin-bottom: .55rem;
  color: var(--muted);
  font-size: .78rem;
}

.thread-page .related-item {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: .55rem;
  transition: border-color .15s ease, background .15s ease;
}

.thread-page .related-item:last-child {
  margin-bottom: 0;
}

.thread-page .related-item:hover {
  border-color: #b7c9dc;
  background: #f8fafc;
  color: inherit;
}

.thread-page .related-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 auto;
  background: #eef2f6;
}

.thread-page .related-item h3 {
  margin: 0 0 .2rem;
  font-size: .88rem;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-page .related-item small {
  color: var(--muted);
  font-size: .75rem;
}

.thread-page .side-empty {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  padding: .85rem .35rem;
}

.thread-page .reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1100;
  pointer-events: none;
}

.thread-page .reading-progress .progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0b3d6e, #0f766e);
  transition: width .12s ease;
}

@media (max-width: 991.98px) {
  .thread-page .thread-layout {
    grid-template-columns: 1fr;
  }

  .thread-page .thread-side-sticky {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 575.98px) {
  .thread-page .hub-hero-card {
    padding: 1.15rem 1.15rem;
  }

  .thread-page .thread-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .thread-page .thread-actions {
    justify-content: stretch;
  }

  .thread-page .thread-actions .btn {
    flex: 1 1 auto;
  }

  .thread-page .thread-card-body {
    padding: 1rem 1rem 1.2rem;
  }
}

@media print {
  .thread-page .thread-toolbar,
  .thread-page .thread-side-sticky,
  .thread-page .reading-progress,
  .sb-topnav,
  #layoutSidenav_nav {
    display: none !important;
  }

  .thread-page .thread-layout {
    display: block;
  }

  .thread-page .hub-hero-card {
    box-shadow: none;
    border: 1px solid #ccc;
    color: #000;
    background: #fff;
  }
}
