/* =========================================================
   KSS Ungeordnete Liste – Frontend Styles
   Brandfarbe über CSS Custom Property:  --kss-list-accent
   ========================================================= */

/* ---- Basis ---- */
.kss-unordered-list {
  --kss-list-accent-resolved: var(--kss-list-accent, var(--wp--preset--color--primary, #2563eb));
  --kss-list-gap: 0.9rem;
  --kss-list-icon-size: 1.15em;
  --kss-list-line-height: 1.5;
  --kss-list-padding-inline: 0px;
  --kss-list-padding-top: 0px;
  --kss-list-padding-bottom: 0px;

  padding-inline-start: var(--kss-list-padding-inline);
  padding-top: var(--kss-list-padding-top);
  padding-bottom: var(--kss-list-padding-bottom);
}

.kss-unordered-list__items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--kss-list-gap);
}

/* ---- Listen-Item ---- */
.kss-unordered-list__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0;
  transition: transform 0.2s ease;
}

/* ---- Bullet-Container ---- */
.kss-unordered-list__bullet {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--kss-list-icon-size);
  height: var(--kss-list-icon-size);
  margin-top: 0.18em; /* optische Ausrichtung zur ersten Textzeile */
}

/* Icon via CSS-Mask – Farbe wird durch background-color gesteuert */
.kss-unordered-list__bullet::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--kss-list-accent-resolved);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}

/* --- Icon-Varianten --- */
.kss-unordered-list__bullet--check::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.kss-unordered-list__bullet--check-circle::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}

.kss-unordered-list__bullet--arrow::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
}

.kss-unordered-list__bullet--dot::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5' fill='black'/%3E%3C/svg%3E");
}

.kss-unordered-list__bullet--diamond::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='12,3 21,12 12,21 3,12' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='12,3 21,12 12,21 3,12' fill='black'/%3E%3C/svg%3E");
}

.kss-unordered-list__bullet--star::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2' fill='black'/%3E%3C/svg%3E");
}

.kss-unordered-list__bullet--dash::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}

/* ---- Text-Content ---- */
.kss-unordered-list__content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kss-unordered-list__title {
  font-weight: 500;
  line-height: var(--kss-list-line-height, 1.5);
  color: inherit;
}

.kss-unordered-list__description {
  margin: 0;
  font-size: 0.9em;
  line-height: var(--kss-list-line-height, 1.65);
  color: #666;
}

/* ===========================================
   Layout: Standard (default, großzügig)
   =========================================== */
.kss-unordered-list--layout-standard .kss-unordered-list__items {
  gap: 1.1rem;
}

.kss-unordered-list--layout-standard .kss-unordered-list__item {
  gap: 0.85rem;
}

.kss-unordered-list--layout-standard {
  --kss-list-icon-size: 1.3em;
}

/* ===========================================
   Layout: Kompakt (dichte, inline-ähnlich)
   =========================================== */
.kss-unordered-list--layout-compact .kss-unordered-list__items {
  gap: 0.55rem;
}

.kss-unordered-list--layout-compact .kss-unordered-list__item {
  align-items: center;
  gap: 0.6rem;
}

.kss-unordered-list--layout-compact {
  --kss-list-icon-size: 1em;
}

.kss-unordered-list--layout-compact .kss-unordered-list__title {
  font-weight: 400;
}

.kss-unordered-list--layout-compact .kss-unordered-list__bullet {
  margin-top: 0;
}

/* ===========================================
   Layout: Karten (Card-Optik)
   =========================================== */
.kss-unordered-list--layout-cards .kss-unordered-list__items {
  gap: 1rem;
}

.kss-unordered-list--layout-cards .kss-unordered-list__item {
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  gap: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.kss-unordered-list--layout-cards .kss-unordered-list__item:hover {
  border-color: var(--kss-list-accent-resolved);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.kss-unordered-list--layout-cards {
  --kss-list-icon-size: 1.4em;
}

/* --- Eigenes SVG-Icon (via CSS-Variable) --- */
.kss-unordered-list__bullet--custom::before {
  -webkit-mask-image: var(--kss-list-custom-icon, none);
  mask-image: var(--kss-list-custom-icon, none);
}

/* Fallback wenn kein Custom-Icon gesetzt */
.kss-unordered-list__bullet--custom:not([style*='--kss-list-custom-icon'])::before,
.kss-unordered-list:not([style*='--kss-list-custom-icon']) .kss-unordered-list__bullet--custom::before {
  -webkit-mask-image: var(--kss-list-custom-icon,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5' fill='black'/%3E%3C/svg%3E"));
  mask-image: var(--kss-list-custom-icon,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5' fill='black'/%3E%3C/svg%3E"));
}

/* ===========================================
   Zentriert
   =========================================== */
.kss-unordered-list--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===========================================
   Spalten-Layout
   =========================================== */
@media (min-width: 768px) {
  .kss-unordered-list--cols-2 .kss-unordered-list__items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem 1.5rem;
  }

  .kss-unordered-list--cols-3 .kss-unordered-list__items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem 1.5rem;
  }
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 767px) {
  .kss-unordered-list--cols-2 .kss-unordered-list__items,
  .kss-unordered-list--cols-3 .kss-unordered-list__items {
    grid-template-columns: 1fr;
  }

  .kss-unordered-list--layout-cards .kss-unordered-list__item {
    padding: 0.85rem 1rem;
  }
}
