/* The content pages (worker/src/content.ts): /templates, /blog and their pages. Loaded after ../engine/engine.css,
   whose colour and shape tokens it uses, so the live example and the page around it share one palette. The engine
   sets data-scheme on <html> (light or dark, the system's until the reader picks); before it runs, and on pages with
   no example, the system's choice comes from the light block below (a copy of engine.css's light tokens). Phone
   first; wider screens only add room. */
@media (prefers-color-scheme: light) {
  :root:not([data-scheme]) {
    color-scheme: light; --bg: #ffffff; --panel: #f6f7f9; --line: #e3e6eb; --ink: #15181e; --dim: #5b6472; --accent: #1f8f55;
    --warm: #b8651f; --blue: #2f6fd6; --btn: #f1f3f6; --accent-line: #9fd3b5; --faint: #8a93a1; --accent-bg: #e3f4ea;
    --accent-soft: #eef8f2; --warm-line: #e6c39f; --warm-soft: #fbf1e6; --line-hi: #c9ced6; --panel-2: #f3f5f8;
    --code-bg: #f3f4f6; --bar-bg: #ffffff; --uvp-bg: #eef8f2; --done: #c9ced6; --blue-2: #2f6fd6; --bad: #c5372c;
    --bad-soft: #fdecea; --bad-line: #f0b9b3; --blue-line: #b9cff2; --btn-a: rgba(241, 243, 246, 0.96);
    --shadow: rgba(0, 0, 0, 0.12); --violet: #7b4fd0; --teal: #12868d; --gold: #9a7a0a;
  }
}
:root { --c-text: 720px; --c-wide: 1120px; }
html { -webkit-text-size-adjust: 100%; }
body.site { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--font); overflow-x: hidden; }
/* the engine's own chrome: the bar (edit, MD, HTML, light/dark), the block palette, the side contents and tabs.
   The page has its own Markdown button; the example is read in the page's flow. */
body.site #bar, body.site #palette, body.site #toc, body.site #tocbtn, body.site .tabstrip { display: none !important; }
body.site > #app:empty { display: none; }
.site a { color: var(--accent); }
.site a:hover { text-decoration-thickness: 2px; }


/* columns: text at a reading width, the example and the lists wider */
.site main > * { max-width: var(--c-text); margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
.site main > .ex, .site main > .list { max-width: none; }
.site .crumbs { padding-top: 22px; font-size: 14px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 6px; }
.site .crumbs a { color: var(--faint); text-decoration: none; } .site .crumbs a:hover { color: var(--ink); }

/* header */
.site .hd { padding-top: 14px; padding-bottom: 8px; }
.site .kicker { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--warm); font-weight: 700; margin: 0 0 10px; }
.site .hd h1 { font-family: var(--head-font); font-size: 34px; line-height: 1.1; letter-spacing: -.025em; margin: 0 0 14px; text-wrap: balance; }
.site .lead { font-size: 19px; line-height: 1.55; color: var(--dim); margin: 0 0 18px; }
.site .by { font-size: 14.5px; color: var(--faint); margin: 0 0 18px; } .site .by b { color: var(--dim); font-weight: 600; }
.site .fine { font-size: 14px; color: var(--faint); margin: 10px 0 0; } .site .fine a { color: inherit; }
.site .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.site .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 18px; border-radius: 12px;
  border: 1px solid var(--line-hi); background: var(--btn); color: var(--ink); font: inherit; font-size: 15.5px; font-weight: 650; text-decoration: none; }
.site .btn:hover { border-color: var(--dim); }
.site .btn.main { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.site .btn.main:hover { filter: brightness(1.06); }
@media (max-width: 520px) { .site .hd .acts .btn { flex: 1 1 auto; } .site .hd .acts .btn.main { flex-basis: 100%; } }

/* the live example: a page on a band */
.site main > .ex { margin: 26px 0 8px; padding: 18px 10px 26px; background: var(--panel-2); border-block: 1px solid var(--line); }
.site .ex-top, .site .ex-page { max-width: var(--c-wide); margin: 0 auto; }
.site .ex-top { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--faint); padding: 0 4px 10px; font-family: var(--ui-font); }
.site .ex-top span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site .dots { display: flex; gap: 5px; flex: none; } .site .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-hi); }
.site .ex-page { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 22px 16px; overflow: hidden;
  box-shadow: 0 18px 50px var(--shadow); }
.site .ex-page > .wrap { max-width: none; }
@media (min-width: 760px) {
  .site main > .ex { padding: 26px 24px 40px; }
  .site .ex-page { padding: calc(40px * var(--space)) calc(48px * var(--space)); }
}

/* the article */
.site .prose { padding-top: 28px; }
.site .prose h2 { font-family: var(--head-font); font-size: 25px; line-height: 1.25; letter-spacing: -.02em; text-transform: none; color: var(--ink);
  font-weight: 700; margin: 40px 0 12px; text-wrap: balance; }
.site .prose h3 { font-family: var(--head-font); font-size: 19.5px; line-height: 1.3; letter-spacing: -.01em; margin: 28px 0 8px; }
.site .prose p, .site .prose ul, .site .prose ol, .site .prose blockquote, .site .prose table { margin: 0 0 16px; }
.site .prose ul, .site .prose ol { padding-left: 24px; font-size: inherit; line-height: inherit; }
.site .prose li { margin: 0 0 6px; } .site .prose li::marker { color: var(--faint); }
.site .prose ol b { color: inherit; }
.site .prose strong { font-weight: 650; }
.site .prose code { font: .86em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code-bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1px 5px; }
.site .prose blockquote { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 10px 10px 0; color: var(--ink); }
.site .prose blockquote > :last-child { margin-bottom: 0; }
.site .prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15.5px; max-width: 100%; }
.site .prose th { text-align: left; font-family: var(--ui-font); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim);
  font-weight: 650; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line-hi); white-space: nowrap; }
.site .prose td { padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

/* questions, related, the closing call */
.site main > section > h2 { font-family: var(--head-font); font-size: 22px; letter-spacing: -.02em; text-transform: none; color: var(--ink); font-weight: 700; margin: 0 0 12px; }
.site .faq { margin-top: 36px; }
.site .faq details { border-top: 1px solid var(--line); } .site .faq details:last-child { border-bottom: 1px solid var(--line); }
.site .faq summary { cursor: pointer; list-style: none; padding: 15px 34px 15px 0; font-weight: 650; position: relative; }
.site .faq summary::-webkit-details-marker { display: none; }
.site .faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 22px; color: var(--faint); font-weight: 400; }
.site .faq details[open] summary::after { content: "−"; }
.site .faq details p { color: var(--dim); margin: 0 0 16px; }
.site .rel { margin-top: 40px; }
.site .cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.site .cards a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.site .cards a:hover { border-color: var(--accent-line); }
.site .cards b { font-weight: 650; line-height: 1.35; } .site .cards span { color: var(--dim); font-size: 15px; line-height: 1.5; }
.site .cards time { color: var(--faint); font-size: 13.5px; margin-top: auto; padding-top: 6px; }
.site .cards img { display: block; width: calc(100% + 36px); height: auto; aspect-ratio: 1200 / 630; object-fit: cover; object-position: top;
  margin: -16px -18px 10px; border-bottom: 1px solid var(--line); border-radius: 13px 13px 0 0; }
.site main > .list { padding: 8px 16px 0; }
.site .list .cards { max-width: var(--c-wide); margin: 0 auto; }
.site main > .more { max-width: var(--c-wide); margin: 36px auto 0; padding: 0 16px; }
.site .more h2 { font-size: 20px; margin: 0 0 10px; }
.site .more ul { margin: 0; padding-left: 20px; color: var(--dim); line-height: 1.8; }
@media (min-width: 680px) { .site .list .cards, .site .rel .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .site .list .cards { grid-template-columns: repeat(3, 1fr); } }
.site .cta { margin-top: 48px; margin-bottom: 56px; text-align: center; }
.site .cta > * { max-width: 600px; margin-left: auto; margin-right: auto; }
.site main > .cta { padding: 30px 20px; border: 1px solid var(--accent-line); border-radius: 18px; background: var(--accent-soft); max-width: calc(var(--c-text) - 32px); }
.site .cta p { color: var(--dim); margin-bottom: 18px; }
.site .cta .acts { justify-content: center; }
@media (max-width: 720px) { .site main > .cta { margin-left: 16px; margin-right: 16px; } }


@media (min-width: 760px) {
  .site .hd h1 { font-size: 46px; }
  .site .crumbs { padding-top: 34px; }
  .site .prose h2 { font-size: 28px; }
}
/* the index pages: the header as wide as the list */
.site main.wide > .crumbs, .site main.wide > .hd { max-width: var(--c-wide); }
.site main.wide > .hd .lead { max-width: var(--c-text); }
@media print { .site .cta, .site .acts { display: none; } .site .ex { background: none; border: 0; } }
