/* =========================================================
   CredibilityOS — Research report layer (/research/*)
   Layered on styles.css + reference/article.css. Adds: stat
   tiles, citation leaderboard tables with inline bars, topic
   cards, takeaway callouts, figures, source notes.
   Token-driven; values flip with data-theme like article.css.
   ========================================================= */

/* -------- Screen-reader-only (table captions) -------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* -------- Figures (generated editorial illustrations) -------- */
.rpt-figure {
  margin: var(--space-8) 0;
}

.rpt-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.rpt-figure--hero {
  margin: clamp(24px, 4vw, 48px) 0 0;
}

/* -------- Headline stat tiles (GEN:report-stats) -------- */
.rpt-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: var(--space-6) var(--space-8);
  padding: var(--space-6) 0;
  margin: var(--space-8) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.rpt-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.rpt-stat__num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-primary);
  /* Tiles align as a row; a wrapping value ("July 2026") drops its label
     out of line with the siblings'. */
  white-space: nowrap;
}

[data-theme="dark"] .rpt-stat__num {
  color: var(--color-accent);
}

.rpt-stat__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* -------- Topic cards (GEN:report-leaderboards) -------- */
.rpt-topic {
  margin: var(--space-10, 40px) 0;
}

.rpt-topic h3 {
  margin-bottom: var(--space-2);
}

.rpt-topic__kw {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4);
}

.rpt-camps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: var(--space-6);
  align-items: start;
}

.rpt-camp__name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-3);
}

.rpt-camp__name::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

.rpt-camp__name--google::before {
  background: var(--color-primary);
}

.rpt-camp__name--chatgpt::before {
  background: #8fa3bd;
}

/* -------- Tables -------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rpt-table {
  width: 100%;
  border-collapse: collapse;
}

.rpt-table th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--color-border-strong, var(--color-border));
}

.rpt-table td {
  padding: 7px var(--space-2);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  vertical-align: baseline;
}

[data-theme="dark"] .rpt-table td {
  color: #cfd5dd;
}

.rpt-table tbody tr:nth-child(even) td {
  background: rgba(127, 127, 127, 0.05);
}

.rpt-rank {
  width: 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.rpt-domain,
.rpt-url {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  /* break-word, not anywhere: 'anywhere' shrinks min-content width and made
     20+-char domains wrap mid-word at desktop widths. */
  overflow-wrap: break-word;
}

.rpt-num-h {
  text-align: right;
}

.rpt-table .rpt-num {
  position: relative;
  text-align: right;
  width: 42%;
  min-width: 110px;
}

.rpt-table--pages .rpt-num,
.rpt-table--brands .rpt-num,
.rpt-table--demand .rpt-num {
  width: auto;
  min-width: 88px;
}

.rpt-bar {
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: var(--w, 0%);
  border-radius: 2px;
  pointer-events: none;
}

.rpt-bar--google {
  background: rgba(234, 88, 12, 0.26);
}

.rpt-bar--chatgpt {
  background: rgba(143, 163, 189, 0.22);
}

.rpt-count {
  position: relative;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
}

/* -------- Most-cited pages blocks (GEN:report-pages) -------- */
.rpt-pages {
  margin: var(--space-8) 0;
}

.rpt-pages h3 {
  font-size: 1.0625rem;
  margin-bottom: var(--space-3);
}

/* -------- Takeaways, overlap line, source notes -------- */
.rpt-take {
  border-left: 3px solid var(--color-primary);
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  margin: var(--space-8) 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 500;
  color: var(--color-text-primary);
}

.rpt-overlap {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: var(--space-6) 0;
}

.rpt-src {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: var(--space-3) 0 0;
  line-height: 1.55;
}

/* -------- Small screens -------- */
@media (max-width: 720px) {
  .rpt-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .rpt-table .rpt-num {
    width: 38%;
    min-width: 96px;
  }
}
