/* One sentiment treatment for the main feed and each stock's News view. */
.news-sentiment-card {
  --news-sash-tint-start: 44%;
  --news-sash-tint-end: 34%;
  --news-sentiment-label: "UNRATED";
  --news-sentiment-color: var(--tr-reading-muted, #606d66);
  --news-sentiment-paper: var(--tr-reading-surface, var(--paper, #fbfcfa));
}
.news-sentiment-card[data-sentiment="positive"] { --news-sentiment-label: "POSITIVE"; --news-sentiment-color: var(--tr-reading-positive, #11745a); }
.news-sentiment-card[data-sentiment="negative"] { --news-sentiment-label: "NEGATIVE"; --news-sentiment-color: var(--tr-reading-negative, #a04439); }
.news-sentiment-card[data-sentiment="neutral"] { --news-sentiment-label: "NEUTRAL"; --news-sentiment-color: var(--tr-reading-neutral, #825d13); }
/* A brighter ribbon keeps the small black caption legible in dark mode. */
html[data-reading-theme="dark"] .news-sentiment-card {
  --news-sash-tint-start: 76%;
  --news-sash-tint-end: 70%;
}
html body .news-story.news-sentiment-card,
html body.stock-news-mode #report-content .news-story.news-sentiment-card {
  position: relative;
  background-color: var(--news-sentiment-paper);
  background-image:
    linear-gradient(135deg, rgb(255 255 255 / 4%), transparent 45%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--news-sentiment-color) 8%, var(--news-sentiment-paper)),
      color-mix(in srgb, var(--news-sentiment-color) 2%, var(--news-sentiment-paper)));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%), 0 3px 12px rgb(0 0 0 / 7%);
}
/* Keep the corner ribbon inside the card without clipping links or focus rings. */
.news-story.news-sentiment-card::before {
  /* The context heading or hidden fallback supplies accessible sentiment. */
  content: var(--news-sentiment-label) / "";
  position: absolute;
  z-index: 1;
  top: 20px;
  right: -2px;
  width: 56px;
  height: 12px;
  transform: rotate(45deg);
  pointer-events: none;
  color: #000;
  font-family: var(--tr-type-family, "IBM Plex Sans", system-ui, sans-serif);
  font-size: 10px;
  line-height: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  text-align: center;
  text-transform: none;
  white-space: nowrap;
}
.news-story.news-sentiment-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 64px;
  pointer-events: none;
  clip-path: polygon(0 0, 24px 0, 100% 40px, 100% 100%);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--news-sentiment-color) var(--news-sash-tint-start), transparent),
    color-mix(in srgb, var(--news-sentiment-color) var(--news-sash-tint-end), transparent));
}
html body .news-story.news-sentiment-card > .news-headline,
html body.stock-news-mode #report-content .news-story.news-sentiment-card > .news-headline {
  padding-inline-end: 48px;
}
.news-sentiment-card .news-sentiment-context {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--news-sentiment-color) 18%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--news-sentiment-color) 5%, transparent);
  overflow-wrap: anywhere;
}
html body .news-sentiment-context > h3,
html body.reading #report-content .tr-stock-news .news-sentiment-context > h3 {
  margin: 0 0 6px !important;
  padding: 0;
  color: var(--news-sentiment-color) !important;
  font-family: var(--tr-type-family, "IBM Plex Sans", system-ui, sans-serif);
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 500 !important;
  letter-spacing: 0;
  text-transform: none;
}
html body .news-sentiment-context > p,
html body.reading #report-content .tr-stock-news .news-sentiment-context > p {
  margin: 0 !important;
  padding: 0;
  color: var(--tr-reading-copy, #3e4c45) !important;
  font-family: var(--tr-type-family, "IBM Plex Sans", system-ui, sans-serif);
  font-size: 12px !important;
  line-height: 18px !important;
  font-weight: 400 !important;
  letter-spacing: 0;
  text-transform: none;
  white-space: pre-line;
}
@media (forced-colors: active) {
  .news-story.news-sentiment-card::before,
  .news-story.news-sentiment-card::after { display: none; }
  html body .news-story.news-sentiment-card,
  html body.stock-news-mode #report-content .news-story.news-sentiment-card { background-image: none; box-shadow: none; }
  .news-sentiment-card .news-sentiment-context { border-color: CanvasText; }
}
@media print {
  .news-story.news-sentiment-card::before,
  .news-story.news-sentiment-card::after { display: none; }
  html body .news-story.news-sentiment-card > .news-headline,
  html body.stock-news-mode #report-content .news-story.news-sentiment-card > .news-headline { padding-inline-end: 0; }
  html body .news-story.news-sentiment-card,
  html body.stock-news-mode #report-content .news-story.news-sentiment-card { background: none; box-shadow: none; }
  .news-sentiment-card .news-sentiment-context { background: none; border-color: #999; }
  html body .news-sentiment-context > h3,
  html body .news-sentiment-context > p { color: #000 !important; }
}
