/* Blog posts: figures that open large, tables, and the interactive parts (:::try, :::compare, :::calc, :::quiz,
   :::steps, :::gallery, :::cta, :::tip) written in a post. Uses the site's colours, so light and dark both work. */
.post-body { counter-reset: none; }
.post-body h2 { scroll-margin-top: 80px; }
.post-body .bf { margin: 26px 0; }
.post-body .bf img { display: block; width: 100%; height: auto; border-radius: 14px; cursor: zoom-in; background: var(--panel2);
  box-shadow: 0 18px 50px -20px rgba(0,0,0,.45), 0 0 0 1px var(--line); transition: transform .25s; }
.post-body .bf img:hover { transform: translateY(-2px); }
.post-body .bf figcaption, .post-body .bw-cmp figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }
.btable { overflow-x: auto; margin: 22px 0; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.btable table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.btable th, .btable td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.btable th { background: var(--panel2); font-weight: 700; }
.btable tr:last-child td { border-bottom: 0; }
.btable tbody tr:hover { background: var(--hover); }

.bw { margin: 28px 0; padding: 20px 22px; border-radius: 18px; background: var(--panel2); }
.bw-l { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }
.bw > p:last-child { margin-bottom: 0; }
.bw-tip { border-left: 4px solid var(--accent); }
.bw-note { border-left: 4px solid #3b82f6; } .bw-note .bw-l { color: #3b82f6; }
.bw-warn { border-left: 4px solid #d97706; } .bw-warn .bw-l { color: #d97706; }
.bw-fine { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* :::try - a little live search */
.bw-q { display: flex; gap: 8px; }
.bw-q input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 12px; border: 0; font: inherit; color: var(--text);
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); outline: none; }
.bw-q input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.bw-q button, .bw-chips button, .bw-opts button { font: inherit; cursor: pointer; border: 0; }
.bw-q button { padding: 0 18px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; }
.bw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.bw-chips button { padding: 7px 13px; border-radius: 99px; background: var(--panel); color: var(--text); font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.bw-chips button:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-text); }
.bw-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-top: 12px; min-height: 0; }
.bw-res figure { position: relative; margin: 0; border-radius: 12px; overflow: hidden; animation: bwIn .35s both; }
.bw-res img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.bw-res b { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 7px; font-size: 11.5px; background: rgba(0,0,0,.66); color: #fff; }
.bw-res p { grid-column: 1 / -1; margin: 4px 0; color: var(--muted); font-size: 14px; }
@keyframes bwIn { from { opacity: 0; transform: translateY(8px) scale(.97); } }

/* :::compare - before / after */
.bw-cmp { padding: 0; background: none; }
.bw-cmp-in { position: relative; border-radius: 16px; overflow: hidden; user-select: none; box-shadow: 0 0 0 1px var(--line); }
.bw-cmp-in img { display: block; width: 100%; height: auto; }
.bw-cmp-b { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.bw-cmp-b img { width: 100%; height: 100%; object-fit: cover; }
.bw-cmp-h { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 12px rgba(0,0,0,.4); pointer-events: none; }
.bw-cmp-h::after { content: "\2194"; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #111; font-weight: 700; }
.bw-cmp-l, .bw-cmp-r { position: absolute; top: 10px; padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; }
.bw-cmp-l { left: 10px; } .bw-cmp-r { right: 10px; }
.bw-cmp input[type=range] { width: 100%; margin-top: 10px; accent-color: var(--accent); }

/* :::calc */
.bw-calc label { display: grid; grid-template-columns: 1fr 2fr 44px; align-items: center; gap: 12px; margin: 10px 0; font-size: 15px; }
.bw-calc input { width: 100%; accent-color: var(--accent); }
.bw-calc output { font-weight: 700; text-align: right; }
.bw-calc-r { margin: 14px 0 0; font-size: 17px; }
.bw-calc-r b { font-size: 26px; color: var(--accent-text); }
@media (max-width: 600px) { .bw-calc label { grid-template-columns: 1fr 44px; } .bw-calc input { grid-column: 1 / -1; grid-row: 2; } }

/* :::quiz */
.bw-opts { display: grid; gap: 8px; }
.bw-opts button { text-align: left; padding: 13px 16px; border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s; }
.bw-opts button:hover { transform: translateX(3px); }
.bw-opts button.on { box-shadow: inset 0 0 0 2px var(--accent); }
.bw-ans:empty { display: none; }
.bw-ans { margin: 14px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); animation: bwIn .3s both; }

/* :::steps */
.bw-steps ol { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.bw-steps li { counter-increment: st; margin: 6px 0; }
.bw-steps label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel); cursor: pointer; }
.bw-steps label::before { content: counter(st); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 14px; }
.bw-steps input { display: none; }
.bw-steps input:checked + span { text-decoration: line-through; color: var(--muted); }
.bw-steps li:has(input:checked) label::before { content: "\2713"; background: var(--accent); color: #fff; }
.bw-prog { float: right; color: var(--muted); }

/* :::gallery */
.bw-gal { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 46%); gap: 14px; overflow-x: auto; padding: 4px 2px 12px; background: none; scroll-snap-type: x mandatory; }
.bw-gal .bf { margin: 0; scroll-snap-align: start; }

/* :::cta */
.bw-cta { text-align: center; padding: 30px 22px; background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--panel2); }
.bw-cta > b { display: block; font-size: 24px; letter-spacing: -.02em; line-height: 1.2; }
.bw-cta p { color: var(--muted); }
.bw-cta-b { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* the larger picture, the contents list and the reading bar (made by blog.js) */
.bz { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.86); cursor: zoom-out; animation: bwIn .2s both; }
.bz img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.btoc { margin: 0 0 26px; padding: 16px 20px; border-radius: 16px; background: var(--panel2); font-size: 15px; }
.btoc b { display: block; margin-bottom: 6px; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.btoc ol { margin: 0; padding-left: 20px; } .btoc li { margin: 4px 0; } .btoc a { color: var(--text); }
.btoc a:hover { color: var(--accent-text); }
.bbar { position: fixed; left: 0; top: 0; z-index: 80; height: 3px; width: 0; background: var(--shine); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .bw *, .bz { animation: none !important; transition: none !important; } }
