/**
 * @file article-components.css
 * Verid — Artikel-Komponenten Style Guide
 *
 * Neue semantische Bausteine für Artikelseiten:
 *   div.vor-nach        — Vor- und Nachteile (grün/rot, zweispaltig)
 *   table.vergleich     — Vergleichstabelle (zwei Systeme / Konzepte)
 *   ol.verid-steps      — Schritt-für-Schritt-Anleitung (Stepper)
 *   mark.term           — Fachbegriff-Hervorhebung (gelbes Highlight)
 *   div.bs-liste        — Buchungssatz, gegliedert (Soll / an / Haben)
 */

/* ═══════════════════════════════════════════════════════════
   1. Vor- und Nachteile  (div.vor-nach)
   ─────────────────────────────────────────────────────────
   Zwei Spalten: links Vorteile (grün), rechts Nachteile (rot).
   Mobile: gestapelt.

   HTML-Muster:
   <div class="vor-nach">
     <div class="vor-nach__vorteile">
       <h4>Vorteile</h4>
       <ul>
         <li>Automatisierbar, kein manueller Eingriff nötig</li>
       </ul>
     </div>
     <div class="vor-nach__nachteile">
       <h4>Nachteile</h4>
       <ul>
         <li>Reagiert nicht auf saisonale Schwankungen</li>
       </ul>
     </div>
   </div>
   ═══════════════════════════════════════════════════════════ */

.node__content div.vor-nach,
.text-content div.vor-nach {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: var(--verid-space-6) 0;
}

.node__content div.vor-nach__vorteile,
.node__content div.vor-nach__nachteile,
.text-content div.vor-nach__vorteile,
.text-content div.vor-nach__nachteile {
  border-radius: var(--verid-radius);
  padding: 1rem 1.25rem 1.125rem;
}

.node__content div.vor-nach__vorteile,
.text-content div.vor-nach__vorteile {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}

.node__content div.vor-nach__nachteile,
.text-content div.vor-nach__nachteile {
  background: var(--verid-color-info-light, #FDF0EE);
  border: 1px solid #F5C6BE;
}

.node__content div.vor-nach__vorteile h4,
.node__content div.vor-nach__nachteile h4,
.text-content div.vor-nach__vorteile h4,
.text-content div.vor-nach__nachteile h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
}

.node__content div.vor-nach__vorteile h4,
.text-content div.vor-nach__vorteile h4 {
  color: #16A34A;
}

.node__content div.vor-nach__nachteile h4,
.text-content div.vor-nach__nachteile h4 {
  color: var(--verid-color-info, #D94F3D);
}

.node__content div.vor-nach__vorteile ul,
.node__content div.vor-nach__nachteile ul,
.text-content div.vor-nach__vorteile ul,
.text-content div.vor-nach__nachteile ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.node__content div.vor-nach__vorteile li,
.node__content div.vor-nach__nachteile li,
.text-content div.vor-nach__vorteile li,
.text-content div.vor-nach__nachteile li {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  font-size: var(--verid-text-base);
  line-height: var(--verid-leading-normal);
  color: var(--verid-color-text-secondary);
}

.node__content div.vor-nach__vorteile li::before,
.text-content div.vor-nach__vorteile li::before {
  content: '✓';
  color: #16A34A;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05em;
  font-size: 0.95em;
}

.node__content div.vor-nach__nachteile li::before,
.text-content div.vor-nach__nachteile li::before {
  content: '✗';
  color: var(--verid-color-info, #D94F3D);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05em;
  font-size: 0.95em;
}

@media (max-width: 600px) {
  .node__content div.vor-nach,
  .text-content div.vor-nach {
    grid-template-columns: 1fr;
  }
}


/* ═══════════════════════════════════════════════════════════
   2. Vergleichstabelle  (table.vergleich)
   ─────────────────────────────────────────────────────────
   Zwei oder mehr Spalten; erste Spalte = Kriterium (grau),
   Kopfzeile = blau. Typisch für System- oder Konzeptvergleich.

   HTML-Muster:
   <table class="vergleich">
     <thead>
       <tr>
         <th>Kriterium</th>
         <th>System A</th>
         <th>System B</th>
       </tr>
     </thead>
     <tbody>
       <tr>
         <td>Flexibilität</td>
         <td>hoch</td>
         <td>niedrig</td>
       </tr>
     </tbody>
   </table>
   ═══════════════════════════════════════════════════════════ */

.node__content table.vergleich,
.text-content table.vergleich {
  width: 100%;
  border-collapse: collapse;
  margin: var(--verid-space-6) 0;
  font-size: var(--verid-text-base);
  border-radius: var(--verid-radius);
  overflow: hidden;
}

.node__content table.vergleich thead th,
.text-content table.vergleich thead th {
  background: var(--verid-color-accent);
  color: #fff;
  padding: 0.65rem 1rem;
  font-weight: 600;
  text-align: left;
  font-size: var(--verid-text-sm);
  letter-spacing: 0.02em;
  border: none;
}

/* Erste Kopfzelle (Kriterium-Spalte): Grau statt Blau */
.node__content table.vergleich thead th:first-child,
.text-content table.vergleich thead th:first-child {
  background: var(--verid-color-surface-2, #E8EBF4);
  color: var(--verid-color-text-secondary);
}

.node__content table.vergleich tbody td,
.text-content table.vergleich tbody td {
  padding: 0.7rem 1rem;
  vertical-align: top;
  border-bottom: 1px solid var(--verid-color-border);
  line-height: 1.55;
  color: var(--verid-color-text-secondary);
  font-size: var(--verid-text-base);
}

/* Erste Datenzelle (Kriterium): fett, dunkle Farbe, heller Hintergrund */
.node__content table.vergleich tbody td:first-child,
.text-content table.vergleich tbody td:first-child {
  font-weight: 600;
  color: var(--verid-color-text);
  background: var(--verid-color-surface, #F3F5FA);
  white-space: nowrap;
}

.node__content table.vergleich tbody tr:last-child td,
.text-content table.vergleich tbody tr:last-child td {
  border-bottom: none;
}

/* Zebra-Streifen für lange Tabellen (optional: table.vergleich.zebra) */
.node__content table.vergleich.zebra tbody tr:nth-child(even) td:not(:first-child),
.text-content table.vergleich.zebra tbody tr:nth-child(even) td:not(:first-child) {
  background: var(--verid-color-surface, #F3F5FA);
}


/* ═══════════════════════════════════════════════════════════
   3. Schritt-für-Schritt  (ol.verid-steps)
   ─────────────────────────────────────────────────────────
   Stepper-Design: blaue Nummernblase + vertikale Verbindungslinie.
   Jedes li enthält ein div mit strong (Titel) und p (Beschreibung).

   HTML-Muster:
   <ol class="verid-steps">
     <li><div>
       <strong>Bedarf ermitteln</strong>
       <p>Primär- und Sekundärbedarf aus dem Produktionsprogramm ableiten.</p>
     </div></li>
     <li><div>
       <strong>Bestellung auslösen</strong>
       <p>Bestellmenge und -zeitpunkt festlegen.</p>
     </div></li>
   </ol>
   ═══════════════════════════════════════════════════════════ */

.node__content ol.verid-steps,
.text-content ol.verid-steps {
  list-style: none;
  padding: 0;
  counter-reset: verid-steps;
  display: flex;
  flex-direction: column;
  margin: var(--verid-space-4) 0 var(--verid-space-6);
}

.node__content ol.verid-steps > li,
.text-content ol.verid-steps > li {
  counter-increment: verid-steps;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  column-gap: 1rem;
  margin: 0;
  padding-bottom: 1.5rem;
  position: relative;
}

/* Vertikale Verbindungslinie zwischen den Schritten */
.node__content ol.verid-steps > li:not(:last-child)::after,
.text-content ol.verid-steps > li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 2.25rem;
  left: 1.125rem;
  transform: translateX(-50%);
  width: 2px;
  bottom: 0;
  background: var(--verid-color-accent-pale, #DDE3F7);
}

/* Nummernblase */
.node__content ol.verid-steps > li::before,
.text-content ol.verid-steps > li::before {
  content: counter(verid-steps);
  grid-column: 1;
  grid-row: 1;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--verid-color-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* Letzter Schritt: Blase etwas heller — Signal für "Ziel erreicht" */
.node__content ol.verid-steps > li:last-child::before,
.text-content ol.verid-steps > li:last-child::before {
  background: #16A34A;
}

/* Inhalt */
.node__content ol.verid-steps > li > div,
.text-content ol.verid-steps > li > div {
  grid-column: 2;
  padding-top: 0.3rem;
  min-width: 0;
}

.node__content ol.verid-steps > li > div > strong,
.text-content ol.verid-steps > li > div > strong {
  display: block;
  font-size: var(--verid-text-md);
  font-weight: 700;
  color: var(--verid-color-text);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.node__content ol.verid-steps > li > div > p,
.text-content ol.verid-steps > li > div > p {
  font-size: var(--verid-text-base);
  color: var(--verid-color-text-secondary);
  margin: 0;
  line-height: var(--verid-leading-normal);
}


/* ═══════════════════════════════════════════════════════════
   4. Fachbegriff-Hervorhebung  (mark.term)
   ─────────────────────────────────────────────────────────
   Subtiles gelbes Highlight für die Erstnennung eines
   Fachbegriffs oder eine besonders wichtige Aussage.
   Kein Kursiv, kein Fettdruck — nur Hintergrundfarbe.

   HTML-Muster:
   <p>Das <mark class="term">Bestellpunktverfahren</mark> löst
   automatisch eine Bestellung aus.</p>
   ═══════════════════════════════════════════════════════════ */

.node__content mark.term,
.text-content mark.term {
  background: #FEF9C3;
  color: inherit;
  border-radius: 2px;
  padding: 0 3px;
  font-style: normal;
  font-weight: inherit;
}

/* ═══════════════════════════════════════════════════════════
   5. Buchungssatz – Gegliederte Liste  (div.bs-liste)
   ─────────────────────────────────────────────────────────
   Stellt einen deutschen Buchungssatz gegliedert dar:
   Soll-Konten oben, „an" als Trenner, Haben-Konten unten.
   Hintergrund: transparent (erbt von der Umgebung).

   HTML-Muster:
   <div class="bs-liste">
     <div class="bs-liste-soll">
       <div class="bs-zeile">
         <span>Bankguthaben</span>
         <span class="bs-soll-betrag">1.880.000 €</span>
       </div>
     </div>
     <div class="bs-liste-an">an</div>
     <div class="bs-liste-haben">
       <div class="bs-zeile">
         <span>Verbindlichkeiten ggü. Kreditinstituten</span>
         <span class="bs-haben-betrag">2.000.000 €</span>
       </div>
     </div>
   </div>
   ═══════════════════════════════════════════════════════════ */

.node__content .bs-liste,
.text-content .bs-liste {
  border: 1px solid var(--verid-color-border, #DDE1EA);
  border-radius: 6px;
  overflow: hidden;
  font-size: var(--verid-text-md, 1.125rem);
  line-height: 1.6;
  margin: 0.75rem 0;
}

.node__content .bs-liste-soll,
.text-content .bs-liste-soll,
.node__content .bs-liste-haben,
.text-content .bs-liste-haben {
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.node__content .bs-liste-an,
.text-content .bs-liste-an {
  padding: 0.3rem 1.25rem;
  border-top: 1px dashed var(--verid-color-border, #DDE1EA);
  border-bottom: 1px dashed var(--verid-color-border, #DDE1EA);
}

.node__content .bs-zeile,
.text-content .bs-zeile {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.node__content .bs-soll-betrag,
.text-content .bs-soll-betrag {
  font-weight: 700;
  color: var(--verid-color-accent, #1F3CA6);
  white-space: nowrap;
}

.node__content .bs-haben-betrag,
.text-content .bs-haben-betrag {
  font-weight: 700;
  color: #D94F3D;
  white-space: nowrap;
}
