/* =============================================================
   DMD2 Voices – Frontend Styles  v0.10
   Farben über CSS Custom Properties anpassen.
   Im Elementor-Widget können alle Werte direkt im Panel gesetzt werden.
   ============================================================= */

:root {
  --dmd2-primary:       #1a1a14;
  --dmd2-primary-light: #2e2e22;
  --dmd2-accent:        #8B8968;
  --dmd2-accent-hover:  #6b6a50;
  --dmd2-accent-light:  #F0EDE0;
  --dmd2-bg:            #F7F5EE;
  --dmd2-bg-white:      #ffffff;
  --dmd2-border:        #E0DDD0;
  --dmd2-border-dark:   #C8C6B2;
  --dmd2-text:          #1a1a14;
  --dmd2-text-muted:    #8B8975;
  --dmd2-text-hint:     #B4B09A;
  --dmd2-badge-bg:      #F0EDE0;
  --dmd2-badge-fg:      #5a5940;
  --dmd2-badge-border:  #D8D5C2;
  --dmd2-tag-bg:        #F5F3EC;
  --dmd2-tag-fg:        #8B8975;
  --dmd2-player-bg:     #F7F5EE;
  --dmd2-player-btn:    #8B8968;
  --dmd2-player-fill:   #8B8968;
  --dmd2-radius:        12px;
  --dmd2-radius-sm:     6px;
  --dmd2-radius-pill:   999px;
  --dmd2-shadow:        0 2px 10px rgba(26,26,20,.07);
  --dmd2-shadow-hover:  0 6px 22px rgba(26,26,20,.12);
  --dmd2-transition:    0.15s ease;
  --dmd2-font:          inherit;
}

/* ── Global reset: neutralise Elementor/theme overrides on all dmd2v elements ─
   Targeting the showcase wrapper ensures we don't break anything outside.    */
.dmd2v-showcase,
.dmd2v-showcase * {
  box-sizing: border-box;
}
/* Elementor sometimes targets all spans/divs inside its widgets */
.dmd2v-badge,
.dmd2v-tag,
.dmd2v-sit-tab,
.dmd2v-chip {
  display: inline-block;
  font-family: inherit;
}

/* ── Showcase wrapper ────────────────────────────────────────── */
.dmd2v-showcase {
  font-family: var(--dmd2-font);
  color: var(--dmd2-text);
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Filter bar ─────────────────────────────────────────────── */
.dmd2v-filter-wrap { margin-bottom: 24px; }

.dmd2v-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.dmd2v-filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 150px;
}

.dmd2v-filter-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--dmd2-text-muted);
}

.dmd2v-filter {
  appearance: none;
  -webkit-appearance: none;
  background: var(--dmd2-bg-white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5'%3E%3Cpath d='M0 0l4.5 5L9 0z' fill='%238B8975'/%3E%3C/svg%3E")
    no-repeat right 9px center;
  border: 1.5px solid var(--dmd2-border-dark);
  border-radius: var(--dmd2-radius-sm);
  padding: 7px 26px 7px 9px;
  font-size: 13px;
  color: var(--dmd2-text);
  cursor: pointer;
  transition: border-color var(--dmd2-transition);
  line-height: 1.4;
}
.dmd2v-filter:focus {
  outline: none;
  border-color: var(--dmd2-accent);
  box-shadow: 0 0 0 3px var(--dmd2-accent-light);
}
.dmd2v-filter.is-active { border-color: var(--dmd2-accent); }

.dmd2v-reset-filter {
  appearance: none;
  background: none;
  border: 1.5px solid var(--dmd2-border-dark);
  border-radius: var(--dmd2-radius-sm);
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dmd2-text-muted);
  cursor: pointer;
  transition: all var(--dmd2-transition);
}
.dmd2v-reset-filter:hover {
  border-color: var(--dmd2-accent);
  color: var(--dmd2-accent);
}

.dmd2v-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.dmd2v-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--dmd2-accent-light);
  color: var(--dmd2-accent-hover);
  border: 1px solid var(--dmd2-border-dark);
  border-radius: var(--dmd2-radius-pill);
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dmd2v-chip-remove { cursor: pointer; opacity: .6; }
.dmd2v-chip-remove:hover { opacity: 1; }

/* ── Grid ───────────────────────────────────────────────────── */
.dmd2v-grid { display: grid; gap: 22px; transition: opacity .2s; }
.dmd2v-grid.is-loading { opacity: .35; pointer-events: none; }

.dmd2v-cols-1 { grid-template-columns: 1fr; }
.dmd2v-cols-2 { grid-template-columns: repeat(2, 1fr); }
.dmd2v-cols-3 { grid-template-columns: repeat(3, 1fr); }
.dmd2v-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 920px) {
  .dmd2v-cols-3, .dmd2v-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .dmd2v-cols-2, .dmd2v-cols-3, .dmd2v-cols-4 { grid-template-columns: 1fr; }
  .dmd2v-filters { flex-direction: column; }
  .dmd2v-filter-group { width: 100%; }
}

.dmd2v-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 24px;
  color: var(--dmd2-text-muted);
  font-size: 14px;
}

/* ── Card ───────────────────────────────────────────────────── */
.dmd2v-card {
  background: var(--dmd2-bg-white);
  border: 1.5px solid var(--dmd2-border);
  border-radius: var(--dmd2-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--dmd2-shadow);
  transition: box-shadow var(--dmd2-transition), transform var(--dmd2-transition), border-color var(--dmd2-transition);
}
.dmd2v-card:hover {
  box-shadow: var(--dmd2-shadow-hover);
  border-color: var(--dmd2-border-dark);
  transform: translateY(-2px);
}
.dmd2v-card.is-hidden { display: none !important; }

.dmd2v-card-header { display: flex; align-items: center; gap: 12px; }

/* Avatar */
.dmd2v-avatar { flex-shrink: 0; }
.dmd2v-avatar-img {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--dmd2-border);
  display: block;
}
.dmd2v-avatar-svg {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: block;
  border: 2px solid var(--dmd2-border);
}

.dmd2v-identity { flex: 1; min-width: 0; }
.dmd2v-initials {
  font-size: 20px;
  font-weight: 800;
  color: var(--dmd2-primary);
  letter-spacing: -.03em;
  line-height: 1.1;
}
.dmd2v-tagline {
  font-size: 12px;
  color: var(--dmd2-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* Badges */
.dmd2v-lang-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.dmd2v-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--dmd2-radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.dmd2v-badge-lang {
  background: var(--dmd2-badge-bg);
  color: var(--dmd2-badge-fg);
  border: 1px solid var(--dmd2-badge-border);
}

/* Tags */
.dmd2v-style-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.dmd2v-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--dmd2-radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--dmd2-tag-bg);
  color: var(--dmd2-tag-fg);
  border: 1px solid var(--dmd2-border);
}

/* ── Player ─────────────────────────────────────────────────── */
.dmd2v-player-wrap {
  background: var(--dmd2-player-bg);
  border: 1px solid var(--dmd2-border);
  border-radius: var(--dmd2-radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Situation tabs – slim, flat, no pill radius */
.dmd2v-sit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1.5px solid var(--dmd2-border-dark);
  margin-bottom: 2px;
}
/* Situation tabs — now <span role="tab">, no button styles to fight */
.dmd2v-sit-tab {
  display: inline-block;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  padding: 4px 10px 3px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dmd2-text-muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--dmd2-transition), border-color var(--dmd2-transition);
  white-space: nowrap;
  line-height: 1.5;
  /* Explicitly zero out any inherited padding/margin from theme */
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
}
.dmd2v-sit-tab:hover { color: var(--dmd2-accent); }
.dmd2v-sit-tab.is-active {
  color: var(--dmd2-accent);
  border-bottom-color: var(--dmd2-accent);
  font-weight: 800;
}

/* Player row */
.dmd2v-player {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Play button — <div role="button">, no theme button interference */
.dmd2v-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: var(--dmd2-primary);
  color: #fff;
  cursor: pointer;
  user-select: none;
  opacity: .72;
  transition: background var(--dmd2-transition), transform var(--dmd2-transition), opacity var(--dmd2-transition);
  /* Reset anything the theme might apply to divs */
  padding: 0;
  margin: 0;
  border: none;
}
.dmd2v-play-btn:hover {
  opacity: 1;
  background: var(--dmd2-accent);
  transform: scale(1.1);
}
.dmd2v-play-btn svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

/* WaveSurfer container */
.dmd2v-waveform-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* The div WaveSurfer mounts into */
.dmd2v-waveform {
  display: block;
  width: 100%;
  height: 44px;  /* overridable via Elementor slider */
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
}
/* WaveSurfer v7 shadow-DOM cursor styling */
.dmd2v-waveform ::part(cursor) {
  width: 2px;
  background: var(--dmd2-accent);
}

.dmd2v-time {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--dmd2-text-hint);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Script display */
.dmd2v-script-display {
  font-size: 11.5px;
  color: var(--dmd2-text-muted);
  line-height: 1.5;
  font-style: italic;
  border-top: 1px solid var(--dmd2-border);
  padding-top: 7px;
}

.dmd2v-no-demos {
  font-size: 12px;
  color: var(--dmd2-text-hint);
  text-align: center;
  padding: 6px 0;
  font-style: italic;
}

/* ── CTA Button ─────────────────────────────────────────────── */
/* Pill + Uppercase + Bold – exact match für "GRATIS TESTEN" auf dmd2.com */
.dmd2v-card-footer { margin-top: auto; padding-top: 4px; }
/* CTA Button — all: unset then rebuild as pill */
.dmd2v-cta-btn {
  all: unset;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  padding: 9px 18px !important;
  background: var(--dmd2-accent) !important;
  color: #fff !important;
  border-radius: var(--dmd2-radius-pill) !important;
  text-align: center !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: background var(--dmd2-transition) !important;
  line-height: 1.5 !important;
}
.dmd2v-cta-btn:hover,
.dmd2v-cta-btn:focus {
  background: var(--dmd2-primary) !important;
  color: #fff !important;
  text-decoration: none !important;
}
