@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");

:root {
  --color-primary: #d64000;
  --color-primary-hover: #bd3800;
  --color-text: #040219;
  --color-text-muted: #4a4a4a;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;
  --color-border: #dbdbdb;
  --color-link: #3273dc;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--color-link);
}

.docs-header {
  align-items: center;
  background: var(--color-text);
  display: flex;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.docs-header__home {
  align-items: center;
  display: flex;
}

.docs-header__iqdoc {
  display: block;
  height: 30px;
  width: auto;
}

.docs-header__title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.docs-header__title-line {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.docs-header__itiqpro {
  display: block;
  height: 18px;
  width: auto;
}

.docs-header__docs {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.docs-header__tagline {
  align-items: center;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  font-size: 0.875rem;
  gap: 0.35rem;
}

.docs-header__mce-mark {
  display: block;
  height: 1rem;
  width: auto;
}

.docs-header__nav {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.docs-header__nav a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  text-decoration: none;
}

.docs-header__nav a.docs-header__action {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  color: #fff;
  padding: 0.3rem 0.65rem;
}

.docs-header__nav a.docs-header__action:hover {
  border-color: #fff;
}

.docs-body {
  min-height: calc(100vh - 7rem);
}

.docs-body--with-sidebar {
  display: grid;
  grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
}

.docs-sidebar {
  background: var(--color-bg-alt);
  border-right: 1px solid var(--color-border);
  max-height: calc(100vh - 3.5rem);
  overflow-y: auto;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 3.5rem;
}

.docs-tree,
.docs-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.docs-tree ul {
  margin-top: 0.35rem;
  padding-left: 1rem;
}

.docs-tree li {
  margin: 0.5rem 0;
}

.docs-tree a,
.docs-tree summary {
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}

/*
 * Leaf docs get a bullet plus a hanging indent so multi-line names wrap under
 * their first character instead of blending into the neighboring entries.
 */
.docs-tree a {
  display: block;
  padding-left: 1rem;
  text-indent: -0.7rem;
}

.docs-tree a::before {
  color: var(--color-primary);
  content: "\2022";
  margin-right: 0.45rem;
}

/* Folders draw their own caret that rotates when expanded. */
.docs-tree summary {
  list-style: none;
}

.docs-tree summary::-webkit-details-marker {
  display: none;
}

.docs-tree summary::before {
  color: var(--color-text);
  content: "\25B8";
  display: inline-block;
  font-size: 1rem;
  margin-right: 0.4rem;
}

.docs-tree details[open] > summary::before {
  transform: rotate(90deg);
}

.docs-tree a:hover {
  color: var(--color-primary);
}

.docs-tree a.is-active {
  background: #ffffff;
  border-left: 3px solid var(--color-primary);
  color: var(--color-primary);
  display: block;
  font-weight: 600;
  margin-left: -0.5rem;
  padding: 0.2rem 0.4rem 0.2rem calc(0.5rem - 3px);
  text-indent: 0;
}

/* The left border is the active-item indicator; the bullet would overlap it. */
.docs-tree a.is-active::before {
  content: none;
}

.docs-main {
  margin: 0 auto;
  max-width: 92rem;
  padding: 2rem clamp(1rem, 4vw, 3rem) 4rem;
  width: 100%;
}

/*
 * Document headings match the in-app MCe viewer (ClientApp/src/IQDocStyles.scss)
 * so a doc reads the same on the public site as in the app.
 */
.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4,
.doc-content h5,
.doc-content h6 {
  font-weight: bold;
  line-height: 1.25;
}

.doc-content h1 {
  color: #215868;
  font-size: 1.4rem;
  margin: 0.9rem 0 0.5rem;
}

.doc-content h2 {
  color: #31849b;
  font-size: 1.3rem;
  margin: 1.5rem 0 0.5rem;
}

.doc-content h3 {
  color: #5f497a;
  font-size: 1.1rem;
  margin: 1.2rem 0 0.3rem;
}

.doc-content h4 {
  color: #b2a1c7;
  font-size: 1.1rem;
  font-style: italic;
  margin: 1rem 0 0.3rem;
}

.doc-content h5 {
  color: #7f7f7f;
  font-size: 1rem;
  margin: 1rem 0 0.3rem;
}

.doc-content h6 {
  color: #7f7f7f;
  font-size: 1rem;
  font-style: italic;
  margin: 1rem 0 0.3rem;
}

.toc-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.toc-card {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  display: block;
  min-height: 6rem;
  padding: 1rem;
  text-decoration: none;
}

.toc-card:hover {
  border-color: var(--color-primary);
}

.toc-card__title {
  font-weight: 600;
}

.toc-card__desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.doc-content {
  max-width: 76rem;
}

.doc-content img {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  height: auto;
  max-width: 100%;
}

.doc-content table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

.doc-content th,
.doc-content td {
  border: 1px solid var(--color-border);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: #4d4d4d;
  color: #fff;
  font-weight: 600;
}

/* Alternating three-row bands, ported from the viewer's alternating-bands mixin. */
.doc-content tbody tr:nth-child(3n + 1) {
  background: #deebee;
}

.doc-content tbody tr:nth-child(3n + 2) {
  background: #ffffff;
}

.doc-content tbody tr:nth-child(3n + 3) {
  background: #f0f0f0;
}

.doc-content blockquote {
  background: #f8f8f8;
  border-left: 0.2rem solid #3498db;
  font-style: italic;
  margin: 1rem 0;
  padding: 0.5rem 0.75rem;
}

.doc-content a {
  color: #3498db;
}

.doc-content pre {
  background: #0d1117;
  border-radius: 6px;
  color: #e6edf3;
  overflow-x: auto;
  padding: 1rem;
}

.doc-content pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

/*
 * Mermaid diagrams render inside a <pre class="mermaid"> element, which would
 * otherwise inherit the dark code-block background above. The default Mermaid
 * theme draws dark node outlines, edges, and text, so a light background is
 * required for the flowchart lines to stay visible.
 */
.doc-content pre.mermaid {
  background: #ffffff;
  color: inherit;
  text-align: center;
}

.doc-content :not(pre) > code {
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.1rem;
}

.iqdoc-viewer-title-row {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.iqdoc-viewer-title-copy {
  min-width: 0;
}

.title {
  color: #984806;
  font-size: 2.6rem;
  line-height: 1.1em;
  margin-bottom: 0.05em;
}

.subtitle {
  color: #e36c0a;
  font-size: 2.6rem;
  line-height: 1.1em;
  margin-bottom: 0.05em;
}

#TitleRuler {
  background-color: #000;
  border: none;
  color: #000;
  height: 1px;
  margin-bottom: 1rem;
  margin-top: calc(0.05em + 4px);
  width: 100%;
}

.doc-attachment,
.doc-include-link {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  display: inline-block;
  margin: 0.25rem 0;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
}

.highlighted-block {
  border-left: 4px solid var(--color-primary);
  margin: 1rem 0;
  padding: 0.75rem 1rem;
}

.collapsible {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
}

.collapsible-summary {
  cursor: pointer;
  font-weight: 600;
}

.collapsible-body {
  margin-top: 0.5rem;
}

.collapsible-body > :first-child {
  margin-top: 0;
}

.collapsible-body > :last-child {
  margin-bottom: 0;
}

.more-info {
  display: inline-flex;
  gap: 0.25rem;
}

.more-info sup {
  color: var(--color-primary);
  font-weight: 600;
}

.more-info__text {
  color: var(--color-text-muted);
  font-size: 0.9em;
}

.doc-invalid-component {
  color: var(--color-primary);
  font-size: 0.9em;
}

.doc-include-error {
  display: block;
  margin: 0.5em 0;
  padding: 0.5em 0.75em;
  border-left: 3px solid #c0392b;
  background: #fdecea;
  color: #7d2018;
  font-size: 0.95em;
}

.docs-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  padding: 1rem;
  text-align: center;
}

@media (max-width: 800px) {
  .docs-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-header__nav {
    flex-wrap: wrap;
    margin-left: 0;
  }

  .docs-body--with-sidebar {
    display: block;
  }

  .docs-sidebar {
    border-bottom: 1px solid var(--color-border);
    border-right: 0;
    max-height: none;
    position: static;
  }
}
