/* Managed Workspace Hilfe — single wiki theme (Material-compatible) */

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html {
  font-size: 100%;
}

/* Align Material tokens with one palette (avoid fighting component defaults) */
:root,
[data-md-color-scheme="default"] {
  --wiki-bg: #f4f6f9;
  --wiki-surface: #ffffff;
  --wiki-border: #e2e8f0;
  --wiki-ink: #0f172a;
  --wiki-text: #475569;
  --wiki-muted: #64748b;
  --wiki-accent: #4c4ceb;
  --wiki-accent-soft: rgba(76, 76, 235, 0.1);
  /* Hover: dark on light bg (Material’s --md-accent-fg is #fff and would make links unreadable) */
  --wiki-link-hover: #4338ca;

  /* Footer strip (dark bar) */
  --wiki-footer-bg: #0a0a0a;
  --wiki-footer-edge: rgba(255, 255, 255, 0.12);
  --wiki-footer-text: rgba(255, 255, 255, 0.82);
  --wiki-footer-muted: rgba(255, 255, 255, 0.55);
  --wiki-footer-hover: #a5b4fc;

  --md-default-fg-color: var(--wiki-ink);
  --md-default-fg-color--light: var(--wiki-text);
  --md-default-fg-color--lighter: var(--wiki-muted);
  --md-default-bg-color: var(--wiki-surface);
  --md-typeset-a-color: var(--wiki-accent);
  --md-typeset-font-size: 0.9375rem;
  --md-typeset-line-height: 1.65;
  --md-primary-fg-color: #fff;
  --md-primary-bg-color: var(--wiki-accent);
  --md-accent-fg-color: #fff;
  --md-accent-bg-color: var(--wiki-accent);

  /*
   * Main/header/footer shell. Slightly tighter than 100vw−2rem so the TOC column
   * sits closer to the viewport edge (large empty margin on the right was visible).
   */
  --wiki-shell-width: min(96rem, calc(100vw - 1rem));
}

body,
input,
button {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--wiki-bg);
}

/* --- Header + tabs: flat bar, no double shadows --- */
.md-header {
  background: var(--wiki-surface);
  border-bottom: 1px solid var(--wiki-border);
  box-shadow: none;
}

/*
 * Keep header + tab row on the same horizontal shell as `.md-main__inner`.
 * Overriding `max-width: none` was full-bleeding the bar while main uses
 * `--wiki-shell-width`, which looked misaligned next to the article column.
 * Material’s `.md-grid` inside tabs defaults to ~61rem — also narrower than our shell.
 */
.md-header__inner.md-grid,
.md-tabs .md-grid {
  max-width: var(--wiki-shell-width);
}

.md-header__inner {
  padding-inline: 1rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.5rem;
  width: auto;
}

.md-header__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--wiki-ink);
}

.md-header__ellipsis {
  color: var(--wiki-ink);
}

.md-tabs {
  background: var(--wiki-surface);
  border-bottom: 1px solid var(--wiki-border);
  box-shadow: none;
}

.md-tabs__link {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 1;
}

.md-tabs__item--active .md-tabs__link {
  color: var(--wiki-accent);
  font-weight: 600;
}

/*
 * Mobile: hide the duplicate tab bar. The drawer already contains the full tree
 * (all sections + pages). Keeping tabs visible confused “all pages” vs tab-only scope.
 */
@media (max-width: 76.2344em) {
  .md-tabs {
    display: none;
  }
}

/* --- Main layout: let Material own sticky offsets (no custom `top` on scrollwrap) --- */
.md-main {
  background: transparent;
  padding-top: 0.75rem;
}

.md-main__inner {
  width: 100%;
  max-width: var(--wiki-shell-width);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

@media (min-width: 76.25em) {
  .md-main__inner {
    align-items: flex-start;
    gap: 0;
  }

  /*
   * Material uses .md-sidebar { height: 0 } + sticky for the desktop nav/TOC.
   * Do NOT set overflow on .md-sidebar itself — it clips the scrollwrap and
   * collapses the visible column (~few dozen px). Clip only long TOC text below.
   */
  .md-sidebar--primary {
    width: 14rem;
    min-width: 14rem;
    max-width: 14rem;
    background: var(--wiki-bg);
    border-right: 1px solid var(--wiki-border);
  }

  .md-sidebar--secondary {
    width: 14rem;
    min-width: 14rem;
    max-width: 14rem;
    margin-left: 0;
    background: var(--wiki-bg);
    border-left: 1px solid var(--wiki-border);
  }

  .md-sidebar--primary,
  .md-sidebar--secondary {
    box-shadow: none;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap,
  .md-sidebar--secondary .md-sidebar__scrollwrap {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0.75rem 0.875rem;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Material default margin: 0 .2rem — flush outer edges so columns use full shell width */
  [dir="ltr"] .md-sidebar--primary .md-sidebar__scrollwrap {
    margin-left: 0;
  }

  [dir="ltr"] .md-sidebar--secondary .md-sidebar__scrollwrap {
    margin-right: 0;
  }

  [dir="rtl"] .md-sidebar--primary .md-sidebar__scrollwrap {
    margin-right: 0;
  }

  [dir="rtl"] .md-sidebar--secondary .md-sidebar__scrollwrap {
    margin-left: 0;
  }

  /* Same treatment as the TOC column: solid strip so labels/nav don’t show through. */
  .md-sidebar--primary .md-sidebar__scrollwrap,
  .md-sidebar--secondary .md-sidebar__scrollwrap {
    background: var(--wiki-bg);
  }

  .md-content {
    max-width: none;
    min-width: 0;
    background: var(--wiki-surface);
    border-radius: 0;
    min-height: 70vh;
  }
}

/* --- Side nav --- */
@media (min-width: 76.25em) {
  /*
   * TOC title + lifted tab section label (“Dateien & Zusammenarbeit”, …): scroll with the
   * column — same as Inhaltsverzeichnis, not pinned (Material defaults both to sticky).
   */
  .md-sidebar--secondary .md-nav--secondary .md-nav__title {
    position: static;
    top: auto;
    z-index: auto;
    box-shadow: none;
    margin: 0 0 0.35rem;
  }

  .md-sidebar--primary .md-nav--lifted > .md-nav__list > .md-nav__item--active > .md-nav__link {
    position: static;
    top: auto;
    z-index: auto;
    box-shadow: none;
    background: transparent;
    margin: 0 0 0.35rem;
  }
}

.md-sidebar .md-nav__link {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--wiki-text);
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
}

.md-sidebar .md-nav__link:hover {
  color: var(--wiki-ink);
  background: rgba(15, 23, 42, 0.05);
}

.md-sidebar .md-nav__link--active {
  color: var(--wiki-accent);
  font-weight: 600;
  background: var(--wiki-accent-soft);
}

/* --- Left + right nav column titles (site + drawer / Inhaltsverzeichnis) --- */
.md-sidebar--primary .md-nav__title,
.md-sidebar--secondary .md-nav__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wiki-muted);
  box-shadow: none;
  /* Solid so sticky title (mobile/small) never shows list text through it */
  background: var(--wiki-bg);
  border: none;
  padding: 0.5rem 0.25rem 0.35rem;
  margin: 0;
}

/* Long labels: same wrapping as the TOC column */
.md-sidebar--primary .md-nav__link {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.md-sidebar--primary .md-nav__link .md-ellipsis {
  white-space: normal;
  overflow-wrap: inherit;
  word-break: inherit;
}

.md-sidebar--secondary .md-nav__link {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--wiki-text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.md-sidebar--secondary .md-nav__link .md-ellipsis {
  white-space: normal;
  overflow-wrap: inherit;
  word-break: inherit;
}

.md-sidebar--secondary .md-nav__link:hover {
  color: var(--wiki-link-hover);
}

.md-sidebar--secondary .md-nav__link--active {
  color: var(--wiki-accent);
  font-weight: 600;
}

/* --- Article --- */
.md-content__inner {
  margin-top: 0;
  padding: 1.25rem 1.5rem 2rem;
  max-width: 48rem;
  /* Wide tables/code: clip here so the article column does not spill under the TOC column. */
  overflow-x: auto;
}

.md-typeset {
  font-size: var(--md-typeset-font-size);
  line-height: var(--md-typeset-line-height);
  color: var(--wiki-text);
}

.md-typeset h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--wiki-ink);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.md-typeset h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--wiki-ink);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--wiki-border);
}

.md-typeset h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--wiki-ink);
  margin-top: 1.35rem;
}

.md-typeset a {
  color: var(--wiki-accent);
  text-decoration: none;
}

.md-typeset a:hover,
.md-typeset a:focus-visible {
  color: var(--wiki-link-hover);
  text-decoration: underline;
}

/* Beat Material accent/primary rules that set hover text to white */
.md-content .md-typeset a:hover,
.md-content .md-typeset a:focus-visible {
  color: var(--wiki-link-hover) !important;
  -webkit-text-fill-color: var(--wiki-link-hover);
}

.md-typeset code {
  font-size: 0.875em;
  padding: 0.12em 0.35em;
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border);
  border-radius: 0.25rem;
  color: var(--wiki-ink);
}

.md-typeset pre {
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border);
  border-radius: 0.5rem;
}

.md-typeset pre code {
  border: 0;
  background: transparent;
}

.md-typeset blockquote {
  border-left: 3px solid var(--wiki-accent);
  background: var(--wiki-accent-soft);
  padding: 0.875rem 1rem;
  margin: 1.25rem 0;
  border-radius: 0 0.375rem 0.375rem 0;
  color: var(--wiki-ink);
}

.md-typeset table:not([class]) {
  width: 100%;
  font-size: 0.8125rem;
  border: 1px solid var(--wiki-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.md-typeset__table {
  margin: 1.25rem 0;
  overflow-x: auto;
}

.md-typeset table:not([class]) th {
  background: var(--wiki-bg);
  font-weight: 600;
  padding: 0.5rem 0.65rem;
}

.md-typeset table:not([class]) td {
  padding: 0.5rem 0.65rem;
  border-color: var(--wiki-border);
}

/* --- Cards (index) --- */
.md-typeset .cs-card-grid {
  display: grid;
  gap: 0.875rem;
  margin: 1.25rem 0;
}

@media (min-width: 60em) {
  .md-typeset .cs-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 80em) {
  .md-typeset .cs-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.md-typeset .cs-card {
  padding: 1rem 1.1rem;
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border);
  border-radius: 0.5rem;
}

.md-typeset .cs-card > :last-child {
  margin-bottom: 0;
}

.md-typeset .cs-card strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--wiki-ink);
  font-weight: 600;
}

/* --- PDF link (toc partial) --- */
.md-sidebar--primary .cs-toc-pdf {
  display: none;
}

.md-sidebar--secondary .cs-toc-pdf {
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--wiki-border);
}

.cs-toc-pdf__link {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--wiki-text);
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--wiki-border);
  border-radius: 0.375rem;
  background: var(--wiki-surface);
}

.cs-toc-pdf__link:hover {
  color: var(--wiki-accent);
  border-color: var(--wiki-accent);
  background: var(--wiki-accent-soft);
}

.md-content__button {
  display: none;
}

/* --- Search --- */
.md-search__form {
  border: 1px solid var(--wiki-border);
  border-radius: 999px;
  background: var(--wiki-bg);
  box-shadow: none;
}

.md-search__form:hover,
.md-search__form:focus-within {
  border-color: #cbd5e1;
  background: var(--wiki-surface);
  box-shadow: 0 0 0 2px var(--wiki-accent-soft);
}

.md-search__input {
  font-size: 0.8125rem;
  color: var(--wiki-ink);
  -webkit-text-fill-color: var(--wiki-ink);
}

.md-search__input::placeholder {
  color: var(--wiki-muted);
  -webkit-text-fill-color: var(--wiki-muted);
}

.md-search__icon,
.md-search__icon svg {
  color: var(--wiki-accent);
}

/* --- Footer: prev/next (light, like main wiki) + meta (dark bar) --- */
.md-footer {
  margin-top: auto;
  background: transparent;
  color: inherit;
  border-top: 1px solid var(--wiki-border);
}

/* Prev/next row — same light tone as before the dark footer strip */
.md-footer nav.md-footer__inner.md-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
  max-width: var(--wiki-shell-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0.875rem 1rem !important;
  background: var(--wiki-bg);
  border-bottom: 1px solid var(--wiki-border);
}

.md-footer__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 0;
  max-width: calc(50% - 0.5rem);
  color: var(--wiki-text);
  text-decoration: none;
}

.md-footer__link--next {
  flex-direction: row;
  justify-content: flex-end;
  text-align: right;
}

.md-footer__link--prev {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
}

.md-footer__link--next:only-of-type {
  margin-left: auto;
}

.md-footer__link:only-of-type {
  max-width: min(100%, 28rem);
  flex: 0 1 auto;
}

.md-footer__link:hover {
  color: var(--wiki-accent);
}

.md-footer__link .md-icon svg,
.md-footer__button.md-icon svg {
  fill: currentColor;
}

.md-footer__title {
  min-width: 0;
  color: inherit;
}

.md-footer__direction {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wiki-muted);
}

.md-footer-meta.md-typeset {
  margin: 0;
  color: inherit;
  border-top: none;
  background: var(--wiki-footer-bg);
}

.md-footer-meta .md-footer-meta__inner.md-grid {
  display: flex !important;
  justify-content: center !important;
  align-items: stretch !important;
  flex-wrap: wrap !important;
  gap: 0 !important;
  max-width: var(--wiki-shell-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 1rem 1rem 1.25rem !important;
}

.md-copyright {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  text-align: center;
  color: var(--wiki-footer-muted);
}

.md-copyright__highlight {
  color: var(--wiki-footer-text);
}

/* Legal links (Impressum / Datenschutz) — see docs/overrides/partials/copyright.html */
.cs-footer-legal {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
}

.cs-footer-legal a {
  color: var(--wiki-footer-text);
  text-decoration: none;
  font-weight: 500;
}

.cs-footer-legal a:hover {
  color: var(--wiki-footer-hover);
  text-decoration: underline;
}

.cs-footer-legal__sep {
  color: var(--wiki-footer-muted);
  user-select: none;
}

.cs-footer-generator {
  font-size: 0.75rem;
  color: var(--wiki-footer-muted);
  opacity: 0.9;
}

.cs-footer-generator a {
  color: var(--wiki-footer-muted);
  text-decoration: underline;
}

.cs-footer-generator a:hover {
  color: var(--wiki-footer-hover);
}

@media (max-width: 44em) {
  .md-footer nav.md-footer__inner.md-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .md-footer__link {
    max-width: 100%;
    flex: 1 1 auto;
  }

  .md-footer__link--next {
    justify-content: flex-start;
    text-align: left;
  }
}

/* --- Back to top --- */
.md-top {
  background: var(--wiki-accent);
  color: #fff;
  border-radius: 0.375rem;
}

/* --- Mobile --- */
@media (max-width: 76.2344em) {
  .md-header__inner {
    padding-inline: 0.5rem;
    gap: 0.35rem;
  }

  .md-header__title {
    font-size: 0.875rem;
    min-width: 0;
    flex: 1;
  }

  .md-header__topic:last-child {
    display: none;
  }

  .md-header__button[for="__drawer"] {
    order: -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--wiki-border);
    border-radius: 0.5rem;
    background: var(--wiki-surface);
  }

  .md-sidebar--primary {
    background: var(--wiki-surface);
    border-right: 1px solid var(--wiki-border);
  }

  .md-sidebar--primary .md-sidebar__scrollwrap {
    overflow-y: auto;
  }

  .md-nav--primary .md-nav__title,
  .md-nav--primary .md-nav__title[for="__drawer"] {
    background: var(--wiki-surface);
    color: var(--wiki-ink);
    border-bottom: 1px solid var(--wiki-border);
  }

  .md-nav--primary .md-nav__title .md-logo img,
  .md-nav--primary .md-nav__title .md-logo svg {
    height: 1.5rem;
  }

  .md-content__inner {
    padding: 1rem 1rem 1.5rem;
  }

  .md-typeset .cs-card-grid {
    gap: 0.75rem;
  }

  .md-typeset table:not([class]) {
    font-size: 0.75rem;
  }
}
