/* =====================================================
   Trends Publisher v2.0.0 - Frontend Styles
   Universal theme compatibility with auto dark mode
   ===================================================== */

:root {
  --tp-card-bg: #ffffff;
  --tp-card-border: #f0f0f2;
  --tp-card-radius: 12px;
  --tp-text-primary: #1a1a2e;
  --tp-text-secondary: #6b7280;
  --tp-text-muted: #9ca3af;
  --tp-accent: #0d7377;
  --tp-muted-bg: #f3f4f6;
  --tp-stat-up-color: #059669;
  --tp-stat-up-bg: rgba(5, 150, 105, 0.07);
  --tp-stat-up-border: rgba(5, 150, 105, 0.18);
  --tp-stat-up-glow: rgba(5, 150, 105, 0.12);
  --tp-stat-down-color: #dc2626;
  --tp-stat-down-bg: rgba(220, 38, 38, 0.06);
  --tp-stat-down-border: rgba(220, 38, 38, 0.16);
  --tp-stat-down-glow: rgba(220, 38, 38, 0.10);
  --tp-stat-neutral-color: #6366f1;
  --tp-stat-neutral-bg: rgba(99, 102, 241, 0.06);
  --tp-stat-neutral-border: rgba(99, 102, 241, 0.15);
  --tp-stat-neutral-glow: rgba(99, 102, 241, 0.10);
  --tp-stat-panel-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(5, 150, 105, 0.03) 100%);
  --tp-stat-panel-header-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(5, 150, 105, 0.06) 100%);
  --tp-stat-divider: rgba(0, 0, 0, 0.06);
  --tp-stat-icon-bg: rgba(0, 0, 0, 0.04);
}

/* =====================================================
   Dark Mode Variables
   Supports ALL common WordPress dark mode patterns:
   - .dark / html.dark / body.dark (Tailwind, many themes)
   - .nu-dark (NetworkUstad, Flavor themes)
   - .dark-mode / .darkmode (common toggle plugins)
   - .night-mode (night toggle plugins)
   - [data-theme="dark"] (data attribute approach)
   - [data-color-scheme="dark"]
   - [data-bs-theme="dark"] (Bootstrap 5.3+)
   - .flavor-dark, .flavor-night
   - .tp-dark (our own bridge class - set by JS)
   - prefers-color-scheme media query (OS-level)
   ===================================================== */
.dark,
html.dark,
body.dark,
.nu-dark,
html.nu-dark,
body.nu-dark,
.dark-mode,
html.dark-mode,
body.dark-mode,
.darkmode,
html.darkmode,
body.darkmode,
.night-mode,
html.night-mode,
body.night-mode,
[data-theme="dark"],
[data-color-scheme="dark"],
[data-bs-theme="dark"],
[data-mode="dark"],
.flavor-dark,
.flavor-night,
.tp-dark,
html.tp-dark,
body.tp-dark {
  --tp-card-bg: #1e1e2e;
  --tp-card-border: #2e2e3e;
  --tp-card-radius: 12px;
  --tp-text-primary: #e4e4e7;
  --tp-text-secondary: #a1a1aa;
  --tp-text-muted: #71717a;
  --tp-accent: #14b8a6;
  --tp-muted-bg: #27272a;
  --tp-stat-up-color: #34d399;
  --tp-stat-up-bg: rgba(52, 211, 153, 0.10);
  --tp-stat-up-border: rgba(52, 211, 153, 0.22);
  --tp-stat-up-glow: rgba(52, 211, 153, 0.15);
  --tp-stat-down-color: #f87171;
  --tp-stat-down-bg: rgba(248, 113, 113, 0.10);
  --tp-stat-down-border: rgba(248, 113, 113, 0.20);
  --tp-stat-down-glow: rgba(248, 113, 113, 0.12);
  --tp-stat-neutral-color: #818cf8;
  --tp-stat-neutral-bg: rgba(129, 140, 248, 0.10);
  --tp-stat-neutral-border: rgba(129, 140, 248, 0.20);
  --tp-stat-neutral-glow: rgba(129, 140, 248, 0.12);
  --tp-stat-panel-bg: linear-gradient(135deg, rgba(129, 140, 248, 0.06) 0%, rgba(52, 211, 153, 0.06) 100%);
  --tp-stat-panel-header-bg: linear-gradient(135deg, rgba(129, 140, 248, 0.10) 0%, rgba(52, 211, 153, 0.10) 100%);
  --tp-stat-divider: rgba(255, 255, 255, 0.06);
  --tp-stat-icon-bg: rgba(255, 255, 255, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light):not(.light-mode):not(.lightmode):not(.day-mode):not(.tp-light):not([data-theme="light"]):not([data-color-scheme="light"]):not([data-bs-theme="light"]):not([data-mode="light"]) {
    --tp-card-bg: #1e1e2e;
    --tp-card-border: #2e2e3e;
    --tp-card-radius: 12px;
    --tp-text-primary: #e4e4e7;
    --tp-text-secondary: #a1a1aa;
    --tp-text-muted: #71717a;
    --tp-accent: #14b8a6;
    --tp-muted-bg: #27272a;
    --tp-stat-up-color: #34d399;
    --tp-stat-up-bg: rgba(52, 211, 153, 0.10);
    --tp-stat-up-border: rgba(52, 211, 153, 0.22);
    --tp-stat-up-glow: rgba(52, 211, 153, 0.15);
    --tp-stat-down-color: #f87171;
    --tp-stat-down-bg: rgba(248, 113, 113, 0.10);
    --tp-stat-down-border: rgba(248, 113, 113, 0.20);
    --tp-stat-down-glow: rgba(248, 113, 113, 0.12);
    --tp-stat-neutral-color: #818cf8;
    --tp-stat-neutral-bg: rgba(129, 140, 248, 0.10);
    --tp-stat-neutral-border: rgba(129, 140, 248, 0.20);
    --tp-stat-neutral-glow: rgba(129, 140, 248, 0.12);
    --tp-stat-panel-bg: linear-gradient(135deg, rgba(129, 140, 248, 0.06) 0%, rgba(52, 211, 153, 0.06) 100%);
    --tp-stat-panel-header-bg: linear-gradient(135deg, rgba(129, 140, 248, 0.10) 0%, rgba(52, 211, 153, 0.10) 100%);
    --tp-stat-divider: rgba(255, 255, 255, 0.06);
    --tp-stat-icon-bg: rgba(255, 255, 255, 0.06);
  }
}

/* =====================================================
   Trending Cards Grid
   ===================================================== */
.tp-trends-section {
  box-sizing: border-box;
  width: 100%;
}

.tp-trends-section *,
.tp-trends-section *::before,
.tp-trends-section *::after {
  box-sizing: border-box;
}

.tp-trends-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.tp-trends-section[data-gap="sm"] .tp-trends-grid { gap: 12px; }
.tp-trends-section[data-gap="md"] .tp-trends-grid { gap: 20px; }
.tp-trends-section[data-gap="lg"] .tp-trends-grid { gap: 28px; }

@media (min-width: 640px) {
  .tp-trends-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .tp-trends-section[data-columns="1"] .tp-trends-grid { grid-template-columns: 1fr; }
  .tp-trends-section[data-columns="2"] .tp-trends-grid { grid-template-columns: repeat(2, 1fr); }
  .tp-trends-section[data-columns="3"] .tp-trends-grid { grid-template-columns: repeat(3, 1fr); }
  .tp-trends-section[data-columns="4"] .tp-trends-grid { grid-template-columns: repeat(4, 1fr); }
  .tp-trends-section[data-columns="5"] .tp-trends-grid { grid-template-columns: repeat(5, 1fr); }
  .tp-trends-section[data-columns="6"] .tp-trends-grid { grid-template-columns: repeat(6, 1fr); }
}

/* =====================================================
   Trend Card
   ===================================================== */
.tp-trend-card {
  display: flex;
  flex-direction: column;
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: var(--tp-card-radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.tp-trend-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.tp-trend-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.tp-trend-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--tp-muted-bg);
}

.tp-trend-card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.tp-trend-card:hover .tp-trend-card-thumb img {
  transform: scale(1.05);
}

.tp-trend-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-block;
  padding: 4px 10px;
  background: var(--tp-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  z-index: 2;
}

.tp-trend-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}

.tp-trend-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--tp-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tp-trend-card-excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--tp-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tp-trend-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--tp-card-border);
}

.tp-trend-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--tp-stat-neutral-bg);
  color: var(--tp-stat-neutral-color);
  border: 1px solid var(--tp-stat-neutral-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: default;
}

.tp-trend-stat:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--tp-stat-neutral-glow);
}

.tp-trend-stat.tp-stat-up {
  background: var(--tp-stat-up-bg);
  color: var(--tp-stat-up-color);
  border-color: var(--tp-stat-up-border);
}

.tp-trend-stat.tp-stat-up:hover {
  box-shadow: 0 3px 10px var(--tp-stat-up-glow);
}

.tp-trend-stat.tp-stat-down {
  background: var(--tp-stat-down-bg);
  color: var(--tp-stat-down-color);
  border-color: var(--tp-stat-down-border);
}

.tp-trend-stat.tp-stat-down:hover {
  box-shadow: 0 3px 10px var(--tp-stat-down-glow);
}

.tp-trend-stat.tp-stat-neutral {
  background: var(--tp-stat-neutral-bg);
  color: var(--tp-stat-neutral-color);
  border-color: var(--tp-stat-neutral-border);
}

.tp-trend-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--tp-stat-icon-bg);
}

.tp-trend-stat-data {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.tp-trend-stat-value {
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: -0.01em;
}

.tp-trend-stat-label {
  font-weight: 500;
  font-size: 11px;
  opacity: 0.75;
}

.tp-trend-stat-arrow {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.tp-trend-stat-arrow svg {
  display: block;
}

.tp-trend-stat.tp-stat-up .tp-trend-stat-arrow {
  animation: tp-pulse-up 2s ease-in-out infinite;
}

.tp-trend-stat.tp-stat-down .tp-trend-stat-arrow {
  animation: tp-pulse-down 2s ease-in-out infinite;
}

@keyframes tp-pulse-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes tp-pulse-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

.tp-trend-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--tp-muted-bg) 0%, var(--tp-card-border) 100%);
  color: var(--tp-text-muted);
}

.tp-trend-placeholder svg {
  opacity: 0.4;
}

/* =====================================================
   Layout Variants
   ===================================================== */
.tp-trends-section[data-layout="compact"] .tp-trend-card-thumb {
  aspect-ratio: 16 / 8;
}

.tp-trends-section[data-layout="compact"] .tp-trend-card-body {
  padding: 12px 14px 14px;
  gap: 6px;
}

.tp-trends-section[data-layout="compact"] .tp-trend-card-title {
  font-size: 14px;
}

.tp-trends-section[data-layout="compact"] .tp-trend-card-excerpt {
  font-size: 12px;
}

.tp-trends-section[data-layout="compact"] .tp-trend-card-stats {
  padding-top: 10px;
}

.tp-trends-section[data-layout="compact"] .tp-trend-stat {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 16px;
}

.tp-trends-section[data-layout="compact"] .tp-trend-stat-icon {
  width: 16px;
  height: 16px;
  font-size: 11px;
}

.tp-trends-section[data-layout="horizontal"] .tp-trend-card-link {
  flex-direction: row;
}

.tp-trends-section[data-layout="horizontal"] .tp-trend-card-thumb {
  aspect-ratio: auto;
  width: 200px;
  min-height: 140px;
  flex-shrink: 0;
}

.tp-trends-section[data-layout="horizontal"] .tp-trend-card-body {
  padding: 16px 18px;
  justify-content: center;
}

@media (max-width: 639px) {
  .tp-trends-section[data-layout="horizontal"] .tp-trend-card-link {
    flex-direction: column;
  }

  .tp-trends-section[data-layout="horizontal"] .tp-trend-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: auto;
  }
}

/* =====================================================
   Archive & Taxonomy Templates
   ===================================================== */
.tp-archive-main {
  padding: 32px 0;
}

.tp-archive-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.tp-archive-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--tp-card-border);
}

.tp-archive-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--tp-text-primary);
}

.tp-archive-description {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--tp-text-secondary);
}

.tp-archive-container .tp-trends-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .tp-archive-container .tp-trends-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .tp-archive-container .tp-trends-grid {
    grid-template-columns: repeat(var(--tp-cols, 3), 1fr);
  }
}

.tp-archive-container .tp-trend-card-title {
  font-size: 17px;
}

.tp-no-posts {
  text-align: center;
  padding: 60px 20px;
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: var(--tp-card-radius);
}

.tp-no-posts h2 {
  margin: 16px 0 8px;
  font-size: 20px;
  color: var(--tp-text-primary);
}

.tp-no-posts p {
  margin: 0;
  font-size: 14px;
  color: var(--tp-text-muted);
}

.tp-archive-container .nav-links {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.tp-archive-container .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--tp-text-secondary);
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: 8px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tp-archive-container .page-numbers:hover {
  background: var(--tp-muted-bg);
  color: var(--tp-text-primary);
}

.tp-archive-container .page-numbers.current {
  background: var(--tp-accent);
  color: #ffffff;
  border-color: var(--tp-accent);
}

/* =====================================================
   Single Trend Template
   ===================================================== */
.tp-single-trend {
  padding: 24px 0 48px;
}

.tp-single-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

.tp-breadcrumbs {
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--tp-text-muted);
}

.tp-breadcrumbs a {
  color: var(--tp-text-secondary);
  text-decoration: none;
}

.tp-breadcrumbs a:hover {
  color: var(--tp-accent);
}

.tp-single-header {
  margin-bottom: 28px;
}

.tp-single-category-badge {
  display: inline-block;
  padding: 5px 12px;
  margin-bottom: 14px;
  background: var(--tp-accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.15s;
}

.tp-single-category-badge:hover {
  opacity: 0.85;
  color: #ffffff;
}

.tp-single-title {
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--tp-text-primary);
}

@media (min-width: 640px) {
  .tp-single-title { font-size: 38px; }
}

.tp-single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--tp-text-secondary);
}

.tp-single-meta svg {
  vertical-align: -2px;
  margin-right: 4px;
  opacity: 0.6;
}

.tp-single-date,
.tp-single-readtime {
  display: inline-flex;
  align-items: center;
}

.tp-single-source {
  display: inline-flex;
  align-items: center;
  color: var(--tp-accent);
  text-decoration: none;
  font-weight: 500;
}

.tp-single-source:hover {
  text-decoration: underline;
}

.tp-single-featured-image {
  margin-bottom: 32px;
  border-radius: var(--tp-card-radius);
  overflow: hidden;
  background: var(--tp-muted-bg);
}

.tp-featured-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

/* =====================================================
   Statistics Panel (Single Template) - Modern Redesign
   ===================================================== */
.tp-stats-panel {
  margin-bottom: 32px;
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: var(--tp-card-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.02);
}

.tp-stats-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  background: var(--tp-stat-panel-header-bg);
  border-bottom: 1px solid var(--tp-card-border);
  font-size: 14px;
  font-weight: 700;
  color: var(--tp-text-primary);
  letter-spacing: 0.01em;
}

.tp-stats-panel-header svg {
  opacity: 0.8;
  flex-shrink: 0;
  color: var(--tp-accent);
}

.tp-stats-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  background: var(--tp-stat-panel-bg);
}

.tp-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px 22px;
  text-align: center;
  position: relative;
  transition: background 0.2s ease;
}

.tp-stat-card::after {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 16px;
  right: 0;
  width: 1px;
  background: var(--tp-stat-divider);
}

.tp-stat-card:last-child::after {
  display: none;
}

.tp-stat-card:hover {
  background: var(--tp-stat-icon-bg);
}

@media (max-width: 639px) {
  .tp-stats-panel-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tp-stat-card::after {
    top: 12px;
    bottom: 12px;
  }
  .tp-stat-card:nth-child(2n)::after {
    display: none;
  }
  .tp-stat-card:nth-child(n+3) {
    border-top: 1px solid var(--tp-stat-divider);
  }
}

@media (max-width: 399px) {
  .tp-stats-panel-grid {
    grid-template-columns: 1fr;
  }
  .tp-stat-card::after {
    display: none;
  }
  .tp-stat-card + .tp-stat-card {
    border-top: 1px solid var(--tp-stat-divider);
  }
}

.tp-stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  background: var(--tp-stat-icon-bg);
  transition: transform 0.2s ease;
}

.tp-stat-card:hover .tp-stat-card-icon {
  transform: scale(1.08);
}

.tp-stat-card.tp-stat-up .tp-stat-card-icon {
  background: var(--tp-stat-up-bg);
  border: 1px solid var(--tp-stat-up-border);
}

.tp-stat-card.tp-stat-down .tp-stat-card-icon {
  background: var(--tp-stat-down-bg);
  border: 1px solid var(--tp-stat-down-border);
}

.tp-stat-card.tp-stat-neutral .tp-stat-card-icon {
  background: var(--tp-stat-neutral-bg);
  border: 1px solid var(--tp-stat-neutral-border);
}

.tp-stat-card-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--tp-text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tp-stat-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tp-stat-card-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-top: 2px;
}

.tp-stat-card.tp-stat-up .tp-stat-card-value { color: var(--tp-stat-up-color); }
.tp-stat-card.tp-stat-up .tp-stat-card-arrow {
  color: var(--tp-stat-up-color);
  background: var(--tp-stat-up-bg);
  animation: tp-pulse-up 2s ease-in-out infinite;
}
.tp-stat-card.tp-stat-down .tp-stat-card-value { color: var(--tp-stat-down-color); }
.tp-stat-card.tp-stat-down .tp-stat-card-arrow {
  color: var(--tp-stat-down-color);
  background: var(--tp-stat-down-bg);
  animation: tp-pulse-down 2s ease-in-out infinite;
}
.tp-stat-card.tp-stat-neutral .tp-stat-card-value { color: var(--tp-stat-neutral-color); }

/* =====================================================
   Single Trend Content Area
   ===================================================== */
.tp-single-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--tp-text-primary);
}

.tp-single-content h2 {
  margin: 32px 0 16px;
  font-size: 24px;
  font-weight: 600;
  color: var(--tp-text-primary);
}

.tp-single-content h3 {
  margin: 24px 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--tp-text-primary);
}

.tp-single-content h4 {
  margin: 20px 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--tp-text-primary);
}

.tp-single-content p {
  margin: 0 0 16px;
  color: var(--tp-text-primary);
}

.tp-single-content ul,
.tp-single-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.tp-single-content li {
  margin-bottom: 6px;
  color: var(--tp-text-primary);
}

.tp-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.tp-single-content a {
  color: var(--tp-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tp-single-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--tp-accent);
  background: var(--tp-muted-bg);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--tp-text-secondary);
}

.tp-single-content pre,
.tp-single-content code {
  background: var(--tp-muted-bg);
  color: var(--tp-text-primary);
  border-radius: 4px;
}

.tp-single-content pre {
  padding: 16px;
  overflow-x: auto;
  border-radius: 8px;
}

.tp-single-content code {
  padding: 2px 6px;
  font-size: 0.9em;
}

.tp-single-content pre code {
  padding: 0;
  background: none;
}

/* =====================================================
   Related Articles (Single Template)
   ===================================================== */
.tp-related-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--tp-card-border);
}

.tp-related-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 600;
  color: var(--tp-text-primary);
}

.tp-related-title svg {
  opacity: 0.6;
  flex-shrink: 0;
}

.tp-related-grid {
  display: grid;
  gap: 12px;
}

.tp-related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--tp-card-bg);
  border: 1px solid var(--tp-card-border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, box-shadow 0.15s;
}

.tp-related-card:hover {
  background: var(--tp-muted-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tp-related-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
}

.tp-related-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tp-related-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tp-related-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tp-related-date {
  font-size: 12px;
  color: var(--tp-text-muted);
}
