/* music/styles.css — module skin for Music
 *
 * Base palette for the module. Structural rules (spacing, radius,
 * topbar/breadcrumb shells) live in shared/site.css — this file only
 * overrides palette tokens, same shape as stories/styles.css.
 *
 * Theme: the module chrome (this file's default palette, the hero
 * banner, the player bar) reads as mounted hardware — gunmetal panels,
 * a brass/amber accent, bolted edges — rather than any one genre's
 * mood. That's deliberate: this module will eventually span Latin
 * choral to synthwave, and no single genre's aesthetic should own the
 * shared chrome. Individual album pages are expected to layer their
 * own sub-variant skin on top of this later (same shape as
 * book-eatric/book-maren or story-moggruk) to carry their own vibe in
 * the content area — this file is only the sensible default until an
 * album has one.
 */
:root {
  --bg: #15161a;
  --bg-raised: #1e2025;
  --text: #ece8e0;
  --text-dim: #8a8983;
  --accent: #d99a3f;
  --accent-contrast: #15161a;
  --border: rgba(255, 255, 255, 0.09);
}

/* ---- Bolt decoration ----
 * A small drawn "flathead screw" used at the corners of panel-like
 * elements (the hero banner, album cards) to reinforce the mounted-
 * hardware read. Pure CSS, no image asset — sits absolutely inside any
 * ancestor with position:relative.
 */
.bolt {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    linear-gradient(var(--bg-raised) 0 100%) center / 60% 2px no-repeat,
    radial-gradient(circle at 35% 30%, #fff3 0%, transparent 45%),
    radial-gradient(circle at center, #4a4c52 0%, #202226 70%, #101113 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.bolt-tl { top: 10px; left: 10px; }
.bolt-tr { top: 10px; right: 10px; }
.bolt-bl { bottom: 10px; left: 10px; }
.bolt-br { bottom: 10px; right: 10px; }

/* ---- Hero banner ----
 * Hard-edged panel, not a feathered blend (contrast Stories' parchment
 * treatment) — this is meant to read as a mounted plate, not an
 * illustration floating on the page.
 */
.music-banner {
  position: relative;
  max-width: var(--content-max-width);
  margin: var(--space-5) auto 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.music-banner img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

/* ---- Landing page ---- */
.music-hub {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
  text-align: center;
}

.music-hub-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin: var(--space-5) 0 var(--space-2);
}

.music-hub-sub {
  color: var(--text-dim);
  margin: 0 0 var(--space-6);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  text-align: left;
}

.album-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.album-card:hover,
.album-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.album-card-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
  margin-bottom: var(--space-3);
}

.album-card-type {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-1);
}

.album-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 var(--space-1);
}

.album-card-meta {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---- Album page ---- */
.album {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}

.album-header {
  display: flex;
  gap: var(--space-5);
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.album-cover {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.album-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 var(--space-2);
}

.album-meta {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.album-description {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 0 var(--space-5);
}

.tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.track {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: background var(--transition-fast);
}

.track:hover,
.track:focus-visible {
  background: var(--bg-raised);
}

.track.playing {
  background: var(--bg-raised);
  color: var(--accent);
}

.track-index {
  width: 1.75rem;
  flex-shrink: 0;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.track.playing .track-index {
  color: var(--accent);
}

.track-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.tracklist-heading {
  list-style: none;
  padding: var(--space-3) var(--space-2) var(--space-1);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.tracklist-heading:first-child {
  padding-top: var(--space-2);
}

.track-main {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-weight: 600;
}

.track-gloss {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.track-duration {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ---- Player bar ---- */
.player {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-5);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.player-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.player-btn:hover,
.player-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.player-btn.play-pause {
  width: 2.75rem;
  height: 2.75rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.player-now {
  flex: 1;
  min-width: 0;
}

.player-now-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-scrubber {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.player-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.player-progress {
  flex: 1;
  accent-color: var(--accent);
}

@media (max-width: 600px) {
  .album-header {
    align-items: center;
    text-align: center;
    justify-content: center;
  }
  .album-description {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  .album-cover {
    width: 160px;
    height: 160px;
  }
  .player {
    flex-wrap: wrap;
  }
  .player-now {
    order: 3;
    flex-basis: 100%;
  }
}
