/* Code examples */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; font: 400 0.8rem/1.4 var(--font-mono); color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
/* 40px tap height on touch widths without shifting the line (negative margin cancels the padding) */
@media (max-width: 820px) { .crumbs a { display: inline-block; padding: 12px 6px; margin: -12px -6px; } }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); }
.ex-hero .lede { max-width: 720px; }
.ex-env { margin-top: 32px; max-width: 640px; }
.ex-env .eyebrow { margin: 0 0 6px; }
.ex-env .muted { margin: 0 0 12px; }

.ex-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-block: 24px 96px; }
.ex-toc { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; }
.ex-toc__docs { margin-top: 14px; color: var(--signal) !important; }
.ex-recipe { padding-bottom: 56px; margin-bottom: 56px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--nav-h) + 24px); }
.ex-recipe .kicker { margin: 0 0 6px; }
.ex-recipe .h3 { margin: 0 0 10px; }
.ex-recipe > .muted { max-width: 680px; margin: 0 0 22px; }

.ex-code { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; }
.ex-code__bar:empty, .ex-code__bar:has(> [hidden]:only-child) { display: none; }
.ex-code__bar { padding: 8px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ex-tabs { display: flex; gap: 4px; border: 0; }
.ex-tabs [role="tab"] { font: 500 0.8rem/1 var(--font-mono); color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.ex-tabs [role="tab"]:hover { color: var(--text); }
.ex-tabs [role="tab"][aria-selected="true"] { color: var(--text); background: var(--surface-2); border-color: var(--line-2); }
.ex-panel { position: relative; }
.ex-panel .copy-btn { z-index: 2; }
.ex-panel + .ex-panel { border-top: 1px solid var(--line); }
.ex-panel__label { margin: 0; padding: 12px 18px 0; font-size: 0.74rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.ex-code .code { border: 0; border-radius: 0; background: transparent; }
.js .ex-code[data-ready] .ex-panel__label { display: none; }
.js .ex-code[data-ready] .ex-panel + .ex-panel { border-top: 0; }
/* With the tab bar showing (labels hidden), the Copy button sits at the right end of the bar
   instead of on top of the first code line. */
.js .ex-code[data-ready] { position: relative; }
.js .ex-code[data-ready] .ex-panel { position: static; }
.js .ex-code[data-ready] .ex-code__bar { padding-right: 84px; }
.js .ex-code[data-ready] .copy-btn { top: 13px; }

.ex-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; }
.ex-cta .h3 { margin: 0 0 6px; }
.ex-cta .muted { margin: 0; max-width: 560px; }

@media (max-width: 1020px) {
  .ex-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .ex-toc { position: static; }
}
@media (max-width: 760px) {
  .ex-cta { padding: 24px 20px; }
}
@media (max-width: 820px) { .js .ex-code[data-ready] .copy-btn { top: 8px; } }
/* Narrow: let the language tabs wrap rather than clip behind the Copy button. */
@media (max-width: 560px) {
  .ex-code__bar { overflow-x: visible; }
  .ex-tabs { flex-wrap: wrap; width: auto; }
  .ex-tabs [role="tab"] { padding: 8px 10px; }
}

/* 40px+ tap targets on touch widths */
@media (max-width: 820px) { .ex-toc a { display: flex; align-items: center; min-height: 40px; } }
