/* Specifiction — BACKSTAGE (look.blog = 'backstage'). The site reads like a touring band's paperwork (input list, stage plot, rider), so its
   blog is what travels with the band: every story a ROAD CASE — the black case with its aluminium frame and ball corners, the section on a
   strip of gaffer tape, the case number stencilled on, the story's picture taped to the lid like a photo. Articles open as a case lid with
   the PACKING LIST (the story's sections) on a paper label. Stencil type is for short labels only; headlines stay in the display face so
   they read. One stylesheet for the app's /blog/ and home block (src/lib/ui/sites/specifiction/Backstage*.svelte) and WordPress's own
   listings and articles (ops/wp/theme/parts/backstage/). The cases stay dark in both themes: they are objects, not surfaces. */

.bk { --stencil: 'Big Shoulders Stencil Display', var(--font-display); --case: #1E1D26; --case-2: #17161E; --rail: #A9A8B5; --rail-2: #6C6B78; --lid-ink: #F4F3FA; --lid-mute: #ABAABA; }
.bk .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bk-t-teal { --tape: #2DD4BF; } .bk-t-violet { --tape: #A99DFF; } .bk-t-yellow { --tape: #F7D24A; } .bk-t-red { --tape: #FF8A8E; }

/* ---------- the masthead ---------- */
.bk-mast { display: grid; gap: 10px; margin: 14px 0 26px; }
.bk-mast > .google-auto-placed { width: 100%; }
.bk-kick { justify-self: start; padding: 5px 10px 4px; background: var(--ink); color: var(--bg); font: 800 .92rem/1 var(--stencil); letter-spacing: .14em; text-transform: uppercase; transform: rotate(-1deg); }
.bk-mast h1 { margin: 0; font: 800 clamp(2.8rem, 2rem + 4vw, 5rem)/.95 var(--stencil); letter-spacing: .04em; text-transform: uppercase; }
.bk-mast--sm h1 { font: 800 clamp(1.8rem, 1.4rem + 1.8vw, 2.6rem)/1.08 var(--font-display); letter-spacing: -.01em; text-transform: none; }
.bk-stand { max-width: 62ch; color: var(--muted); font-size: 1.06rem; line-height: 1.55; }
.bk-sections { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.bk-sections button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--ink); font: 800 .95rem/1 var(--stencil); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; box-shadow: inset 0 0 0 2px var(--tape, var(--line)); transform: rotate(-.8deg); }
.bk-sections button:nth-child(even) { transform: rotate(.8deg); }
.bk-sections button i { font-style: normal; font-family: var(--font-text); font-size: .8rem; letter-spacing: 0; color: var(--muted); }
.bk-sections button.on { background: var(--tape, var(--ink)); color: #14141F; box-shadow: none; }
.bk-sections button.on i { color: #14141F; }
.bk-sections .bk-all.on { background: var(--ink); color: var(--bg); }
.bk-sections .bk-all.on i { color: var(--bg); opacity: .75; }

/* ---------- a case ---------- */
.bk-case { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; height: 100%; padding: 22px 18px 16px; border-radius: 10px; color: var(--lid-ink); text-decoration: none;
  background:
    radial-gradient(circle at 10px 10px, #E2E1EA 0 3px, #8F8E9B 3.6px 5.4px, transparent 6px),
    radial-gradient(circle at calc(100% - 10px) 10px, #E2E1EA 0 3px, #8F8E9B 3.6px 5.4px, transparent 6px),
    radial-gradient(circle at 10px calc(100% - 10px), #E2E1EA 0 3px, #8F8E9B 3.6px 5.4px, transparent 6px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), #E2E1EA 0 3px, #8F8E9B 3.6px 5.4px, transparent 6px),
    linear-gradient(180deg, var(--case), var(--case-2));
  box-shadow: inset 0 0 0 4px var(--rail), inset 0 0 0 5px var(--rail-2), 0 12px 24px -16px rgb(0 0 0 / .8); transition: transform .15s ease; }
.bk-case:hover { transform: translateY(-2px); color: var(--lid-ink); }
.bk-tape { justify-self: start; margin: -32px 0 0 -4px; padding: 5px 11px 4px; background: var(--tape, #F7D24A); color: #14141F; font: 800 .88rem/1 var(--stencil); letter-spacing: .1em; text-transform: uppercase; transform: rotate(-2deg);
  clip-path: polygon(0 6%, 4% 0, 50% 4%, 96% 0, 100% 8%, 98% 100%, 52% 95%, 3% 100%); box-shadow: 0 2px 0 rgb(0 0 0 / .2); }
.bk-no { position: absolute; top: 14px; right: 18px; font: 800 .8rem/1 var(--stencil); letter-spacing: .14em; text-transform: uppercase; color: var(--lid-mute); }
.bk-pic { position: relative; display: block; margin: 2px 4px 0; padding: 6px; background: #F3F2EC; transform: rotate(-1deg); box-shadow: 0 8px 16px -10px rgb(0 0 0 / .9); }
.bk-pic::before { content: ''; position: absolute; z-index: 1; top: -9px; left: 50%; width: 64px; height: 18px; margin-left: -32px; background: rgb(245 244 236 / .62); transform: rotate(3deg); }
.bk-pic img { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; }
.bk-case:nth-child(even) .bk-pic { transform: rotate(1deg); }
.bk-tt { font: 800 1.12rem/1.28 var(--font-display); color: var(--lid-ink); overflow-wrap: anywhere; text-wrap: pretty; }
.bk-case:hover .bk-tt { text-decoration: underline; text-decoration-color: var(--tape, #F7D24A); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 700 .82rem/1.2 var(--stencil); letter-spacing: .12em; text-transform: uppercase; color: var(--lid-mute); }

/* the case on top of the stack */
.bk-lead { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto; gap: 18px 26px; align-items: center; margin-bottom: 30px; padding: 30px 26px 24px; }
.bk-lead .bk-tape { grid-column: 1 / -1; margin: -42px 0 0 -6px; font-size: 1rem; }
.bk-lead .bk-pic { margin: 0; }
.bk-lead .bk-body { display: grid; gap: 12px; align-content: center; }
.bk-lead .bk-tt { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.3rem); line-height: 1.15; }
.bk-ex { color: var(--lid-mute); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bk-up { justify-self: end; font: 800 .8rem/1 var(--stencil); letter-spacing: .2em; text-transform: uppercase; color: var(--lid-mute); }
.bk-lead:not(:has(.bk-pic)) { grid-template-columns: minmax(0, 1fr); }

/* the stack */
.bk-deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 34px 20px; margin: 0; padding: 18px 0 0; list-style: none; }
.bk-deck--row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bk-none, .bk-empty { margin: 14px 0 0; padding: 18px; border-radius: var(--radius-lg); background: var(--surface-2); color: var(--muted); text-align: center; }
.bk-none button { border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.bk-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 16px; margin-top: 34px; font-weight: 700; color: var(--muted); }
.bk-pager a, .bk-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 16px; color: var(--ink); font: 800 1rem/1 var(--stencil); letter-spacing: .1em; text-transform: uppercase; }
.bk-pager a { box-shadow: inset 0 0 0 2px var(--ink); }
.bk-pager a:hover { background: var(--ink); color: var(--bg); }
.bk-pager .page-numbers.current { background: var(--brand); color: var(--brand-ink); }
.bk-pager .dots { min-width: 0; padding: 0 2px; }

/* ---------- the home block ---------- */
.bk-home { margin: 34px 0 10px; }
.bk-home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
.bk-home-head h2 { margin: 0; font: 800 clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem)/1 var(--stencil); letter-spacing: .06em; text-transform: uppercase; }
.bk-home-head a { font-weight: 700; color: var(--ink); white-space: nowrap; text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 3px; text-underline-offset: 3px; }

/* ---------- WordPress: listings and articles ---------- */
.bk-list .bk-wrapbody, .bk-art .bk-wrapbody { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: clamp(26px, 4vw, 46px); align-items: start; margin-top: 10px; }
.bk .bk-wrapbody--full { grid-template-columns: minmax(0, 1fr); }
.bk-list .bk-deck { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
/* an article opens as the case lid: tape, case number, headline, standfirst, byline — and the packing list on a paper label */
.bk-art .bk-lid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); grid-template-rows: auto; gap: 16px 26px; align-items: start; margin-top: 26px; padding: 34px 26px 24px; height: auto; transform: none; }
.bk-art .bk-lid:hover { transform: none; }
.bk-art .bk-lid > .google-auto-placed { grid-column: 1 / -1; width: 100%; }
.bk-art .bk-lid .bk-tape { grid-column: 1 / -1; margin: -46px 0 0 -6px; font-size: 1rem; }
.bk-art .bk-lid-main { display: grid; gap: 12px; min-width: 0; }
.bk-art .bk-lid h1 { margin: 0; font: 800 clamp(1.8rem, 1.3rem + 2vw, 2.8rem)/1.12 var(--font-display); color: var(--lid-ink); text-wrap: balance; }
.bk-art .bk-lid .bk-stand { color: var(--lid-mute); }
.bk-art .bk-lid .bk-meta a { color: var(--lid-ink); }
.bk-pack { align-self: stretch; padding: 14px 16px 12px; background: #F3F2EC; color: #1B1A22; transform: rotate(1deg); box-shadow: 0 10px 18px -12px rgb(0 0 0 / .9); }
.bk-pack h2 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid #1B1A22; font: 800 1rem/1 var(--stencil); letter-spacing: .16em; text-transform: uppercase; }
.bk-pack ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: pk; }
.bk-pack li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; font-size: .9rem; line-height: 1.3; }
.bk-pack li::before { content: ''; width: 14px; height: 14px; margin-top: 2px; border: 2px solid #1B1A22; border-radius: 2px; }
.bk-art .bk-hero { margin: 22px 0 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.bk-art .bk-hero img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }
.bk-art .bk-hero figcaption { padding: 8px 14px; font-size: .84rem; color: var(--muted); background: var(--surface); }
.bk-art .pdt-paper { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; overflow: clip; overflow-clip-margin: 8px; }
.bk-art .entry-content { font-size: 1.1rem; line-height: 1.75; max-width: 68ch; }
/* sections read like the rider's numbered lines: a strip of tape before each heading */
.bk-art .entry-content h2 { position: relative; margin: 1.9em 0 .6em; padding-left: 22px; font: 800 clamp(1.35rem, 1.15rem + .8vw, 1.8rem)/1.25 var(--font-display); }
.bk-art .entry-content h2::before { content: ''; position: absolute; left: 0; top: .2em; bottom: .2em; width: 10px; background: var(--accent); transform: rotate(-2deg); }
.bk-art .entry-content h3 { margin: 1.6em 0 .45em; font: 700 1.2rem/1.3 var(--font-display); }
.bk-art .entry-content a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.bk-art .entry-content a:hover { color: var(--brand); }
.bk-art .entry-content ol li::marker { color: var(--brand); font-weight: 800; }
.bk-art .entry-content ul li::marker { color: var(--accent); }
.bk-art .entry-content blockquote { margin: 1.7em 0; padding: 14px 18px; border: 0; background: #F3F2EC; color: #1B1A22; box-shadow: 0 8px 16px -12px rgb(0 0 0 / .6); transform: rotate(-.4deg); }
.bk-art .entry-content blockquote p:last-child { margin-bottom: 0; }
.bk-art .entry-content table { font-size: .96rem; }
.bk-art .entry-content th { background: var(--surface-2); color: var(--ink); font-weight: 700; }
.bk-art .entry-content img, .bk-art .entry-content figure img { border-radius: var(--radius); }
.bk-art .entry-content code { padding: 1px 6px; border-radius: 5px; background: var(--surface-2); font-family: ui-monospace, Menlo, monospace; font-size: .88em; }
.bk-art .entry-content pre { padding: 14px 16px; border-radius: var(--radius); background: var(--ink); color: var(--bg); overflow-x: auto; font-family: ui-monospace, Menlo, monospace; }
.bk-art .entry-content pre code { padding: 0; background: none; color: inherit; }
.bk-art .pdt-comments { margin-top: 34px; padding: 22px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.bk-art .pdt-comments h2, .bk-art .pdt-comments .comment-reply-title { margin: 0 0 10px; font: 700 1.3rem/1.25 var(--font-display); background: none; }
.bk-hop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.bk-hop a { display: grid; gap: 6px; padding: 14px 16px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.bk-hop a:hover { background: var(--ink); color: var(--bg); }
.bk-hop a.nx { grid-column: 2; text-align: right; }
.bk-hop small { font: 800 .82rem/1 var(--stencil); letter-spacing: .14em; text-transform: uppercase; color: inherit; opacity: .75; }
.bk-hop b { font: 700 1.02rem/1.3 var(--font-display); }
.bk-reads { margin-top: 40px; }
.bk-reads h2 { margin: 0 0 8px; font: 800 clamp(1.5rem, 1.2rem + 1vw, 2.1rem)/1.05 var(--stencil); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- 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 1.5px var(--line); overflow: hidden; }
.pdt-side.jr-side .widget-title, .pdt-side.jr-side .wp-block-heading, .pdt-side.jr-side .widget > h2 { margin: 10px 0 6px; padding: 0; background: none; color: var(--ink); font: 800 1.15rem/1.2 'Big Shoulders Stencil Display', var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.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: 4px; }
.pdt-side.jr-side .pdt-latest-t { font-weight: 700; font-size: .95rem; line-height: 1.25; color: var(--ink); }
.pdt-side.jr-side .pdt-latest-d { font-size: .78rem; color: var(--muted); }
.pdt-side.jr-side .ym-latest-posts-widget { --ym-latest-accent: var(--brand); }
.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: 4px; }
.pdt-side.jr-side .ym-sidebar-latest-rank { background: var(--ink); color: var(--bg); box-shadow: none; border-radius: 3px; }
.pdt-side.jr-side .ym-sidebar-latest-title { font-weight: 700; font-size: .95rem; color: var(--ink); }
.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 a { font-weight: 700; color: var(--ink); }
.pdt-side.jr-side .wp-block-latest-posts__post-date { display: block; margin-top: 2px; font-size: .78rem; color: var(--muted); }

/* ---------- narrower screens ---------- */
@media (max-width: 1080px) {
  .bk-list .bk-wrapbody, .bk-art .bk-wrapbody { grid-template-columns: minmax(0, 1fr); }
  .bk .bk-wrapbody > .pdt-side { max-width: 640px; }
  .bk-deck--row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .bk-lead { grid-template-columns: minmax(0, 1fr); padding: 30px 16px 18px; }
  .bk-art .bk-lid { grid-template-columns: minmax(0, 1fr); padding: 32px 16px 20px; }
  .bk-pack { transform: rotate(.5deg); }
}
@media (max-width: 560px) {
  .bk-sections { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 6px; scrollbar-width: none; }
  .bk-sections button { flex: none; }
  .bk-deck, .bk-deck--row, .bk-list .bk-deck { grid-template-columns: minmax(0, 1fr); }
  .bk-art .entry-content { font-size: 1.05rem; }
  .bk-hop { grid-template-columns: minmax(0, 1fr); }
  .bk-hop a.nx { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .bk-case { transition: none; } .bk-case:hover { transform: none; } }

/* long words wrap (05-Oct-2026): a bare URL or a long code-like token typed in an article's text breaks onto the next line instead of
   running past the column on a phone (pipeline fixed the Markdown links; plain URLs stay as written) */
.entry-content :is(p, li, dd, blockquote, figcaption) { overflow-wrap: break-word; }
.entry-content td, .entry-content th { overflow-wrap: anywhere; }
