/* ==========================================================================
   Gruzzi Radio: Mediathek. Ergänzt /stil.css und den Stil der Radioseite.
   Auswahl, Suche, Monate als Kasten wie die Tage im Sendeplan, darin
   kompakte Zeilen. Farben nur aus den Variablen von stil.css, damit hell
   und dunkel zur übrigen Website passen.
   ========================================================================== */

/* ------------------------------------------------------- Auswahl und Suche */

.mt-werkzeuge {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-top: 1.8rem;
}

.mt-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.mt-filter button {
  min-height: 48px;
  padding: 0.45rem 1.15rem;
  border: 2px solid var(--akzent);
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--akzent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.mt-filter button[aria-pressed="true"] { background: var(--akzent); color: var(--flaeche); }
.mt-filter button:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }

.mt-suche { flex: 0 1 22rem; min-width: 0; }
.mt-suche label { display: block; margin: 0 0 0.3rem; font-weight: 700; }
.mt-suche input { min-height: 48px; }

.mt-zahl { margin: 1.3rem 0 0; color: var(--text-schwach); }

/* ------------------------------------------------------------------ Monate */

.mt-monat {
  margin: 1rem 0 0;
  padding: 0 1.3rem;
  border: 1px solid var(--rand);
  border-radius: 14px;
  background: var(--flaeche);
}
.mt-monat[open] { box-shadow: var(--schatten); }
.mt-monat[hidden] { display: none; }

.mt-monat > summary {
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.5rem 0;
  color: var(--text);
  list-style: none;
}
.mt-monat > summary::-webkit-details-marker { display: none; }
.mt-monat[open] > summary { color: var(--akzent); }
.mt-monat > summary h2 { margin: 0; font-size: 1.25rem; color: inherit; }

.mt-anzahl {
  padding: 0.05rem 0.6rem 0.1rem;
  border-radius: 999px;
  background: var(--rand);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Winkel rechts wie im Sendeplan, offen in der Akzentfarbe. */
.mt-monat > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 0.65rem;
  height: 0.65rem;
  margin: 0 0.25rem 0 auto;
  border-right: 3px solid var(--akzent);
  border-bottom: 3px solid var(--akzent);
  transform: rotate(45deg) translate(-0.15rem, -0.15rem);
  transition: transform 0.18s ease;
}
.mt-monat[open] > summary::after { transform: rotate(-135deg) translate(-0.15rem, -0.15rem); }
.mt-monat > summary:focus-visible { outline: 3px solid var(--akzent); outline-offset: 4px; border-radius: 6px; }

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

.mt-liste { list-style: none; margin: 0; padding: 0 0 0.4rem; }

.mt-eintrag {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  gap: 0.3rem 1rem;
  align-items: center;
  max-width: none;
  margin: 0;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rand);
}
.mt-eintrag[hidden] { display: none; }

.mt-tag { align-self: start; padding-top: 0.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mt-wochentag {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--messing);
}

.mt-was h3 { margin: 0; font-size: 1.1rem; }
.mt-angaben {
  max-width: none;
  margin: 0.3rem 0 0;
  color: var(--text-schwach);
  font-size: 0.95rem;
  line-height: 1.6;
}
/* Die Art fließt mit dem Text; bei Gespräche oder Märchen ist sie klar und fällt weg. */
.mt-art { display: inline-block; margin-right: 0.45rem; line-height: 1.35; }
#mt-liste[data-filter="gespraeche"] .mt-art,
#mt-liste[data-filter="maerchen"] .mt-art { display: none; }

.mt-hoeren {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.4rem 1.1rem 0.4rem 0.95rem;
  border: 2px solid var(--akzent);
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--akzent);
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
/* Abspieldreieck vor dem Wort */
.mt-hoeren::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 0.4rem solid transparent;
  border-bottom: 0.4rem solid transparent;
  border-left: 0.65rem solid currentColor;
}
@media (hover: hover) {
  .mt-hoeren:hover { background: var(--akzent); color: var(--flaeche); }
}
.mt-hoeren:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }
.mt-hoeren[hidden] { display: none; }

.mt-spieler { grid-column: 2 / -1; }
.mt-spieler[hidden] { display: none; }
.mt-spieler audio { display: block; width: 100%; margin: 0.35rem 0 0; }
.mt-spieler .folge-laden { margin: 0.2rem 0 0; }
.mt-spieler .folge-laden a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* Schmal: Knopf unter den Titel, Spieler über die ganze Breite. */
@media (max-width: 30rem) {
  .mt-monat { padding: 0 1rem; }
  .mt-eintrag { grid-template-columns: 3rem minmax(0, 1fr); }
  .mt-hoeren { grid-column: 2; justify-self: start; }
  .mt-spieler { grid-column: 1 / -1; }
  .mt-suche { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mt-monat > summary::after { transition: none; }
}
