/*
 * Block-based blog posts (includes/blog-renderer.php).
 * Self-contained on purpose: the Tailwind build is pre-compiled, so these
 * classes never depend on which utilities happen to be in it. The blog-admin
 * app loads a copy of this file for its WYSIWYG preview; keep the two in sync
 * (blog-admin: npm run sync:contract).
 */

.qb-article {
  --qb-pad: clamp(1.25rem, 4vw, 3rem);
  --qb-measure: 46rem;
  --qb-primary: #2563eb;
  --qb-accent: #ea580c;
  --qb-success: #16a34a;
  --qb-warning: #d97706;
  --qb-danger: #dc2626;
  --qb-muted: #6b7280;
  --qb-dark: #111827;
  --qb-light: #f3f4f6;
  --qb-text: #1f2937;
  max-width: 72rem;
  margin: 0 auto;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .08), 0 4px 10px -6px rgba(0, 0, 0, .06);
  overflow: hidden;
}
.qb-article-body { padding: var(--qb-pad); }
.qb-article-cover img { display: block; width: 100%; height: auto; max-height: 28rem; object-fit: cover; }
.qb-article-header { max-width: var(--qb-measure); margin: 0 auto 2rem; }
.qb-article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; color: var(--qb-muted); font-size: .875rem; padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid #e5e7eb; }
.qb-article-meta .icon { margin-right: .4rem; }
.qb-article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.qb-tag { background: #dbeafe; color: #1e40af; padding: .2rem .75rem; border-radius: 999px; font-size: .75rem; }
.qb-article-title { font-size: clamp(1.875rem, 4vw, 2.75rem); line-height: 1.15; font-weight: 800; color: var(--qb-dark); letter-spacing: -.01em; }

/* ---- document flow -------------------------------------------------------- */
.qb-doc { color: var(--qb-text); font-size: 1.0625rem; line-height: 1.75; overflow-wrap: break-word; }
.qb-doc::after { content: ""; display: block; clear: both; }
.qb-doc .qb-block { margin: 0 0 1.25rem; }
.qb-doc > .qb-block { max-width: var(--qb-measure); margin-left: auto; margin-right: auto; }
.qb-doc > .qb-w-narrow { max-width: 36rem; }
.qb-doc > .qb-w-wide { max-width: 100%; }
.qb-doc > .qb-w-full { max-width: none; margin-left: calc(-1 * var(--qb-pad)); margin-right: calc(-1 * var(--qb-pad)); }
.qb-doc > .qb-w-full.qb-image .qb-img { border-radius: 0; }
.qb-col > .qb-block:last-child, .qb-group > .qb-block:last-child { margin-bottom: 0; }
.qb-doc a:not(.qb-btn) { color: var(--qb-primary); text-decoration: underline; text-underline-offset: 2px; }
.qb-doc a:not(.qb-btn):hover { color: #1d4ed8; }
.qb-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: #f3f4f6; padding: .1em .35em; border-radius: .25rem; }
.qb-doc mark { background: #fef08a; padding: 0 .15em; border-radius: .15rem; }

/* ---- shared style tokens -------------------------------------------------- */
.qb-doc .qb-align-left { text-align: left; }
.qb-doc .qb-align-center { text-align: center; }
.qb-doc .qb-align-right { text-align: right; }
.qb-doc .qb-align-justify { text-align: justify; }

.qb-doc .qb-mt-none { margin-top: 0; } .qb-doc .qb-mb-none { margin-bottom: 0; }
.qb-doc .qb-mt-xs { margin-top: .5rem; } .qb-doc .qb-mb-xs { margin-bottom: .5rem; }
.qb-doc .qb-mt-sm { margin-top: 1rem; } .qb-doc .qb-mb-sm { margin-bottom: 1rem; }
.qb-doc .qb-mt-md { margin-top: 1.5rem; } .qb-doc .qb-mb-md { margin-bottom: 1.5rem; }
.qb-doc .qb-mt-lg { margin-top: 2.5rem; } .qb-doc .qb-mb-lg { margin-bottom: 2.5rem; }
.qb-doc .qb-mt-xl { margin-top: 4rem; } .qb-doc .qb-mb-xl { margin-bottom: 4rem; }
.qb-doc .qb-mt-2xl { margin-top: 6rem; } .qb-doc .qb-mb-2xl { margin-bottom: 6rem; }
.qb-p-none { padding: 0; } .qb-p-xs { padding: .5rem; } .qb-p-sm { padding: 1rem; } .qb-p-md { padding: 1.5rem; }
.qb-p-lg { padding: 2.5rem; } .qb-p-xl { padding: clamp(2rem, 5vw, 4rem); } .qb-p-2xl { padding: clamp(2.5rem, 7vw, 6rem); }

.qb-bg-muted { background-color: #f9fafb; } .qb-bg-primary { background-color: #eff6ff; } .qb-bg-accent { background-color: #fff7ed; }
.qb-bg-success { background-color: #f0fdf4; } .qb-bg-warning { background-color: #fffbeb; } .qb-bg-danger { background-color: #fef2f2; }
.qb-bg-dark { background-color: var(--qb-dark); color: #f9fafb; } .qb-bg-light { background-color: var(--qb-light); } .qb-bg-white { background-color: #fff; }
.qb-bg-dark a:not(.qb-btn) { color: #93c5fd; }
.qb-text-muted { color: var(--qb-muted); } .qb-text-primary { color: var(--qb-primary); } .qb-text-accent { color: var(--qb-accent); }
.qb-text-success { color: var(--qb-success); } .qb-text-warning { color: var(--qb-warning); } .qb-text-danger { color: var(--qb-danger); }
.qb-text-dark { color: var(--qb-dark); } .qb-text-light { color: #e5e7eb; } .qb-text-white { color: #fff; }

.qb-r-none { border-radius: 0; } .qb-r-sm { border-radius: .375rem; } .qb-r-md { border-radius: .75rem; } .qb-r-lg { border-radius: 1.25rem; } .qb-r-full { border-radius: 999px; }
.qb-border { border: 1px solid #e5e7eb; }
.qb-shadow { box-shadow: 0 10px 25px -8px rgba(0, 0, 0, .15); }
@media (max-width: 767px) { .qb-hide-mobile { display: none !important; } }
@media (min-width: 768px) { .qb-hide-desktop { display: none !important; } }

/* ---- text blocks ---------------------------------------------------------- */
.qb-heading { color: var(--qb-dark); font-weight: 750; line-height: 1.25; letter-spacing: -.01em; scroll-margin-top: 5rem; }
.qb-bg-dark .qb-heading, .qb-bg-dark.qb-heading { color: #fff; }
.qb-doc .qb-h1 { font-size: clamp(1.875rem, 4vw, 2.5rem); margin-top: 2.5rem; margin-bottom: 1.25rem; }
.qb-doc .qb-h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); margin-top: 2.5rem; margin-bottom: 1rem; }
.qb-doc .qb-h3 { font-size: 1.375rem; margin-top: 2rem; margin-bottom: .75rem; }
.qb-doc .qb-h4 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: .5rem; }
.qb-doc > .qb-heading:first-child { margin-top: 0; }
.qb-size-sm { font-size: .9375rem; }
.qb-size-lg { font-size: 1.25rem; line-height: 1.65; color: #374151; }

/* ---- lists ---------------------------------------------------------------- */
.qb-list { padding-left: 1.5rem; }
.qb-list li { margin: .4rem 0; }
.qb-list--unordered.qb-list--default { list-style: disc; }
.qb-list--ordered.qb-list--default { list-style: decimal; }
.qb-li-title { display: block; color: var(--qb-dark); }
.qb-list-cols-2, .qb-list-cols-3 { display: grid; gap: .25rem 1.5rem; }
@media (min-width: 640px) {
  .qb-list-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qb-list-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.qb-list--default.qb-list-cols-2 li, .qb-list--default.qb-list-cols-3 li { margin-left: 0; }

.qb-list--check, .qb-list--arrow, .qb-list--bubble, .qb-list--card { list-style: none; padding-left: 0; counter-reset: qb-item var(--qb-start, 0); }
.qb-list--check li, .qb-list--arrow li, .qb-list--bubble li { position: relative; padding-left: 2.25rem; counter-increment: qb-item; }
.qb-list--check li::before, .qb-list--arrow li::before, .qb-list--bubble li::before {
  position: absolute; left: 0; top: .2em; width: 1.5rem; height: 1.5rem; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; line-height: 1;
}
.qb-list--check li::before { content: "\2713"; background: #dcfce7; color: var(--qb-success); }
.qb-list--arrow li::before { content: "\2192"; background: #dbeafe; color: var(--qb-primary); }
.qb-list--bubble li::before { content: "\2022"; background: var(--qb-primary); color: #fff; font-size: 1.1rem; }
.qb-list--bubble.qb-list--ordered li::before { content: counter(qb-item); font-size: .8rem; }
.qb-list--bubble li { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px; padding: .55rem 1.1rem .55rem 2.9rem; margin: .6rem 0; }
.qb-list--bubble li::before { left: .7rem; top: .6rem; }

.qb-list--card { display: grid; gap: 1rem; }
@media (min-width: 640px) {
  .qb-list--card.qb-list-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qb-list--card.qb-list-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.qb-list--card li { margin: 0; padding: 1.25rem 1.25rem 1.25rem 1.25rem; background: #fff; border: 1px solid #e5e7eb; border-radius: .875rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); counter-increment: qb-item; }
.qb-list--card.qb-list--ordered li::before { content: counter(qb-item); display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--qb-primary); color: #fff; font-weight: 700; font-size: .875rem; margin-bottom: .6rem; }
.qb-list--card .qb-li-title { font-size: 1.0625rem; margin-bottom: .25rem; }

/* ---- code ----------------------------------------------------------------- */
.qb-code { background: #0f172a; border-radius: .75rem; overflow: hidden; }
.qb-code-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .75rem .5rem 1rem; background: #1e293b; color: #94a3b8; font: 500 .8125rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.qb-copy { display: inline-flex; align-items: center; gap: .35rem; background: transparent; border: 1px solid #334155; color: #cbd5e1; border-radius: .375rem; padding: .2rem .55rem; font: inherit; cursor: pointer; }
.qb-copy:hover { background: #334155; color: #fff; }
.qb-pre { margin: 0; padding: 1rem 1.25rem; overflow-x: auto; color: #e2e8f0; font: .875rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
.qb-doc .qb-pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.qb-pre--wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.qb-pre--lines code { counter-reset: qb-line; }
.qb-pre--lines .qb-line { counter-increment: qb-line; }
.qb-pre--lines .qb-line::before { content: counter(qb-line); display: inline-block; width: 2.5em; margin-right: 1em; text-align: right; color: #475569; user-select: none; }

/* ---- quote ---------------------------------------------------------------- */
.qb-quote blockquote { margin: 0; }
.qb-quote--default { border-left: 4px solid var(--qb-primary); padding: .25rem 0 .25rem 1.25rem; }
.qb-quote--default blockquote p { font-style: italic; color: #374151; }
.qb-quote--large { text-align: center; padding: 1.5rem 1rem; }
.qb-quote--large blockquote p { font-size: clamp(1.25rem, 2.5vw, 1.625rem); line-height: 1.5; font-weight: 600; color: var(--qb-dark); }
.qb-quote--large blockquote p::before { content: "\201C"; display: block; font-size: 3.5rem; line-height: 1; color: var(--qb-primary); }
.qb-quote--pull { border-top: 3px solid var(--qb-dark); border-bottom: 3px solid var(--qb-dark); padding: 1.25rem 0; }
.qb-quote--pull blockquote p { font-size: 1.375rem; line-height: 1.5; font-weight: 700; color: var(--qb-dark); }
.qb-quote figcaption { margin-top: .6rem; font-size: .875rem; color: var(--qb-muted); }
.qb-quote cite { font-style: normal; font-weight: 600; }

/* ---- image ---------------------------------------------------------------- */
.qb-image { margin-left: auto; margin-right: auto; }
.qb-image.qb-img-small { width: 33.333%; min-width: 12rem; }
.qb-image.qb-img-medium { width: 50%; min-width: 16rem; }
.qb-image.qb-img-large { width: 75%; }
.qb-image.qb-img-full { width: 100%; }
.qb-doc > .qb-image.qb-img-full { width: auto; }
.qb-image.qb-align-left { margin-left: 0; margin-right: auto; }
.qb-image.qb-align-right { margin-left: auto; margin-right: 0; }
.qb-img { display: block; width: 100%; height: auto; }
.qb-img--rounded { border-radius: .875rem; }
.qb-img--shadow { box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .35); }
.qb-aspect-1-1 { aspect-ratio: 1 / 1; } .qb-aspect-4-3 { aspect-ratio: 4 / 3; } .qb-aspect-3-2 { aspect-ratio: 3 / 2; }
.qb-aspect-16-9 { aspect-ratio: 16 / 9; } .qb-aspect-21-9 { aspect-ratio: 21 / 9; }
.qb-fit-cover { object-fit: cover; } .qb-fit-contain { object-fit: contain; }
.qb-image figcaption { margin-top: .5rem; font-size: .875rem; color: var(--qb-muted); text-align: center; }
.qb-img-link { display: block; }
@media (min-width: 768px) {
  .qb-doc .qb-float-left { float: left; margin: .35rem 1.75rem 1rem 0; }
  .qb-doc .qb-float-right { float: right; margin: .35rem 0 1rem 1.75rem; }
  .qb-doc > .qb-float-left { margin-left: max(0px, calc((100% - var(--qb-measure)) / 2)); }
  .qb-doc > .qb-float-right { margin-right: max(0px, calc((100% - var(--qb-measure)) / 2)); }
}
@media (max-width: 640px) {
  .qb-image.qb-img-small, .qb-image.qb-img-medium, .qb-image.qb-img-large { width: 100%; min-width: 0; }
}

/* ---- callout -------------------------------------------------------------- */
.qb-callout { display: flex; gap: .875rem; padding: 1rem 1.25rem; border-radius: .75rem; border: 1px solid; }
.qb-callout-icon { flex: none; font-size: 1.25rem; margin-top: .2rem; }
.qb-callout-body > p { margin: 0; }
.qb-callout-body > p + p { margin-top: .35rem; }
.qb-callout-title { font-weight: 700; color: var(--qb-dark); }
.qb-callout--info { background: #eff6ff; border-color: #bfdbfe; } .qb-callout--info .qb-callout-icon { color: var(--qb-primary); }
.qb-callout--tip { background: #f5f3ff; border-color: #ddd6fe; } .qb-callout--tip .qb-callout-icon { color: #7c3aed; }
.qb-callout--warning { background: #fffbeb; border-color: #fde68a; } .qb-callout--warning .qb-callout-icon { color: var(--qb-warning); }
.qb-callout--success { background: #f0fdf4; border-color: #bbf7d0; } .qb-callout--success .qb-callout-icon { color: var(--qb-success); }
.qb-callout--note { background: #f9fafb; border-color: #e5e7eb; } .qb-callout--note .qb-callout-icon { color: var(--qb-muted); }

/* ---- button --------------------------------------------------------------- */
.qb-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; border-radius: .625rem; text-decoration: none; transition: background-color .15s, color .15s, border-color .15s; border: 2px solid transparent; }
.qb-btn--sm { padding: .4rem .9rem; font-size: .875rem; }
.qb-btn--md { padding: .65rem 1.4rem; font-size: 1rem; }
.qb-btn--lg { padding: .85rem 1.9rem; font-size: 1.125rem; }
.qb-btn--block { display: flex; width: 100%; }
.qb-btn--primary { background: var(--qb-primary); color: #fff; }
.qb-btn--primary:hover { background: #1d4ed8; color: #fff; }
.qb-btn--secondary { background: var(--qb-dark); color: #fff; }
.qb-btn--secondary:hover { background: #374151; color: #fff; }
.qb-btn--outline { border-color: var(--qb-primary); color: var(--qb-primary); background: transparent; }
.qb-btn--outline:hover { background: #eff6ff; }

/* ---- table ---------------------------------------------------------------- */
.qb-table-wrap { overflow-x: auto; }
.qb-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.qb-table caption { caption-side: bottom; padding-top: .5rem; font-size: .875rem; color: var(--qb-muted); }
.qb-table th, .qb-table td { border: 1px solid #e5e7eb; padding: .65rem .85rem; text-align: left; vertical-align: top; }
.qb-table thead th { background: #f9fafb; font-weight: 700; color: var(--qb-dark); }
.qb-table tbody th { font-weight: 600; background: #fcfcfd; }
.qb-table--striped tbody tr:nth-child(even) td { background: #f9fafb; }

/* ---- divider / spacer ----------------------------------------------------- */
.qb-divider { border: 0; height: 0; margin-top: 2rem; margin-bottom: 2rem; }
.qb-divider--line { border-top: 1px solid #e5e7eb; }
.qb-divider--dashed { border-top: 2px dashed #d1d5db; }
.qb-divider--dots { height: auto; text-align: center; }
.qb-divider--dots::before { content: "\2022\2002\2022\2002\2022"; color: #9ca3af; letter-spacing: .4em; }
.qb-doc .qb-spacer { margin: 0; }
.qb-spacer-xs { height: .5rem; } .qb-spacer-sm { height: 1rem; } .qb-spacer-md { height: 2rem; }
.qb-spacer-lg { height: 3.5rem; } .qb-spacer-xl { height: 5rem; } .qb-spacer-2xl { height: 8rem; }

/* ---- layout: columns + group ---------------------------------------------- */
.qb-columns { display: grid; grid-template-columns: minmax(0, 1fr); }
.qb-gap-none { gap: 0; } .qb-gap-xs { gap: .5rem; } .qb-gap-sm { gap: 1rem; } .qb-gap-md { gap: 1.5rem; }
.qb-gap-lg { gap: 2.5rem; } .qb-gap-xl { gap: 4rem; } .qb-gap-2xl { gap: 6rem; }
.qb-stack-never { grid-template-columns: var(--qb-cols); }
@media (min-width: 640px) { .qb-stack-sm { grid-template-columns: var(--qb-cols); } }
@media (min-width: 768px) { .qb-stack-md { grid-template-columns: var(--qb-cols); } }
@media (min-width: 1024px) { .qb-stack-lg { grid-template-columns: var(--qb-cols); } }
@media (max-width: 639px) { .qb-reverse.qb-stack-sm > .qb-col:first-child { order: 1; } }
@media (max-width: 767px) { .qb-reverse.qb-stack-md > .qb-col:first-child { order: 1; } }
@media (max-width: 1023px) { .qb-reverse.qb-stack-lg > .qb-col:first-child { order: 1; } }
.qb-col { min-width: 0; display: flex; flex-direction: column; }
.qb-columns.qb-valign-top { align-items: start; } .qb-columns.qb-valign-center { align-items: center; }
.qb-columns.qb-valign-bottom { align-items: end; } .qb-columns.qb-valign-stretch { align-items: stretch; }
.qb-col.qb-valign-top { align-self: start; } .qb-col.qb-valign-center { align-self: center; }
.qb-col.qb-valign-bottom { align-self: end; } .qb-col.qb-valign-stretch { align-self: stretch; }
.qb-col > .qb-image { min-width: 0; }
.qb-group::after { content: ""; display: block; clear: both; }
