/* ==========================================================
   MEINbusiness Schrittübersicht
   Titel: H2 aus dem Theme
   Inhalt: Absatzformatierung aus dem Theme
   ========================================================== */

.step-guide-module {
  --step-ink: #001d30;
  --step-orange: #ff6c20;
  --step-beige: #e9e4db;
  --step-shadow: #bdb3a7;

  --step-shadow-x: 8px;
  --step-shadow-y: 10px;
  --step-padding: 28px;

  width: 100%;
  max-width: 960px;
  min-width: 0;
  margin: 60px auto;

  /* Platz für den Schatten */
  padding: 0 var(--step-shadow-x) var(--step-shadow-y) 0;
  box-sizing: border-box;

  container-type: inline-size;
  container-name: mb-steps;
}

.step-guide-module *,
.step-guide-module *::before,
.step-guide-module *::after {
  box-sizing: border-box;
}

/* ---------- Zeilen ---------- */

.step-guide-module .step-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 0;

  min-width: 0;
  margin-bottom: 40px;
}

.step-guide-module .step-row:last-child {
  margin-bottom: 0;
}

/* ---------- Zahl und Untertitel ---------- */

.step-guide-module .step-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-width: 0;
  padding-right: 12px;
}

.step-guide-module .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 60px;
  min-height: 60px;
  padding: 8px 10px;
  margin: 0;

  font-family: inherit;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;

  color: var(--mb-number-text, #001d30);
  background: var(--mb-number-bg, #44a7c1);
  border-radius: 0;
  box-shadow: none;

  overflow-wrap: anywhere;
}

.step-guide-module .step-subheadline {
  max-width: 100%;

  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .8px;
  text-align: center;

  color: var(--step-ink);
  overflow-wrap: anywhere;
}

/* ---------- Karte ---------- */

.step-guide-module .step-right-col {
  min-width: 0;
  margin: 0;
}

.step-guide-module .step-card {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;

  background: var(--step-beige);
  border: 0;
  border-radius: 0;

  box-shadow:
    var(--step-shadow-x)
    var(--step-shadow-y)
    0
    var(--step-shadow);
}

/* ---------- Klickbarer Header ---------- */

.step-guide-module .step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  min-width: 0;
  min-height: 64px;
  margin: 0;
  padding: 22px var(--step-padding);

  background: transparent;
  list-style: none;
  cursor: pointer;
}

.step-guide-module .step-card-header::-webkit-details-marker {
  display: none;
}

.step-guide-module .step-card-header::marker {
  content: "";
}

.step-guide-module .step-card-header::before,
.step-guide-module .step-card-header::after {
  content: none;
}

.step-guide-module .step-card-header:focus-visible {
  outline: 3px solid var(--step-ink);
  outline-offset: 4px;
}

/* H2: Schrift, Größe und Zeilenhöhe kommen aus dem Theme */

.step-guide-module h2.step-card-title {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;

  color: var(--step-ink);
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* ---------- Pfeil ---------- */

.step-guide-module .step-arrow-container {
  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 40px;
  width: 40px;
  height: 40px;

  border-radius: 0;
  background: var(--step-orange);
}

.step-guide-module .step-card[open] .step-arrow-container {
  background: var(--step-beige);
}

.step-guide-module .step-arrow-icon {
  display: block;
  width: 12px;
  height: 14px;

  background: var(--step-ink);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transition: transform .25s ease;
}

.step-guide-module .step-card[open] .step-arrow-icon {
  transform: rotate(90deg);
}

/* ---------- Inhalt ---------- */

.step-guide-module .step-card-body {
  min-width: 0;
  margin: 0;
  padding: 0 var(--step-padding) var(--step-padding);

  background: transparent;
  color: var(--step-ink);
  overflow-wrap: anywhere;
}

/* Geschlossene Karten bleiben auch bei fremden Theme-Regeln zu. */
.step-guide-module .step-card:not([open]) > .step-card-body {
  display: none;
}

.step-guide-module .step-card-inner {
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* Keine eigene Schriftgröße oder Zeilenhöhe für Absätze.
   Direkt gesetzte Schriftfamilien aus Rich Text neutralisieren. */

.step-guide-module .step-card-inner,
.step-guide-module .step-card-inner p,
.step-guide-module .step-card-inner li,
.step-guide-module .step-card-inner span,
.step-guide-module .step-card-inner div,
.step-guide-module .step-card-inner a,
.step-guide-module .step-card-inner strong,
.step-guide-module .step-card-inner b,
.step-guide-module .step-card-inner em {
  font-family: inherit !important;
}

.step-guide-module .step-card-inner > :first-child {
  margin-top: 0;
}

.step-guide-module .step-card-inner > :last-child {
  margin-bottom: 0;
}

.step-guide-module .step-card-inner ul,
.step-guide-module .step-card-inner ol {
  padding-left: 1.4em;
}

.step-guide-module .step-card-inner li {
  margin-bottom: 8px;
}

.step-guide-module .step-card-inner img,
.step-guide-module .step-card-inner video {
  display: block;
  max-width: 100%;
  height: auto;
}

.step-guide-module .step-card-inner iframe {
  max-width: 100%;
}

.step-guide-module .step-card-inner table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.step-guide-module .step-card-inner pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Schmale Module / Mobil ---------- */

@container mb-steps (max-width: 600px) {
  .step-guide-module .step-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 30px;
  }

  .step-guide-module .step-row:last-child {
    margin-bottom: 0;
  }

  .step-guide-module .step-left-col {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 0;
  }

  .step-guide-module .step-number {
    min-width: 48px;
    min-height: 48px;
    font-size: 28px;
  }

  .step-guide-module .step-subheadline {
    text-align: left;
    letter-spacing: .5px;
  }

  .step-guide-module .step-card-header {
    gap: 12px;
    padding: 18px 20px;
  }

  .step-guide-module .step-card-body {
    padding: 0 20px 20px;
  }

  .step-guide-module .step-arrow-container {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 640px) {
  .step-guide-module {
    margin: 32px auto;
    --step-shadow-x: 5px;
    --step-shadow-y: 7px;
  }
}

/* Fallback ohne Container Queries */

@supports not (container-type: inline-size) {
  @media (max-width: 640px) {
    .step-guide-module .step-row {
      grid-template-columns: minmax(0, 1fr);
      gap: 14px;
      margin-bottom: 30px;
    }

    .step-guide-module .step-row:last-child {
      margin-bottom: 0;
    }

    .step-guide-module .step-left-col {
      flex-direction: row;
      justify-content: flex-start;
      gap: 12px;
      padding: 0;
    }

    .step-guide-module .step-subheadline {
      text-align: left;
    }

    .step-guide-module .step-card-header {
      padding: 18px 20px;
    }

    .step-guide-module .step-card-body {
      padding: 0 20px 20px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-guide-module .step-arrow-icon {
    transition: none;
  }
}