/*
 * pages/podcast.css
 * Styles for podcast-siden (page-podcast.php).
 */

/* ============================================================
   FLOATING LAYOUT
============================================================ */

.page-podcast > section {
  width: calc(100% - 2 * var(--space-lg));
  max-width: var(--max-width-content);
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-top: var(--space-lg);
}

.page-podcast > section:first-child {
  margin-top: var(--space-sm);
}

.page-podcast {
  padding-bottom: var(--space-lg);
}

/* ============================================================
   1. HERO
   Følger kongres-hero-mønsteret: foto øverst, 2-kol body under
============================================================ */

.podcast-hero {
  background: var(--color-bg-card);
}

.podcast-hero__image img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
}

.podcast-hero__body {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-sm) var(--space-xl);
  padding: var(--space-3xl) var(--space-xl);
  align-items: start;
}

.podcast-hero__breadcrumb {
  display: block;
  grid-column: 1 / -1;
  font-size: var(--font-size-secondary);
  color: var(--color-text-secondary);
}

.podcast-hero__breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.podcast-hero__breadcrumb a:hover {
  color: var(--color-primary);
}

.podcast-hero__heading {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  line-height: var(--line-height-h1);
  letter-spacing: var(--letter-spacing-h1);
  margin: 0;
}

.podcast-hero__text {
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
  line-height: var(--line-height-secondary);
  margin: 0;
  padding-top: 0.5em;
}

/* ============================================================
   2. FEATURED EPISODE
============================================================ */

.featured-episode {
  background: var(--color-primary);
  padding: var(--space-2xl) var(--space-xl);
  color: var(--color-text-white);
}

.featured-episode__label {
  display: block;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary-light);
  margin-bottom: var(--space-lg);
}

.featured-episode__grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-2xl);
  align-items: center;
  margin-bottom: var(--space-xl);
}

.featured-episode__ep-meta {
  font-size: var(--font-size-caption);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-sm-plus);
}

.featured-episode__title {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-h2);
  letter-spacing: var(--letter-spacing-h2);
  color: var(--color-text-white);
  margin-bottom: var(--space-md);
}

.featured-episode__excerpt {
  font-size: var(--font-size-body);
  color: rgba(255, 255, 255, 0.9);
  line-height: var(--line-height-body);
  margin-bottom: var(--space-lg);
  max-width: var(--max-width-text);
}

.featured-episode__guest-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: var(--space-xs);
}

.featured-episode__guest-name {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-white);
}

.featured-episode__guest-title {
  font-size: var(--font-size-secondary);
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}

.featured-episode__cover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  aspect-ratio: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-episode__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-episode__cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.4);
}

/* Afspiller */
.featured-episode__player {
  border-top: 0.5px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--space-lg);
}

.featured-episode__progress-bg {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  height: 4px;
  margin-bottom: var(--space-md);
  cursor: pointer;
  position: relative;
}

.featured-episode__progress-fill {
  background: var(--color-accent);
  height: 4px;
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width var(--duration-fast) linear;
  pointer-events: none;
}

.featured-episode__controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm-plus);
}

/* Featured-knapper: farveoverride til grøn baggrund */
.featured-episode__btn-play {
  background: var(--color-text-white);
  color: var(--color-primary);
  border-color: transparent;
}

.featured-episode__btn-play:hover {
  background: var(--color-text-white);
  opacity: 0.9;
}

.featured-episode__btn-info {
  border-color: rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--color-text-white);
}

.featured-episode__btn-info:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.featured-episode__time {
  margin-left: auto;
  font-size: var(--font-size-caption);
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
}

/* Om episoden — accordion i featured */
.featured-episode__accordion {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-enter) var(--easing-out);
}

.featured-episode__accordion.is-open {
  max-height: 500px;
}

.featured-episode__accordion-inner {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  margin-top: var(--space-lg);
  padding: var(--space-xl);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
}

.featured-episode__accordion-heading {
  font-size: var(--font-size-caption);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-disabled);
  margin-bottom: var(--space-sm-plus);
}

.featured-episode__accordion-text {
  font-size: var(--font-size-secondary);
  color: var(--color-text-secondary);
  line-height: var(--line-height-body);
}

.featured-episode__accordion-text p { margin-bottom: var(--space-sm); }
.featured-episode__accordion-text p:last-child { margin-bottom: 0; }

.featured-guest-card {
  background: var(--color-bg-inactive);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.featured-guest-card + .featured-guest-card {
  margin-top: var(--space-sm);
}

.featured-guest-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-section);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-disabled);
}

.featured-guest-card__name {
  font-size: var(--font-size-secondary);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.featured-guest-card__title {
  font-size: var(--font-size-caption);
  color: var(--color-text-disabled);
  margin-top: 2px;
}

/* ============================================================
   3. EPISODELISTE
============================================================ */

.episode-list {
  background: var(--color-bg-card);
  padding: var(--space-2xl) var(--space-xl);
}

.episode-list__h2 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-h3);
  letter-spacing: var(--letter-spacing-h3);
  margin-bottom: var(--space-xs);
}

.episode-list__sub {
  font-size: var(--font-size-secondary);
  color: var(--color-text-disabled);
  margin-bottom: var(--space-xl);
}

.episode-row {
  border-top: var(--card-border);
}

.episode-row__header {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md) 0;
  cursor: pointer;
}

.episode-row__num {
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  opacity: 0.6;
}

.episode-row__title {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: 3px;
}

.episode-row__meta {
  font-size: var(--font-size-label);
  color: var(--color-text-disabled);
}

/* Episode-liste knapper: ingen overrides nødvendige — btn--primary/btn--secondary klarer det */
.episode-row__btn-info:hover { background: var(--color-bg-inactive); }

.episode-row__btn-info .chevron {
  display: inline-block;
  transition: transform var(--duration-base) var(--easing-out);
}

.episode-row.is-open .episode-row__btn-info .chevron {
  transform: rotate(180deg);
}

/* Mini-afspiller — vises når episoden spiller */
.episode-row__player {
  display: none;
  padding: 0 0 var(--space-md) 60px;
  align-items: center;
  gap: var(--space-md);
}

.episode-row.is-playing .episode-row__player {
  display: flex;
}

.episode-row__progress-bg {
  flex: 1;
  background: var(--color-bg-inactive);
  border-radius: var(--radius-pill);
  height: 4px;
  cursor: pointer;
  position: relative;
}

.episode-row__progress-fill {
  background: var(--color-primary);
  height: 4px;
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width var(--duration-fast) linear;
  pointer-events: none;
}

.episode-row__player-time {
  font-size: var(--font-size-caption);
  color: var(--color-text-disabled);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Accordion */
.episode-row__accordion {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-enter) var(--easing-out);
}

.episode-row.is-open .episode-row__accordion {
  max-height: 400px;
}

.episode-row__accordion-inner {
  padding: 0 0 var(--space-lg) 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.episode-accordion__label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-disabled);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-medium);
}

.episode-accordion__text {
  font-size: var(--font-size-secondary);
  color: var(--color-text-secondary);
  line-height: var(--line-height-body);
}

.episode-accordion__text p { margin-bottom: var(--space-sm); }
.episode-accordion__text p:last-child { margin-bottom: 0; }

.episode-guest-card {
  background: var(--color-bg-inactive);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.episode-guest-card + .episode-guest-card {
  margin-top: var(--space-sm);
}

.episode-guest-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-section);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-disabled);
}

.episode-guest-card__name {
  font-size: var(--font-size-secondary);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.episode-guest-card__title {
  font-size: var(--font-size-caption);
  color: var(--color-text-disabled);
  margin-top: 2px;
}

/* ============================================================
   4. NEWSLETTER
============================================================ */

.podcast-newsletter {
  background: var(--color-bg-inactive);
  padding: var(--space-3xl) var(--space-xl);
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-2xl);
  align-items: center;
}

.podcast-newsletter__label {
  display: block;
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.podcast-newsletter__h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-h2);
  letter-spacing: var(--letter-spacing-h2);
  margin: 0 0 var(--space-md) 0;
  max-width: 640px;
}

.podcast-newsletter__text {
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0 0 var(--space-xl) 0;
  line-height: var(--line-height-body);
}

.podcast-newsletter__form {
  display: flex;
  gap: var(--space-sm);
  max-width: 440px;
}

/* Dekorativ lydbølge */
.podcast-newsletter__wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 220px;
}

.podcast-newsletter__wave span {
  flex: 1 1 0;
  max-width: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  opacity: 0.85;
  transform-origin: center;
  animation: podcast-wave 2.8s ease-in-out infinite alternate;
}

.podcast-newsletter__wave span:nth-child(1),
.podcast-newsletter__wave span:nth-last-child(1) { height: 14%; }
.podcast-newsletter__wave span:nth-child(2),
.podcast-newsletter__wave span:nth-last-child(2) { height: 30%; }
.podcast-newsletter__wave span:nth-child(3),
.podcast-newsletter__wave span:nth-last-child(3) { height: 22%; }
.podcast-newsletter__wave span:nth-child(4),
.podcast-newsletter__wave span:nth-last-child(4) { height: 46%; }
.podcast-newsletter__wave span:nth-child(5),
.podcast-newsletter__wave span:nth-last-child(5) { height: 34%; }
.podcast-newsletter__wave span:nth-child(6),
.podcast-newsletter__wave span:nth-last-child(6) { height: 62%; }
.podcast-newsletter__wave span:nth-child(7),
.podcast-newsletter__wave span:nth-last-child(7) { height: 44%; }
.podcast-newsletter__wave span:nth-child(8),
.podcast-newsletter__wave span:nth-last-child(8) { height: 78%; }
.podcast-newsletter__wave span:nth-child(9),
.podcast-newsletter__wave span:nth-last-child(9) { height: 56%; }
.podcast-newsletter__wave span:nth-child(10),
.podcast-newsletter__wave span:nth-last-child(10) { height: 90%; }
.podcast-newsletter__wave span:nth-child(11) { height: 100%; }

/* Accentbars i orange */
.podcast-newsletter__wave span:nth-child(8),
.podcast-newsletter__wave span:nth-child(11),
.podcast-newsletter__wave span:nth-child(14) {
  background: var(--color-accent);
}

/* Forskudt puls */
.podcast-newsletter__wave span:nth-child(3n)   { animation-delay: -0.9s; }
.podcast-newsletter__wave span:nth-child(3n+1) { animation-delay: -1.8s; }
.podcast-newsletter__wave span:nth-child(4n)   { animation-duration: 3.4s; }

@keyframes podcast-wave {
  from { transform: scaleY(0.55); }
  to   { transform: scaleY(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .podcast-newsletter__wave span {
    animation: none;
  }
}

.podcast-newsletter__input {
  flex: 1;
  border: var(--input-border);
  border-radius: var(--input-radius);
  padding: var(--input-padding);
  height: var(--btn-height-lg);
  font-size: var(--font-size-body);
  font-family: var(--font-family);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color var(--duration-base);
}

.podcast-newsletter__input:focus {
  border-color: var(--color-primary);
}

.podcast-newsletter__submit {
  background: var(--color-primary);
  color: var(--color-text-white);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-lg);
  height: var(--btn-height-lg);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  letter-spacing: var(--letter-spacing-button);
  transition: background var(--duration-base) var(--easing-out);
}

.podcast-newsletter__submit:hover { background: var(--color-primary-hover); }
.podcast-newsletter__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.podcast-newsletter__feedback {
  margin-top: var(--space-md);
  font-size: var(--font-size-secondary);
  color: var(--color-primary);
  min-height: 20px;
}

.podcast-newsletter__feedback--error {
  color: var(--color-danger);
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1024px) {
  .podcast-hero__body {
    grid-template-columns: 1fr;
  }

  .podcast-hero__text {
    padding-top: 0;
  }

  /* Matcher base.css h1-skala — klassen overstyrer ellers element-reglen */
  .podcast-hero__heading {
    font-size: 42px;
  }

  .featured-episode__title,
  .podcast-newsletter__h2 {
    font-size: 32px;
  }

  .podcast-newsletter {
    grid-template-columns: 1fr;
  }

  .podcast-newsletter__wave {
    height: 120px;
    margin-top: var(--space-lg);
    gap: 5px;
  }
}

@media (max-width: 767px) {
  .featured-episode__grid {
    grid-template-columns: 1fr;
  }

  /* Cover i fuld bredde øverst */
  .featured-episode__cover {
    order: -1;
  }

  .featured-episode__accordion-inner,
  .episode-row__accordion-inner {
    grid-template-columns: 1fr;
  }

  .episode-row__accordion-inner,
  .episode-row__player {
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .podcast-hero__image img {
    height: 240px;
  }

  .podcast-hero__heading {
    font-size: 36px;
  }

  /* Nummer + titel på første række, knapper på egen række under */
  .episode-row__header {
    grid-template-columns: 44px auto auto 1fr;
    row-gap: var(--space-sm);
  }

  .episode-row__header > div:nth-child(2) {
    grid-column: 2 / -1;
    grid-row: 1;
  }

  .episode-row__btn-play {
    grid-column: 2;
    grid-row: 2;
  }

  .episode-row__btn-info {
    grid-column: 3;
    grid-row: 2;
  }

  .podcast-newsletter__form {
    flex-direction: column;
  }

  /* flex: 1 fra raekkelayoutet maa ikke styre hoejden i kolonne-tilstand */
  .podcast-newsletter__input {
    flex: 0 0 auto;
  }

  .podcast-newsletter__submit {
    justify-content: center;
  }
}
