/* News. Core — live blog (front end). Theme variables with fallbacks; dark mode via the theme's
   html[data-theme] switch (+ system preference). */

.nlb{
  --nlb-accent: #C4121A;          /* red for text/badges: AA on light paper (the brand red is 4:1) */
  --nlb-rail: var(--line, #DED7C8);
  --nlb-card: var(--paper-2, #fff);
  --nlb-when: 84px;               /* desktop time column */
  --nlb-gap: 28px;
  --nlb-sticky: 96px;             /* below the sticky site header */
  position: relative;
  margin: 1.4em 0 2.4em;
  font-family: var(--sans, system-ui, sans-serif);
  color: var(--ink, #141414);
}
html[data-theme="dark"] .nlb{ --nlb-accent: #FF6B6B; }
@media (prefers-color-scheme: dark){
  html[data-theme="system"] .nlb{ --nlb-accent: #FF6B6B; }
}
.nlb .sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.nlb [hidden]{ display:none !important; }

/* ------------------------------------------------ Header strip */
.nlb-head{
  border-top: 3px solid var(--nlb-accent);
  padding-top: 14px;
  margin-bottom: 22px;
}
.nlb.is-ended .nlb-head{ border-top-color: var(--ink, #141414); }
.nlb-head__bar{
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
}
.nlb-head__title{
  margin: 0; display: flex; align-items: center;
  font-family: var(--sans, system-ui, sans-serif); font-size: inherit; line-height: 1;
}
.nlb-badge{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 11px 6px 10px; border-radius: 2px;
  background: var(--nlb-accent); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; line-height: 1.2;
}
html[data-theme="dark"] .nlb.is-live .nlb-badge{ background:#C4121A; }
@media (prefers-color-scheme: dark){ html[data-theme="system"] .nlb.is-live .nlb-badge{ background:#C4121A; } }
.nlb-badge__dot{
  width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none;
  animation: nlb-pulse 1.6s ease-in-out infinite;
}
.nlb.is-ended .nlb-badge{ background: var(--ink, #141414); color: var(--paper, #fff); letter-spacing: .06em; }
.nlb.is-ended .nlb-badge__dot{ display: none; }
@keyframes nlb-pulse{
  0%,100%{ opacity: 1; box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
  50%{ opacity: .55; box-shadow: 0 0 0 5px rgba(255,255,255,0); }
}
.nlb-head__meta{
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  font-size: 14px; line-height: 1.4; color: var(--muted, #6B675E);
}
.nlb-head__updated time{ color: var(--ink, #141414); font-weight: 700; }
.nlb-head__count{ display: inline-flex; align-items: center; gap: 14px; }
.nlb-head__count::before{ content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }

/* Key events */
.nlb-keys{
  margin-top: 16px; padding: 16px 18px 12px;
  background: var(--nlb-card); border: 1px solid var(--line, #DED7C8); border-radius: var(--radius-m, 8px);
}
.nlb-keys__title{
  display: flex; align-items: center; gap: 7px; margin: 0 0 10px;
  font-family: var(--sans, system-ui, sans-serif); font-size: 12px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink, #141414);
}
.nlb-keys__title .nlb-icon{ color: var(--nlb-accent); fill: currentColor; stroke: none; width: 14px; height: 14px; }
.nlb-keys__list{ margin: 0; padding: 0; list-style: none; }
.nlb-keys__list li{ position: relative; padding-left: 20px; }
.nlb-keys__list li::before{
  content: ""; position: absolute; left: 3px; top: 13px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--nlb-card); border: 2px solid var(--nlb-accent);
}
.nlb-keys__list li::after{
  content: ""; position: absolute; left: 7px; top: 24px; bottom: -8px; width: 1px; background: var(--nlb-rail);
}
.nlb-keys__list li:last-child::after,
.nlb-keys__list li:has(+ li[hidden])::after{ display: none; }
.nlb-keys__list a{
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline;
  padding: 6px 0; min-height: 32px; color: var(--ink, #141414); text-decoration: none;
  font-size: 15px; line-height: 1.4;
}
.nlb-keys__list time{ font-size: 13px; font-weight: 800; color: var(--nlb-accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nlb-keys__list a:hover span,
.nlb-keys__list a:focus-visible span{ text-decoration: underline; text-underline-offset: 3px; }
.nlb-keys__toggle{
  margin: 6px 0 2px 20px; padding: 4px 0; min-height: 28px; border: 0; background: none;
  font: 700 13px/1.3 var(--sans, system-ui, sans-serif); color: var(--ink, #141414);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ------------------------------------------------ "N new updates" (sticky, takes no space) */
.nlb-new-wrap{
  position: sticky; top: var(--nlb-sticky); z-index: 20; height: 0;
  display: flex; justify-content: center; pointer-events: none;
}
.nlb-new{
  pointer-events: auto; transform: translateY(-8px);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 9px 18px 9px 14px; border: 0; border-radius: 999px;
  background: #C4121A; color: #fff; cursor: pointer;
  font: 700 14px/1.2 var(--sans, system-ui, sans-serif);
  box-shadow: 0 8px 24px rgba(0,0,0,.22), 0 1px 3px rgba(0,0,0,.2);
  animation: nlb-drop .28s ease-out;
}
.nlb-new:hover{ background: var(--red-deep, #8C0F14); }
.nlb-new:focus-visible{ outline: 3px solid var(--ink, #141414); outline-offset: 2px; }
@keyframes nlb-drop{ from{ opacity: 0; transform: translateY(-20px); } }

/* ------------------------------------------------ Feed + timeline rail */
.nlb-feed,
.nlb-pinned{ position: relative; }
.nlb-feed::before{
  content: ""; position: absolute; top: 4px; bottom: 0; left: 4px; width: 2px;
  background: var(--nlb-rail); border-radius: 1px;
}
.nlb-pinned:empty{ display: none; }
.nlb-pinned{ margin-bottom: 18px; }

.nlb-item{
  position: relative; padding-left: 22px; margin: 0 0 18px;
  scroll-margin-top: calc(var(--nlb-sticky) + 12px);
}
.nlb-item:focus{ outline: none; }
.nlb-item::before{ /* rail dot */
  content: ""; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper, #F5F1EA); border: 2px solid var(--nlb-accent); box-sizing: border-box;
}
.nlb.is-ended .nlb-item::before{ border-color: var(--muted, #6B675E); }
.nlb-item.is-key::before{ background: var(--nlb-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nlb-accent) 18%, transparent); }
.nlb-pinned .nlb-item{ padding-left: 0; }
.nlb-pinned .nlb-item::before{ display: none; }

.nlb-item__when{
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; line-height: 1.2;
}
.nlb-item__clock{
  color: var(--nlb-accent); font-size: 14px; font-weight: 800; text-decoration: none;
  font-variant-numeric: tabular-nums; white-space: nowrap; min-height: 24px; display: inline-flex; align-items: center;
}
.nlb-item__clock:hover{ text-decoration: underline; text-underline-offset: 3px; }
.nlb-item__ago{ font-size: 13px; color: var(--muted, #6B675E); white-space: nowrap; }

.nlb-item__card{
  min-width: 0; padding: 16px 16px 12px;
  background: var(--nlb-card); border: 1px solid var(--line, #DED7C8); border-radius: var(--radius-m, 8px);
  transition: box-shadow .3s, border-color .3s;
}
.nlb-item.is-key .nlb-item__card{ border-left: 3px solid var(--nlb-accent); }
.nlb-item.is-pinned .nlb-item__card{
  border: 1.5px solid var(--ink, #141414);
  background: color-mix(in srgb, var(--nlb-accent) 5%, var(--nlb-card));
}
.nlb-item:focus-visible .nlb-item__card,
.nlb-item.is-target .nlb-item__card{
  border-color: var(--nlb-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nlb-accent) 30%, transparent);
}

.nlb-item__flags{ display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.nlb-flag{
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 6px; border-radius: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; line-height: 1.3;
}
.nlb-flag .nlb-icon{ width: 12px; height: 12px; }
.nlb-flag--key{ background: color-mix(in srgb, var(--nlb-accent) 12%, transparent); color: var(--nlb-accent); }
.nlb-flag--key .nlb-icon{ fill: currentColor; stroke: none; }
.nlb-flag--pin{ background: var(--ink, #141414); color: var(--paper, #fff); }

.nlb-item__title{
  margin: 0 0 8px; font-family: var(--serif, Georgia, serif);
  font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--ink, #141414);
}
.nlb-item.is-pinned .nlb-item__title{ font-size: clamp(21px, 2.4vw, 26px); }
.nlb-item__body{
  font-family: var(--serif, Georgia, serif); font-size: 16.5px; line-height: 1.6; color: var(--ink, #141414);
  overflow-wrap: anywhere;
}
.nlb-item__body > *{ margin: 0 0 .8em; }
.nlb-item__body > *:last-child{ margin-bottom: 0; }
.nlb-item__body a{ color: var(--nlb-accent); text-decoration: underline; text-underline-offset: 2px; }
.nlb-item__body ul{ list-style: disc; padding-left: 1.3em; }
.nlb-item__body ol{ list-style: decimal; padding-left: 1.4em; }
.nlb-item__body li{ margin: 0 0 .3em; }
.nlb-item__body blockquote{ margin-left: 0; padding-left: 14px; border-left: 3px solid var(--line, #DED7C8); font-style: italic; }
.nlb-item__body h3,
.nlb-item__body h4{ font-size: 1.05em; }

.nlb-item__media{ margin: 14px 0 0; }
.nlb-item__media img{ width: 100%; height: auto; border-radius: var(--radius-s, 4px); }
.nlb-item__media figcaption{ margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--muted, #6B675E); }
.nlb-item__embed{ margin: 14px 0 0; max-width: 100%; overflow: hidden; }
.nlb-item__embed iframe{ max-width: 100%; border: 0; }
.nlb-item__embed iframe[src*="youtube"],
.nlb-item__embed iframe[src*="youtu.be"],
.nlb-item__embed iframe[src*="vimeo"],
.nlb-item__embed iframe[src*="dailymotion"]{ width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius-s, 4px); }
.nlb-item__embed .twitter-tweet{ margin: 0 auto !important; }
.nlb-item__embed--link a{
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--line, #DED7C8); border-radius: var(--radius-s, 4px);
  font-size: 14px; font-weight: 700; color: var(--ink, #141414); text-decoration: none; overflow-wrap: anywhere;
}

.nlb-item__foot{
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line, #DED7C8);
}
.nlb-item__author{ display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; line-height: 1.3; }
.nlb-item__author img{ width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line, #DED7C8); }
.nlb-item__author > span:first-of-type{ font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nlb-item__edited{ color: var(--muted, #6B675E); font-size: 12.5px; }
.nlb-item__edited::before{ content: "· "; }
.nlb-item__tools{ display: flex; gap: 6px; flex: none; }
.nlb-tool{
  width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line, #DED7C8); border-radius: 50%;
  background: transparent; color: var(--ink-2, #17171A); cursor: pointer;
  transition: border-color .18s, color .18s;
}
.nlb-tool:hover{ border-color: var(--nlb-accent); color: var(--nlb-accent); }
.nlb-tool:focus-visible,
.nlb-more__btn:focus-visible,
.nlb-keys a:focus-visible,
.nlb-keys__toggle:focus-visible,
.nlb-item__clock:focus-visible{ outline: 2px solid var(--nlb-accent); outline-offset: 2px; }

/* Older / empty / locked */
.nlb-more{ padding-left: 22px; margin-top: 4px; }
.nlb-more__btn{
  width: 100%; min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--ink, #141414); border-radius: var(--radius-s, 4px);
  background: transparent; color: var(--ink, #141414); cursor: pointer;
  font: 700 14px/1.2 var(--sans, system-ui, sans-serif);
  transition: background .18s, color .18s;
}
.nlb-more__btn:hover{ background: var(--ink, #141414); color: var(--paper, #fff); }
.nlb-more__btn[disabled]{ opacity: .6; cursor: progress; }
.nlb-empty,
.nlb-locked{
  margin: 0; padding: 16px 18px; border: 1px dashed var(--line, #DED7C8); border-radius: var(--radius-m, 8px);
  font-size: 15px; line-height: 1.5; color: var(--muted, #6B675E); background: var(--nlb-card);
}
.nlb-locked{ border-style: solid; color: var(--ink, #141414); }

/* ------------------------------------------------ Desktop: time column + rail between */
@media (min-width: 640px){
  .nlb-feed::before{ left: calc(var(--nlb-when) + var(--nlb-gap) / 2 - 1px); }
  .nlb-item{
    display: grid; grid-template-columns: var(--nlb-when) minmax(0, 1fr); column-gap: var(--nlb-gap);
    padding-left: 0; margin-bottom: 20px;
  }
  .nlb-item::before{ left: calc(var(--nlb-when) + var(--nlb-gap) / 2 - 5px); top: 20px; }
  .nlb-item__when{
    flex-direction: column; align-items: flex-end; gap: 3px; margin: 0; padding-top: 14px; text-align: right;
  }
  .nlb-item__clock{ font-size: 15px; }
  .nlb-item__card{ padding: 18px 22px 14px; }
  .nlb-item__title{ font-size: 21px; }
  .nlb-item__body{ font-size: 17px; }
  .nlb-pinned .nlb-item{ display: block; }
  .nlb-pinned .nlb-item__when{ flex-direction: row; align-items: baseline; justify-content: flex-start; padding: 0; margin: 0 0 8px; text-align: left; }
  .nlb-more{ padding-left: calc(var(--nlb-when) + var(--nlb-gap)); }
}
@media (max-width: 781px){ .nlb{ --nlb-sticky: 72px; } }

@media (prefers-reduced-motion: reduce){
  .nlb-badge__dot,
  .nlb-new{ animation: none; }
  .nlb-item__card{ transition: none; }
}
