/* LunCoSim documentation — specification-style theme */

:root {
  --md-text-font-family: system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --md-code-font-family: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --md-primary-fg-color: #0b2239;
  --md-primary-fg-color--light: #173a57;
  --md-primary-fg-color--dark: #061523;
  --md-accent-fg-color: #0b7285;

  --lunco-cyan: #1c8fa3;
  --lunco-cyan-dark: #0a6273;
  --lunco-cyan-soft: rgba(28, 143, 163, 0.12);
  --lunco-rule: rgba(11, 34, 57, 0.16);
  --lunco-rule-strong: rgba(11, 34, 57, 0.3);
  --lunco-panel: #f5f8fa;
  --lunco-panel-strong: #eaf0f4;
  --lunco-shadow: 0 1px 2px rgba(6, 21, 35, 0.08);
}

[data-md-color-scheme="default"] {
  --md-typeset-a-color: #0a6273;
  --md-default-fg-color: #1c2733;
  --md-default-fg-color--light: #4a5866;
  --md-default-fg-color--lighter: #74818e;
  --md-default-bg-color: #ffffff;
}

[data-md-color-scheme="slate"] {
  --md-typeset-a-color: #5cc8d8;
  --md-accent-fg-color: #5cc8d8;
  --lunco-cyan: #5cc8d8;
  --lunco-cyan-dark: #8adce8;
  --lunco-cyan-soft: rgba(92, 200, 216, 0.14);
  --lunco-rule: rgba(213, 228, 240, 0.18);
  --lunco-rule-strong: rgba(213, 228, 240, 0.32);
  --lunco-panel: #17212b;
  --lunco-panel-strong: #1e2b37;
  --lunco-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Page shell */

.md-grid {
  max-width: 80rem;
}

.md-typeset {
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--md-default-fg-color);
}

.md-content__inner {
  max-width: 54rem;
  margin: 0 auto;
  padding-top: 1.1rem;
  padding-bottom: 2.4rem;
}

.md-typeset p {
  margin: 0.8em 0;
}

.md-typeset li {
  margin-bottom: 0.3em;
}

.md-typeset hr {
  border-bottom: 1px solid var(--lunco-rule);
}

/* Chapter and section numbering */

.chapter {
  counter-reset: section figure;
}

.chapter > h1::before {
  content: var(--chapter-prefix) "\00a0\00a0";
  color: var(--lunco-cyan-dark);
  font-weight: 700;
}

.chapter h2 {
  counter-increment: section;
  counter-reset: subsection;
}

.chapter h2::before {
  content: var(--chapter-prefix) "." counter(section) "\00a0\00a0";
  color: var(--lunco-cyan-dark);
  font-weight: 700;
}

.chapter h3 {
  counter-increment: subsection;
}

.chapter h3::before {
  content: var(--chapter-prefix) "." counter(section) "." counter(subsection)
    "\00a0\00a0";
  color: var(--lunco-cyan-dark);
  font-weight: 700;
}

/* A chapter overview is a part introduction, not a numbered section.
   Keep its h1 prefix but do not collide with the nav's section numbers. */
.chapter-overview h2::before,
.chapter-overview h3::before {
  content: none;
}

/* Headings */

.md-typeset h1 {
  margin: 0 0 1.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--lunco-rule-strong);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.md-typeset h2 {
  margin: 2.2rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--lunco-rule);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.008em;
}

.md-typeset h3 {
  margin: 1.7rem 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
}

.md-typeset h4 {
  margin: 1.3rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.md-typeset h5 {
  margin: 1.1rem 0 0.35rem;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: none;
}

/* Links and inline code */

.md-typeset a {
  text-decoration: none;
}

.md-typeset a:hover {
  text-decoration: underline;
}

.md-typeset code {
  padding: 0.1em 0.3em;
  border: 1px solid var(--lunco-rule);
  border-radius: 3px;
  background-color: var(--lunco-panel);
  font-size: 0.82em;
}

.md-typeset pre > code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.78rem;
  line-height: 1.6;
}

.md-typeset .highlight {
  border: 1px solid var(--lunco-rule);
  border-radius: 4px;
  background-color: var(--lunco-panel);
}

.md-typeset .highlight pre {
  margin: 0;
}

.md-typeset .highlighttable .linenos {
  border-right: 1px solid var(--lunco-rule);
  background-color: var(--lunco-panel-strong);
}

/* Tables — specification style, not cards */

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  margin: 1.1rem 0 1.4rem;
  border: 1px solid var(--lunco-rule-strong);
  border-collapse: collapse;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.8rem;
  line-height: 1.55;
}

.md-typeset__scrollwrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.md-typeset table:not([class]) th code,
.md-typeset table:not([class]) td code {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.md-typeset table:not([class]) th {
  padding: 0.55em 0.7em;
  border: 1px solid var(--lunco-rule-strong);
  background-color: var(--lunco-panel-strong);
  color: var(--md-default-fg-color);
  font-weight: 700;
  text-align: left;
  vertical-align: bottom;
}

.md-typeset table:not([class]) td {
  padding: 0.5em 0.7em;
  border: 1px solid var(--lunco-rule);
  vertical-align: top;
}

.md-typeset table:not([class]) tr:nth-child(even) td {
  background-color: rgba(127, 127, 127, 0.025);
}

.md-typeset table:not([class]) caption {
  caption-side: top;
  padding: 0 0 0.4rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.76rem;
  text-align: left;
}

/* Figures and captions */

.md-typeset figure {
  margin: 1.6rem 0;
  text-align: center;
}

.md-typeset figure.diagram {
  overflow: hidden;
  border: 1px solid var(--lunco-rule);
  border-radius: 6px;
  background: #f5f8fa;
  text-align: left;
}

.chapter figure {
  counter-increment: figure;
}

.md-typeset figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--lunco-rule);
  border-radius: 2px;
  box-shadow: var(--lunco-shadow);
}

.md-typeset figure.diagram img {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.md-typeset figcaption {
  margin-top: 0.55rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: left;
}

.md-typeset figure.diagram figcaption {
  margin: 0;
  padding: 0.65rem 0.9rem 0.75rem;
  border-top: 1px solid var(--lunco-rule);
  background: var(--md-default-bg-color);
}

.chapter figcaption::before {
  content: "Figure " counter(figure) ". ";
  font-weight: 700;
  color: var(--md-default-fg-color);
}

.md-typeset figure.shot a:hover img {
  border-color: var(--md-accent-fg-color);
}

/* Admonitions */

.md-typeset .admonition,
.md-typeset details {
  margin: 1.2rem 0;
  border: 1px solid var(--lunco-rule);
  border-left: 4px solid var(--md-accent-fg-color);
  border-radius: 0;
  box-shadow: none;
  font-size: 0.82rem;
}

.md-typeset .admonition-title,
.md-typeset summary {
  padding: 0.55rem 0.8rem;
  background-color: var(--lunco-panel);
  font-weight: 700;
}

.md-typeset .admonition > :last-child,
.md-typeset details > :last-child {
  margin-bottom: 0.8rem;
}

/* Navigation */

.md-nav {
  font-size: 0.74rem;
  line-height: 1.5;
}

.md-nav__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.md-nav__item {
  padding-top: 0.12rem;
}

.md-nav__link {
  line-height: 1.45;
}

.md-nav__link--active,
.md-nav__item .md-nav__link--active {
  font-weight: 700;
}

.md-nav--primary .md-nav__item > .md-nav__link {
  border-left: 2px solid transparent;
  padding-left: 0.45rem;
}

.md-nav--primary .md-nav__item > .md-nav__link--active {
  border-left-color: var(--md-accent-fg-color);
  color: var(--md-typeset-a-color);
}

.md-nav--primary > .md-nav__list > .md-nav__item {
  margin-top: 0.35rem;
}

.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link {
  font-weight: 700;
  color: var(--md-default-fg-color);
}

.md-nav--secondary {
  font-size: 0.72rem;
}

.md-nav--secondary .md-nav__link--active {
  border-left: 2px solid var(--md-accent-fg-color);
  padding-left: 0.4rem;
}

/* Header and footer */

.md-header {
  background-color: #0b2239;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.md-header__title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.md-header__topic:first-child {
  font-weight: 400;
}

.md-search__form {
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.1);
}

.md-footer {
  background-color: #061523;
}

.md-footer-meta {
  background-color: rgba(0, 0, 0, 0.18);
}

.md-copyright {
  font-size: 0.68rem;
}

/* Title page */

.titlepage {
  max-width: 46rem;
  margin: 0.5rem auto 2rem;
}

.titlepage .title-kicker {
  margin: 0 0 0.5rem;
  color: var(--lunco-cyan-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.titlepage h1 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.titlepage .title-subtitle {
  margin: 0.7rem 0 1.6rem;
  color: var(--md-default-fg-color--light);
  font-size: 1.05rem;
  line-height: 1.5;
}

.titlepage .title-meta {
  margin: 1.4rem 0 1.8rem;
  border-top: 2px solid var(--lunco-rule-strong);
  border-bottom: 1px solid var(--lunco-rule);
  font-size: 0.8rem;
}

.titlepage .title-meta dl {
  display: grid;
  grid-template-columns: 9rem 1fr;
  margin: 0;
  padding: 0.35rem 0;
}

.titlepage .title-meta dt {
  padding: 0.4em 0.7em;
  color: var(--md-default-fg-color--light);
  font-weight: 700;
}

.titlepage .title-meta dd {
  margin: 0;
  padding: 0.4em 0.7em;
}

.titlepage .abstract {
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--lunco-cyan);
  background-color: var(--lunco-panel);
  font-size: 0.84rem;
}

.titlepage .abstract > :first-child {
  margin-top: 0;
}

.titlepage .abstract > :last-child {
  margin-bottom: 0;
}

.titlepage .contents {
  margin: 1.5rem 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--lunco-rule);
}

.titlepage .contents ol {
  margin: 0.4rem 0 0;
  padding-left: 1.5rem;
}

.titlepage .contents li {
  margin-bottom: 0.18em;
}

.titlepage .contents a {
  color: var(--md-default-fg-color);
}

.titlepage .title-figure {
  margin: 1.6rem 0;
}

.titlepage .title-figure figcaption {
  text-align: center;
}

.home h2 {
  margin-top: 2rem;
}

/* Grid cards, used sparingly on overview pages */

.md-typeset .grid.cards > ul > li {
  border: 1px solid var(--lunco-rule);
  border-radius: 3px;
  box-shadow: none;
  transition: border-color 120ms ease;
}

.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--md-accent-fg-color);
  box-shadow: none;
}

.md-typeset .grid.cards > ul > li > p:first-child {
  font-weight: 700;
}

/* Perspective cards and task table */

.md-typeset .perspective-cards.grid.cards > ul > li {
  padding: 0.8rem;
}

@media screen and (max-width: 30em) {
  .md-typeset .perspective-cards.grid.cards {
    grid-gap: 0.35rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md-typeset .perspective-cards.grid.cards > ul > li {
    padding: 0.55rem 0.6rem;
  }

  .md-typeset .perspective-cards.grid.cards > ul > li p {
    margin: 0.3em 0;
    font-size: 0.7rem;
    line-height: 1.4;
  }
}

@media screen and (max-width: 44em) {
  .titlepage .title-meta dl {
    grid-template-columns: 7rem 1fr;
  }

  .md-typeset .perspective-table table {
    display: block;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .md-typeset .perspective-table thead {
    display: none;
  }

  .md-typeset .perspective-table tbody,
  .md-typeset .perspective-table tr,
  .md-typeset .perspective-table td {
    display: block;
  }

  .md-typeset .perspective-table tr {
    margin: 0.55rem 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--lunco-rule);
    border-radius: 2px;
    background-color: var(--md-default-bg-color);
  }

  .md-typeset .perspective-table td {
    padding: 0.12rem 0;
    border: 0;
    background: transparent !important;
  }

  .md-typeset .perspective-table td:first-child {
    font-weight: 700;
  }

  .md-typeset .perspective-table td + td {
    margin-top: 0.3rem;
  }

  .md-typeset .perspective-table td:nth-child(2)::before {
    content: "Use: ";
    color: var(--md-default-fg-color--light);
    font-weight: 600;
  }

  .md-typeset .perspective-table td:nth-child(3)::before {
    content: "Start with: ";
    color: var(--md-default-fg-color--light);
    font-weight: 600;
  }
}

@media screen and (max-width: 60em) {
  .md-typeset h1 {
    font-size: 1.55rem;
  }

  .titlepage h1 {
    font-size: 2rem;
  }

  .titlepage .title-meta table td:first-child {
    width: 7rem;
  }
}

@media print {
  .md-header,
  .md-sidebar,
  .md-footer,
  .md-top,
  .md-content__button {
    display: none !important;
  }

  .md-content__inner {
    max-width: none;
  }

  .chapter h2 {
    break-after: avoid;
  }

  .md-typeset table,
  .md-typeset figure,
  .md-typeset pre {
    break-inside: avoid;
  }
}
