/* Inferse — THE EVENT STREAM (look.blog = 'eventstream'). Built for people who wire software together: the stories arrive as events,
   newest first, each with its offset in the stream, its type, the topic it was published on and its read time; the newest is opened out
   with its payload. One stylesheet for the app's /blog/ and home block (src/lib/ui/sites/inferse/EventStream*.svelte) and WordPress's own
   listings and articles (ops/wp/theme/parts/eventstream/). Colours come from the site's tokens (ink and lime). */

.es .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.es code { font-family: var(--font-mono, ui-monospace, monospace); }

/* ---------- the masthead ---------- */
.es-mast { display: grid; gap: 12px; margin: 14px 0 22px; padding: 0 0 18px; border-bottom: 2px solid var(--ink); }
.es-mast > .google-auto-placed { width: 100%; }
.es-status { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 4px 10px; border-radius: 4px; background: var(--ink); color: var(--bg); font: 700 .74rem/1 var(--font-mono, monospace); letter-spacing: .06em; text-transform: uppercase; }
.es-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.es-mast h1 { margin: 0; font: 800 clamp(2.2rem, 1.6rem + 3vw, 3.8rem)/1 var(--font-display); letter-spacing: -.04em; }
.es-mast--sm h1 { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.6rem); }
.es-stand { max-width: 64ch; color: var(--muted); font-size: 1.04rem; line-height: 1.55; }
.es-subs { display: flex; flex-wrap: wrap; gap: 6px; }
.es-subs button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 4px; background: var(--surface); color: var(--ink); font: 600 .8rem/1 var(--font-mono, monospace); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.es-subs button i { font-style: normal; color: var(--muted); }
.es-subs button:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.es-subs button.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.es-subs button.on i { color: var(--accent); }

/* ---------- the newest, opened out ---------- */
.es-lead { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); margin-bottom: 18px; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.es-lead:hover { color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--ink); }
.es-lead .es-pic { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); }
.es-lead .es-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.es-lead-body { display: grid; align-content: center; gap: 14px; padding: 20px 24px; }
.es-payload { display: block; padding: 12px 14px; border-radius: var(--radius); background: var(--ink); color: color-mix(in srgb, var(--bg) 82%, var(--accent)); font-size: .8rem; line-height: 1.55; white-space: nowrap; overflow-x: auto; }
.es-lead .es-hl { font: 800 clamp(1.35rem, 1.1rem + 1vw, 1.9rem)/1.18 var(--font-display); letter-spacing: -.02em; }
.es-lead:hover .es-hl { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.es-ex { color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- the stream ---------- */
.es-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.es-ev { display: grid; grid-template-columns: 64px minmax(0, 1fr) 128px; align-items: center; gap: 16px; padding: 14px 6px; border-bottom: 1px solid var(--line); color: var(--ink); }
.es-ev:hover { color: var(--ink); background: var(--surface); }
.es-ev:hover .es-hl { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.es-off { justify-self: end; padding: 3px 8px; border-radius: 4px; background: var(--surface-2); font: 700 .8rem/1 var(--font-mono, monospace); color: var(--muted); font-variant-numeric: tabular-nums; }
.es-body { display: grid; gap: 6px; min-width: 0; }
.es-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 600 .74rem/1.2 var(--font-mono, monospace); color: var(--muted); }
.es-meta code { padding: 1px 6px; border-radius: 3px; background: var(--surface-2); color: var(--ink); font-size: 1em; }
.es-meta code + code { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.es-hl { font: 700 1.06rem/1.32 var(--font-display); color: var(--ink); overflow-wrap: anywhere; text-wrap: pretty; }
.es-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.es-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.es-none, .es-empty { margin: 14px 0 0; padding: 18px; border-radius: var(--radius-lg); background: var(--surface-2); color: var(--muted); text-align: center; }
.es-none button { border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.es-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 16px; margin-top: 26px; font: 600 .86rem/1 var(--font-mono, monospace); color: var(--muted); }
.es-pager a, .es-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 4px; color: var(--ink); }
.es-pager a { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.es-pager a:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.es-pager .page-numbers.current { background: var(--ink); color: var(--bg); }
.es-pager .dots { min-width: 0; padding: 0 2px; }

/* ---------- the home block ---------- */
.es-home { margin: 34px 0 10px; }
.es-home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; }
.es-home-head h2 { margin: 0; font: 800 clamp(1.4rem, 1.1rem + 1vw, 1.9rem)/1.1 var(--font-display); letter-spacing: -.03em; }
.es-home-head a { font: 600 .84rem/1 var(--font-mono, monospace); color: var(--ink); white-space: nowrap; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ---------- WordPress: listings and articles ---------- */
.es-list-page .es-wrapbody, .es-art .es-wrapbody { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: clamp(26px, 4vw, 46px); align-items: start; margin-top: 8px; }
.es .es-wrapbody--full { grid-template-columns: minmax(0, 1fr); }
.es-art .es-head { display: grid; gap: 14px; margin: 14px 0 0; padding: 0 0 18px; border-bottom: 2px solid var(--ink); }
.es-art .es-head > .google-auto-placed { width: 100%; }
.es-art .es-head h1 { margin: 0; font: 800 clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem)/1.08 var(--font-display); letter-spacing: -.03em; text-wrap: balance; }
.es-art .es-stand { font-size: 1.1rem; }
.es-byline { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); }
.es-byline a { color: var(--ink); font-weight: 700; }
.es-art .es-hero { margin: 18px 0 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.es-art .es-hero img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }
.es-art .es-hero figcaption { padding: 8px 14px; font-size: .84rem; color: var(--muted); background: var(--surface); }
.es-art .pdt-paper { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; overflow: clip; overflow-clip-margin: 8px; }
.es-art .entry-content { font-size: 1.07rem; line-height: 1.75; max-width: 70ch; }
.es-art .entry-content h2 { margin: 1.9em 0 .6em; font: 800 clamp(1.3rem, 1.1rem + .8vw, 1.75rem)/1.25 var(--font-display); letter-spacing: -.02em; }
.es-art .entry-content h2::before { content: '# '; font-family: var(--font-mono, monospace); color: var(--accent); }
.es-art .entry-content h3 { margin: 1.6em 0 .45em; font: 700 1.16rem/1.3 var(--font-display); }
.es-art .entry-content a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.es-art .entry-content a:hover { color: var(--accent); }
.es-art .entry-content ul li::marker, .es-art .entry-content ol li::marker { color: var(--accent); font-weight: 800; }
.es-art .entry-content blockquote { margin: 1.7em 0; padding: 14px 18px; border: 0; border-radius: var(--radius); background: var(--surface-2); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.es-art .entry-content blockquote p:last-child { margin-bottom: 0; }
.es-art .entry-content table { font-size: .95rem; font-variant-numeric: tabular-nums; }
.es-art .entry-content th { background: var(--surface-2); color: var(--ink); font: 700 .78rem/1.3 var(--font-mono, monospace); }
.es-art .entry-content img, .es-art .entry-content figure img { border-radius: 8px; }
.es-art .entry-content code { padding: 1px 6px; border-radius: 4px; background: var(--surface-2); font-family: var(--font-mono, monospace); font-size: .88em; }
.es-art .entry-content pre { padding: 14px 16px; border-radius: 8px; background: var(--ink); color: var(--bg); overflow-x: auto; font-family: var(--font-mono, monospace); }
.es-art .entry-content pre code { padding: 0; background: none; color: inherit; }
.es-art .pdt-comments { margin-top: 34px; padding: 22px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.es-art .pdt-comments h2, .es-art .pdt-comments .comment-reply-title { margin: 0 0 10px; font: 800 1.3rem/1.25 var(--font-display); }
.es-hop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.es-hop a { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.es-hop a:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.es-hop a.nx { grid-column: 2; text-align: right; }
.es-hop small { font: 600 .72rem/1 var(--font-mono, monospace); color: var(--muted); }
.es-reads { margin-top: 36px; }
.es-reads h2 { margin: 0 0 10px; font: 800 clamp(1.3rem, 1.1rem + .8vw, 1.7rem)/1.2 var(--font-display); letter-spacing: -.03em; }

/* ---------- the site's sidebar ---------- */
.pdt-side.jr-side .widget { padding: 6px 16px 10px; border: 0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.pdt-side.jr-side .widget-title { margin: 10px 0 6px; padding: 0; background: none; color: var(--muted); font: 700 .76rem/1.3 var(--font-mono, monospace); letter-spacing: .08em; text-transform: uppercase; }
.pdt-side.jr-side .widget-title::before { content: '// '; color: var(--accent); }
.pdt-side.jr-side .pdt-latest-list li { padding: 9px 0; border-bottom-color: var(--line); }
.pdt-side.jr-side .pdt-latest-list a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 12px; align-items: center; }
.pdt-side.jr-side .pdt-latest-list a:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.pdt-side.jr-side .pdt-latest-list img { grid-row: span 2; width: 64px; aspect-ratio: 16 / 9; height: auto; object-fit: cover; display: block; border-radius: 6px; }
.pdt-side.jr-side .pdt-latest-t { font-weight: 700; font-size: .93rem; line-height: 1.25; color: var(--ink); }
.pdt-side.jr-side .pdt-latest-d { font: 600 .74rem/1.2 var(--font-mono, monospace); color: var(--muted); }
.pdt-side.jr-side .ym-latest-posts-widget { --ym-latest-accent: var(--accent); }
.pdt-side.jr-side .ym-sidebar-latest-card { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; min-block-size: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pdt-side.jr-side .ym-sidebar-latest-card:last-child { border-bottom: 0; }
.pdt-side.jr-side .ym-sidebar-latest-media { aspect-ratio: 16 / 9; border-radius: 6px; }
.pdt-side.jr-side .ym-sidebar-latest-rank { background: var(--ink); color: var(--bg); box-shadow: none; border-radius: 4px; }
.pdt-side.jr-side .ym-sidebar-latest-title { font-weight: 700; font-size: .93rem; color: var(--ink); }

/* WordPress's own Latest Posts block in the sidebar: the date on its own line, the heading like the other widget titles */
.pdt-side.jr-side .wp-block-heading, .pdt-side.jr-side .widget > h2 { margin: 10px 0 6px; font: 700 .76rem/1.3 var(--font-mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pdt-side.jr-side .wp-block-latest-posts { margin: 0; padding: 0; list-style: none; }
.pdt-side.jr-side .wp-block-latest-posts li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.pdt-side.jr-side .wp-block-latest-posts li:last-child { border-bottom: 0; }
.pdt-side.jr-side .wp-block-latest-posts a { font-weight: 700; font-size: .93rem; line-height: 1.25; color: var(--ink); }
.pdt-side.jr-side .wp-block-latest-posts__post-date { display: block; margin-top: 2px; font: 600 .74rem/1.2 var(--font-mono, monospace); color: var(--muted); }

/* ---------- narrower screens ---------- */
@media (max-width: 1080px) {
  .es-list-page .es-wrapbody, .es-art .es-wrapbody { grid-template-columns: minmax(0, 1fr); }
  .es .es-wrapbody > .pdt-side { max-width: 640px; }
}
@media (max-width: 820px) {
  .es-lead { grid-template-columns: minmax(0, 1fr); }
  .es-ev { grid-template-columns: 44px minmax(0, 1fr) 92px; gap: 12px; }
}
@media (max-width: 560px) {
  .es-subs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .es-subs button { flex: none; }
  .es-ev { grid-template-columns: minmax(0, 1fr) 84px; grid-template-areas: 'body thumb'; padding: 12px 2px; }
  .es-off { display: none; }
  .es-body { grid-area: body; }
  .es-thumb { grid-area: thumb; }
  .es-lead-body { padding: 16px; }
  .es-art .entry-content { font-size: 1.03rem; }
  .es-hop { grid-template-columns: minmax(0, 1fr); }
  .es-hop a.nx { grid-column: 1; }
}
