/* ============================================================
   ToolNest Dynamic Content
   Server-rendered cards, featured stories, hubs and related posts.
   ============================================================ */

.tn-dc-grid { width: 100%; }
.tn-dc-card { height: 100%; min-width: 0; }
.tn-dc-cover { display: block; }
.tn-dc-card img.tn-cover,
.tn-dc-featured-cover img.tn-cover,
.tn-dc-topic-card img.tn-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}
.tn-dc-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tn-dc-card .tn-h3 { margin: 0; }
.tn-dc-card .tn-h3 a { color: var(--tn-ink); text-decoration: none; }
.tn-dc-card .tn-h3 a:hover { color: var(--tn-blue); }
.tn-dc-card .tn-body {
  margin: 0;
  color: var(--tn-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tn-dc-card .tn-meta { margin-top: auto; }
.tn-new-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--tn-gold);
  color: var(--tn-ink);
  font-family: var(--tn-font-ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  line-height: 1;
  text-transform: uppercase;
}

/* Featured story / comparison spotlight */
.tn-dc-featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  min-width: 0;
}
.tn-dc-featured-grid.tn-dc-no-image { grid-template-columns: minmax(0, 1fr); }
.tn-dc-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}
.tn-dc-stack .tn-h2,
.tn-dc-stack .tn-lead,
.tn-dc-stack .tn-meta { margin: 0; }
.tn-dc-stack .tn-h2 { max-width: 18ch; }
.tn-dc-stack .tn-h2 a { color: var(--tn-ink); text-decoration: none; }
.tn-dc-stack .tn-h2 a:hover { color: var(--tn-blue); }
.tn-dc-stack .tn-lead { max-width: 54ch; color: var(--tn-muted); }
.tn-dc-featured-cover { display: block; }
.tn-dc-featured-cover img.tn-cover { box-shadow: 0 18px 44px rgba(23, 33, 31, 0.12); }
.tn-dc-featured-grid .tn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--tn-font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}
.tn-dc-featured-grid .tn-btn-ink { background: var(--tn-ink); color: var(--tn-canvas); }
.tn-dc-featured-grid .tn-btn-ink:hover { background: var(--tn-blue); color: #fff; }
.tn-dc-featured-grid .tn-btn-primary { background: var(--tn-blue); color: #fff; }
.tn-dc-featured-grid .tn-btn-primary:hover { background: var(--tn-ink); color: var(--tn-canvas); }

/* Compact latest list (archive sidebar) */
.tn-dc-list-card { display: flex; flex-direction: column; gap: 14px; }
.tn-dc-list-card .tn-eyebrow { margin: 0; }
.tn-dc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tn-dc-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  margin: 0;
}
.tn-dc-list-num {
  color: var(--tn-mint);
  font-family: var(--tn-font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.tn-dc-list a {
  color: var(--tn-canvas);
  font-family: var(--tn-font-ui);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.tn-dc-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tn-dc-list-date {
  color: var(--tn-on-dark-muted);
  font-family: var(--tn-font-ui);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Pagination */
.tn-dc-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}
.tn-dc-pagination a,
.tn-dc-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--tn-border);
  border-radius: 999px;
  background: var(--tn-surface);
  color: var(--tn-ink);
  font-family: var(--tn-font-ui);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.tn-dc-pagination a:hover { border-color: var(--tn-blue); color: var(--tn-blue); }
.tn-dc-pagination .current {
  background: var(--tn-ink);
  border-color: var(--tn-ink);
  color: var(--tn-canvas);
}

/* Dynamic related section on single posts */
.tn-dc-related { background: var(--tn-canvas); }
.tn-dc-related-head { margin-bottom: 32px; }
.tn-dc-related-head .tn-eyebrow { margin: 0 0 8px; }
.tn-dc-related-head .tn-h2 { margin: 0; }

/* Hide the old hard-coded related section; the dynamic module replaces it. */
body.single-post .elementor .tn-section-sm:has(.tn-related-grid) {
  display: none !important;
}

/* Static copy replacements that keep the surrounding Elementor layout */
.tn-dc-text { margin: 0; }
.tn-dc-muted { color: var(--tn-muted); }
.tn-dc-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--tn-font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

/* Topic filter chips */
.tn-dc-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.tn-dc-filter-chips .tn-chip {
  min-height: 44px;
  text-decoration: none;
}

/* Topic directory */
.tn-dc-topic-grid .tn-topic-card { height: 100%; }
.tn-dc-topic-count { margin-top: auto; color: var(--tn-muted); }

@media (max-width: 1023px) {
  .tn-dc-featured-grid { gap: 28px; }
  .tn-dc-stack .tn-h2 { max-width: 22ch; }
}

@media (max-width: 767px) {
  .tn-dc-featured-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tn-dc-stack .tn-h2 { max-width: none; font-size: 28px; }
  .tn-dc-featured-cover img.tn-cover { box-shadow: 0 12px 28px rgba(23, 33, 31, 0.1); }
  .tn-dc-list-card { padding: 22px; }
  .tn-dc-pagination { margin-top: 28px; }
}
