/*
 * SICK LiDAR Developer Guide: themed to match the sensor's own web UI
 * ==============================================================
 * Colours sampled directly from the device application (SICK Synergy
 * design system). The docs use a single light appearance (dark mode
 * has been removed); the brand blue and accents come from the device.
 *
 * Device palette (sampled live):
 *   #000206  page background      #00051a / #0e1633  surfaces / cards
 *   #262f55  borders              #4d5473  secondary       #777ea4  muted text
 *   #e9ebf1  body text            #005aff  primary blue    #3183fe  focus
 *   #5e97fc / #91bbff  light blue #a5e1b9  green (success)  #8a6000  warning
 */

:root {
  --sick-bg: #000206;
  --sick-surface: #00051a;
  --sick-surface-2: #0e1633;
  --sick-border: #262f55;
  --sick-border-2: #4d5473;
  --sick-muted: #777ea4;
  --sick-text: #e9ebf1;
  --sick-blue: #005aff;
  --sick-blue-link: #5e97fc;
  --sick-blue-foc: #3183fe;
  --sick-blue-100: #dae7ff;
  --sick-green: #a5e1b9;
  --sick-green-dk: #155033;
  --sick-amber: #ffbf32;
}

/* Fonts: device uses "SICK Intl"; Inter is the closest web fallback. */
:root {
  --md-text-font: "Inter";
  --md-code-font: "Roboto Mono";
}

/* ============================================================= *
 *  Header + tabs                                                *
 * ============================================================= */
/* SICK wordmark: enlarged, with extra header height so it fits */
.md-header {
  height: auto;
}
.md-header__inner {
  min-height: 5rem;
}
.md-header__button.md-logo {
  padding: 0.3rem 0.3rem 0.3rem 0;
}
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 3.4rem;
  width: auto;
}

/* More breathing room between top-level nav categories */
.md-nav--primary > .md-nav__list > .md-nav__item {
  margin-top: 1.1rem;
}
.md-nav--primary > .md-nav__list > .md-nav__item:first-child {
  margin-top: 0;
}
.md-nav--primary > .md-nav__list > .md-nav__item--section > .md-nav__link,
.md-nav--primary > .md-nav__list > .md-nav__item--section > label.md-nav__link {
  margin-bottom: 0.2rem;
}
/* Bold the top-level leaf links too (e.g. Home, Getting started), so they
   match the bold section headings (Sensor Features, Visualization, ...). */
.md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--section) > .md-nav__link {
  font-weight: 700;
}

/* ============================================================= *
 *  LIGHT SCHEME  (the only appearance; forced under any scheme)  *
 * ============================================================= *
 * These rules use the attribute-presence selector [data-md-color-scheme]
 * (not ="default") so they win even if a returning visitor's localStorage
 * still holds the old "slate" value and Material sets the body to slate.
 * The full set of light base variables is redefined here so slate can never
 * darken the page background or text. */
[data-md-color-scheme] {
  /* Light base (Material's default light values) */
  --md-default-bg-color: #ffffff;
  --md-default-bg-color--light: hsla(0, 0%, 100%, 0.7);
  --md-default-bg-color--lighter: hsla(0, 0%, 100%, 0.3);
  --md-default-bg-color--lightest: hsla(0, 0%, 100%, 0.12);
  --md-default-fg-color: rgba(0, 0, 0, 0.87);
  --md-default-fg-color--light: rgba(0, 0, 0, 0.54);
  --md-default-fg-color--lighter: rgba(0, 0, 0, 0.32);
  --md-default-fg-color--lightest: rgba(0, 0, 0, 0.07);
  --md-code-fg-color: rgba(0, 0, 0, 0.87);

  /* Brand tuning */
  --md-primary-fg-color: var(--sick-bg);
  --md-accent-fg-color: var(--sick-blue);
  --md-typeset-a-color: var(--sick-blue);
  --md-code-bg-color: #f4f6fb;
  /* Footer uses the SICK dark navy legal-bar treatment. */
  --md-footer-bg-color: #00083c;
  --md-footer-bg-color--dark: #00051a;
  --md-footer-fg-color: #ffffff;
  --md-footer-fg-color--light: rgba(255, 255, 255, 0.8);
  --md-footer-fg-color--lighter: rgba(255, 255, 255, 0.6);
  /* Header sits on a light surface -> dark text & icons */
  --md-primary-bg-color: #00051a;
  --md-primary-bg-color--light: rgba(0, 5, 26, 0.6);
}
/* Light header + tabs to match the light appearance */
[data-md-color-scheme] .md-header {
  background-color: #ffffff;
  color: var(--sick-bg);
  border-bottom: 1px solid #e3e7f1;
}
[data-md-color-scheme] .md-tabs {
  background-color: #ffffff;
  color: var(--sick-bg);
}
/* Footer bar: dark legal-information strip matching the SICK website. */
.md-footer {
  background-color: #00083c;
  border-top: 0;
  color: #ffffff;
}
/* The mobile-only drawer header repeats the logo above the nav list; keep it
   light too instead of Material's dark default (it also fixes an accidental
   near-invisible dark-on-dark title text). Hidden entirely on desktop, see
   below. */
[data-md-color-scheme] .md-nav--primary .md-nav__title[for="__drawer"] {
  background-color: #ffffff;
  color: var(--sick-bg);
  border-bottom: 1px solid #e3e7f1;
}
/* Search field readable on the light header */
[data-md-color-scheme] .md-search__form {
  background-color: #eef1f8;
}
[data-md-color-scheme] .md-search__form:hover {
  background-color: #e3e7f1;
}
[data-md-color-scheme] .md-search__input,
[data-md-color-scheme] .md-search__input::placeholder,
[data-md-color-scheme] .md-search__icon {
  color: var(--sick-bg);
}

/* Footer layout: centered, wrapping items that stay intact when zoomed. */
.md-footer-meta__inner {
  box-sizing: border-box;
  display: flex;
  max-width: none;
  width: 100%;
  padding: 1.2rem 1rem;
}
.sick-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.sick-footer__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}
.sick-footer__item {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  white-space: nowrap;
}

.sick-footer__links a,
.sick-footer__links span,
.sick-footer__version,
.sick-footer__copyright {
  color: #e9ebf1 !important;
  font: inherit;
  font-size: 0.8rem;
  line-height: inherit;
  opacity: 1;
}
.sick-footer__links a {
  text-decoration: none;
}
.sick-footer__links a:hover,
.sick-footer__links a:focus {
  text-decoration: underline;
}
.sick-footer__copyright {
  justify-content: center;
}

@media screen and (max-width: 45em) {
  .md-footer-meta__inner {
    padding: 1rem;
  }

  .sick-footer {
    gap: 0.75rem;
  }
}

.md-typeset {
  font-size: 0.8rem;
}

/* Use the complete desktop viewport while retaining the documentation navigation. */
@media screen and (min-width: 76.25em) {
  .md-grid {
    max-width: none;
    margin-right: 2rem;
    margin-left: 2rem;
  }

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

  .md-content {
    max-width: none;
    margin: 0;
  }

  .md-content__inner {
    max-width: none;
    margin: 0;
    padding: 0 1.5rem;
  }
}

/* ---------- Typography ---------- */
.md-typeset .headerlink {
  width: 0.9rem;
  height: 0.9rem;
  margin-left: 0.4rem;
  font-size: 0;
  vertical-align: 0.08em;
}
.md-typeset .headerlink::before {
  content: "🔗";
  font-size: 0.7rem;
  line-height: 1;
}

.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--sick-bg);
  border-bottom: 2px solid var(--sick-blue);
  padding-bottom: 0.3rem;
  font-size: 1.4rem;
}
.md-typeset h2,
.md-typeset h3 {
  font-weight: 700;
  color: var(--sick-bg);
}

/* ---------- Prose images: centered with a thin black border ---------- */
.md-typeset img:not(.twemoji):not(.product-image--right) {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.5rem;
  border: 1px solid #000000;
  border-radius: 0;
}

.md-typeset .product-image--right {
  float: right;
  margin: 0 0 1rem 1.5rem;
  border: 0;
  border-radius: 0;
}

.md-typeset h1 > button.copy-for-ai {
  float: right;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.385rem 0.595rem;
  border: 1px solid var(--sick-blue);
  border-radius: 0;
  background: #fff;
  color: var(--sick-blue);
  font-family: var(--md-text-font), sans-serif;
  line-height: 1;
  font-weight: 700;
  font-size: 0.56rem;
  cursor: pointer;
}

.md-typeset h1 > button.copy-for-ai svg {
  width: 0.84rem;
  height: 0.84rem;
  min-width: 0.84rem;
  fill: currentColor;
}

.md-typeset h1 > button.copy-for-ai:hover,
.md-typeset h1 > button.copy-for-ai:focus-visible {
  background: var(--sick-blue);
  color: #fff;
}

/* ---------- Tables: neutral academic presentation ---------- */
.md-typeset table:not([class]) {
  font-size: 0.78rem;
  border: 1px solid #c7cdd6;
  border-radius: 0;
  overflow: hidden;
}
.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.5em 0.75em;
  border: 1px solid #d8dde5;
}
.md-typeset table:not([class]) th {
  background: #eef1f4;
  color: #20252b;
  font-weight: 600;
  min-width: 0;
}
.md-typeset table:not([class]) tr:nth-child(even) td {
  background: #fafbfc;
}

/* ---------- Admonitions ---------- */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  border-width: 0 0 0 3px;
}
/* ---------- Admonitions: one neutral "info" style everywhere ---------- */
/* Only `note` and `info` are used across the guide (no coloured tip/warning
   call-outs); both get the same neutral brand-blue treatment. */
.md-typeset .admonition.note,
.md-typeset details.note,
.md-typeset .admonition.info,
.md-typeset details.info {
  border-left-color: var(--sick-blue);
}
.md-typeset .note > .admonition-title,
.md-typeset .info > .admonition-title {
  background-color: rgba(0, 90, 255, 0.14);
}

/* ---------- Responsive wrapper for the looping MP4 "GIF" demos ---------- */
.md-typeset .video {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--sick-border);
  border-radius: 0;
  overflow: hidden;
}
.md-typeset .video video {
  display: block;
  width: 100%;
  height: auto;
}
.md-typeset .video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

/* ---------- Picture/video captions ---------- */
.md-typeset p.caption {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--sick-muted, #6b7280);
  font-style: italic;
  text-align: center;
}
.md-typeset p.caption a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Hide the on-page table of contents (guide reads top-to-bottom) ----------
.md-sidebar--secondary {
  display: none !important;
}
@media screen and (min-width: 76.25em) {
  .md-sidebar--secondary {
    display: none !important;
  }
}
*/

/* ---------- Hide the duplicate site title atop the left nav ---------- */
/* The masthead already shows the SICK logo + "SICK LiDAR Developer Guide";
   repeating it as the first line of the left nav column is redundant. Keep it
   on narrow/mobile widths, where it doubles as the drawer header. */
@media screen and (min-width: 76.25em) {
  .md-nav--primary > .md-nav__title[for="__drawer"] {
    display: none;
  }
}

/* ---------- Grid cards, tuned to the light brand surface ---------- */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border: 1px solid #e3e7f1;
  border-radius: 10px;
  background: #f4f6fb;
  overflow: hidden;
}

/* Home page navigation cards: the headline (first line) is a plain-blue link,
   there is no icon and no separate "arrow" link at the bottom of the card. */
.md-typeset .grid.cards > ul > li > p:first-child {
  margin-top: 0;
  text-align: center;
}
.md-typeset .grid.cards > ul > li > p:first-child a {
  color: var(--sick-blue);
  text-decoration: none;
}
.md-typeset .grid.cards > ul > li > p:first-child a:hover {
  text-decoration: underline;
}
.md-typeset .grid.cards > ul > li > p:not(:first-child) {
  font-size: 0.72rem;
}

/* Keep five homepage cards per row on wide screens and remain responsive. */
.md-typeset .grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
@media screen and (min-width: 76.25em) {
  .md-grid {
    max-width: 74rem;
  }
  .md-typeset .grid.cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Subtle brand link underline on hover */
.md-typeset a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Product-compatibility chips (API Integration) ---------- */
.md-typeset .chips {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin: 0.2rem 0 1.1rem;
}
.md-typeset .chips .chips-label {
  margin-right: 0;
}
.md-typeset .chip {
  font-weight: 600;
}
