/* ===========================================================================
   Erklär-Illustration (aufklappbar) — generische Orientierungshilfe, z. B. auf
   der Verpackungs- und der Bauteil-Übersicht. Reine Erklärung (Bild), klar
   abgesetzt von der echten Liste. Offen, solange noch nichts angelegt ist;
   danach eingeklappt. Nutzt die Tokens aus app.css.
   =========================================================================== */

.erkl {
  margin: 0 0 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.erkl > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 17px;
}
.erkl > summary::-webkit-details-marker { display: none; }
.erkl > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius); }

.erkl-marke { display: flex; flex-direction: column; gap: 2px; }
.erkl-marke b { font-size: 1.08rem; letter-spacing: -.01em; }

.erkl-chev { margin-left: auto; width: 18px; height: 18px; color: var(--muted); transition: transform .18s; flex: none; }
.erkl[open] > summary .erkl-chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .erkl-chev { transition: none; } }

.erkl-inhalt { padding: 2px 17px 16px; }
.erkl-text { margin: 0 0 12px; color: var(--muted); font-size: .9rem; line-height: 1.55; max-width: 76ch; }

.erkl img {
  display: block; width: 100%; height: auto; max-width: 820px;
  border-radius: var(--radius-sm);
}

/* Galerie mehrerer Einzelbilder (z. B. die Bauteile: Flasche, Deckel, Kleber, Farbe …) */
.erkl-galerie {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  max-width: 490px;
}
.erkl-galerie img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
/* Breitere Kacheln für detailliertere Bilder (Verpackungs-Ebenen „aus Einzelteilen") */
.erkl-galerie.breit { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; max-width: 680px; }
/* Kompakte Icon-Reihe, z. B. die fünf Prüf-Arten der Bauteil-Nachweise */
.erkl-galerie.reihe { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); max-width: 580px; }

/* Klick auf ein Erklär-Bild zeigt es groß; Klick, Schließen-Knopf oder Esc schließt wieder. */
.erkl-galerie.breit img,
.zoombar { cursor: zoom-in; }

.bild-zoom-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 5vh 4vw;
  background: rgba(15, 23, 42, .72);
  cursor: zoom-out;
  animation: bild-zoom-auf .14s ease-out;
}
@keyframes bild-zoom-auf { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bild-zoom-overlay { animation: none; } }

.bild-zoom-fig {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: .75rem;
  max-width: 100%;
}
.bild-zoom-bild {
  width: auto; max-width: min(94vw, 860px); max-height: 80vh; object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  background: #fff;
}
.bild-zoom-cap {
  margin: 0; max-width: 62ch; text-align: center;
  color: #fff; font-size: .88rem; line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}
.bild-zoom-close {
  position: fixed; top: 1rem; right: 1.1rem;
  width: 2.5rem; height: 2.5rem; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 1.7rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.bild-zoom-close:hover { background: rgba(255, 255, 255, .3); }
.bild-zoom-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------------------------------------------------------------------------
   Dynamische Verpackungsart-Erklärung: das Dropdown steuert, welche Erklärung
   angezeigt wird. Text links, optionales Bild rechts.
   --------------------------------------------------------------------------- */
.vp-erkl-body { display: flex; gap: 16px; align-items: flex-start; }
.vp-erkl-text { flex: 1 1 auto; min-width: 0; }
.vp-erkl-text .vp-desc { margin: .1rem 0 .55rem; line-height: 1.5; }
.vp-erkl-text .vp-ex { margin: .1rem 0 .55rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.vp-erkl-text .vp-ecig { margin: .55rem 0 0; font-size: .9rem; }
.vp-erkl-text .vp-note { margin: .55rem 0 0; }
.erkl img.vp-img { flex: 0 0 auto; width: 280px; max-width: 38%; height: auto; align-self: flex-start; border: 1px solid var(--line); cursor: zoom-in; }
@media (max-width: 640px) {
  .vp-erkl-body { flex-direction: column; }
  .erkl img.vp-img { width: 100%; max-width: 100%; }
}

/* ---------------------------------------------------------------------------
   Kachelraster „Verpackungsart / Verpackung" (Bild oben, Text unten). Wird u. a.
   im PPWR-Wissen für die Grundbegriffe genutzt. Nutzt die Tokens aus app.css.
   --------------------------------------------------------------------------- */
.gl-arten { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 1rem; }
.gl-art { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.gl-art img { display: block; width: 100%; height: auto; }
.gl-art-text { padding: 11px 13px; }
.gl-art-text b { display: block; margin: 0 0 4px; font-size: .95rem; color: var(--ink); }
.gl-art-text p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
