/* Build Notes — front-end styles for post_content (content-HTML contract) + reduced-motion.
   Ships in the child theme; consumes the Bricks global variables (:root) already live on the site.
   Class vocabulary frozen to match spec/single-post.spec.json. */

/* code windows (hero + inline) */
.bn-herocode { background: var(--surface-dark); border-radius: var(--r-lg); padding: 26px 30px; position: relative; margin: 0 0 30px; box-shadow: var(--sh-raised); }
.bn-herocode .bn-recipe, .bn-recipe { font-family: var(--font-hand); color: var(--accent-yellow); font-size: 20px; }
.code-window { background: var(--surface-code); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-raised); }
.code-window__chrome, .bn-code__bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.code-window__chrome i, .bn-code__bar i { width: 13px; height: 13px; border-radius: 50%; display: block; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.code-window pre, .bn-code pre { margin: 0; padding: 4px 20px 20px; font-family: var(--font-mono); font-size: 15px; line-height: 1.7; color: #e7edf0; background: transparent; overflow-x: auto; }
.code-window pre code, .bn-code pre code { background: transparent; color: #e7edf0; padding: 0; }

.bn-code { background: var(--surface-code); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-raised); position: relative; margin: 22px 0; }
.bn-code pre { display: flex; }
.bn-code--numbered pre code { counter-reset: ln; }
.bn-code__copy { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; background: #2a3436; color: #cfd6d8; border: 1px solid #3a4649; border-radius: 8px; padding: 6px 12px; font-family: var(--font-sans); font-size: 13px; font-weight: 600; cursor: pointer; }
.bn-code code { white-space: pre; color: #c7ced3; font-family: var(--font-mono); }

/* checklist */
.bn-checklist { list-style: none; padding: 0; margin: 16px 0; }
.bn-checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; font-size: 18px; color: var(--text-body); }
.bn-checklist li::before { content: ""; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: var(--success-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l4 4 10-10' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/15px no-repeat; }

/* tip callout */
.bn-callout { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--r-md); padding: 16px 20px; font-size: 16px; margin: 22px 0; }
.bn-callout--tip { background: #FCEFC7; color: #5a4a1a; }
.bn-callout .ic { flex: none; width: 22px; height: 22px; margin-top: 2px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.2 1 2.5h6c0-1.3.3-1.8 1-2.5A6 6 0 0 0 12 3z' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.2 1 2.5h6c0-1.3.3-1.8 1-2.5A6 6 0 0 0 12 3z' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat; }
.bn-callout b, .bn-callout strong { color: #3d3110; }

/* 3-column demo */
.bn-demo { display: grid; grid-template-columns: 1fr 1fr 0.8fr; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: #FBF7EF; overflow: hidden; margin: 22px 0; }
.bn-demo > div { padding: 18px; border-right: 1px solid var(--border-subtle); }
.bn-demo > div:last-child { border-right: none; }
.bn-demo pre { margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; white-space: pre; overflow-x: auto; color: #3a4a4d; }
.bn-demo .lbl { font-family: var(--font-mono); font-weight: 700; color: var(--brand-teal); font-size: 13px; margin-bottom: 8px; }
.bn-demo .lbl.res { color: var(--text-heading); font-family: var(--font-serif); }
.bn-demo .res-body strong { font-family: var(--font-serif); font-size: 18px; display: block; margin: 8px 0 4px; }

/* in-article sticky note */
.bn-note { background: var(--note-green); border-radius: 3px; padding: 20px 24px; box-shadow: var(--sh-raised); font-family: var(--font-mono); color: #3a4230; position: relative; background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.035) 0 1px, transparent 1px 15px), repeating-linear-gradient(90deg, rgba(0,0,0,.035) 0 1px, transparent 1px 15px); }
.bn-note--float { float: right; width: 300px; margin: 6px 0 16px 28px; transform: rotate(1.5deg); }
.bn-note .tape { position: absolute; top: -12px; left: 40%; width: 90px; height: 26px; background: rgba(245,197,66,.5); transform: rotate(-4deg); }
.bn-note p { line-height: 1.8; margin: 0; white-space: pre-line; }

/* h2 numbered underline in content */
.bn-h2 .num { position: relative; }
.bn-h2 .num::after { content: ""; position: absolute; left: 0; right: 6px; bottom: -3px; height: 3px; background: #2f9c9c; border-radius: 3px; }

/* responsive (my content classes; Bricks layout uses breakpoint suffixes in the templates) */
@media (max-width: 991px) {
  .bn-note--float { float: none; width: auto; margin: 16px 0; transform: none; }
}
@media (max-width: 767px) {
  .bn-demo { grid-template-columns: 1fr; }
  .bn-demo > div { border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .bn-herocode { padding: 18px; }
}
img, svg, video, pre { max-width: 100%; }
.code-window, .bn-code, .bn-herocode, .bn-demo { max-width: 100%; }
/* safety net: prevent horizontal page scroll from residual few-px decorative overflows */
html, body { overflow-x: clip; max-width: 100%; }

/* keyboard-focusable scroll regions get a visible focus ring (JS adds tabindex) */
.bn-code pre:focus-visible, .bn-demo pre:focus-visible, .code-window pre:focus-visible { outline: 2px solid var(--accent-yellow); outline-offset: 2px; }

/* accessibility: reduced motion (child theme owns this so it survives builder re-saves; @layer beats Bricks) */
@layer bricks {
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  }
}
