/* Design follows the Resources posts on wenhaojiangsoc.github.io (al-folio): white page, black light-weight
   Roboto text, Duke blue (#00539B) for links and section numbers, hairline dividers, quiet code blocks. */
:root { --cdd-theme: #00539B; --cdd-divider: rgba(0, 0, 0, 0.1); --cdd-light: #828282; }

body { font-weight: 300; color: #000; background: #fff; line-height: 1.5; }
strong, b, th { font-weight: 500; }
a { color: var(--cdd-theme); text-decoration: none; }
a:hover { color: var(--cdd-theme); text-decoration: underline; }
hr { border-top: 1px solid var(--cdd-divider); opacity: 1; }

/* Navbar: white, hairline border, brand left, links right */
.navbar { background-color: #fff !important; border-bottom: 1px solid var(--cdd-divider); box-shadow: none; opacity: 0.97; }
.navbar .navbar-brand { font-size: 1.1rem; font-weight: 400; color: #000; }
.navbar .nav-link { color: #000; font-weight: 300; font-size: 1rem; padding-left: 0.5rem; padding-right: 0.5rem; }
.navbar .nav-link:hover { color: var(--cdd-theme); background: none; }
.navbar .nav-item.active > .nav-link, .navbar .nav-link.active { color: var(--cdd-theme); font-weight: 500; background: none; }
.navbar .dropdown-menu { border: 1px solid var(--cdd-divider); border-radius: 4px; box-shadow: none; }
.navbar .dropdown-item { font-weight: 300; }
.navbar .dropdown-item:hover, .navbar .dropdown-item:focus { color: var(--cdd-theme); background: #fff; }
.navbar .navbar-text, .navbar small { color: var(--cdd-light) !important; }
.navbar form input { border: 1px solid var(--cdd-divider); border-radius: 999px; font-weight: 300; font-size: 0.9rem; }

/* Page width and layout. Main column flexes; the sidebar is a fixed 230px column from 768px up, so the two always fit on one row.
   Home: package details on the right. Articles and reference: contents list on the left, as in the posts. */
.container, .container-fluid { max-width: 1120px; }
@media (min-width: 768px) {
  .row > main { flex: 1 1 0; width: auto; min-width: 0; max-width: none; }
  .row > aside { flex: 0 0 230px; width: 230px; margin-left: 0; margin-right: 0; }
  .template-article .row > aside, .template-reference-topic .row > aside { order: -1; }
  .template-article .row > main, .template-reference-topic .row > main { padding-left: 2.5rem; }
  .template-home .row > main { padding-right: 2.75rem; }
  .template-home .row > aside { border-left: 1px solid var(--cdd-divider); padding-left: 1.5rem; margin-top: 5.5rem; align-self: flex-start; position: sticky; top: 5rem; }
}
@media (max-width: 767px) {
  .template-home .row > aside { order: 2; border-top: 1px solid var(--cdd-divider); margin-top: 2.5rem; padding-top: 0.5rem; }
}
main p, main li { text-align: justify; }
main img { max-width: 100%; height: auto; }

/* Titles: modest, light, left-aligned */
h1, h2, h3, h4, h5 { font-weight: 300; color: #000; text-align: left; }
h1, .page-header h1 { font-size: 1.9rem; line-height: 1.25; }
.page-header { border-bottom: none; margin-bottom: 1.25rem; padding-bottom: 0; min-height: 0; }
main h2 { font-size: 1.5rem; margin-top: 2.5rem; padding-top: 1.25rem; padding-bottom: 0; border-top: 1px solid var(--cdd-divider); border-bottom: none; }
main h3 { font-size: 1.1rem; font-weight: 500; margin-top: 1.5rem; }
main h4 { font-size: 1rem; font-weight: 500; }

/* Numbered sections on the home page and articles, as in the posts */
.template-home main, .template-article main { counter-reset: section; }
.template-home main h2, .template-article main h2 { counter-increment: section; }
.template-home main h2::before, .template-article main h2::before { content: counter(section); color: var(--cdd-theme); margin-right: 0.6rem; }

/* Sidebar (contents, links, developers): small and quiet */
aside { font-size: 0.875rem; }
aside h2, aside h3 { font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cdd-light); border: none; margin-top: 1.5rem; padding: 0; }
aside h2::before { content: none !important; }
aside a, aside .nav-link, #toc .nav-link { color: #000; font-weight: 300; text-decoration: none; }
aside a:hover, #toc .nav-link:hover, #toc .nav-link.active { color: var(--cdd-theme); background: none; }
#toc > .nav { border-left: none; }
#toc .nav-link { padding: 0.15rem 0; border: none; }
aside small, aside .text-muted { color: var(--cdd-light) !important; }

/* Code: transparent blue wash, hairline border, as on the blog */
code { font-size: 0.85em; color: #000; background: rgba(1, 33, 105, 0.08); padding: 0.1em 0.35em; border-radius: 4px; }
pre, div.sourceCode pre { font-size: 0.85rem; line-height: 1.55; color: #000; background: rgba(1, 33, 105, 0.055); border: 1px solid rgba(1, 33, 105, 0.16); border-radius: 6px; padding: 0.9rem 1rem; }
pre code { background: transparent; padding: 0; font-size: inherit; }
div.sourceCode { background: transparent; border: none; }
pre code a, pre a { color: inherit; text-decoration: none; }
pre code a:hover { color: var(--cdd-theme); text-decoration: underline; }
code span.co { color: var(--cdd-light); font-style: italic; }
code span.st, code span.ss, code span.vs, code span.ch { color: #4f7a5a; }
code span.fu, code span.kw, code span.cf, code span.im { color: var(--cdd-theme); font-weight: 400; }
code span.dv, code span.fl, code span.cn, code span.ot, code span.op, code span.va, code span.at { color: #000; }
a code, a > code { color: var(--cdd-theme); }

/* Tables */
main table, table.table { font-size: 0.9rem; margin: 1rem 0 1.25rem; border: none; }
main table th, main table td, .table > :not(caption) > * > * { padding: 0.45rem 0.75rem 0.45rem 0; vertical-align: top; text-align: left; background: transparent; box-shadow: none; }
main table th { font-weight: 500; border-bottom: 1px solid var(--cdd-light); }
main table td { border-bottom: 1px solid var(--cdd-divider); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: transparent; box-shadow: none; }

/* Figures, quotes, logo, footer */
main p > img, main .figure img { background: #fff; border: 1px solid var(--cdd-divider); border-radius: 6px; padding: 0.5rem; }
.caption, figcaption, p.caption { font-size: 0.8rem; color: var(--cdd-light); margin-top: 0.4rem; text-align: left; }
blockquote { border-left: 5px solid var(--cdd-theme); margin: 1.5em 0; padding: 0.6em 1em; color: #000; }
.page-header img.logo { width: 130px; height: auto; margin-left: 24px; border: none; padding: 0; }
/* Home: logo centred above a centred title */
.template-home .page-header { text-align: center; margin: 1rem 0 2rem; }
.template-home .page-header img.logo { float: none; display: block; width: 118px; margin: 0 auto 1.1rem; }
.template-home .page-header h1 { text-align: center; font-size: 1.9rem; margin: 0; }
.template-home main > .section > p:first-of-type { margin-top: 0; }
aside .list-unstyled li { margin-bottom: 0.3rem; line-height: 1.4; }
aside .links, aside .license, aside .citation, aside .developers, aside .dev-status { margin-bottom: 0.25rem; }
footer { border-top: 1px solid var(--cdd-divider); font-size: 0.85rem; color: var(--cdd-light); margin-top: 3rem; }
footer a { color: #000; }

/* Home: the two README figures side by side, captions underneath, stacked on phones */
.cdd-figs table { width: 100%; margin: 1.25rem 0 0.75rem; table-layout: fixed; }
.cdd-figs td { border: none !important; padding: 0 0.6rem 0.4rem 0 !important; font-size: 0.8rem; color: var(--cdd-light); text-align: left; }
.cdd-figs td + td { padding: 0 0 0.4rem 0.6rem !important; }
.cdd-figs img { width: 100%; background: #fff; border: 1px solid var(--cdd-divider); border-radius: 6px; padding: 0.4rem; }
.cdd-figs em { font-style: normal; font-weight: 500; color: #000; }
@media (max-width: 575px) {
  .cdd-figs table, .cdd-figs tbody, .cdd-figs tr, .cdd-figs td { display: block; width: 100% !important; }
  .cdd-figs td, .cdd-figs td + td { padding: 0 0 0.6rem 0 !important; }
}

@media (max-width: 767px) {
  main p, main li { text-align: left; }
  h1, .page-header h1 { font-size: 1.6rem; }
}
@media (max-width: 575px) {
  .page-header img.logo { width: 84px; margin-left: 12px; }
  .template-home .page-header img.logo { width: 96px; margin: 0 auto 0.9rem; }
}
@media (max-width: 575px) {
  pre, div.sourceCode pre { margin-left: 0; margin-right: 0; border-radius: 6px; }
}

main p, main li, main td { hyphens: manual; -webkit-hyphens: manual; }
