/* StockTitan News Feed — theme-aware styles. */
.stocktitan-news-feed {

    /* Add explicit fallbacks so it works on any theme */
  --stnf-text: var(--wp--preset--color--foreground, currentColor);
  --stnf-link: var(--wp--preset--color--link, var(--wp--preset--color--primary, #0073aa));
  /* Inherit theme colors unless overridden via CSS variables */
  --stnf-bg:          transparent;
  --stnf-title:       initial;
  --stnf-summary:     initial;
  --stnf-date:        initial;
  --stnf-symbol:      initial;
  --stnf-exchange:    initial;
  --stnf-tag:         initial;
  --stnf-divider:     initial;
  --stnf-tag-bg: rgba(0,0,0,0.12);

  background: var(--stnf-bg);
  color: var(--stnf-text);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.stocktitan-news-feed .stnf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.stocktitan-news-feed .stnf-footer {
  margin-top: .75rem;
  padding-top: .5rem;
  border-top: 1px solid var(--stnf-divider, rgba(0,0,0,0.08));
  font-size: .85em;
  opacity: .9;
}
.stocktitan-news-feed .stnf-footer a { color: var(--stnf-link, currentColor); text-decoration: none; }
.stocktitan-news-feed .stnf-footer a:hover, .stocktitan-news-feed .stnf-footer a:focus { text-decoration: underline; }

.stocktitan-news-feed .stnf-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--stnf-divider, rgba(0,0,0,0.08));
}
.stocktitan-news-feed .stnf-item:last-child { border-bottom: 0; }

.stocktitan-news-feed .stnf-title {
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  color: var(--stnf-title, var(--stnf-link));
}
.stocktitan-news-feed .stnf-title:hover,
.stocktitan-news-feed .stnf-title:focus {
  text-decoration: underline;
}

.stocktitan-news-feed .stnf-meta {
  font-size: 0.85em;
  margin-top: 0.15rem;
  display: flex; gap: .5rem; flex-wrap: wrap;
  opacity: 0.95;
}
.stocktitan-news-feed .stnf-meta .stnf-exchange { color: var(--stnf-exchange, var(--stnf-text)); }
.stocktitan-news-feed .stnf-meta .stnf-date     { color: var(--stnf-date,     var(--stnf-text)); }
.stocktitan-news-feed .stnf-tz { font-size: .85em; opacity: .8; }
.stocktitan-news-feed .stnf-sep { opacity: .5; }

/* Symbol color + link behavior */
.stocktitan-news-feed .stnf-meta .stnf-symbol,
.stocktitan-news-feed .stnf-meta a.stnf-symbol {
  color: var(--stnf-symbol, var(--stnf-text));
  text-decoration: none;
}
.stocktitan-news-feed .stnf-meta a.stnf-symbol:hover,
.stocktitan-news-feed .stnf-meta a.stnf-symbol:focus {
  text-decoration: underline;
}


.stocktitan-news-feed .stnf-summary {
  margin-top: 0.35rem;
  line-height: 1.5;
  color: var(--stnf-summary, var(--stnf-text));
}

/* Tag badges */
.stocktitan-news-feed .stnf-tags { margin-top:.4rem; display:flex; gap:.35rem; flex-wrap:wrap; }
.stocktitan-news-feed .stnf-tag {
  display: inline-flex;
  align-items: center;
  padding: .18rem .5rem;
  border-radius: 999px;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  background: var(--stnf-tag-bg);
  color: var(--stnf-tag, var(--stnf-text));
}

/* Layout row: logo (left) + body (right) */
.stocktitan-news-feed {
  --stnf-logo-size: 56px; /* tweak if you want */
}

.stocktitan-news-feed .stnf-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* Header row: logo + title (+ meta under title) */
.stocktitan-news-feed .stnf-head,
.stocktitan-news-feed .stnf-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .2rem;
  min-height: 3rem;
}

/* Clickable logo */
.stocktitan-news-feed .stnf-logo {
  display: inline-flex;
  flex: 0 0 auto;
  width: var(--stnf-logo-size, 56px);
  height: var(--stnf-logo-size, 56px);
  border-radius: 12px;
  overflow: hidden;
  /* color-mix() fallbacks for Safari <16.4 */
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 10%, transparent);
  background: rgba(0, 0, 0, 0.1);
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.stocktitan-news-feed .stnf-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;        
  display: block;
}

/* Hide logos when toggled off (frontend + editor) */
.stocktitan-news-feed.stnf--no-logo .stnf-logo { display: none !important; }
.wp-block-stocktitan-news-feed-news-feed[data-show-logo="false"] .stnf-logo { display: none !important; }

.stocktitan-news-feed .stnf-head-main {
  min-width: 0; /* allow wrapping */
  flex: 1 1 auto;
}

.stocktitan-news-feed .stnf-head-main .stnf-title {
  display: inline-block;
  margin-top: .1rem;
}

.stocktitan-news-feed .stnf-head-main .stnf-meta {
  margin-top: .2rem;
}


/* ---------- Color preset: StockTitan Dark Mode ---------- */
.stocktitan-news-feed.stnf--preset-stocktitan-dark {
  --stnf-bg:              var(--background-feed, #0d0c2d);
  --stnf-text:            var(--text, #ddd);
  --stnf-link:            var(--text-highlight, #339bc6);
  --stnf-title:           var(--text-title-secondary, #97c9fc);
  --stnf-symbol:          var(--color-stock-symbol, #3586d3);
  --stnf-symbol-hover:    var(--color-stock-symbol-hover, #35d3d1);
  --stnf-divider:         var(--article-border-color-2, #26294c);

  --stnf-tag-bg:          var(--background-feed-tag, #006e62);
  --stnf-tag:        var(--text-feed-tag, #fff);
}

/* ---------- Color preset: NYSE (Light) ---------- */
.stocktitan-news-feed.stnf--preset-nyse {
  --stnf-bg:       #ffffff;
  --stnf-text:     #000000;
  --stnf-link:     #4299e1;   /* matches ring color rgb(66,153,225) */
  --stnf-title:    #000000;
  --stnf-symbol:   #4299e1;
  --stnf-divider:  #e2e8f0;

  /* Tag chips */
  --stnf-tag-bg:   #d4e2e8;   /* from selection background */
  --stnf-tag:      #000000;
}

/* optional hover tweak for symbol links in NYSE preset */
.stocktitan-news-feed.stnf--preset-nyse .stnf-meta a.stnf-symbol:hover,
.stocktitan-news-feed.stnf--preset-nyse .stnf-meta a.stnf-symbol:focus {
  color: #2b6cb0; /* deeper blue on hover */
}

.stocktitan-news-feed.stnf--preset-nasdaq {
  /* Neutrals from your snippet */
  --stnf-bg:       #ffffff;   /* --jptr22-color-neutral-white */
  --stnf-text:     #313141;   /* --jptr22-color-neutral-70 */
  --stnf-link:     #08062a;   /* --jptr22-color-neutral-black */

  --stnf-title:    #08062a;   /* strong headline */
  --stnf-symbol:   #00eb80;   /* --jptr22-color-green-40  (NASDAQ green) */
  --stnf-divider:  #e6e6e6;   /* --jptr22-color-neutral-20 */

  /* Tag chips */
  --stnf-tag-bg:   #f5f5fa;   /* --jptr22-color-neutral-02 */
  --stnf-tag:      #313141;   /* --jptr22-color-neutral-70 */
}

/* Optional hover for symbol links in NASDAQ preset */
.stocktitan-news-feed.stnf--preset-nasdaq .stnf-meta a.stnf-symbol:hover,
.stocktitan-news-feed.stnf--preset-nasdaq .stnf-meta a.stnf-symbol:focus {
  color: #0db057;
}

/* ---------- Color preset: Bloomberg Terminal ---------- */
.stocktitan-news-feed.stnf--preset-bloomberg {
  --stnf-bg:       #000000;
  --stnf-text:     #cccccc;
  --stnf-link:     #f5a623;
  --stnf-title:    #f5a623;
  --stnf-symbol:   #f5a623;
  --stnf-exchange: #999999;
  --stnf-date:     #999999;
  --stnf-summary:  #cccccc;
  --stnf-divider:  #222222;
  --stnf-tag-bg:   #1a1a1a;
  --stnf-tag:      #f5a623;
}
.stocktitan-news-feed.stnf--preset-bloomberg .stnf-meta a.stnf-symbol:hover,
.stocktitan-news-feed.stnf--preset-bloomberg .stnf-meta a.stnf-symbol:focus {
  color: #ffc147;
}

/* ---------- Color preset: Financial Times ---------- */
.stocktitan-news-feed.stnf--preset-ft {
  --stnf-bg:       #fff1e5;
  --stnf-text:     #33302e;
  --stnf-link:     #990f3d;
  --stnf-title:    #990f3d;
  --stnf-symbol:   #0d7680;
  --stnf-exchange: #66605a;
  --stnf-date:     #66605a;
  --stnf-summary:  #33302e;
  --stnf-divider:  #ccc1b7;
  --stnf-tag-bg:   #f2dfce;
  --stnf-tag:      #33302e;
}
.stocktitan-news-feed.stnf--preset-ft .stnf-meta a.stnf-symbol:hover,
.stocktitan-news-feed.stnf--preset-ft .stnf-meta a.stnf-symbol:focus {
  color: #095f68;
}
