/* ============================================================
   Tech Observer Live Blog — public styles
   Approved spec: #C8102E red · #1A1A1A text · #2A2A2A body ·
   #666 muted · #E0E0E0 hairlines · red @6% tints ·
   Source Serif 4 19px/15px · Inter · Roboto Condensed labels ·
   18px/10px rhythm, 16px card gaps. Monochrome share icons.
   ============================================================ */
:root {
  --tolb-red:        #C8102E;
  --tolb-red-dk:     #9E0020;
  --tolb-text:       #1A1A1A;
  --tolb-body:       #2A2A2A;
  --tolb-muted:      #666666;
  --tolb-border:     #E0E0E0;
  --tolb-tint:       rgba(200,16,46,0.06);
  --tolb-serif:      'Source Serif 4', Georgia, serif;
  --tolb-sans:       'Inter', Arial, sans-serif;
  --tolb-cond:       'Roboto Condensed', 'Arial Narrow', sans-serif;
  --tolb-sticky-top: 90px;
}

.tolb-wrap { margin: 8px 0 32px; font-family: var(--tolb-sans); }
.tolb-wrap *, .tolb-widget * { box-sizing: border-box; }

/* ── Status bar ── */
.tolb-statusbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.tolb-live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--tolb-red); color: #fff;
  font-family: var(--tolb-cond); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; padding: 3px 10px; border-radius: 2px;
}
.tolb-closed-badge {
  background: #555; color: #fff; font-family: var(--tolb-cond);
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 2px;
}
.tolb-dot { width: 7px; height: 7px; background: #fff; border-radius: 50%; display: inline-block; animation: tolb-blink 1.1s infinite; }
.tolb-dot.red { background: var(--tolb-red); }
@keyframes tolb-blink { 0%,100%{opacity:1} 50%{opacity:.25} }
@media (prefers-reduced-motion: reduce) { .tolb-dot { animation: none; } }

.tolb-meta { font-size: 12px; color: var(--tolb-muted); }
.tolb-meta strong { color: var(--tolb-red); font-weight: 600; }

/* ── Share icons: monochrome, minimal ── */
.tolb-share { display: inline-flex; align-items: center; gap: 14px; margin-left: auto; }
.tolb-sh {
  color: #222 !important; display: inline-flex; align-items: center;
  text-decoration: none !important; border: 0 !important; box-shadow: none !important;
  opacity: .85; transition: opacity .12s, color .12s;
}
.tolb-sh:hover { opacity: 1; color: var(--tolb-red) !important; }
.tolb-sh svg { display: block; }

/* ── Key developments ── */
.tolb-summary {
  background: var(--tolb-tint); border-left: 3px solid var(--tolb-red);
  border-radius: 0 4px 4px 0; padding: 14px 16px; margin: 0 0 20px !important;
  list-style: none !important;
}
.tolb-summary::before {
  content: 'Key Developments'; display: block;
  font-family: var(--tolb-cond); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--tolb-red);
  margin-bottom: 10px;
}
.tolb-summary li {
  font-family: var(--tolb-sans); font-size: 13px; color: var(--tolb-text);
  line-height: 1.5; padding: 4px 0 4px 14px !important; position: relative;
  border-bottom: 1px solid var(--tolb-border); margin: 0 !important; list-style: none !important;
}
.tolb-summary li:last-child { border-bottom: 0; }
.tolb-summary li::before {
  content: ''; position: absolute; left: 0; top: 12px;
  width: 5px; height: 5px; background: var(--tolb-red); border-radius: 50%;
}

/* ── Grid: two columns ── */
.tolb-grid.has-ticker { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.tolb-grid.no-ticker  { display: block; }

/* ── Ticker ── */
.tolb-ticker {
  position: sticky; top: var(--tolb-sticky-top);
  max-height: calc(100vh - var(--tolb-sticky-top) - 20px); overflow-y: auto;
  background: #fff; border: 1px solid var(--tolb-border); border-radius: 4px;
}
.tolb-ticker::-webkit-scrollbar { width: 4px; }
.tolb-ticker::-webkit-scrollbar-thumb { background: var(--tolb-border); border-radius: 2px; }
.tolb-ticker-head {
  position: sticky; top: 0; z-index: 5; background: #fff;
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 2px solid var(--tolb-red);
  font-size: 13px; font-weight: 700; color: var(--tolb-text);
}
.tolb-ticker-head .tolb-dot.red { margin-right: -2px; }
.tolb-ticker-item {
  display: flex; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--tolb-border);
  text-decoration: none !important; border-left: 0 !important;
  box-shadow: none !important; transition: background .12s;
}
.tolb-ticker-item:hover { background: var(--tolb-tint); }
.tolb-ticker-item.is-active { background: var(--tolb-tint); }
.tolb-ticker-item.is-active .tt-title { color: var(--tolb-red); font-weight: 600; }
.tt-time {
  font-family: var(--tolb-cond); font-size: 11px; font-weight: 600;
  color: var(--tolb-red); white-space: nowrap; min-width: 42px; padding-top: 2px;
}
.tt-title { font-family: var(--tolb-sans); font-size: 12.5px; line-height: 1.4; color: var(--tolb-text); font-weight: 500; }

/* ── Entry cards ── */
.tolb-entry {
  background: #fff; border: 1px solid var(--tolb-border); border-radius: 4px;
  margin: 0 0 16px !important; overflow: hidden; scroll-margin-top: 100px;
}
.tolb-entry.tolb-new { animation: tolb-flash 2s ease-out; }
@keyframes tolb-flash { 0% { box-shadow: 0 0 0 3px rgba(200,16,46,.3); } 100% { box-shadow: none; } }

.tolb-entry-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px; background: var(--tolb-tint);
  border-bottom: 1px solid var(--tolb-border);
}
.tolb-entry-time {
  font-family: var(--tolb-cond); font-size: 11px; font-weight: 700;
  color: var(--tolb-red); text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--tolb-red); padding: 2px 8px; border-radius: 2px;
}
.tolb-entry-ago { font-family: var(--tolb-sans); font-size: 11px; color: var(--tolb-muted); }
.tolb-entry-cat {
  margin-left: auto; font-family: var(--tolb-cond); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: #fff;
  padding: 2px 7px; border-radius: 2px; background: #555;
}
.tolb-entry-cat.govtech   { background: #1565C0; }
.tolb-entry-cat.security  { background: #B71C1C; }
.tolb-entry-cat.statement { background: #2E7D32; }
.tolb-entry-cat.breaking  { background: var(--tolb-red); }
.tolb-entry-cat.policy    { background: #6A1B9A; }

.tolb-entry-body { padding: 16px 18px; }
.tolb-entry-hl {
  font-family: var(--tolb-serif) !important;
  font-size: 19px !important; font-weight: 700; line-height: 1.3 !important;
  color: var(--tolb-text) !important; margin: 0 0 10px !important; padding: 0 !important;
}
.tolb-entry-text {
  font-family: var(--tolb-serif); font-size: 15px; line-height: 1.7; color: var(--tolb-body);
}
.tolb-entry-text p { margin: 0 0 12px; }
.tolb-entry-text p:last-child { margin-bottom: 0; }
.tolb-entry-text em, .tolb-entry-text i { font-style: italic; }
.tolb-entry-text a { color: var(--tolb-red); }

.tolb-entry-img { margin: 14px 0 0 !important; }
.tolb-entry-img img { width: 100%; height: auto; display: block; border-radius: 3px; }
.tolb-entry-img figcaption {
  font-family: var(--tolb-sans); font-size: 12px; font-style: italic;
  color: var(--tolb-muted); padding-top: 6px; line-height: 1.5;
}

.tolb-embed { margin-top: 14px; }
.tolb-embed iframe, .tolb-embed blockquote { max-width: 100% !important; margin-left: 0 !important; }

.tolb-entry-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-top: 1px solid var(--tolb-border); background: #FAFAFA;
}
.tolb-entry-foot .tolb-share { margin-left: 0; gap: 12px; }
.tolb-entry-foot .tolb-sh svg { width: 14px; height: 14px; }
.tolb-entry-author { font-family: var(--tolb-sans); font-size: 11px; color: var(--tolb-muted); }
.tolb-anchor {
  margin-left: auto; font-family: var(--tolb-sans); font-size: 11px;
  color: var(--tolb-muted) !important; text-decoration: none !important;
  cursor: pointer; border: 0 !important; box-shadow: none !important;
  transition: color .12s;
}
.tolb-anchor:hover { color: var(--tolb-red) !important; }

/* ── Load more / empty / pill ── */
.tolb-load-more {
  display: block; width: 100%; padding: 11px; background: #fff;
  border: 1px solid var(--tolb-red); color: var(--tolb-red); border-radius: 3px;
  font-family: var(--tolb-cond); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; cursor: pointer; transition: all .15s;
}
.tolb-load-more:hover { background: var(--tolb-red); color: #fff; }
.tolb-empty {
  text-align: center; padding: 40px 20px; color: var(--tolb-muted);
  font-family: var(--tolb-sans); font-size: 14px;
  background: #fff; border: 1px solid var(--tolb-border); border-radius: 4px;
}
.tolb-new-pill {
  position: sticky; top: 70px; z-index: 50; display: block; margin: 0 auto 14px;
  width: max-content; background: var(--tolb-red); color: #fff; border: 0;
  padding: 7px 18px; border-radius: 20px;
  font-family: var(--tolb-sans); font-size: 12px; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 10px rgba(200,16,46,.4);
}

/* ============================================================
   Homepage widget — same spec
   ============================================================ */
.tolb-widget {
  background: #fff; border: 1px solid var(--tolb-border); border-radius: 4px;
  overflow: hidden; margin: 0 0 24px; font-family: var(--tolb-sans);
}
.tolb-w-top {
  background: var(--tolb-red); padding: 8px 16px;
  display: flex; align-items: center; gap: 10px;
}
.tolb-w-top .tolb-dot { width: 8px; height: 8px; background: #fff; }
.tolb-w-label {
  font-family: var(--tolb-cond); font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #fff;
}
.tolb-w-upd { font-size: 11px; color: rgba(255,255,255,.75); margin-left: auto; }

.tolb-w-main { display: grid; grid-template-columns: minmax(0,1fr) 250px; }
.tolb-w-hero { padding: 18px 20px; }
.tolb-w-headline {
  display: block; font-family: var(--tolb-serif);
  font-size: 22px; font-weight: 700; line-height: 1.28;
  color: var(--tolb-text) !important; text-decoration: none !important; margin-bottom: 12px;
}
.tolb-w-headline:hover { color: var(--tolb-red) !important; }
.tolb-w-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tolb-w-img { display: block; border-radius: 3px; overflow: hidden; aspect-ratio: 16/10; background: #eee; }
.tolb-w-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tolb-w-latest { display: flex; flex-direction: column; }
.tolb-w-latest-label {
  font-family: var(--tolb-cond); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--tolb-red); margin-bottom: 6px;
}
.tolb-w-latest-text {
  font-family: var(--tolb-serif); font-size: 14px; line-height: 1.55;
  color: var(--tolb-text) !important; text-decoration: none !important; flex: 1;
}
.tolb-w-latest-text:hover { color: var(--tolb-red) !important; }
.tolb-w-latest-ago { font-size: 11px; color: var(--tolb-muted); margin-top: 6px; }

.tolb-w-ticker { border-left: 1px solid var(--tolb-border); display: flex; flex-direction: column; }
.tolb-w-ticker-head {
  padding: 10px 14px; border-bottom: 1px solid var(--tolb-border);
  font-family: var(--tolb-cond); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--tolb-red);
  display: flex; align-items: center; gap: 6px;
}
.tolb-w-ticker-head .tolb-dot { width: 6px; height: 6px; background: var(--tolb-red); }
.tolb-w-ticker-list { flex: 1; }
.tolb-w-tick {
  display: block; padding: 9px 14px; border-bottom: 1px solid var(--tolb-border);
  text-decoration: none !important; transition: background .12s;
}
.tolb-w-tick:hover { background: var(--tolb-tint); }
.tw-time { display: block; font-family: var(--tolb-cond); font-size: 11px; font-weight: 600; color: var(--tolb-red); margin-bottom: 3px; }
.tw-title { display: block; font-size: 12px; line-height: 1.4; color: var(--tolb-text); font-weight: 500; }
.tolb-w-cta {
  display: block; text-align: center; padding: 11px; background: var(--tolb-tint);
  border-top: 1px solid var(--tolb-border);
  font-family: var(--tolb-cond); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--tolb-red) !important;
  text-decoration: none !important; transition: background .15s, color .15s;
}
.tolb-w-cta:hover { background: var(--tolb-red); color: #fff !important; }

/* ============================================================
   Day separators (feed + ticker)
   ============================================================ */
.tolb-day-sep {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 12px;
  font-family: var(--tolb-cond); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--tolb-muted);
}
.tolb-day-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--tolb-border);
}
.tolb-day-sep span { white-space: nowrap; }

.tolb-day-sep.tt-sep {
  display: block; margin: 0; padding: 8px 14px 5px;
  font-size: 10.5px; color: var(--tolb-muted);
  background: #FAFAFA; border-bottom: 1px solid var(--tolb-border);
}
.tolb-day-sep.tt-sep::after { display: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .tolb-grid.has-ticker, .tolb-grid.no-ticker { display: block; }
  .tolb-ticker {
    position: static !important; max-height: 234px; margin-bottom: 16px;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .tolb-new-pill { top: 12px; }
  .tolb-statusbar { gap: 10px; }
  .tolb-meta { order: 3; width: 100%; }
  .tolb-w-main { grid-template-columns: 1fr; }
  .tolb-w-ticker { border-left: 0; border-top: 1px solid var(--tolb-border); }
}
@media (max-width: 560px) {
  .tolb-wrap { margin: 8px 0 24px; }
  .tolb-w-hero-grid { grid-template-columns: 1fr; }
  .tolb-entry { margin-bottom: 14px !important; }
  .tolb-entry-head { padding: 9px 14px; gap: 8px; }
  .tolb-entry-body { padding: 14px; }
  .tolb-entry-foot { padding: 9px 14px; }
  .tolb-entry-hl { font-size: 17.5px !important; }
  .tolb-entry-text { font-size: 14.5px; }
  .tolb-anchor { display: none; }
  .tolb-ticker { max-height: 198px; }
}

/* ============================================================
   Sticky rescue for tagDiv/Newspaper overflow:hidden wrappers.
   CSS :has for modern browsers; JS fallback does the same.
   ============================================================ */
@media (min-width: 901px) {
  body :has(#tolb-app) { overflow: visible !important; }
}
