/* Default css file for jemdoc. */

/* ---- palette ------------------------------------------------------------
   Every colour the page uses has a name here, so the whole sheet can be
   re-themed in one place. `html[data-theme="dark"]` below swaps the set for
   a night version; the button that flips it lives in theme.js.
   Light is the default, which is also what a reader without JavaScript
   gets. ------------------------------------------------------------------ */
:root {
	--bg: #ffffff;
	--panel: #f6f6f6;
	--panel2: #f4f4f4;
	--border: #dddddd;
	--ink: #111111;
	--text: #222222;
	--muted: #666666;
	--head: #527bbd;
	--head-current: #022b6d;
	--link: #224b8d;
	--menulink: #527bbd;
	--rule: #aaaaaa;
	--hair: #e2e2e2;
	--foot: #c0c0c0;
	--footlink: #80a0b0;
	--code: #ffffdd;
	--infobg: #ffffee;
	--blocktitle: #cd7b62;
	--tableborder: #000000;
	--cellborder: #808080;
	--hl: rgba(120, 190, 255, 0.35);
	--nav-w: 210px;
	color-scheme: light;
}

/* the night set is jemdoc's own palette pushed down, not the homepage's
   solarized one: same blue headings, same grey panel, a neutral dark ground */
html[data-theme="dark"] {
	--bg: #1a1c20;
	--panel: #22252a;
	--panel2: #262a30;
	--border: #33383f;
	--ink: #e8eaec;
	--text: #cfd3d8;
	--muted: #9aa1aa;
	--head: #7ea6d8;
	--head-current: #a9c8ea;
	--link: #7ea6d8;
	--menulink: #9cbde6;
	--rule: #3a4048;
	--hair: #2b3037;
	--foot: #8b939c;
	--footlink: #9db4c6;
	--code: #2b3037;
	--infobg: #23272d;
	--blocktitle: #cf8a72;
	--tableborder: #6b737c;
	--cellborder: #3a4048;
	--hl: rgba(120, 190, 255, 0.18);
	color-scheme: dark;
}

/* ---- layout -------------------------------------------------------------
   The sidebar is a fixed width so that switching language does not move it:
   the menu is nowrap, and 简体 / 繁體 labels are much shorter than the
   English ones, which used to let the whole column breathe in and out. --- */
table#tlayout {
    border: none;
    border-collapse: separate;
    background: var(--bg);
    table-layout: fixed;
    width: 100%;
}

body {
	background: var(--bg);
	color: var(--ink);
	font-family: Georgia, serif;
	padding-bottom: 8px;
	margin: 0;
}

#layout-menu {
	background: var(--panel);
	border: 1px solid var(--border);
	padding-top: 0.5em;
	padding-left: 8px;
	padding-right: 8px;
	font-size: 1.0em;
	width: var(--nav-w);
	min-width: var(--nav-w);
	max-width: var(--nav-w);
	box-sizing: border-box;
	white-space: normal;
    text-align: left;
    vertical-align: top;
}

#layout-menu td {
	background: var(--panel2);
    vertical-align: top;
}

#layout-content {
	padding-top: 0.0em;
	padding-left: 1.0em;
	padding-right: 1.0em;
    border: none;
    background: var(--bg);
    text-align: left;
    vertical-align: top;
}

#layout-menu a {
	line-height: 1.5em;
	margin-left: 0.5em;
}

tt {
    background: var(--code);
}

pre, tt {
	font-size: 90%;
	font-family: monaco, monospace;
}

a, a > tt {
	color: var(--link);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

a:hover {
	border-bottom: 1px dotted var(--border);
}

#layout-menu a.current:link, #layout-menu a.current:visited {
	color: var(--head-current);
	border-bottom: 1px solid var(--border);
}
#layout-menu a:link, #layout-menu a:visited, #layout-menu a:hover {
	color: var(--menulink);
	text-decoration: none;
}
#layout-menu a:hover {
	text-decoration: none;
	border-bottom-color: var(--border);
}

div.menu-category {
	border-bottom: 1px solid var(--border);
	margin-top: 0.8em;
	padding-top: 0.2em;
	padding-bottom: 0.1em;
	font-weight: bold;
}

div.menu-item {
	padding-left: 16px;
	text-indent: -16px;
}

div#toptitle {
	padding-bottom: 0.2em;
	margin-bottom: 1.5em;
	border-bottom: 3px double var(--border);
}

/* Reduce space if we begin the page with a title. */
div#toptitle + h2, div#toptitle + h3 {
	margin-top: -0.7em;
}

div#subtitle {
	margin-top: 0.0em;
	margin-bottom: 0.0em;
	padding-top: 0em;
	padding-bottom: 0.1em;
}

em {
	font-style: italic;
}

strong {
	font-weight: bold;
}


h1, h2, h3 {
	color: var(--head);
	margin-top: 0.7em;
	margin-bottom: 0.3em;
	padding-bottom: 0.2em;
	line-height: 1.0;
	padding-top: 0.5em;
	border-bottom: 1px solid var(--rule);
}

h1 {
	font-size: 165%;
}

h2 {
	padding-top: 0.8em;
	font-size: 125%;
}

h2 + h3 {
    padding-top: 0.2em;
}

h3 {
	font-size: 110%;
	border-bottom: none;
}

p {
	margin-top: 0.0em;
	margin-bottom: 0.8em;
	padding: 0;
	line-height: 1.3;
}

pre {
	padding: 0;
	margin: 0;
}

div#footer {
	font-size: small;
	border-top: 1px solid var(--foot);
	padding-top: 0.1em;
	margin-top: 4.0em;
	color: var(--foot);
}

div#footer a {
	color: var(--footlink);
}

div#footer-text {
	float: left;
	padding-bottom: 8px;
}

ul, ol, dl {
	margin-top: 0.2em;
	padding-top: 0;
	margin-bottom: 0.8em;
}

dt {
	margin-top: 0.5em;
	margin-bottom: 0;
}

dl {
	margin-left: 20px;
}

dd {
	color: var(--text);
}

dd > *:first-child {
	margin-top: 0;
}

ul {
	list-style-position: outside;
	list-style-type: square;
}

p + ul, p + ol {
	margin-top: -0.5em;
}

li ul, li ol {
	margin-top: -0.3em;
}

ol {
	list-style-position: outside;
	list-style-type: decimal;
}

li p, dd p {
	margin-bottom: 0.3em;
}


ol ol {
	list-style-type: lower-alpha;
}

ol ol ol {
	list-style-type: lower-roman;
}

p + div.codeblock {
	margin-top: -0.6em;
}

div.codeblock, div.infoblock {
	margin-right: 0%;
	margin-top: 1.2em;
	margin-bottom: 1.3em;
}

div.blocktitle {
	font-weight: bold;
	color: var(--blocktitle);
	margin-top: 1.2em;
	margin-bottom: 0.1em;
}

div.blockcontent {
	border: 1px solid var(--border);
	padding: 0.3em 0.5em;
}

div.infoblock > div.blockcontent {
	background: var(--infobg);
}

div.blockcontent p + ul, div.blockcontent p + ol {
	margin-top: 0.4em;
}

div.infoblock p {
	margin-bottom: 0em;
}

div.infoblock li p, div.infoblock dd p {
	margin-bottom: 0.5em;
}

div.infoblock p + p {
	margin-top: 0.8em;
}

div.codeblock > div.blockcontent {
	background: var(--panel);
}

span.pycommand {
	color: #000070;
}

span.statement {
	color: #008800;
}
span.builtin {
	color: #000088;
}
span.special {
	color: #990000;
}
span.operator {
	color: #880000;
}
span.error {
	color: #aa0000;
}
span.comment, span.comment > *, span.string, span.string > * {
	color: #606060;
}

/* the same code colours, brightened for a dark background */
html[data-theme="dark"] span.pycommand {
	color: #82aaff;
}
html[data-theme="dark"] span.statement {
	color: #98c379;
}
html[data-theme="dark"] span.builtin {
	color: #61afef;
}
html[data-theme="dark"] span.special {
	color: #e06c75;
}
html[data-theme="dark"] span.operator {
	color: #d19a66;
}
html[data-theme="dark"] span.error {
	color: #e06c75;
}
html[data-theme="dark"] span.comment, html[data-theme="dark"] span.comment > *,
html[data-theme="dark"] span.string, html[data-theme="dark"] span.string > * {
	color: #98a2ac;
}

/* a printed CV is black on white, whatever the screen is set to */
@media print {
	#layout-menu { display: none; }
	:root, html[data-theme="dark"] {
		--bg: #ffffff;
		--panel: #ffffff;
		--panel2: #ffffff;
		--border: #dddddd;
		--ink: #111111;
		--text: #222222;
		--muted: #444444;
		--head: #33496e;
		--head-current: #022b6d;
		--link: #224b8d;
		--menulink: #224b8d;
		--rule: #aaaaaa;
		--hair: #cccccc;
		--foot: #666666;
		--footlink: #445566;
		--code: #f4f4f4;
		--infobg: #ffffff;
		--hl: rgba(120, 190, 255, 0.35);
		color-scheme: light;
	}
}

#fwtitle {
	margin: 2px;
}

#fwtitle #toptitle {
	padding-left: 0.5em;
	margin-bottom: 0.5em;
}

#layout-content h1:first-child, #layout-content h2:first-child, #layout-content h3:first-child {
	margin-top: -0.7em;
}

div#toptitle h1, #layout-content div#toptitle h1 {
	margin-bottom: 0.0em;
	padding-bottom: 0.1em;
	padding-top: 0;
	margin-top: 0.5em;
	border-bottom: none;
}

img.eq {
	padding: 0;
	padding-left: 0.1em;
	padding-right: 0.1em;
	margin: 0;
}

img.eqwl {
	padding-left: 2em;
	padding-top: 0.6em;
	padding-bottom: 0.2em;
	margin: 0;
}

table {
    border: 2px solid var(--tableborder);
    border-collapse: collapse;
}

td {
    padding: 2px;
    padding-left: 0.5em;
    padding-right: 0.5em;
    text-align: center;
    border: 1px solid var(--cellborder);
}

table + table {
    margin-top: 1em;
}

tr.heading {
    font-weight: bold;
    border-bottom: 2px solid var(--tableborder);
}

img {
    border: none;
}

table.imgtable, table.imgtable td {
    border: none;
    text-align: left;
}

/* ---- Noah Zhou /cv page additions (keep the jemdoc look) ---- */
html {
	scroll-behavior: smooth;
}

#layout-content ul li {
	line-height: 1.35;
}

div.pub-item {
	margin-bottom: 0.9em;
	line-height: 1.35;
}

div.pub-item .pub-venue {
	font-style: italic;
}

span.pub-link {
	white-space: nowrap;
}

div.role-title {
	font-weight: bold;
	margin-top: 1.1em;
	margin-bottom: 0.15em;
}

div.role-meta {
	color: var(--muted);
	font-size: 95%;
	margin-bottom: 0.35em;
}

ul.tight {
	margin-bottom: 0.5em;
}

hr.rule {
	border: none;
	border-top: 1px solid var(--hair);
	margin: 1.1em 0;
}

/* ---- pulled from the main site so a CV page can highlight a scan-first number ---- */
.highlight-blue {
	background-color: var(--hl);
	border-radius: 0.35rem;
	padding: 0.05rem 0.35rem;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

/* ---- language switcher: en / 简体 / 繁體 ---- */
#layout-menu div.menu-lang {
	padding-left: 16px;
	text-indent: -16px;
	font-size: 92%;
	color: var(--muted);
	line-height: 1.5em;
}

#layout-menu div.menu-lang a {
	margin-left: 0;
}

/* ---- paper / night button, injected by theme.js ---- */
#layout-menu button.menu-theme {
	display: block;
	margin: 0.35em 0 0.1em;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 92%;
	line-height: 1.5em;
	color: var(--muted);
	cursor: pointer;
	text-align: left;
}

#layout-menu button.menu-theme:hover {
	color: var(--head);
}

#layout-menu button.menu-theme:focus-visible {
	outline: 2px dotted var(--muted);
	outline-offset: 2px;
}

#layout-menu button.menu-theme .ic {
	width: 13px;
	height: 13px;
	margin-right: 6px;
	vertical-align: -2px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

#layout-menu button.menu-theme .sun {
	display: none;
}

html[data-theme="dark"] #layout-menu button.menu-theme .moon {
	display: none;
}

html[data-theme="dark"] #layout-menu button.menu-theme .sun {
	display: inline;
}

/* ---- narrow screens: the sidebar stops being a column ---- */
@media (max-width: 760px) {
	table#tlayout, table#tlayout tbody, table#tlayout tr,
	#layout-menu, #layout-content {
		display: block;
		width: auto;
		min-width: 0;
		max-width: none;
	}
	#layout-menu {
		border: none;
		border-bottom: 1px solid var(--border);
		padding-bottom: 0.4em;
		margin-bottom: 1.2em;
	}
	#layout-menu div.menu-category {
		margin-top: 0.5em;
	}
	#layout-menu button.menu-theme {
		margin-top: 0.5em;
	}
}
