/* Video post layout + playlist (see assets/js/video-playlist.js) */

.video-post {
  margin-bottom: 2rem;
}

.video-post__stage {
  scroll-margin-top: 12px;
}

.video-post__player {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
}

.video-post__title {
  margin: 1.25rem 0 0.25rem;
}

.video-post__subtitle {
  margin: 0 0 0.5rem;
  color: var(--color-text-acc);
  font-weight: 500;
}

.video-post__playlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.video-post__playlist li {
  margin: 0;
  padding: 0;
}

.video-post__playlist li::before {
  content: none;
}

.video-post__item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  padding: 0.4rem;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: left;
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.video-post__item:hover {
  transform: translateY(-2px);
  border-color: var(--color-light-acc);
}

.video-post__item:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.video-post__item.is-active {
  border-color: var(--color-primary);
}

.video-post__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-acc) center / cover no-repeat;
  border-radius: 8px;
}

.video-post__label {
  font-weight: 600;
}

.video-post__item.is-active .video-post__label::before {
  content: "▶ ";
  color: var(--color-primary);
}

/* ---- Credits line */

.video-post__credits {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--color-text-acc);
}

/* ---- Sing along / Downloads buttons */

.video-post__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.video-post__action {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.video-post__action:hover {
  border-color: var(--color-light-acc);
}

.video-post__action:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.video-post__action.is-active {
  color: var(--color-primary-contrast);
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.video-post__actions[hidden],
.video-post__action[hidden],
.video-post__downloads[hidden],
.video-post__lyrics[hidden] {
  display: none;
}

.video-post__downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: -0.5rem 0 1.25rem;
}

.video-post__download {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-bg-acc);
  border-radius: 8px;
}

.video-post__download:hover {
  color: var(--color-primary);
}

/* ---- Lyrics panel */

.video-post__lyrics {
  display: flex;
  flex-direction: column;
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 12px;
}

.video-post__lyrics-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.video-post__lyrics-grip {
  display: none;
}

.video-post__lyrics-close {
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-acc);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.video-post__lyrics-close:hover {
  background: var(--color-bg-acc);
}

.video-post__lyrics-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.video-post__chords {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  background: var(--color-bg-acc);
  border-radius: 8px;
}

.video-post__chords dt {
  font-weight: 700;
}

.video-post__chords dd {
  margin: 0;
  font-family: var(--font-mono);
}

.video-post__stanza {
  margin: 0 0 1.1rem;
}

.video-post__stanza.is-chorus {
  padding-left: 0.9rem;
  font-weight: 700;
  border-left: 4px solid var(--color-primary);
}

.video-post__stanza.is-chorus::before {
  content: "Chorus";
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.video-post__chorus-ref {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Wide screens: lyrics sit beside the video, and the video area widens to fit */
@media (min-width: 900px) {
  .video-post.is-singing .video-post__stage {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
    gap: 1rem;
    width: min(1180px, 100vw - 48px);
    margin-left: 50%;
    transform: translateX(-50%);
  }

  /* Keep the panel exactly as tall as the video */
  .video-post.is-singing .video-post__lyrics {
    height: 0;
    min-height: 100%;
  }
}

/* Phones and tablets: lyrics slide up from the bottom, the video stays visible above */
@media (max-width: 899px) {
  .video-post__lyrics {
    position: fixed;
    z-index: 1000;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--video-post-sheet-height, 58vh);
    border-width: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
    animation: video-post-sheet-up 0.25s ease-out;
  }

  .video-post__lyrics-head {
    padding-top: 1.1rem;
  }

  .video-post__lyrics-grip {
    position: absolute;
    top: 0.45rem;
    left: 50%;
    display: block;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    background: var(--color-light-acc);
    border-radius: 2px;
  }

  /* Leave room so the end of the page can scroll above the sheet */
  .video-post-sheet-open body {
    padding-bottom: var(--video-post-sheet-height, 58vh);
  }
}

@keyframes video-post-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .video-post__lyrics {
    animation: none;
  }
}
