/* 2026 General Assembly — Meeting Music page
 * Reuses .video-archive-section / .video-grid shell from video-archive.css.
 */

/* Grid — match the CWM Archives dashboard (smaller cards than the video grid) */
#musicGrid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Music cards */
.music-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.music-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Thumbnail — first PDF page, cropped to the top like a sheet-music clip.
   A light frame + firm divider give a clean break to the white info area,
   the way the dashboard's dark poster edge does. */
.music-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #f4efe4;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.music-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* subtle top-edge shadow so the white sheet reads as paper, not a bleed */
.music-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 6px 14px -8px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.music-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ink);
  color: var(--gold);
  font-size: 3em;
}

.music-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Card title — site sans, ink; one line with an ellipsis */
.music-body h3 {
  font-family: var(--sans);
  color: var(--ink);
  font-size: 1.02rem;
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* File-size line — site sans, muted */
.music-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: #6f7680;
}

.music-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.music-size i {
  font-size: 0.9em;
  color: var(--gold-dark);
}

/* Action buttons — the site's .btn styles, sized to sit two-up in the card */
.music-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.music-actions .btn {
  flex: 1;
  padding: 11px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
}

.music-actions .btn i {
  margin-right: 5px;
}

/* Empty state */
.music-empty {
  text-align: center;
  color: #555;
  font-size: 1.05em;
  max-width: 520px;
  margin: 40px auto;
  line-height: 1.6;
}

.music-empty i {
  display: block;
  font-size: 2.5em;
  color: #0c3c60;
  margin-bottom: 12px;
}

/* ============ Selection (check a card → bottom bar → ZIP download) ============ */
/* Per-card checkbox: a pill in the thumbnail's top-left. Hidden by default;
   on desktop it fades in on card hover and expands to read "Select" so its
   purpose is obvious. On touch it shows as a compact box (no hover to hint on).
   Selected → gold pill with a check + "Selected". */
.music-check {
  position: absolute;
  top: 8px;
  left: 8px;
  height: 28px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  overflow: hidden;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Fixed square glyph slot — holds the checkmark (shown only when selected) */
/* Checkmark slot — collapsed to 0 until the card is selected, so the "Select"
   label can sit centered in the pill; expands to hold the check once selected. */
.music-check .music-check-box {
  flex: 0 0 0;
  width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.music-check .music-check-box i {
  opacity: 0;
}

.music-check-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  padding: 0;
  transition: max-width 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}

.music-card:hover .music-check,
.music-card.is-selected .music-check,
body.music-selecting .music-check {
  opacity: 1;
}

/* Unselected + hovered: "Select" centered in the pill (no box slot showing) */
.music-card:hover .music-check-label {
  max-width: 90px;
  opacity: 1;
  padding: 0 12px;
}

/* Touch devices (no hover): checkbox is always visible (larger sizing below) */
@media (hover: none) {
  .music-check {
    opacity: 1;
  }
}

body.music-selecting .music-card {
  cursor: pointer;
}

/* Dim the per-card actions while selecting — a card click selects, not navigates */
body.music-selecting .music-actions {
  opacity: 0.45;
}

.music-card.is-selected {
  outline: 3px solid var(--gold);
  outline-offset: -1px;
}

.music-card.is-selected .music-check {
  background: var(--gold);
  border-color: var(--gold);
}

/* Selected: expand the box to reveal the check, and shift the label right of it */
.music-card.is-selected .music-check .music-check-box {
  flex: 0 0 26px;
  width: 26px;
}

.music-card.is-selected .music-check .music-check-box i {
  opacity: 1;
}

/* Keep the label visible even without hover so "Selected" reads persistently */
.music-card.is-selected .music-check-label {
  max-width: 90px;
  opacity: 1;
  padding: 0 12px 0 2px;
}

/* Touch: a large, easy-to-tap checkbox (selected or not). Placed after the
   selected rules so it wins for both states. */
@media (hover: none) {
  .music-check {
    height: 40px;
    border-radius: 20px;
  }
  .music-check .music-check-box,
  .music-card.is-selected .music-check .music-check-box {
    flex: 0 0 40px;
    width: 40px;
    font-size: 17px;
  }
}

/* Bottom action bar */
.music-selectbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
}

/* Honor the `hidden` attribute — otherwise display:flex keeps the bar on screen */
.music-selectbar[hidden] {
  display: none;
}

.msb-count {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

.msb-actions {
  display: flex;
  gap: 10px;
}

.music-selectbar .btn {
  padding: 10px 18px;
  font-size: 0.72rem;
  border-radius: 4px;
  white-space: nowrap;
}

.msb-deselect {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid #d7dde3;
}

.msb-deselect:hover {
  background: #f3f4f6;
}

.music-selectbar .btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Keep the last card row clear of the fixed bar */
body.music-selecting {
  padding-bottom: 84px;
}

@media (max-width: 600px) {
  .music-selectbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  }
  .msb-count {
    text-align: center;
  }
  .msb-actions {
    justify-content: space-between;
  }
  .music-selectbar .btn {
    flex: 1;
    padding: 12px 8px;
  }
  body.music-selecting {
    padding-bottom: 132px;
  }
}
