/* === Truth or Tactic — unified styles for single page + explorer === */
/* Works with either IDs (#truthortactic-…) or classes (.truthortactic-…) */

/* Container */
#truthortactic-explorer {
  font-family: var(--wp--preset--font-family--system-ui, system-ui, sans-serif);
  color: var(--wp--preset--color--contrast, #111);
  margin: 2rem 0;
}

/* Controls row */
.truthortactic-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  align-items: center;
  margin-bottom: 1rem;
}

/* Search input (support id OR class) */
#truthortactic-search,
.truthortactic-search {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
}

/* Filter selects (support ids OR classes) */
#truthortactic-filter-topic,
.truthortactic-filter-topic,
#truthortactic-filter-device,
.truthortactic-filter-device,
#truthortactic-filter-tone,
.truthortactic-filter-tone,
#truthortactic-filter-outlet,
.truthortactic-filter-outlet,
#truthortactic-filter-min-grade,
.truthortactic-filter-min-grade {
  padding: 0.45rem 0.6rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  min-width: 11rem;
}

/* Results: cards */
.truthortactic-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin: 0 0 1rem 0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.truthortactic-card h3 {
  margin: 0 0 0.35rem 0;
  font-size: 1.15rem;
}
.truthortactic-card h3 a {
  color: var(--wp--preset--color--contrast, #111);
  text-decoration: none;
}
.truthortactic-card h3 a:hover { text-decoration: underline; }
.truthortactic-excerpt { font-size: .95rem; margin: .1rem 0 .5rem 0; }

/* --- Chips (used on cards and single page) --- */
.truthortactic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0.75rem 0;
}
.truthortactic-chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1.2;
  background: #f3f4f6;   /* neutral */
  color: #111827;
  text-decoration: none;
  border: 1px solid #e5e7eb;
}
.truthortactic-chip:link,
.truthortactic-chip:visited { color: #111827; }
.truthortactic-chip:hover,
.truthortactic-chip:focus {
  background: #e5e7eb;
  border-color: #d1d5db;
  outline: none;
}
/* Category accents */
.truthortactic-chip--outlet { background: #eef2ff; border-color: #e0e7ff; }
.truthortactic-chip--topic  { background: #ecfeff; border-color: #cffafe; }
.truthortactic-chip--device { background: #fef3c7; border-color: #fde68a; }
.truthortactic-chip--tone   { background: #fce7f3; border-color: #fbcfe8; }
.truthortactic-chip--outlet:hover,
.truthortactic-chip--outlet:focus { background: #e0e7ff; }
.truthortactic-chip--topic:hover,
.truthortactic-chip--topic:focus  { background: #cffafe; }
.truthortactic-chip--device:hover,
.truthortactic-chip--device:focus { background: #fde68a; }
.truthortactic-chip--tone:hover,
.truthortactic-chip--tone:focus   { background: #fbcfe8; }

/* --- Grade badges (shared) --- */
.truthortactic-grade {
  display: inline-block;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  font-size: 0.9rem;
  vertical-align: baseline;
  border: 1px solid rgba(0,0,0,.06);
}
.truthortactic-grade--good { background: #e6f7ed; color: #16794f; }
.truthortactic-grade--ok   { background: #fff4e5; color: #8a5a0a; }
.truthortactic-grade--low  { background: #fdecea; color: #8a1919; }

/* Pager */
#truthortactic-pager { margin-top: 1rem; text-align: center; }
#truthortactic-pager button {
  margin: 0 .5rem;
  padding: .45rem .85rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
#truthortactic-pager button:hover { background: #f6f8fa; }

/* --- Single “rhetoric” page bits (summary + stacked meta) --- */
.truthortactic-single { margin-block: 1.25rem 2rem; }

/* Stacked meta list */
.truthortactic-meta-list {
  display: block;
  margin: 0 0 0.75rem 0;
}
.truthortactic-meta-list .truthortactic-meta {
  display: block;
  line-height: 1.5;
  margin: 0.15rem 0;
}

/* Older layout helper (if present in templates) */
.truthortactic-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: .95rem;
  color: var(--wp--preset--color--contrast-2, #555);
}
.truthortactic-meta-row .truthortactic-meta strong {
  color: var(--wp--preset--color--contrast, #111);
  font-weight: 600;
}

.truthortactic-summary {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--wp--preset--color--contrast, #111);
  margin-bottom: 1rem;
}

.truthortactic-origin-link { margin-top: .5rem; }
.truthortactic-origin-link a { text-decoration: underline; }

/* Legend (optional) */
.truthortactic-legend__inner {
  display: flex;
  gap: .5rem .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin: .5rem 0 1rem;
}
.truthortactic-legend__inner > strong { margin-right: .25rem; }

/* Responsive tweaks */
@media (max-width: 782px) {
  #truthortactic-explorer #truthortactic-search,
  .truthortactic-search { max-width: 100%; }

  #truthortactic-filter-topic,
  .truthortactic-filter-topic,
  #truthortactic-filter-device,
  .truthortactic-filter-device,
  #truthortactic-filter-tone,
  .truthortactic-filter-tone,
  #truthortactic-filter-outlet,
  .truthortactic-filter-outlet,
  #truthortactic-filter-min-grade,
  .truthortactic-filter-min-grade {
    min-width: 100%;
  }
}
