/* /new-sites and /new-sites/niche/<slug>.
 *
 * Colour comes only from the tokens declared in src/pages.js (`--primary`, `--border`,
 * `--card`, `--muted-foreground`, …). No literal colour is written here, so the site's palette
 * stays one edit and every surface keeps the same contrast guarantees. The bar strip is
 * decorative: the same numbers are in the stat cards and the table, so a reader who cannot
 * distinguish the bars loses no information.
 */

.newsites {
  padding-top: 32px;
}

.newsites .radar-hero {
  margin-bottom: 12px;
}

/* ---- Search ---- */
.newsites-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}
.newsites-input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: var(--fs-base);
}
/* The global `input[type=search]` rule sets min-width: min(100%, 280px); at 390px that beats
   `.newsites-input` on specificity and wraps the button onto its own row. This keeps the input
   shrinkable so the search and its button stay one control. */
.newsites-search .newsites-input {
  min-width: 0;
  flex: 1 1 180px;
}
.newsites-input::placeholder {
  color: var(--muted-foreground);
}
.newsites-input:focus-visible,
.newsites-chip:focus-visible,
.newsites-domain:focus-visible,
.newsites-actions a:focus-visible,
.newsites-niche-more > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---- Niche chips ---- */
/* `nav` is a global flex/space-between row; these two are inline lists that must pack left. */
.newsites-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin: 6px 0 14px;
}
.newsites-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.newsites-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.newsites-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
}
.newsites-chip-count {
  color: var(--muted-foreground);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.newsites-chip.is-active .newsites-chip-count {
  color: inherit;
}
.newsites-niche-more > summary {
  display: inline-block;
  margin: 2px 0 4px;
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}

/* ---- Stat cards ---- */
.newsites-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.newsites-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.newsites-stat-label {
  color: var(--foreground-secondary);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.newsites-stat-value {
  color: var(--foreground);
  font-size: var(--fs-xl);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.newsites-stat-note {
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
}

/* ---- 14-day strip ---- */
.newsites-strip {
  margin: 4px 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.newsites-strip figcaption {
  color: var(--foreground-secondary);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.newsites-bars {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 84px;
  margin: 10px 0 6px;
}
/* Each column keeps its full-height track, so a quiet day still reads as a bar on a scale
   rather than as a shorter block floating in white space. */
.newsites-bar-slot {
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  min-width: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--background-tertiary);
}
.newsites-bar {
  width: 100%;
  height: var(--bar-height, 4%);
  border-radius: 4px 4px 0 0;
  background: var(--primary);
  opacity: 0.9;
}
.newsites-strip-note {
  margin: 0;
  font-size: var(--fs-xs);
}

/* ---- Honest warnings and notes ---- */
.newsites-warning {
  margin: 10px 0 14px;
  padding: 10px 14px;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warning) 9%, var(--card));
  color: var(--foreground);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.newsites-note {
  max-width: 82ch;
  margin: 16px 0;
  color: var(--foreground-secondary);
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.newsites-result-line {
  margin: 0 0 10px;
  color: var(--foreground-secondary);
  font-size: var(--fs-sm);
}

/* ---- Table ---- */
.newsites-table {
  min-width: 640px;
}
.newsites-domain {
  color: var(--foreground);
  font-weight: 700;
  text-decoration: none;
}
.newsites-domain:hover {
  color: var(--primary);
  text-decoration: underline;
}
.newsites-actions {
  white-space: nowrap;
}
.newsites-actions a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.newsites-actions a:hover {
  text-decoration: underline;
}
.newsites-actions > span {
  padding: 0 6px;
  color: var(--muted-foreground);
}

/* ---- CTA and niche page chrome ---- */
.newsites-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background-secondary);
}
.newsites-cta strong {
  display: block;
  color: var(--foreground);
  font-size: var(--fs-md);
}
.newsites-cta p {
  max-width: 62ch;
  margin: 4px 0 0;
  color: var(--foreground-secondary);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.newsites-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.newsites-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
}
.newsites-breadcrumb a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.newsites-breadcrumb a:hover {
  text-decoration: underline;
}
.newsites-niche-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 12px;
}
.newsites-niche-bar p {
  margin: 0;
  color: var(--foreground-secondary);
  font-size: var(--fs-sm);
}
.newsites-related {
  margin-top: 26px;
}
.newsites-related h2 {
  margin: 0 0 8px;
  font-size: var(--fs-lg);
}

@media (max-width: 640px) {
  .newsites {
    padding-left: 16px;
    padding-right: 16px;
  }
  /* The hero's separator has nothing to separate once the freshness fact wraps. */
  .newsites .radar-hero-meta .meta-sep {
    display: none;
  }
  .newsites-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .newsites-cta {
    align-items: stretch;
    flex-direction: column;
  }
  .newsites-cta-actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .newsites * {
    transition: none !important;
    animation: none !important;
  }
}
