/*
 * components/podcast-player.css
 * Podcastens afspiller nederst på siden (assets/js/podcast-player.js). Vises, når en
 * episode er sat i gang, og bliver stående på tværs af sider.
 */

.podcast-player {
  position: fixed;
  left: 50%;
  bottom: var(--space-md);
  transform: translateX(-50%);
  z-index: 150;
  width: calc(100% - 2 * var(--space-lg));
  max-width: 880px;
  display: grid;
  grid-template-columns: auto minmax(0, 1.2fr) minmax(80px, 1fr) auto auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm-plus) var(--space-md);
  background: var(--color-primary);
  color: var(--color-text-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

/* Plads til afspilleren under footeren */
.has-podcast-player body {
  padding-bottom: 96px;
}

.podcast-player__toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-text-white);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.podcast-player__toggle:hover {
  opacity: 0.9;
}

.podcast-player__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.podcast-player__meta {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.podcast-player__title {
  font-size: var(--font-size-secondary);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-white);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.podcast-player__title[href]:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.podcast-player__progress {
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.podcast-player__progress::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
}

.podcast-player__progress-fill {
  position: relative;
  height: 4px;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  pointer-events: none;
}

.podcast-player__time {
  font-size: var(--font-size-caption);
  color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.podcast-player__close {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-pill);
}

.podcast-player__close:hover {
  color: var(--color-text-white);
  background: rgba(255, 255, 255, 0.1);
}

.podcast-player__toggle:focus-visible,
.podcast-player__close:focus-visible,
.podcast-player__title:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Telefon: titel og knapper øverst, tidslinjen i fuld bredde nederst */
@media (max-width: 640px) {
  .podcast-player {
    bottom: var(--space-sm);
    width: calc(100% - 2 * var(--space-sm));
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    column-gap: var(--space-sm-plus);
    row-gap: var(--space-xs);
    padding: var(--space-sm) var(--space-sm) var(--space-sm-plus) var(--space-sm-plus);
  }

  .podcast-player__progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .has-podcast-player body {
    padding-bottom: 112px;
  }
}
