/**
 * Trends Publisher - Universal Theme-Compatible Styles
 * Version: 2.3.7 (Production)
 * 
 * This CSS is designed to work with ANY WordPress theme.
 * It automatically adapts to light/dark modes using CSS custom properties
 * and supports all common dark mode implementations.
 */

/* =====================================================
   UNIVERSAL COLOR SYSTEM - Light Mode (Default)
   ===================================================== */

:root {
  /* Light mode defaults - works with most themes */
  --tp-card-bg: #ffffff;
  --tp-card-border: #e5e7eb;
  --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: #16a34a;
  --tp-stat-up-bg: rgba(22, 163, 74, 0.08);
  --tp-stat-down-color: #dc2626;
  --tp-stat-down-bg: rgba(220, 38, 38, 0.08);
  --tp-stat-neutral-color: #3b82f6;
  --tp-stat-neutral-bg: rgba(59, 130, 246, 0.08);
}

/* =====================================================
   UNIVERSAL DARK MODE SUPPORT
   Supports ALL common dark mode implementations
   ===================================================== */

/* Light mode via class selectors - Explicit override for light mode */
.light,
.light-mode,
[data-theme="light"],
[data-mode="light"],
.tp-light,
.nu-light,
.ast-light-mode,
body.light-mode,
body.light-theme,
body[data-theme="light"] {
  --tp-card-bg: #ffffff;
  --tp-card-border: #e5e7eb;
  --tp-text-primary: #1a1a2e;
  --tp-text-secondary: #6b7280;
  --tp-text-muted: #9ca3af;
  --tp-accent: #0d7377;
  --tp-muted-bg: #f3f4f6;
  --tp-stat-up-color: #16a34a;
  --tp-stat-up-bg: rgba(22, 163, 74, 0.08);
  --tp-stat-down-color: #dc2626;
  --tp-stat-down-bg: rgba(220, 38, 38, 0.08);
  --tp-stat-neutral-color: #3b82f6;
  --tp-stat-neutral-bg: rgba(59, 130, 246, 0.08);
}

/* Dark mode via class selectors */
.dark,
[data-theme="dark"],
[data-mode="dark"],
.tp-dark,
.nu-dark,
.ast-dark-mode,
.generate-dark-mode,
.dark-mode,
[data-color-mode="dark"],
.owp-dark-mode,
body.dark-mode,
body.dark-theme,
body[data-theme="dark"] {
  --tp-card-bg: #1e1e2e;
  --tp-card-border: #2e2e3e;
  --tp-text-primary: #e4e4e7;
  --tp-text-secondary: #a1a1aa;
  --tp-text-muted: #71717a;
  --tp-accent: #14b8a6;
  --tp-muted-bg: #27272a;
  --tp-stat-up-color: #22c55e;
  --tp-stat-up-bg: rgba(34, 197, 94, 0.12);
  --tp-stat-down-color: #ef4444;
  --tp-stat-down-bg: rgba(239, 68, 68, 0.12);
  --tp-stat-neutral-color: #60a5fa;
  --tp-stat-neutral-bg: rgba(96, 165, 250, 0.12);
}

/* Dark mode via system preference */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode):not([data-theme="light"]):not(.nu-theme):not(.ast-separate-container) {
    --tp-card-bg: #1e1e2e;
    --tp-card-border: #2e2e3e;
    --tp-text-primary: #e4e4e7;
    --tp-text-secondary: #a1a1aa;
    --tp-text-muted: #71717a;
    --tp-accent: #14b8a6;
    --tp-muted-bg: #27272a;
    --tp-stat-up-color: #22c55e;
    --tp-stat-up-bg: rgba(34, 197, 94, 0.12);
    --tp-stat-down-color: #ef4444;
    --tp-stat-down-bg: rgba(239, 68, 68, 0.12);
    --tp-stat-neutral-color: #60a5fa;
    --tp-stat-neutral-bg: rgba(96, 165, 250, 0.12);
  }
}

/* Force light mode for themes without explicit dark/light classes */
body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-single-content,
body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-single-content *,
body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-single-title,
body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-archive-title {
  color: #1a1a2e !important;
}

/* Ensure dark mode text when dark mode is active */
body.dark .tp-single-content,
body.nu-dark .tp-single-content,
body.dark-mode .tp-single-content,
body.ast-dark-mode .tp-single-content,
body[data-theme="dark"] .tp-single-content,
body.dark .tp-single-content *,
body.nu-dark .tp-single-content *,
body.dark-mode .tp-single-content *,
body.ast-dark-mode .tp-single-content *,
body[data-theme="dark"] .tp-single-content * {
  color: #e4e4e7 !important;
}

/* Fix statistics panel colors for light/dark mode */
body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-stats-panel {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
}

body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-stats-panel-header {
  background: #f3f4f6 !important;
  border-bottom-color: #e5e7eb !important;
  color: #1a1a2e !important;
}

body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-stat-card {
  border-right-color: #e5e7eb !important;
  border-bottom-color: #e5e7eb !important;
}

body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-stat-card-value,
body:not(.dark):not(.nu-dark):not(.dark-mode):not(.ast-dark-mode):not([data-theme="dark"]) .tp-stat-card-label {
  color: #1a1a2e !important;
}

body.dark .tp-stats-panel,
body.nu-dark .tp-stats-panel,
body.dark-mode .tp-stats-panel,
body.ast-dark-mode .tp-stats-panel,
body[data-theme="dark"] .tp-stats-panel {
  background: #1e1e2e !important;
  border-color: #2e2e3e !important;
}

body.dark .tp-stats-panel-header,
body.nu-dark .tp-stats-panel-header,
body.dark-mode .tp-stats-panel-header,
body.ast-dark-mode .tp-stats-panel-header,
body[data-theme="dark"] .tp-stats-panel-header {
  background: #27272a !important;
  border-bottom-color: #2e2e3e !important;
  color: #e4e4e7 !important;
}

body.dark .tp-stat-card,
body.nu-dark .tp-stat-card,
body.dark-mode .tp-stat-card,
body.ast-dark-mode .tp-stat-card,
body[data-theme="dark"] .tp-stat-card {
  border-right-color: #2e2e3e !important;
  border-bottom-color: #2e2e3e !important;
}

body.dark .tp-stat-card-value,
body.nu-dark .tp-stat-card-value,
body.dark-mode .tp-stat-card-value,
body.ast-dark-mode .tp-stat-card-value,
body[data-theme="dark"] .tp-stat-card-value,
body.dark .tp-stat-card-label,
body.nu-dark .tp-stat-card-label,
body.dark-mode .tp-stat-card-label,
body.ast-dark-mode .tp-stat-card-label,
body[data-theme="dark"] .tp-stat-card-label {
  color: #e4e4e7 !important;
}

/* =====================================================
   BASE STYLES
   ===================================================== */

.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 CARDS - Universal Theme Support
   ===================================================== */

.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;
  color: var(--tp-text-primary);
}

.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: contain;
  background: var(--tp-muted-bg);
  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-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--tp-card-border);
}

.tp-trend-stat {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--tp-stat-neutral-bg);
  color: var(--tp-stat-neutral-color);
}

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

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

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

.tp-trend-stat-icon {
  display: inline-flex;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

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

.tp-trend-stat-value {
  font-weight: 700;
  font-size: 12px;
}

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

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

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

.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: 8px;
}

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

/* =====================================================
   VIEW ALL TRENDS BUTTON
   ===================================================== */

.tp-view-all-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--tp-card-border);
}

.tp-view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--tp-accent);
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tp-view-all-btn:hover {
  background: var(--tp-accent);
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #ffffff !important;
}

.tp-view-all-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tp-view-all-btn:hover svg {
  transform: translateX(4px);
}

/* =====================================================
   HORIZONTAL LAYOUT
   ===================================================== */

.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: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}

@media (min-width: 1024px) {
  .tp-single-container {
    max-width: 1200px !important;
    padding: 0 40px !important;
  }
}

@media (min-width: 1280px) {
  .tp-single-container {
    max-width: 1400px !important;
    padding: 0 60px !important;
  }
}

.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;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-width: 100vw;
  border-radius: 0;
  overflow: hidden;
  background: var(--tp-muted-bg);
}

.tp-featured-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: cover;
  background: var(--tp-muted-bg);
}

/* =====================================================
   STATISTICS PANEL
   ===================================================== */

.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;
}

.tp-stats-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--tp-muted-bg);
  border-bottom: 1px solid var(--tp-card-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-text-primary);
}

.tp-stats-panel-header svg {
  opacity: 0.7;
  flex-shrink: 0;
}

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

.tp-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  text-align: center;
  border-right: 1px solid var(--tp-card-border);
  position: relative;
}

.tp-stat-card:last-child {
  border-right: none;
}

@media (max-width: 639px) {
  .tp-stats-panel-grid {
    grid-template-columns: 1fr;
  }
  .tp-stat-card {
    border-right: none;
    border-bottom: 1px solid var(--tp-card-border);
  }
  .tp-stat-card:last-child {
    border-bottom: none;
  }
}

.tp-stat-card-icon {
  font-size: 28px;
  line-height: 1;
}

.tp-stat-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--tp-text-primary);
  line-height: 1.2;
}

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

.tp-stat-card-arrow {
  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); }
.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); }
.tp-stat-card.tp-stat-neutral .tp-stat-card-value { color: var(--tp-stat-neutral-color); }

/* =====================================================
   SINGLE TREND CONTENT
   ===================================================== */

.tp-single-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--tp-text-primary) !important;
}

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

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

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

.tp-single-content ul,
.tp-single-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
  color: var(--tp-text-primary) !important;
}

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

.tp-single-content strong,
.tp-single-content b {
  color: var(--tp-text-primary) !important;
}

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

.tp-single-content a {
  color: var(--tp-accent) !important;
  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) !important;
}

/* =====================================================
   RELATED ARTICLES
   ===================================================== */

.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;
  background: var(--tp-muted-bg);
}

.tp-related-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--tp-muted-bg);
}

.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);
}

/* =====================================================
   THEME COMPATIBILITY OVERRIDES
   Ensures plugin works with any WordPress theme
   ===================================================== */

/* Reset any theme-specific styles that might interfere */
.tp-trend-card,
.tp-trend-card *,
.tp-stats-panel,
.tp-stats-panel *,
.tp-archive-container,
.tp-archive-container *,
.tp-single-container,
.tp-single-container * {
  box-sizing: border-box;
}

/* Ensure links inherit color properly */
.tp-trend-card-link,
.tp-related-card {
  color: inherit !important;
}

/* Prevent theme link styles from affecting cards */
.tp-trend-card a,
.tp-related-card {
  text-decoration: none !important;
}

/* Ensure proper text color inheritance */
.tp-trend-card-title,
.tp-archive-title,
.tp-single-title,
.tp-related-name {
  color: var(--tp-text-primary) !important;
}

.tp-trend-card-excerpt,
.tp-archive-description,
.tp-single-meta,
.tp-related-date {
  color: var(--tp-text-muted) !important;
}

/* Ensure backgrounds work in all themes */
.tp-trend-card,
.tp-stats-panel,
.tp-no-posts,
.tp-related-card {
  background: var(--tp-card-bg) !important;
  border-color: var(--tp-card-border) !important;
}

/* =====================================================
   ACCESSIBILITY & PRINT STYLES
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  .tp-trend-card,
  .tp-trend-card-thumb img,
  .tp-related-card {
    transition: none !important;
  }
}

@media print {
  .tp-trend-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .tp-trend-card:hover {
    transform: none;
    box-shadow: none;
  }
}
