/* Docs hub: /docs/. Loaded after main.css by includes/docs-shell.php. */

/* No product subnav on docs pages, so the fixed chrome is topbar + header only. */
body.page-docs { --subnav-h: 0px; --chrome-h: calc(var(--topbar-h) + var(--header-h)); }

.dx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Search ---------- */
.dx-search { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-light); }
.dx-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.dx-search [data-lucide], .dx-search .lucide { width: 16px; height: 16px; flex: none; }
.dx-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text-dark); -webkit-appearance: none; appearance: none; }
.dx-search input::-webkit-search-cancel-button { display: none; }
.dx-search kbd { font: 600 11px var(--font); color: var(--text-light); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; background: var(--bg-light); }
.dx-search:focus-within kbd { display: none; }
.dx-results { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 6px; max-height: min(70vh, 460px); overflow-y: auto; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(17, 24, 39, .14); }
.dx-results[hidden] { display: none; }
.dx-results li a { display: block; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-dark); }
.dx-results li a:hover, .dx-results li a[aria-selected="true"] { background: var(--primary-light); }
.dx-results .dx-r-title { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.dx-results .dx-r-crumb { display: block; margin-top: 1px; font-size: 12px; color: var(--text-light); }
.dx-results .dx-r-snip { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-medium); line-height: 1.45; }
.dx-results mark { background: rgba(245, 158, 11, .28); color: inherit; border-radius: 2px; padding: 0 1px; }
.dx-results .dx-empty { padding: 14px 10px; font-size: 14px; color: var(--text-medium); }

/* ---------- Hub landing ---------- */
.dx-hero { padding: 64px 0 36px; background: linear-gradient(180deg, var(--bg-light), var(--bg-white)); border-bottom: 1px solid var(--border); }
.dx-hero h1 { font-family: var(--font-display); font-size: clamp(34px, 5vw, 48px); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 12px; }
.dx-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--primary-ink); margin-bottom: 10px; }
.dx-lead { font-size: 18px; line-height: 1.55; color: var(--text-medium); max-width: 62ch; margin-bottom: 22px; }
.dx-search--hero { max-width: 560px; height: 50px; }
.dx-search--hero input { font-size: 16px; }
.dx-section { padding: 40px 0 72px; }
.dx-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dx-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-xl); color: var(--text-dark); transition: border-color .15s, box-shadow .15s, transform .15s; }
.dx-card:hover { border-color: var(--primary); box-shadow: 0 8px 24px rgba(17, 24, 39, .08); transform: translateY(-1px); }
.dx-card h2 { font-size: 22px; margin: 0; }
.dx-card p { font-size: 15px; color: var(--text-medium); line-height: 1.55; margin: 0; }
.dx-card-meta { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--primary-ink); }
/* Product wordmark: Quicksand name plus a dot in the product colour (docs/TYPOGRAPHY.md). */
.dx-card h2.dx-wordmark { font-family: var(--font-brand); font-weight: 700; font-size: 30px; line-height: 1.1; letter-spacing: -.3px; color: var(--text-dark); margin-bottom: 4px; }
.dx-wordmark-dot { color: var(--trace); }
.dx-card--measure .dx-wordmark-dot, .dx-wordmark--measure .dx-wordmark-dot { color: var(--measure); }
.dx-card--quote .dx-wordmark-dot, .dx-wordmark--quote .dx-wordmark-dot { color: var(--quote); }
h1 .dx-wordmark { font-family: var(--font-brand); font-weight: 700; letter-spacing: -.3px; }
.dx-h2 { font-size: 22px; margin: 44px 0 14px; }
.dx-featured { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dx-featured a { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text-dark); }
.dx-featured a:hover { border-color: var(--primary); background: var(--bg-light); }
.dx-featured strong { font-size: 15px; }
.dx-featured span { font-size: 12px; color: var(--text-light); }
.dx-featured em { font-style: normal; font-size: 13.5px; color: var(--text-medium); line-height: 1.5; }

/* ---------- Layout: sidebar | article | on this page ---------- */
.dx-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 48px; padding: 36px 0 72px; align-items: start; }
.dx-layout--page { grid-template-columns: 264px minmax(0, 1fr) 208px; gap: 40px; }
.dx-menu-toggle { display: none; }

.dx-sidebar { position: sticky; top: calc(var(--chrome-h) + 16px); max-height: calc(100vh - var(--chrome-h) - 32px); overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; display: flex; flex-direction: column; gap: 14px; }
.dx-switch { display: flex; gap: 2px; padding: 3px; background: var(--bg-gray); border-radius: var(--radius-md); }
.dx-switch a { flex: 1; text-align: center; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--text-medium); border-radius: 6px; }
.dx-switch a:hover { color: var(--text-dark); }
.dx-switch a.is-current { background: var(--bg-white); color: var(--text-dark); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.dx-tree { display: flex; flex-direction: column; gap: 6px; }
.dx-group summary { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 13px; font-weight: 700; color: var(--text-dark); cursor: pointer; border-radius: var(--radius-sm); list-style: none; }
.dx-group summary::-webkit-details-marker { display: none; }
.dx-group summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint); transform: rotate(-45deg); transition: transform .15s; }
.dx-group[open] summary::after { transform: rotate(45deg); }
.dx-group summary:hover { background: var(--bg-gray); }
.dx-group summary [data-lucide], .dx-group summary .lucide { width: 15px; height: 15px; color: var(--text-light); }
.dx-group ul { list-style: none; margin: 2px 0 6px 15px; padding: 0 0 0 10px; border-left: 1px solid var(--border); }
.dx-group li a { display: block; padding: 6px 10px; font-size: 14px; color: var(--text-medium); border-radius: var(--radius-sm); line-height: 1.35; }
.dx-group li a:hover { color: var(--text-dark); background: var(--bg-gray); }
.dx-group li a.is-current { color: var(--primary-ink); background: var(--primary-light); font-weight: 600; }

/* ---------- Article ---------- */
.dx-article { min-width: 0; }
.dx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--text-light); }
.dx-crumbs a { color: var(--text-medium); }
.dx-crumbs a:hover { color: var(--link); }
.dx-article > h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 40px); line-height: 1.12; letter-spacing: -.015em; margin-bottom: 12px; }
.dx-article .dx-lead { margin-bottom: 26px; }

.dx-body { font-size: 16px; line-height: 1.75; color: var(--text-medium); }
.dx-body > * { max-width: 70ch; }
.dx-body h2 { position: relative; font-size: 24px; line-height: 1.25; color: var(--text-dark); margin: 52px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--chrome-h) + 20px); max-width: none; }
.dx-body h2:first-child { margin-top: 8px; }
.dx-body h3 { position: relative; font-size: 18px; line-height: 1.3; color: var(--text-dark); margin: 36px 0 10px; scroll-margin-top: calc(var(--chrome-h) + 20px); }
.dx-body h4 { font-size: 15px; color: var(--text-dark); margin: 22px 0 6px; }
.dx-body p { margin: 0 0 16px; }
.dx-body ul, .dx-body ol { margin: 0 0 18px 22px; }
.dx-body li { margin-bottom: 5px; }
.dx-body li > ul, .dx-body li > ol { margin: 6px 0 6px 20px; }
.dx-body strong { color: var(--text-dark); }
.dx-body a { text-decoration: underline; text-decoration-color: rgba(7, 128, 134, .35); text-underline-offset: 2px; }
.dx-body a:hover { text-decoration-color: currentColor; }
.dx-body code { font: 500 .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg-gray); border-radius: 4px; padding: 1px 5px; color: var(--text-dark); }
.dx-body pre { overflow-x: auto; margin: 0 0 18px; padding: 14px 16px; background: #111827; border-radius: var(--radius-md); max-width: none; }
.dx-body pre code { background: none; padding: 0; color: #e5e7eb; font-size: 13.5px; line-height: 1.6; }
.dx-body hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; max-width: none; }
.dx-anchor { position: absolute; left: -22px; top: 0; padding-right: 6px; font-weight: 600; color: var(--text-faint); text-decoration: none !important; opacity: 0; transition: opacity .12s; }
.dx-body h2 .dx-anchor { top: 0; }
.dx-body h2:hover .dx-anchor, .dx-body h3:hover .dx-anchor, .dx-anchor:focus { opacity: 1; }

.dx-shot { margin: 8px 0 26px; max-width: none; }
.dx-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 2px 10px rgba(17, 24, 39, .06); background: var(--bg-light); }
.dx-shot figcaption { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--text-light); }

.dx-table { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--border); border-radius: var(--radius-md); max-width: none; }
.dx-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.dx-table th, .dx-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.dx-table th { background: var(--bg-light); font-size: 12.5px; font-weight: 700; color: var(--text-dark); white-space: nowrap; }
.dx-table tr:last-child td { border-bottom: 0; }
.dx-table td:first-child { color: var(--text-dark); font-weight: 600; }

.dx-callout { margin: 0 0 20px; padding: 12px 16px; border: 1px solid #a7dfe3; background: var(--primary-light); border-radius: var(--radius-md); max-width: 70ch; }
.dx-callout > p:first-child > strong:first-child { color: var(--primary-ink); }
.dx-callout p { margin: 0 0 8px; color: var(--text-dark); font-size: 15px; line-height: 1.65; }
.dx-callout p:last-child { margin-bottom: 0; }
.dx-callout--tip { border-color: #bbf7d0; background: #f0fdf4; }
.dx-callout--tip > p:first-child > strong:first-child { color: #166534; }
.dx-callout--warning { border-color: #fde68a; background: #fffbeb; }
.dx-callout--warning > p:first-child > strong:first-child { color: #92400e; }

.dx-toc-inline { display: none; margin: 0 0 22px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px; }
.dx-toc-inline summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text-dark); }
.dx-toc-inline ul { margin: 8px 0 0 18px; font-size: 14px; }

.dx-updated { margin-top: 36px; font-size: 13px; color: var(--text-light); }
.dx-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.dx-pager a { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text-dark); }
.dx-pager a:hover { border-color: var(--primary); background: var(--bg-light); }
.dx-pager span { font-size: 12px; color: var(--text-light); }
.dx-pager strong { font-size: 15px; }
.dx-pager-next { grid-column: 2; text-align: right; }

/* ---------- On this page ---------- */
.dx-toc { position: sticky; top: calc(var(--chrome-h) + 16px); max-height: calc(100vh - var(--chrome-h) - 32px); overflow-y: auto; overscroll-behavior: contain; font-size: 13px; }
.dx-toc p { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--text-dark); margin: 0 0 8px; }
.dx-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.dx-toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-medium); line-height: 1.4; }
.dx-toc a:hover { color: var(--text-dark); }
.dx-toc a.is-active { color: var(--primary-ink); border-left-color: var(--primary); font-weight: 600; }
.dx-toc-l3 a { padding-left: 24px; font-size: 12.5px; }

/* ---------- Product landing ---------- */
.dx-sec { margin-top: 36px; }
.dx-sec h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin-bottom: 6px; }
.dx-sec h2 [data-lucide], .dx-sec h2 .lucide { width: 20px; height: 20px; color: var(--primary-ink); }
.dx-sec-sum { color: var(--text-medium); font-size: 15px; margin: 0 0 14px; max-width: 64ch; }
.dx-pagelist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dx-pagelist a { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text-dark); }
.dx-pagelist a:hover { border-color: var(--primary); background: var(--bg-light); }
.dx-pagelist strong { font-size: 15px; }
.dx-pagelist span { font-size: 13.5px; color: var(--text-medium); line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .dx-layout--page { grid-template-columns: 240px minmax(0, 1fr); gap: 36px; }
    .dx-toc { display: none; }
    .dx-toc-inline { display: block; }
}
@media (max-width: 860px) {
    .dx-cards, .dx-featured { grid-template-columns: 1fr; }
    .dx-pagelist { grid-template-columns: 1fr; }
    .dx-layout, .dx-layout--page { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
    .dx-menu-toggle { display: inline-flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; font: 600 14px var(--font); color: var(--text-dark); background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; }
    .dx-menu-toggle [data-lucide], .dx-menu-toggle .lucide { width: 16px; height: 16px; }
    .dx-sidebar { display: none; position: static; max-height: none; overflow: visible; padding: 0; }
    .dx-sidebar.is-open { display: flex; }
    .dx-anchor { display: none; }
    .dx-pager { grid-template-columns: 1fr; }
    .dx-pager-next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .dx-card, .dx-group summary::after { transition: none; }
    .dx-card:hover { transform: none; }
}
