/*
 * Wissensartikel im „Neuen Anstrich“ (lädt nach echo-kb-overrides.css).
 * Aufbau: Blaupausen-Kopf mit Kennfarbe, links Themen, Mitte Text, rechts Inhaltsverzeichnis.
 * Die Kennfarbe kommt aus der Body-Klasse shm-k-… (siehe includes/artikel.php).
 */

body.shm-artikel {
  background: var(--shm-weiss);
}

/* Titel des Themes und Echo-KB-Kopf werden durch .shm-akopf ersetzt */
body.shm-artikel .site-main > .page-header,
body.shm-artikel #eckb-article-content-header-v2 {
  display: none !important;
}

body.shm-artikel .site-main,
body.shm-artikel .site-main .page-content {
  margin: 0 !important;
  padding: 0 !important;
}

/* ---- Kopf ---- */
.shm-akopf {
  color: var(--shm-weiss);
  background-color: var(--shm-blaupause);
  background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 24px 24px;
  border-bottom: 6px solid var(--k);
}

.shm-akopf__innen {
  display: grid;
  gap: 14px;
  max-width: calc(1216px);
  margin-inline: auto;
  padding: clamp(28px, 5vw, 48px) var(--shm-rand);
}

body.shm .shm-kat-chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  color: var(--shm-weiss);
  background: var(--k);
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
}

body.shm .shm-akopf__titel {
  max-width: 26ch;
  margin: 0;
  color: var(--shm-weiss);
  font: 800 clamp(1.9rem, 4.4vw, 3.1rem)/1.04 var(--shm-f-display);
  font-stretch: 112%;
  overflow-wrap: break-word;
  hyphens: manual;
}

/* Lange Wörter (Gefährdungsbeurteilung) erst auf schmalen Bildschirmen trennen */
@media (max-width: 700px) {
  body.shm .shm-akopf__titel { hyphens: auto; }
}

.shm-akopf__unter {
  max-width: 52ch;
  margin: 0;
  color: var(--shm-blau-text);
  font: 600 clamp(1.05rem, 1.8vw, 1.3rem)/1.35 var(--shm-f-display);
}

.shm-akopf__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .2);
  color: var(--shm-blau-text);
  font-size: .88rem;
}

.shm-akopf__meta b {
  color: var(--shm-weiss);
}

.shm-pflicht--gelb {
  border-color: var(--shm-plakette);
  color: var(--shm-tinte);
  background: var(--shm-plakette);
}

body.shm .shm-drucken {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 12px;
  border: 1.5px solid rgba(255, 255, 255, .45);
  border-radius: 8px;
  color: var(--shm-weiss);
  background: transparent;
  font: 700 .88rem var(--shm-f-text);
  cursor: pointer;
}

body.shm .shm-drucken:hover,
body.shm .shm-drucken:focus {
  border-color: var(--shm-weiss);
  color: var(--shm-weiss);
  background: transparent;
}

/* ---- Raster: Themen | Text | Inhalt ---- */
body.shm-artikel #eckb-article-body {
  grid-template-columns: 220px minmax(0, 1fr) 230px !important;
  grid-template-areas:
    "left-sidebar article-body article-toc"
    "left-sidebar article-footer article-toc" !important;
  column-gap: clamp(20px, 3vw, 40px) !important;
  max-width: 1216px !important;
  padding: clamp(28px, 4vw, 44px) var(--shm-rand) 70px !important;
}

body.shm-artikel #eckb-article-page-container-v2 #eckb-article-body #eckb-article-right-sidebar {
  position: sticky !important;
  top: 16px;
  align-self: start;
}

body.shm-artikel #eckb-article-right-sidebar .eckb-article-toc {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.shm-artikel .eckb-article-toc__title,
body.shm-artikel #epkb-sidebar-container-v2 .shm-themen-titel {
  margin: 0 0 10px !important;
  color: var(--shm-grau) !important;
  font: 800 .95rem/1.2 var(--shm-f-display) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.shm-toc-fort {
  height: 4px;
  margin: 0 0 12px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--shm-linie);
}

.shm-toc-fort i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--k);
}

body.shm-artikel .eckb-article-toc.eckb-article-toc-reset a {
  border-left-width: 2px !important;
  color: var(--shm-grau) !important;
  font-weight: 400 !important;
}

body.shm-artikel .eckb-article-toc.eckb-article-toc-reset a:hover,
body.shm-artikel .eckb-article-toc.eckb-article-toc-reset a.active,
body.shm-artikel .eckb-article-toc.eckb-article-toc-reset a[aria-current="true"] {
  border-left-color: var(--k) !important;
  color: var(--shm-tinte) !important;
  font-weight: 700 !important;
}

/* Linke Themennavigation mit Kennfarben */
body.shm-artikel #epkb-sidebar-container-v2 {
  top: 16px;
  border: 0;
  background: transparent;
}

body.shm-artikel #epkb-sidebar-container-v2 > #epkb-ml__module-search {
  padding: 0 0 14px !important;
  border: 0;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar__cat__top-cat {
  border: 0 !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar__cat__top-cat__heading-container {
  padding: 6px 8px !important;
  border-radius: 8px !important;
  background: transparent !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar__cat__top-cat__heading-container:hover {
  background: var(--shm-nebel) !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar__heading__inner__cat-name {
  display: flex !important;
  margin: 0 !important;
  align-items: center;
  gap: 8px;
  color: var(--shm-tinte) !important;
  font: 700 .92rem/1.3 var(--shm-f-text) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar__heading__inner__cat-name::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--k);
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar__cat__top-cat__body-container {
  padding: 2px 0 8px 12px !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar-article {
  padding: 4px 0 4px 10px !important;
  border-left: 2px solid transparent !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar-article .eckb-article-title__text {
  color: var(--shm-grau) !important;
  font: 400 .86rem/1.35 var(--shm-f-text) !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar-article:hover,
body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar-article.shm-current-article {
  border-left-color: var(--k) !important;
  background: transparent !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar-article.shm-current-article .eckb-article-title__text {
  color: var(--shm-tinte) !important;
  font-weight: 700 !important;
}

/* ---- Artikeltext ---- */
body.shm-artikel #eckb-article-content-body {
  max-width: 68ch;
  color: var(--shm-tinte);
  font-size: 1.06rem;
  line-height: 1.7;
}

body.shm-artikel #eckb-article-content-body h2 {
  margin: 2.2em 0 .6em;
  font: 800 clamp(1.35rem, 2.4vw, 1.7rem)/1.15 var(--shm-f-display);
  font-stretch: 108%;
  letter-spacing: 0;
}

body.shm-artikel #eckb-article-content-body h2.shm-h-nummer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: baseline;
}

body.shm-artikel #eckb-article-content-body h2.shm-h-nummer::before {
  content: attr(data-n);
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--shm-weiss);
  background: var(--k);
  font: 800 .95rem/1 var(--shm-f-display);
  transform: translateY(-4px);
}

body.shm-artikel #eckb-article-content-body h3 {
  font: 800 1.12rem/1.3 var(--shm-f-display);
  letter-spacing: 0;
}

body.shm-artikel #eckb-article-content-body li::marker {
  color: var(--k);
}

body.shm-artikel #eckb-article-content-body a {
  color: var(--shm-blau);
}

body.shm-artikel #eckb-article-content-body .shm-article-lead {
  padding-left: 18px;
  border-left: 4px solid var(--shm-plakette);
  color: var(--shm-tinte);
  font-size: 1.22rem;
  line-height: 1.55;
}

/* Bausteine aus dem Artikel: Warnung, Tipp, Rechtliches */
body.shm-artikel #eckb-article-content-body .notice-box {
  border: 1.5px solid;
  border-radius: 10px;
  color: var(--shm-tinte);
  font-size: .98rem;
  line-height: 1.55;
}

body.shm-artikel #eckb-article-content-body .notice-box > strong:first-child {
  font-family: var(--shm-f-display);
}

body.shm-artikel #eckb-article-content-body .notice-box--warning {
  border-color: #f2b8b2;
  background: #fdecea;
}

body.shm-artikel #eckb-article-content-body .notice-box--warning > strong:first-child {
  color: var(--shm-k-sicher);
}

body.shm-artikel #eckb-article-content-body .notice-box--warning > strong:first-child::before {
  content: "▲ ";
}

body.shm-artikel #eckb-article-content-body .notice-box--tip {
  border-color: #f1d27a;
  background: #fff6d6;
}

body.shm-artikel #eckb-article-content-body .notice-box--tip > strong:first-child {
  color: var(--shm-tinte);
}

body.shm-artikel #eckb-article-content-body .notice-box--legal {
  border-color: var(--shm-linie);
  color: var(--shm-grau);
  background: var(--shm-papier);
  font-size: .9rem;
}

body.shm-artikel #eckb-article-content-body .notice-box--legal > strong:first-child {
  color: var(--shm-tinte);
}

body.shm-artikel #eckb-article-content-body > p:last-of-type {
  border-left: 0;
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Block-Muster: Kernsatz, Checkliste, Prüfkarte */
body.shm-artikel #eckb-article-content-body .shm-zitat {
  max-width: 30ch;
  margin: 1.4em 0;
  color: var(--shm-blaupause);
  font: 800 clamp(1.4rem, 2.6vw, 1.9rem)/1.2 var(--shm-f-display);
  font-stretch: 108%;
}

body.shm-artikel #eckb-article-content-body .shm-checkliste {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

body.shm-artikel #eckb-article-content-body .shm-checkliste li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--shm-papier);
}

body.shm-artikel #eckb-article-content-body .shm-checkliste li::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border: 2px solid var(--shm-tinte);
  border-radius: 3px;
}

body.shm-artikel #eckb-article-content-body .shm-rhythmus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.4em 0;
  overflow: hidden;
  border: 2px solid var(--shm-tinte);
  border-radius: 12px;
}

.shm-rhythmus .shm-rh {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px;
}

.shm-rhythmus .shm-rh + .shm-rh {
  border-left: 1px dashed var(--shm-linie);
}

.shm-rhythmus .shm-rh--jahr {
  background: var(--shm-papier);
}

body.shm-artikel #eckb-article-content-body .shm-rh__titel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.15rem;
}

.shm-rh__titel::before {
  content: "";
  width: 43px;
  height: 18px;
  background: repeating-linear-gradient(90deg, var(--k) 0 7px, transparent 7px 9px);
}

.shm-rh__titel.shm-takt-1::before {
  background: linear-gradient(90deg, var(--k) 0 7px, transparent 7px 9px, var(--shm-linie) 9px 16px, transparent 16px 18px, var(--shm-linie) 18px 25px, transparent 25px 27px, var(--shm-linie) 27px 34px, transparent 34px 36px, var(--shm-linie) 36px 43px);
}

.shm-rh__titel.shm-takt-0::before {
  width: 7px;
  background: var(--shm-grau);
}

body.shm-artikel #eckb-article-content-body .shm-rh__wer {
  margin: 0;
  color: var(--shm-grau);
  font-size: .8rem;
  font-weight: 700;
}

body.shm-artikel #eckb-article-content-body .shm-rh ul {
  margin: 0;
  font-size: .93rem;
}

/* ---- Artikelende ---- */
.shm-afuss {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 2.4em;
}

.shm-afuss__karte {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: start;
  padding: 18px 20px;
  border: 1px solid var(--shm-linie);
  border-radius: var(--shm-radius);
  background: var(--shm-weiss);
}

body.shm .shm-afuss__karte .shm-afuss__titel {
  margin: 0 !important;
  color: inherit;
  font: 800 1.05rem/1.2 var(--shm-f-display) !important;
}

.shm-afuss__karte p {
  margin: 0 !important;
  color: var(--shm-grau);
  font-size: .93rem;
}

.shm-afuss__karte--forum {
  border-color: var(--shm-blau);
  color: var(--shm-weiss);
  background: var(--shm-blau);
}

.shm-afuss__karte--forum p {
  color: var(--shm-blau-text);
}

body.shm-artikel .eckb-tag-container {
  margin-top: 20px;
  color: var(--shm-grau);
  font-size: .85rem;
}

body.shm-artikel .epkb-article-navigation-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
  padding-top: 0;
  border-top: 0;
}

body.shm-artikel .epkb-article-navigation-container a {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--shm-linie);
  border-radius: 10px;
  color: var(--shm-tinte) !important;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

body.shm-artikel .epkb-article-navigation-container a:hover {
  border-color: var(--shm-blau);
  text-decoration: none !important;
}

body.shm-artikel .epkb-article-navigation__label {
  color: var(--shm-grau);
  font-size: .82rem;
  font-weight: 400;
}

body.shm-artikel .epkb-article-navigation__next {
  text-align: right;
}

body.shm-artikel .epkb-article-navigation-container .epkbfa {
  display: none;
}

/* ---- Schmal ---- */
@media (max-width: 1080px) {
  body.shm-artikel #eckb-article-body {
    grid-template-columns: 200px minmax(0, 1fr) !important;
    grid-template-areas:
      "left-sidebar article-toc"
      "left-sidebar article-body"
      "left-sidebar article-footer" !important;
  }

  body.shm-artikel #eckb-article-page-container-v2 #eckb-article-body #eckb-article-right-sidebar {
    position: static !important;
    margin-bottom: 24px !important;
  }
}

@media (max-width: 760px) {
  body.shm-artikel #eckb-article-body {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "article-toc"
      "article-body"
      "article-footer"
      "left-sidebar" !important;
  }

  .shm-drucken { margin-left: 0; }
  .shm-afuss,
  body.shm-artikel .epkb-article-navigation-container { grid-template-columns: 1fr; }
  body.shm-artikel #eckb-article-content-body .shm-rhythmus { grid-template-columns: 1fr; }
  .shm-rhythmus .shm-rh + .shm-rh { border-left: 0; border-top: 1px dashed var(--shm-linie); }
}

@media print {
  .shm-akopf { color: #000; background: none; border-bottom: 2px solid #000; }
  .shm-akopf * { color: #000 !important; }
  .shm-drucken,
  .shm-afuss,
  .shm-krumen { display: none !important; }
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar__body__main-cat {
  padding-left: 0 !important;
}

body.shm-artikel #epkb-sidebar-container-v2 .epkb-sidebar__body__main-cat > li {
  padding: 0 !important;
}

body.shm-artikel #eckb-article-content-body .shm-afuss a.shm-btn {
  color: var(--shm-weiss);
  text-decoration: none;
  outline-offset: 2px;
}

body.shm-artikel #eckb-article-content-body .shm-afuss a.shm-btn--weiss {
  color: var(--shm-blaupause);
}

body.shm-artikel .epkb-article-navigation-container > div {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  float: none !important;
}

body.shm-artikel .epkb-article-navigation-container a {
  height: 100%;
  background: var(--shm-weiss) !important;
}

body.shm-artikel .epkb-article-navigation-article__title {
  padding: 0 !important;
  color: var(--shm-tinte) !important;
  white-space: normal !important;
  overflow: visible !important;
}

/* Schritt-Zeitstrahl (h3.shm-step): Text rechts neben der Linie einrücken */
body.shm-artikel #eckb-article-content-body .shm-article-step > :not(h3) {
  margin-left: 48px !important;
}

body.shm-artikel #eckb-article-content-body h3.shm-step::before {
  color: var(--shm-weiss);
  background: var(--k);
}

body.shm-artikel #eckb-article-content-body .shm-article-step.shm-step-has-next::after {
  border-left: 2px solid color-mix(in srgb, var(--k) 35%, transparent);
}

@media (max-width: 560px) {
  body.shm-artikel #eckb-article-content-body .shm-article-step > :not(h3) {
    margin-left: 40px !important;
  }

  body.shm-artikel #eckb-article-content-body h3.shm-step {
    padding-left: 40px;
  }
}

/* Forum-Kasten am Artikelende in der Kennfarbe des Themas */
body.shm-artikel .shm-afuss__karte--forum {
  border-color: var(--k, var(--shm-blau));
  background: var(--k, var(--shm-blau));
}

body.shm-artikel .shm-afuss__karte--forum p {
  color: rgba(255, 255, 255, .88);
}

body.shm-artikel #eckb-article-content-body .shm-afuss__karte--forum a.shm-btn--weiss {
  color: var(--k, var(--shm-blaupause));
}
