/* Default css file for jemdoc. */

table#tlayout {
	border: none;
	border-collapse: separate;
	background: white;
}

body {
	background: white;
	font-family: Georgia, "Source Han Serif SC", "Noto Serif CJK SC",
	             "Songti SC", "Microsoft YaHei", "PingFang SC", serif;
	padding-bottom: 8px;
	margin: 0;
}

#layout-menu {
	background: #f6f6f6;
	border: 1px solid #dddddd;
	padding-top: 0.5em;
	padding-left: 8px;
	padding-right: 8px;
	font-size: 1.0em;
	width: auto;
	white-space: nowrap;
	text-align: left;
	vertical-align: top;
}

#layout-menu td {
	background: #f4f4f4;
	vertical-align: top;
}

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

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

tt {
	background: #ffffdd;
}

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

a, a > tt {
	color: #224b8d;
	text-decoration: none;
}

a:hover {
	border-bottom: 1px gray dotted;
}

#layout-menu a.current:link, #layout-menu a.current:visited {
	color: #022b6d;
	border-bottom: 1px gray solid;
}
#layout-menu a:link, #layout-menu a:visited, #layout-menu a:hover {
	color: #527bbd;
	text-decoration: none;
}
#layout-menu a:hover {
	text-decoration: none;
}

div.menu-category {
	border-bottom: 1px solid gray;
	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 gray;
}

/* 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: #527bbd;
	margin-top: 0.7em;
	margin-bottom: 0.3em;
	padding-bottom: 0.2em;
	line-height: 1.0;
	padding-top: 0.5em;
	border-bottom: 1px solid #aaaaaa;
}

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 #c0c0c0;
	padding-top: 0.1em;
	margin-top: 4.0em;
	color: #c0c0c0;
}

div#footer a {
	color: #80a0b0;
}

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: #222222;
}

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;
}

/* One publication per item, all under a single <ol> -- keep them breathing
   the way separate lists used to. */
#layout-content ol > li + li {
	margin-top: 0.55em;
}

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: #cd7b62;
	margin-top: 1.2em;
	margin-bottom: 0.1em;
}

div.blockcontent {
	border: 1px solid silver;
	padding: 0.3em 0.5em;
}

div.infoblock > div.blockcontent {
	background: #ffffee;
}

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: #f6f6f6;
}

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;
}

@media print {
	#layout-menu {
		display: none;
	}

}

#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 black;
	border-collapse: collapse;
}

td {
	padding: 2px;
	padding-left: 0.5em;
	padding-right: 0.5em;
	text-align: center;
	border: 1px solid gray;
}

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

tr.heading {
	font-weight: bold;
	border-bottom: 2px solid black;
}

img {
	border: none;
}

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

/* Custom News Box Style */
.newsbox {
    background: #f7f7f7;
    border-left: 4px solid #527bbd;
    padding: 12px 16px;
    margin: 0.2em 0 0.8em 0;
    border-radius: 6px;
    /* Fixed-height scrolling window */
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b9c4d6 transparent;
}

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

/* ---- Publication cards (figure left, details right) ---- */
.pubcard {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 0 0 1.4em 0;
}

/* Fixed box keeps every figure the same footprint regardless of aspect ratio */
.pubcard-fig {
    flex: 0 0 340px;
    width: 340px;
    height: 192px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    padding: 4px;
    box-sizing: border-box;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.15);
}

/* Thumbnail is a link to the full-resolution figure */
a.pubcard-fig {
    text-decoration: none;
    cursor: zoom-in;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.pubcard-fig:hover {
    border-color: #999;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
    transform: translateY(-2px);
}

.pubcard-fig img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.pubcard-body {
    flex: 1 1 auto;
    min-width: 0;
}

.pubcard-title {
    font-weight: 600;
    line-height: 1.35;
}

.pubcard-authors {
    margin-top: 0.25em;
    font-size: 0.92em;
    color: #333;
}

/* Where it was published -- a badge, so the eye lands on it */
.pubcard-venue {
    display: inline-block;
    margin-top: 0.35em;
    padding: 2px 10px 3px;
    border-radius: 3px;
    background: #1f3864;
    color: #fff;
    font-size: 0.84em;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

/* Not accepted anywhere yet -- same shape, quieter */
.pubcard-venue.preprint {
    background: #edeff3;
    color: #4a5163;
    font-weight: 500;
    box-shadow: none;
}

.pubcard-desc {
    margin-top: 0.4em;
    font-size: 0.9em;
    line-height: 1.45;
    color: #444;
}

/* Stack on narrow screens */
@media (max-width: 620px) {
    .pubcard { flex-direction: column; }
    .pubcard-fig { flex-basis: auto; width: 100%; }
}

/* Venue names in News: italic + semibold */
.newsbox i {
    font-style: italic;
    font-weight: 600;
    color: #000;
}

/* WebKit scrollbar */
.newsbox::-webkit-scrollbar {
    width: 8px;
}

.newsbox::-webkit-scrollbar-track {
    background: transparent;
}

.newsbox::-webkit-scrollbar-thumb {
    background: #c5cedd;
    border-radius: 4px;
}

.newsbox::-webkit-scrollbar-thumb:hover {
    background: #a3b0c6;
}


/* ---- Blog index: light knowledge graph, hover re-centers ---- */
.graphcard {
    display: flex;
    gap: 0;
    max-width: 840px;   /* hard cap -- the flex row can never grow past this */
    margin: 0.4em 0 1.2em 0;
    border: 1px solid #e4e8ef;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.graphview {
    flex: 1 1 58%;
    min-width: 0;
    position: relative;
}

.graphview svg {
    width: 100%;
    height: 100%;
    min-height: 280px;
    max-height: 340px;
    display: block;
}

.graphview .hint {
    position: absolute;
    left: 16px;
    bottom: 10px;
    font-size: .74em;
    color: #b6bfcd;
    letter-spacing: .04em;
    pointer-events: none;
}

.graphview .gnode { cursor: pointer; }

/* the graph is a UI widget, not body copy: a compact sans keeps the
   abbreviations narrow enough to sit inside the circles */
.graphview text {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

@keyframes gnode-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.graphview .gnode {
    opacity: 0;
    animation: gnode-in .8s ease-out forwards;
    transition: opacity .25s ease;
}

@keyframes gedge-in {
    from { opacity: 0; }
}

.graphview .gedge {
    animation: gedge-in 1.3s ease-out forwards;
    transition: stroke .2s ease, stroke-opacity .2s ease, opacity .25s ease;
}

/* hover focus: whatever is off the lit path steps back */
.graphview svg.focus .gnode:not(.lit) { opacity: .3; }
.graphview svg.focus .gedge:not(.lit) { opacity: .18; }

.graphview svg.settled .gnode,
.graphview svg.settled .gedge {
    animation: none;
    opacity: 1;
}

.graphview svg.settled.focus .gnode:not(.lit) { opacity: .3; }
.graphview svg.settled.focus .gedge:not(.lit) { opacity: .18; }

@media (prefers-reduced-motion: reduce) {
    .graphview .gnode, .graphview .gedge {
        animation: none;
        opacity: 1;
    }
    .graphpanel .panel-inner { animation: none; }
}

/* right panel */
.graphpanel {
    flex: 0 0 400px;
    box-sizing: border-box;
    padding: 22px 20px 18px;
    border-left: 1px solid #e4e8ef;
    background: #fafbfd;
    font-size: .92em;
    line-height: 1.55;
    color: #444;
    min-height: 280px;
}

@keyframes panel-up {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: translateY(0); }
}

.graphpanel .panel-inner { animation: panel-up .4s ease-out; }

.graphpanel h3 {
    margin: 0 0 .2em 0;
    padding: 0;
    border: none;
    font-size: 1.15em;
    letter-spacing: .01em;
}

.graphpanel .sub {
    font-size: .78em;
    color: #9aa3b2;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 1em;
}

.graphpanel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.graphpanel li {
    margin-bottom: .7em;
    padding-left: 14px;
    position: relative;
}

.graphpanel li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .5em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.graphpanel a {
    color: #224b8d;
    border-bottom: none;
}

.graphpanel a:hover {
    border-bottom: 1px dotted #8aa2c8;
}

.graphpanel .date {
    color: #9aa3b2;
    font-size: .85em;
}

.graphpanel .empty { color: #9aa3b2; }

/* ---- post rows: thumbnail on the left, title / excerpt / date ---- */

.graphpanel ul.posts li { margin-bottom: 6px; padding-left: 0; }
.graphpanel ul.posts li::before { content: none; }

.graphpanel a.post {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 7px;
    margin: 0 -7px;          /* the hover wash bleeds past the text column */
    border-radius: 9px;
    border-bottom: none;
    transition: background .16s ease;
}

.graphpanel a.post:hover {
    background: #eef2f8;
    border-bottom: none;
}

/* a real cover picture, cropped to fill -- not an icon on a plate */
.graphpanel .thumb {
    flex: 0 0 148px;
    width: 148px;
    height: 108px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font: 700 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: .05em;
}

.graphpanel .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.graphpanel .meta { min-width: 0; }      /* lets the text column shrink */

.graphpanel .meta .t {
    display: block;
    color: #224b8d;
    font-size: .95em;
    line-height: 1.28;
    margin-bottom: 3px;
}

.graphpanel a.post:hover .meta .t { border-bottom: 1px dotted #8aa2c8; }

.graphpanel .meta .x {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #838d9e;
    font-size: .8em;
    line-height: 1.4;
    margin-bottom: 4px;
}

.graphpanel .meta .d {
    display: block;
    color: #9aa3b2;
    font-size: .76em;
}

@media (max-width: 760px) {
    .graphcard { flex-direction: column; }
    .graphpanel {
        flex-basis: auto;
        border-left: none;
        border-top: 1px solid #e4e8ef;
        min-height: 0;
    }
}
