/* Clonr Docs: the buyer guide as a searchable page. Builds on home.css + work.css (colours, fonts, header, .page). */

.docs-page { --ui-bg: #111a24; --ui-line: rgba(31, 111, 181, .32); --f-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace; }

/* ---------- Heading ---------- */
.docs-head { max-width: 760px; }
.docs-head h1 { margin: 1.1rem 0 .8rem; font: 700 clamp(3rem, 7vw, 5.4rem)/.95 var(--f-head); letter-spacing: -0.05em; }
.docs-head h1 em { font-style: normal; color: var(--bright); }
.docs-head h1 span { color: var(--muted); font-weight: 700; letter-spacing: -0.03em; }
.docs-head .c-mark { display: inline-block; width: .76em; height: .76em; margin-right: .04em; vertical-align: -0.02em; }
.docs-head .lede { margin: 0; color: #c9d4de; font-size: 1.1rem; max-width: 60ch; }
.docs-meta { margin: .9rem 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- Search: stays at the top while reading ---------- */
.docs-search { position: sticky; top: 12px; z-index: 6; margin: clamp(28px, 4vw, 44px) 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 10px; padding: 8px 10px 8px 18px; border-radius: 999px; background: rgba(12, 16, 21, .92); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.docs-search:focus-within { border-color: rgba(26, 155, 230, .7); }
.docs-search svg { width: 20px; height: 20px; color: var(--muted); }
.docs-search input { min-width: 0; padding: .7rem 0; border: 0; outline: 0; background: none; color: var(--text); font: 500 1.05rem/1.2 var(--f-body); }
.docs-search input::placeholder { color: #66727e; }
.docs-search input::-webkit-search-cancel-button { display: none; }
.docs-clear { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--field-hover); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.docs-clear:hover { background: #26303b; }
.docs-count { grid-column: 1 / -1; margin: 0; padding: 0 0 4px; color: var(--muted); font-size: .88rem; }
.docs-count:empty { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout: contents on the left, one reading column ---------- */
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); margin-top: clamp(24px, 3vw, 36px); }
.docs-toc ol { position: sticky; top: 104px; list-style: none; margin: 0; padding: 0; }
.docs-toc a { display: block; padding: .5rem .8rem; border-radius: var(--r-sm); color: var(--muted); font-size: .95rem; transition: background .15s, color .15s; }
.docs-toc a:hover { color: var(--text); background: var(--field); }
.docs-toc a.dim { opacity: .35; }
.docs-body { max-width: 820px; min-width: 0; }
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc ol { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-toc a { padding: .45rem .8rem; background: var(--field); border-radius: 999px; font-size: .9rem; }
}

/* ---------- Sections and items ---------- */
.d-section { padding-top: clamp(40px, 6vw, 72px); scroll-margin-top: 96px; }
.d-section:first-of-type { padding-top: 8px; }
.d-section .eyebrow { display: block; color: var(--bright); margin-bottom: .8rem; }
.d-section h2 { margin: 0 0 .9rem; font: 700 clamp(1.9rem, 3.6vw, 2.6rem)/1.08 var(--f-head); letter-spacing: -0.03em; }
.d-lead { margin: 0 0 .6rem; color: #d0dae3; font-size: 1.06rem; }
.docs-body p, .docs-body li { color: #c3ced9; line-height: 1.65; }
.docs-body strong { color: var(--text); font-weight: 600; }
.docs-body a:not(.mono) { color: var(--bright); text-decoration: underline; text-underline-offset: 3px; }

.d-item { padding: 1.4rem 0 .4rem; scroll-margin-top: 96px; }
.d-item h3 { margin: 0 0 .5rem; font: 700 1.22rem/1.3 var(--f-head); letter-spacing: -0.01em; }
.d-item h3 a { color: var(--text) !important; text-decoration: none !important; }
.d-item h3 a:hover { color: var(--bright) !important; }
.d-item p { margin: 0 0 .8rem; }
.d-item:target { animation: d-flash 2.2s ease-out; border-radius: var(--r-md); }
@keyframes d-flash { 0%, 30% { background: rgba(26, 155, 230, .12); box-shadow: 0 0 0 12px rgba(26, 155, 230, .12); } 100% { background: transparent; box-shadow: 0 0 0 12px transparent; } }

/* Panel reference: a name column and a description, one row per section of the panel */
.d-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 1.2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.d-lead + .d-row { margin-top: .8rem; border-top: 1px solid var(--line); }
.d-row h3 { font-size: 1.05rem; }
.d-row p { margin: 0; }
@media (max-width: 640px) { .d-row { grid-template-columns: 1fr; gap: .3rem; } }

/* Limits: compact items */
.d-limit { padding-top: 1rem; }
.d-limit h3 { font-size: 1.08rem; }

/* Troubleshooting questions get a small ? badge */
.qa .d-item h3 { position: relative; padding-left: 1.85rem; }
.qa .d-item h3::before { content: "?"; position: absolute; left: 0; top: .12em; width: 1.25rem; height: 1.25rem; border-radius: 50%; display: grid; place-items: center;
  font: 700 .78rem/1 var(--f-head); color: var(--bright); border: 1px solid rgba(26, 155, 230, .5); }

/* Steps: only where the order matters */
.d-steps { list-style: none; margin: .6rem 0 1rem; padding: 0; counter-reset: s; display: grid; gap: 10px; }
.d-steps > li { counter-increment: s; position: relative; padding: 1rem 1.2rem 1rem 3.9rem; border-radius: var(--r-md); background: var(--field); border: 1px solid var(--line); }
.d-steps > li::before { content: counter(s); position: absolute; left: 1.1rem; top: .95rem; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 700 .9rem/1 var(--f-head); color: #fff; background: rgba(26, 155, 230, .18); border: 1px solid rgba(26, 155, 230, .45); }

/* Maya's own interface (menus, buttons, settings) and file names in the mono face */
.ui { font: 500 .86em/1 var(--f-mono); color: #d7e6f2; background: var(--ui-bg); border: 1px solid var(--ui-line); padding: .22em .5em; border-radius: 6px; white-space: nowrap; }
.docs-body code { font: 500 .88em var(--f-mono); color: #d7e6f2; overflow-wrap: anywhere; }
@media (max-width: 720px) { .ui { white-space: normal; overflow-wrap: anywhere; } }

.d-shot { margin: 1rem 0 .6rem; }
.d-shot img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--ui-line); }
.d-shot figcaption { margin-top: .5rem; font-size: .88rem; color: var(--muted); }

/* ---------- Search results ---------- */
.docs-body mark { background: rgba(26, 155, 230, .32); color: #fff; border-radius: 3px; padding: 0 .08em; box-shadow: 0 0 0 1px rgba(26, 155, 230, .55); }
.docs-page.searching .d-lead { display: none; }
.docs-page.searching .d-section { padding-top: clamp(28px, 4vw, 44px); }
.docs-page.searching .d-section:first-of-type, .docs-page.searching .d-section.first-shown { padding-top: 8px; }
.d-section[hidden], .d-item[hidden] { display: none; }
.docs-empty { margin: 8px 0 0; padding: 1.4rem 1.6rem; border-radius: var(--r-md); background: var(--field); border: 1px solid var(--line); color: #c3ced9; }

/* Licence page */
.d-list { margin: 0 0 .8rem; padding-left: 1.1rem; }
.d-list li { margin: .4rem 0; }
.d-list li::marker { color: var(--bright); }
.legal-page .docs-head h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.legal-page .docs-layout { margin-top: clamp(32px, 5vw, 56px); }
