/* sauropod.css — Sauropod audio player
 * -----------------------------------------------------------------------
 * All visual tokens are CSS custom properties scoped to .sauropod.
 * Override any of them on .sauropod (or a wrapper) to retheme:
 *
 *   .sauropod {
 *     --sauropod-bg:         #1a1a1a;
 *     --sauropod-accent:     #e63946;
 *   }
 *
 * Or target individual classes directly — .sauropod-btn, .sauropod-track,
 * etc. — with higher specificity selectors from your own stylesheet.
 * ----------------------------------------------------------------------- */

.sauropod {
  /* --- Tokens --- */
  --sauropod-bg:          #ffffff;
  --sauropod-border:      #d4cfc9;
  --sauropod-accent:      #8fae46;
  --sauropod-accent-dark: #567117;
  --sauropod-text:        #66595c;
  --sauropod-text-muted:  #94908a;
  --sauropod-btn-bg:      #f2f0ed;
  --sauropod-btn-color:   #66595c;

  /* --- Layout --- */
  display:       grid;
  grid-template-columns: auto 1fr;
  grid-template-rows:    auto auto auto;
  grid-template-areas:
    "art  info"
    "ctrl ctrl"
    "list list";
  gap:           0.5rem;

  /* --- Appearance --- */
  background:    var(--sauropod-bg);
  border:        1px solid var(--sauropod-border);
  border-radius: 4px;
  padding:       0.75rem;
  font-family:   "Helvetica Neue", Helvetica, Arial, freesans, clean, sans-serif;
  font-size:     0.9rem;
  color:         var(--sauropod-text);
  max-width:     480px;
}

/* --- Art --- */
.sauropod-art-wrap {
  grid-area:   art;
  width:       80px;
  height:      80px;
  flex-shrink: 0;
  background:  #e0e0e0;
  border-radius: 2px;
}

.sauropod-art {
  width:         100%;
  height:        100%;
  object-fit:    cover;
  border-radius: 2px;
  display:       block;
}

/* --- Info --- */
.sauropod-info {
  grid-area:  info;
  align-self: center;
  overflow:   hidden;
}

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

.sauropod-artist,
.sauropod-collection {
  color:         var(--sauropod-text-muted);
  font-size:     0.8rem;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}

/* --- Controls --- */
.sauropod-controls {
  grid-area:   ctrl;
  display:     flex;
  align-items: center;
  gap:         0.4rem;
}

.sauropod-btn {
  background:    var(--sauropod-btn-bg);
  color:         var(--sauropod-btn-color);
  border:        1px solid var(--sauropod-border);
  border-radius: 3px;
  padding:       0.3rem 0.6rem;
  cursor:        pointer;
  font-size:     1rem;
  line-height:   1;
  flex-shrink:   0;
  transition:    background 0.15s, color 0.15s, border-color 0.15s;
}

.sauropod-btn:hover {
  background:   var(--sauropod-accent);
  color:        #fff;
  border-color: var(--sauropod-accent);
}

.sauropod-progress-wrap {
  flex:     1;
  display:  flex;
  position: relative;
  align-items: center;
}

.sauropod-buffer {
  position:      absolute;
  left:          0;
  width:         0%;
  height:        4px;
  background:    var(--sauropod-border);
  border-radius: 2px;
  pointer-events: none;
}

.sauropod-progress {
  width:        100%;
  cursor:       pointer;
  accent-color: var(--sauropod-accent);
  position:     relative;
}

.sauropod-time {
  color:       var(--sauropod-text-muted);
  font-size:   0.78rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- Track list --- */
.sauropod-tracklist-wrap {
  grid-area: list;
}

.sauropod-tracklist {
  list-style:   decimal;
  padding-left: 1.4rem;
  margin:       0;
  overflow-y:      auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sauropod-border) transparent;
}

.sauropod-tracklist::-webkit-scrollbar {
  width: 6px;
}

.sauropod-tracklist::-webkit-scrollbar-track {
  background: transparent;
}

.sauropod-tracklist::-webkit-scrollbar-thumb {
  background:    var(--sauropod-border);
  border-radius: 3px;
}

.sauropod-track {
  padding:       0.2rem 0.25rem;
  cursor:        pointer;
  border-radius: 2px;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  transition:    background 0.1s;
}

.sauropod-track:hover {
  background: var(--sauropod-btn-bg);
}

.sauropod-track-active {
  color:       var(--sauropod-accent-dark);
  font-weight: 600;
}

/* --- Error states --- */
.sauropod-error {
  color:     #c00;
  font-size: 0.85rem;
  padding:   0.5rem;
}

.sauropod-audio-error {
  color:       var(--sauropod-text-muted);
  font-size:   0.8rem;
  font-style:  italic;
  align-self:  center;
}

.sauropod-btn:disabled {
  opacity: 0.35;
  cursor:  not-allowed;
}
