/* cairn doc (tools/doc), on top of the map's style.css: the same palette, type and chips. A
   module page has its contents on the left and its declarations on the right, rustdoc-style. */

.bar .search { margin-left: auto; position: relative; flex: 1 1 260px; max-width: 420px; }
#search {
	width: 100%; font: 15px var(--pixel); color: var(--fg); background: var(--panel);
	border: 0; box-shadow: inset 0 0 0 2px var(--rule); padding: 7px 10px; outline: none;
}
#search:focus { box-shadow: inset 0 0 0 2px var(--gold); }
#results {
	position: absolute; right: 0; top: calc(100% + 6px); width: min(620px, 92vw); max-height: 70vh; overflow-y: auto;
	background: var(--panel); box-shadow: inset 0 0 0 2px var(--rule), 4px 4px 0 var(--ink); z-index: 10; padding: 6px;
}
#results a { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0 10px; padding: 6px 8px; color: var(--fg); text-decoration: none; }
#results a.on, #results a:hover { background: var(--chip); }
#results .k { font: 13px var(--pixel); color: var(--muted); grid-row: span 2; }
#results .nm { font: 14px var(--mono); overflow-wrap: anywhere; }
#results .tx { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
#results .none { color: var(--muted); padding: 6px 8px; margin: 0; }

.layout { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0 28px; padding: 0 16px; }
.layout main { max-width: none; margin: 0; padding: 8px 0 72px; min-width: 0; }
aside.toc { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 40px 0 40px; font: 14px/1.5 var(--pixel); }
aside.toc > .pix { margin-bottom: 10px; overflow-wrap: anywhere; }
aside.toc > a { display: block; margin-top: 14px; color: var(--fg); text-decoration: none; font-weight: 600; }
aside.toc ol { list-style: none; padding: 0; margin: 4px 0 0; }
aside.toc li a { color: var(--muted); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
aside.toc li a:hover, aside.toc > a:hover { color: var(--accent); }
aside.toc .n { color: var(--muted); font-weight: 400; }

h1.mod { font-size: 38px; overflow-wrap: anywhere; }
header.page .src, .imports { font-size: 14.5px; color: var(--muted); }
header.page .src { font-family: var(--mono); }
.lede .doc p { font-size: 20px; }
.doc { max-width: 820px; }
.doc p, .doc li { line-height: 1.55; }
.doc h1, .doc h2, .doc h3 { font: 600 18px/1.3 var(--pixel); margin: 22px 0 8px; display: block; }
.doc h1::before, .doc h2::before { content: none; }
.doc pre { background: var(--ink); padding: 12px 14px; overflow-x: auto; font: 13.5px/1.5 var(--mono); }
.doc pre code { background: none; padding: 0; font-size: inherit; }
.doc table { font-size: 15px; margin: 8px 0 14px; }
.doc a code { color: var(--accent); }
.order { display: flex; align-items: center; gap: 8px; margin: 26px 0 0; font-size: 14px; }
.order button { font: 14px var(--pixel); color: var(--muted); background: none; border: 0; box-shadow: inset 0 0 0 2px var(--rule); padding: 4px 10px; cursor: pointer; }
.order button.on { color: var(--ink); background: var(--gold); box-shadow: none; }
.mdoc { margin: 30px 0 12px; }

/* A declaration. */
.decl { padding: 14px 0 16px; border-top: 2px solid var(--rule); scroll-margin-top: 16px; }
.decl:target { box-shadow: inset 4px 0 0 var(--gold); padding-left: 14px; }
.dhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.dhead .kind { font-size: 13px; color: var(--gold); min-width: 64px; }
.dhead h3 { font: 600 16px var(--mono); overflow-wrap: anywhere; }
.dhead h3 a { color: var(--fg); text-decoration: none; }
.dhead h3 .ns { color: var(--muted); font-weight: 400; }
.dhead .m { font-size: 11px; padding: 3px 6px 4px; }
.src { font: 13px var(--mono); color: var(--muted); }
.dhead .src { margin-left: auto; }
pre.sig { margin: 8px 0 8px; padding: 10px 12px; background: var(--ink); font: 13.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
pre.sig a { color: var(--accent); text-decoration: none; }
pre.sig a:hover { text-decoration: underline; }
pre.sig .nm { color: var(--gold); font-weight: 600; }
.members { margin: 10px 0 0 18px; }
.members > b { font-size: 13px; display: block; margin-bottom: 4px; }
.member pre.sig { margin: 4px 0; background: none; padding: 2px 0; }
.member .doc { font-size: 15px; margin: 0 0 6px 16px; color: var(--muted); }
.member .doc p { margin: 0 0 4px; }
.insts { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.private h3 .ns, .private .kind { opacity: 0.7; }

/* A claim on a module page: the map's card, with the statement and the generated declarations. */
.claim .said > b.pix { display: block; margin-top: 12px; }
.claim .said pre.sig { margin: 4px 0; }
.claim .where { font-size: 15px; color: var(--muted); }
.claim .srcline { font-size: 14px; margin: 12px 0 0; color: var(--muted); }
.claim .thm div { white-space: normal; }
.claim .pair { margin-top: 14px; max-width: 760px; }
details.gen { margin-top: 10px; }
details.gen .decl { border-top-color: var(--chip); }
details.gen .decl:first-of-type { margin-top: 8px; }

/* The index's modules. */
table.mods td.modname { padding-left: calc(var(--d) * 14px); font: 14.5px var(--mono); white-space: nowrap; }
table.mods td.modname a { text-decoration: none; }
table.mods td.num { font: 14px var(--pixel); white-space: nowrap; }
table.mods td:last-child { font-size: 15px; }

@media (max-width: 900px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	aside.toc { position: static; max-height: none; padding: 16px 0 0; }
	aside.toc ol { display: none; }
	aside.toc > a { display: inline-block; margin: 4px 12px 0 0; }
	.dhead .src { margin-left: 0; }
	.bar .search { margin-left: 0; max-width: none; }
	table.mods td.modname { white-space: normal; overflow-wrap: anywhere; }
}

.pix { font-family: var(--pixel); }
.claim .said pre.sig b.nm { display: inline; font: inherit; font-weight: 600; color: var(--gold); letter-spacing: 0; }
[hidden] { display: none !important; }
.doc table { display: block; overflow-x: auto; }
