/* NPR documentation contrast overrides.
 * Applies to native m.css output and keeps compatibility with classic Doxygen pages.
 */

:root {
  --npr-bg: #ffffff;
  --npr-surface: #ffffff;
  --npr-surface-muted: #f8fafc;
  --npr-fg: #111827;
  --npr-muted: #4b5563;
  --npr-border: #d1d5db;
  --npr-link: #0b57d0;
  --npr-link-hover: #0842a0;
  --npr-code-bg: #f3f4f6;
  --npr-code-fg: #1f2937;
  --npr-badge-bg: #fef3c7;
  --npr-badge-fg: #7c2d12;
  --npr-badge-border: #f59e0b;
  --npr-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --npr-font-body: "IBM Plex Sans", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --npr-font-mono: "Iosevka Fixed", "Source Code Pro", "Fira Code", "SFMono-Regular", Consolas, monospace;
}

/* Base text contrast */
html,
body,
#doc-content,
.m-text,
.m-doc {
  background: var(--npr-bg);
  color: var(--npr-fg);
}

html {
  font-size: 16px;
}

body,
#doc-content,
.m-text,
.m-doc,
table.directory,
table.memberdecls,
div.contents,
div.header {
  font-family: var(--npr-font-body);
  line-height: 1.65;
}

p,
li,
dd,
td,
th {
  line-height: 1.65;
}

main p,
.m-text p,
.m-doc p {
  text-align: left;
  text-indent: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.title,
#projectname {
  color: var(--npr-fg);
  font-weight: 600;
  letter-spacing: -0.015em;
}

h1,
.title {
  font-size: 2.05rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.35;
}

body > header,
#top,
#titlearea,
#main-nav,
div.header,
div.contents,
div.memitem,
dl.section,
table.directory,
table.memberdecls,
table.m-table,
.m-note,
.m-block,
.m-frame,
pre,
div.fragment,
pre.fragment {
  box-sizing: border-box;
}

pre,
code,
tt,
pre.fragment,
div.fragment,
.m-code {
  font-family: var(--npr-font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  border-radius: 0.45rem;
}

code,
tt {
  padding: 0.14rem 0.3rem;
}

pre,
div.fragment,
pre.fragment,
.m-note,
.m-block,
.m-frame,
table.directory,
table.memberdecls,
table.m-table,
div.memitem,
dl.section {
  box-shadow: var(--npr-shadow);
}

a,
a:link,
a:visited,
a.el,
a.code,
.m-doc a {
  text-underline-offset: 0.14em;
  text-decoration-thickness: 0.08em;
}

@media screen and (min-width: 992px) {
  .m-container {
    width: 1100px;
  }
}

@media screen and (min-width: 1400px) {
  .m-container {
    width: 1180px;
  }
}

/* Keep secondary text readable (WCAG-friendly on white) */
.m-dim,
.m-text.m-dim,
.summary a,
.m-doc .m-thin,
.m-doc-template,
dl.m-doc dd,
ul.m-doc li > span.m-doc {
  color: var(--npr-muted) !important;
}

/* Secondary links must still be readable */
.m-doc-template a,
dl.m-doc dd a,
ul.m-doc li > span.m-doc a {
  color: var(--npr-link) !important;
}

.m-doc-template a:hover,
.m-doc-template a:focus,
.m-doc-template a:active,
dl.m-doc dd a:hover,
dl.m-doc dd a:focus,
dl.m-doc dd a:active,
ul.m-doc li > span.m-doc a:hover,
ul.m-doc li > span.m-doc a:focus,
ul.m-doc li > span.m-doc a:active {
  color: var(--npr-link-hover) !important;
}

/* Stronger link contrast than default m-light orange */
a,
a:link,
a:visited,
a.el,
a.code,
.m-doc a {
  color: var(--npr-link);
}

a:hover,
a:active,
a:focus,
a.el:hover,
.m-doc a:hover {
  color: var(--npr-link-hover);
}

/* Code readability */
pre,
code,
tt,
pre.fragment,
div.fragment,
.m-code {
  background: var(--npr-code-bg);
  color: var(--npr-code-fg);
}

div.contents,
div.header {
  max-width: 78rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.75rem;
  padding-right: 1.75rem;
}

div.header {
  padding-top: 1.2rem;
}

div.contents {
  padding-top: 0.4rem;
  padding-bottom: 1.5rem;
}

div.contents > .textblock > p,
div.contents p,
div.memdoc p {
  margin-bottom: 0.9rem;
}

div.contents ul,
div.contents ol,
div.memdoc ul,
div.memdoc ol {
  padding-left: 1.5rem;
}

div.contents li,
div.memdoc li {
  margin-bottom: 0.3rem;
}

/* #include line in class/namespace pages should be fully legible */
.m-code.m-inverted,
.m-code.m-inverted > span,
.m-code.m-inverted.m-doc-include,
.m-code.m-inverted.m-doc-include > span,
.m-code.m-inverted.m-doc-include > a:link,
.m-code.m-inverted.m-doc-include > a:visited {
  color: var(--npr-code-fg) !important;
  opacity: 1 !important;
}

.m-code.m-inverted.m-doc-include .cp,
.m-code.m-inverted.m-doc-include .cpf {
  color: var(--npr-code-fg) !important;
}

/* Improve "final" and similar badges */
.m-label.m-flat.m-warning {
  color: var(--npr-badge-fg) !important;
  background: var(--npr-badge-bg) !important;
  border: 1px solid var(--npr-badge-border);
}

/* Panel and table edges */
.m-note,
.m-block,
table.m-table,
table.directory,
table.memberdecls,
div.contents,
div.memitem,
dl.section {
  border-color: var(--npr-border);
}

/* Navbar title/brief readability */
body > header > nav #m-navbar-brand,
body > header > nav #m-navbar-brand a {
  color: var(--npr-fg) !important;
}

body > header > nav {
  font-size: 1rem;
}

body > header > nav #m-navbar-brand .m-thin,
body > header > nav #m-navbar-brand .m-breadcrumb {
  color: var(--npr-muted) !important;
}

/* Classic Doxygen compatibility selectors */
#top,
#titlearea,
#projectalign,
#projectname,
#projectbrief,
#side-nav,
.header,
.sm-dox {
  background: var(--npr-surface);
  color: var(--npr-fg);
}

#titlearea {
  border-bottom: 1px solid var(--npr-border);
  padding: 1rem 1.5rem;
}

#projectname {
  font-size: 1.5rem;
  line-height: 1.2;
}

#projectnumber,
#projectbrief {
  color: var(--npr-muted);
  font-size: 0.98rem;
}

#main-nav {
  border-bottom: 1px solid var(--npr-border);
  box-shadow: none;
}

#doc-content {
  font-size: 1rem;
}

#side-nav,
#nav-tree,
#nav-tree .label,
.tablist li,
#main-menu a {
  font-size: 0.97rem;
}

#side-nav {
  border-right: 1px solid var(--npr-border);
}

#nav-tree .selected,
div.memitem,
dl.section {
  background: var(--npr-surface-muted);
}

.memtitle,
table.memberdecls th,
table.directory th {
  background: #eef2f7;
  color: var(--npr-fg);
  font-weight: 600;
}

table.directory,
table.memberdecls,
table.m-table {
  width: 100%;
  background: var(--npr-surface);
  border-radius: 0.55rem;
  overflow: hidden;
}

table.memberdecls td,
table.memberdecls th,
table.directory td,
table.directory th,
table.m-table td,
table.m-table th {
  padding: 0.65rem 0.8rem;
}

div.memitem,
dl.section,
div.fragment,
pre.fragment {
  border-radius: 0.55rem;
}

div.memproto,
table.mlabels,
.params,
table.params {
  font-size: 0.96rem;
}

@media screen and (max-width: 767px) {
  html {
    font-size: 15px;
  }

  div.header,
  div.contents {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #titlearea {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
