/*
 * VORDEM – Songintegration
 * Leitstück auf /hoeren und hörbarer Zugang auf der Startseite.
 */

.home-song {
  width: min(calc(100% - 2rem), var(--max, 1180px));
  margin-inline: auto;
  padding: clamp(4.5rem, 9vw, 8rem) 0;
  border-top: 1px solid var(--line, #c9c0b2);
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 3fr);
  gap: clamp(2rem, 7vw, 8rem);
}

.home-song-meta p:last-child {
  margin: 0;
  color: var(--muted, #6c675f);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.home-song-content h2 {
  max-width: 1000px;
  margin: 0;
  font-family: var(--font-condensed, "Arial Narrow", "Helvetica Neue", Arial, sans-serif);
  font-size: clamp(3rem, 8vw, 7.75rem);
  line-height: .9;
  letter-spacing: -.055em;
  text-transform: uppercase;
  text-wrap: balance;
}

.home-song-content > p {
  max-width: 620px;
  margin: 2rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
}

.home-song-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-top: clamp(2.5rem, 6vw, 5rem);
  padding: 1.1rem 0;
  border-top: 1px solid var(--ink, #11100e);
  border-bottom: 1px solid var(--ink, #11100e);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-decoration: none;
  text-transform: uppercase;
}

.song-page {
  width: min(calc(100% - 2rem), var(--max, 1180px));
  margin-inline: auto;
}

.is-follow-page main:has(.song-page) {
  width: 100%;
  max-width: none;
  padding-top: 0;
  padding-bottom: 0;
}

.song-hero {
  min-height: min(760px, calc(100svh - 110px));
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(4rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 3fr);
  gap: clamp(2rem, 7vw, 8rem);
  align-items: end;
}

.song-hero-meta {
  align-self: start;
}

.song-duration-label {
  margin: 0;
  color: var(--muted, #6c675f);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.song-hero-main h1 {
  margin: 0;
  font-family: var(--font-condensed, "Arial Narrow", "Helvetica Neue", Arial, sans-serif);
  font-size: clamp(5rem, 17vw, 14rem);
  line-height: .72;
  letter-spacing: -.08em;
  text-transform: uppercase;
}

.song-subtitle {
  max-width: 760px;
  margin: clamp(2rem, 5vw, 4rem) 0 0;
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  line-height: 1.35;
}

.song-threshold,
.song-after,
.song-context {
  padding: clamp(5rem, 10vw, 9rem) 0;
  border-top: 1px solid var(--line, #c9c0b2);
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 3fr);
  gap: clamp(2rem, 7vw, 8rem);
}

.song-threshold > :not(.section-label),
.song-after > :not(.section-label),
.song-context > :not(.section-label) {
  grid-column: 2;
}

.song-threshold h2,
.song-after h2,
.song-context h2 {
  max-width: 1000px;
  margin: 0;
  font-family: var(--font-condensed, "Arial Narrow", "Helvetica Neue", Arial, sans-serif);
  font-size: clamp(3rem, 7.5vw, 7rem);
  line-height: .92;
  letter-spacing: -.05em;
  text-transform: uppercase;
  text-wrap: balance;
}

.song-threshold-text {
  max-width: 680px;
  margin-top: 2rem;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.song-listen {
  padding: 0 0 clamp(5rem, 10vw, 9rem);
}

.song-player {
  background: var(--ink, #11100e);
  color: var(--paper, #f4efe5);
  padding: clamp(1.5rem, 5vw, 4.5rem);
}

.song-play {
  width: 100%;
  min-height: clamp(150px, 28vw, 300px);
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  font-family: var(--font-condensed, "Arial Narrow", "Helvetica Neue", Arial, sans-serif);
  font-size: clamp(2.9rem, 9vw, 8.5rem);
  font-weight: 800;
  line-height: .88;
  letter-spacing: -.05em;
  text-align: left;
  text-transform: uppercase;
}

.song-play-icon {
  flex: 0 0 auto;
  font-family: var(--font-sans, "Helvetica Neue", Arial, sans-serif);
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: 0;
}

.song-progress-wrap {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) 55px;
  gap: 1rem;
  align-items: center;
  padding-top: 1.25rem;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

.song-progress {
  --song-progress: 0%;
  width: 100%;
  height: 2px;
  margin: 0;
  appearance: none;
  border: 0;
  background: linear-gradient(
    to right,
    currentColor 0,
    currentColor var(--song-progress),
    rgba(244, 239, 229, .28) var(--song-progress),
    rgba(244, 239, 229, .28) 100%
  );
  cursor: pointer;
}

.song-progress::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--ink, #11100e);
}

.song-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--ink, #11100e);
}

.song-player-missing {
  min-height: 280px;
  display: grid;
  align-content: center;
}

.song-player-missing p {
  max-width: 680px;
}

.song-missing-title {
  margin: 0 0 1rem;
  font-family: var(--font-condensed, "Arial Narrow", "Helvetica Neue", Arial, sans-serif);
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: .9;
}

.song-player-missing code {
  overflow-wrap: anywhere;
}

.song-lyrics {
  border-top: 1px solid var(--ink, #11100e);
  border-bottom: 1px solid var(--ink, #11100e);
}

.song-lyrics summary {
  padding: 1.3rem 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.song-lyrics summary::-webkit-details-marker {
  display: none;
}

.song-lyrics[open] summary span:last-child {
  transform: rotate(45deg);
}

.song-lyrics-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) 0;
  display: flex;
  flex-direction: column;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  line-height: 1.35;
}

.lyrics-line,
.lyrics-cue {
  display: block;
}

.lyrics-cue {
  margin: 2.5rem 0 .8rem;
  color: var(--muted, #6c675f);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.lyrics-gap {
  min-height: 1.1em;
}

.song-context-text {
  margin: 2.5rem 0 0;
}

.song-connections {
  grid-column: 2;
  margin-top: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--ink, #11100e);
}

.song-connections a {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line, #c9c0b2);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .home-song,
  .song-hero,
  .song-threshold,
  .song-after,
  .song-context {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .home-song-content,
  .song-hero-main,
  .song-threshold > :not(.section-label),
  .song-after > :not(.section-label),
  .song-context > :not(.section-label),
  .song-connections {
    grid-column: 1;
  }

  .song-hero {
    min-height: 0;
    padding-top: 4rem;
  }

  .song-hero-main h1 {
    font-size: clamp(5rem, 28vw, 9rem);
  }

  .song-play {
    min-height: 190px;
    align-items: flex-end;
  }

  .song-progress-wrap {
    grid-template-columns: 45px minmax(0, 1fr) 45px;
    gap: .7rem;
  }

  .song-lyrics-inner {
    margin: 0;
  }
}

@media (max-width: 390px) {
  .home-song,
  .song-page {
    width: min(calc(100% - 1.25rem), var(--max, 1180px));
  }

  .song-play {
    flex-direction: column-reverse;
    align-items: flex-start;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .song-lyrics summary span:last-child {
    transition: none;
  }
}

/*
 * iPhone/Safari player correction
 * Uses CSS shapes instead of Unicode play/pause glyphs. This avoids
 * emoji/icon substitution and keeps the complete button visible.
 */
.song-play {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: initial;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3rem);
}

.song-play-symbol {
  position: relative;
  width: clamp(70px, 9vw, 126px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.song-play-triangle {
  width: 0;
  height: 0;
  margin-left: 7%;
  border-top: clamp(10px, 1.25vw, 18px) solid transparent;
  border-bottom: clamp(10px, 1.25vw, 18px) solid transparent;
  border-left: clamp(16px, 2vw, 27px) solid currentColor;
}

.song-pause-bars {
  display: none;
  width: 32%;
  height: 34%;
  border-left: clamp(4px, .48vw, 7px) solid currentColor;
  border-right: clamp(4px, .48vw, 7px) solid currentColor;
}

.song-player.is-playing .song-play-triangle {
  display: none;
}

.song-player.is-playing .song-pause-bars {
  display: block;
}

.song-play-copy {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

/* More reliable range control on mobile Safari */
.song-progress {
  -webkit-appearance: none;
  appearance: none;
  min-height: 28px;
  background: transparent;
}

.song-progress::-webkit-slider-runnable-track {
  width: 100%;
  height: 2px;
  border: 0;
  background: linear-gradient(
    to right,
    currentColor 0,
    currentColor var(--song-progress),
    rgba(244, 239, 229, .28) var(--song-progress),
    rgba(244, 239, 229, .28) 100%
  );
}

.song-progress::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -8px;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--ink, #11100e);
}

@media (max-width: 760px) {
  .song-player {
    padding: 1.15rem;
  }

  .song-play {
    min-height: 136px;
    padding: .75rem 0 1.15rem;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    font-size: clamp(2rem, 10vw, 3.7rem);
    line-height: .9;
  }

  .song-play-symbol {
    width: 62px;
  }

  .song-play-triangle {
    border-top-width: 9px;
    border-bottom-width: 9px;
    border-left-width: 15px;
  }

  .song-pause-bars {
    border-left-width: 4px;
    border-right-width: 4px;
  }

  .song-progress-wrap {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: .5rem;
    padding-top: .8rem;
  }
}

@media (max-width: 390px) {
  .song-play {
    /* Override the older column layout: keep symbol and label together. */
    display: grid;
    flex-direction: initial;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    justify-content: initial;
    min-height: 120px;
    gap: .85rem;
    font-size: clamp(1.8rem, 9.4vw, 2.65rem);
  }

  .song-play-symbol {
    width: 54px;
  }
}
