/* Editorial Intelligence — minimal default styling.
 * Themed deliberately conservatively; per-project themes can override
 * the .ei-sidebar / .ei-related selectors freely.
 */

/* Source attribution badge — shared by both blocks and any future
 * inline placement. Single class so theme overrides stay one-line. */
.ei-source-badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background-color: #f2efe6;
  color: #2a3a2a;
  border-radius: 2px;
  text-decoration: none;
  white-space: nowrap;
}

/* ============================================================
 * Sidebar block
 * ============================================================ */

.ei-sidebar {
  --ei-rule: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 1.1rem;
  background-color: rgba(255, 255, 255, 0.65);
  border-radius: 4px;
}

.ei-sidebar__heading {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid currentColor;
  padding-bottom: 0.35rem;
}

.ei-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ei-sidebar__item {
  padding: 0.7rem 0;
  border-bottom: var(--ei-rule);
}

.ei-sidebar__item:last-child {
  border-bottom: 0;
}

.ei-sidebar__link {
  display: block;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  color: inherit;
}

.ei-sidebar__link:hover {
  text-decoration: underline;
}

.ei-sidebar__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: #5a5a5a;
}

.ei-sidebar__time {
  font-variant-numeric: tabular-nums;
}

.ei-sidebar__tagline,
.ei-related__tagline {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.88rem;
  line-height: 1.45;
  font-style: italic;
  color: #2a3a2a;
}

.ei-related__tagline {
  margin: 0 1rem 0.6rem;
  font-size: 0.92rem;
}

/* Per-pair "why this matches" caption — the editorial trust signal.
 * Sits between the title and the source row. Italic + accent-coloured
 * so it reads as commentary, not as part of the article copy. */
.ei-related__why {
  margin: 0 1rem 0.55rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #2a3a2a;
  font-style: italic;
}

.ei-related__why-text {
  vertical-align: middle;
}

.ei-match-chip {
  display: inline-block;
  margin-right: 0.45em;
  padding: 0.05em 0.5em;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background-color: #e9efe1;
  color: #2a3a2a;
  border-radius: 2px;
  vertical-align: middle;
}

/* ============================================================
 * Related block (bottom of news article)
 * ============================================================ */

.ei-related {
  margin: 2.5rem 0 1rem;
}

.ei-related__heading {
  margin: 0 0 1.2rem;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  border-bottom: 2px solid currentColor;
  padding-bottom: 0.4rem;
}

.ei-related__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.ei-related__card {
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.ei-related__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.ei-related__link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.ei-related__image {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.ei-related__title {
  margin: 0.8rem 1rem 0.4rem;
  font-size: 1.02rem;
  line-height: 1.3;
}

.ei-related__excerpt {
  margin: 0 1rem 0.6rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #404040;
}

.ei-related__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 1rem 0.9rem;
  font-size: 0.82rem;
  color: #5a5a5a;
}

.ei-related__time {
  font-variant-numeric: tabular-nums;
}
