/* Discography Shared Styles — v2.0 (scholarly light)
   Used by: John Coltrane, Chris Potter discography pages.
   Consumes the site design tokens from /shared/site.css (load site.css FIRST).
   Class names/ids/data-* are UNCHANGED — the JS depends on them; only the
   visual styling changed. Light-only; the theme toggle is hidden. */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--serif);
  background: var(--paper);
  color: var(--body);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Header */
header {
  background: var(--bg);
  padding: 1.4rem 1.25rem 1.2rem;
  border-bottom: 1px solid var(--line-strong);
}
.header-content {
  max-width: var(--maxw, 960px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.header-text { text-align: center; }

h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.subtitle {
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Home link (added to the header markup) */
.disc-home {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.disc-home:hover { color: var(--accent); }

/* Theme toggle — hidden (site is light-only now) */
.theme-toggle { display: none !important; }

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

/* Controls */
.controls {
  max-width: var(--maxw, 960px);
  margin: 0 auto;
  padding: 1.1rem 1.25rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box input {
  width: 100%;
  padding: 0.55rem 0.8rem;
  font-family: var(--sans);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  font-size: 0.9rem;
}
.search-box input::placeholder { color: var(--faint); }
.search-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.filter-group { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--sans);
  padding: 0.38rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--body);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

select {
  font-family: var(--sans);
  padding: 0.45rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--body);
  font-size: 0.82rem;
  cursor: pointer;
}
select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* View toggle */
.view-toggle {
  display: flex;
  gap: 0.2rem;
  background: var(--bg);
  padding: 0.2rem;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
}
.view-btn {
  font-family: var(--sans);
  padding: 0.35rem 0.55rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
  font-size: 0.9rem;
}
.view-btn:hover { color: var(--ink); }
.view-btn.active { background: var(--accent); color: #fff; }

/* Info section (e.g. "Trane Approved") */
.info-section { max-width: var(--maxw, 960px); margin: 0 auto; padding: 0.5rem 1.25rem 0; }
.info-section summary {
  cursor: pointer;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
}
.info-section summary:hover { border-color: var(--accent); }
.info-section summary::marker { color: var(--accent); }
.info-section[open] summary { border-radius: 2px 2px 0 0; border-bottom: none; }
.info-section .info-content {
  padding: 0.9rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 2px 2px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--body);
}
.info-section .info-content p { margin-bottom: 0.6rem; }
.info-section .info-content p:last-child { margin-bottom: 0; }
.info-section .info-content em { color: var(--ink); font-style: italic; }

/* Approved / Leader badge (was a green fill) */
.badge-example,
.status-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--accent);
  background: var(--bg);
}
.status-badge { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 1; }
.card-main { position: relative; }

/* Grid */
.albums-container { max-width: var(--maxw, 960px); margin: 0 auto; padding: 1.1rem 1.25rem; }
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.albums-grid.compact { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.7rem; }
.albums-grid.list { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.albums-grid.full { grid-template-columns: 1fr; gap: 1.25rem; }

/* Album card */
.album-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.album-card:hover { border-color: var(--line-strong); background: var(--paper); }
.album-card.expanded,
.albums-grid.full .album-card { grid-column: 1 / -1; cursor: default; }

.card-main { display: flex; gap: 0.75rem; padding: 0.7rem; }
.albums-grid.full .card-main { gap: 1.25rem; padding: 1rem; }

.album-art {
  width: 78px;
  height: 78px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--paper);
  border: 1px solid var(--line);
}
.albums-grid.compact .album-art { width: 58px; height: 58px; }
.albums-grid.full .album-art { width: 150px; height: 150px; }

.album-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.album-title {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.albums-grid.compact .album-title { font-size: 0.88rem; }
.albums-grid.full .album-title { font-size: 1.2rem; white-space: normal; margin-bottom: 0.4rem; }
.album-leader { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); margin-bottom: 0.15rem; }
.album-meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.albums-grid.full .album-meta { font-size: 0.8rem; gap: 0.75rem; }

/* Label tag — uniform, restrained (all labels styled the same) */
.label-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  background: transparent;
}
.albums-grid.full .label-badge { font-size: 0.68rem; padding: 0.15rem 0.45rem; }

/* List view */
.albums-grid.list .album-card { display: flex; align-items: center; border: none; border-bottom: 1px solid var(--line); border-radius: 0; }
.albums-grid.list .album-card:hover { background: var(--paper); }
.albums-grid.list .card-main { flex: 1; padding: 0.5rem 0.4rem; }
.albums-grid.list .album-art { width: 46px; height: 46px; }
.albums-grid.list .album-title { font-size: 0.9rem; }

/* Expanded details */
.card-details { display: none; padding: 0 0.7rem 0.7rem; border-top: 1px solid var(--line); margin-top: 0.5rem; }
.album-card.expanded .card-details,
.albums-grid.full .card-details { display: block; }
.albums-grid.full .card-details { padding: 0 1rem 1rem; margin-left: calc(150px + 1.25rem); }

.detail-section { margin-top: 0.85rem; }
.detail-label {
  font-family: var(--sans);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.detail-content { font-family: var(--sans); font-size: 0.85rem; color: var(--body); line-height: 1.6; }

.track-list { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; counter-reset: track; }
.track { font-family: var(--sans); font-size: 0.78rem; color: var(--body); position: relative; padding-left: 1.25rem; }
.track::before {
  content: counter(track);
  counter-increment: track;
  position: absolute;
  left: 0;
  color: var(--faint);
  font-size: 0.68rem;
  min-width: 1rem;
  font-variant-numeric: tabular-nums;
}
.musicians-list { counter-reset: track; }

/* Transcription links */
.transcription-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.transcription-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.transcription-link:hover { border-color: var(--accent); color: var(--accent-hover); }
.transcription-credit { font-family: var(--sans); font-size: 0.65rem; color: var(--muted); font-style: italic; }

/* Link row */
.links-row { display: flex; gap: 0.5rem; margin-top: 0.85rem; flex-wrap: wrap; align-items: center; }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.link-btn:hover { border-color: var(--accent); color: var(--accent-hover); }
.link-btn.spotify { color: var(--accent); }

.copy-link-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 2px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.copy-link-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-link-btn.copied { background: var(--accent); color: #fff; border-color: var(--accent); }

/* No results */
.no-results { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.no-results h3 { font-family: var(--serif); font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--ink); }

/* Year marker (ruled divider, no gradient) */
.year-marker {
  grid-column: 1 / -1;
  padding: 0.5rem 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.year-marker::before,
.year-marker::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.75rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .albums-grid.full .card-details { margin-left: 0; padding-top: 0.75rem; }
  .albums-grid.full .album-art { width: 110px; height: 110px; }
}
@media (max-width: 600px) {
  header { padding: 1.1rem; }
  .header-content { flex-direction: column; gap: 0.5rem; }
  .disc-home { position: static; transform: none; }
  .albums-grid { grid-template-columns: 1fr; }
  .filter-group { width: 100%; }
  .albums-grid.full .card-main { flex-direction: column; align-items: center; text-align: center; }
  .albums-grid.full .album-info { align-items: center; }
  .albums-grid.full .album-meta { justify-content: center; }
}

/* Loading */
.loading { display: flex; justify-content: center; align-items: center; padding: 4rem; }
.loading::after {
  content: "";
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scroll to top */
.scroll-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 99;
}
.scroll-top.visible { opacity: 1; visibility: visible; }

/* Highlighted album (from URL) */
.album-card.highlighted { border-color: var(--accent); background: var(--paper); }

/* Skip link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.1rem;
  font-family: var(--sans);
  font-weight: 600;
  z-index: 200;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Focus */
.filter-btn:focus-visible, .view-btn:focus-visible, .scroll-top:focus-visible,
.album-card:focus-visible, .copy-link-btn:focus-visible, .read-more-btn:focus-visible,
.link-btn:focus-visible, .transcription-link:focus-visible,
.info-section summary:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: rgba(26, 68, 128, 0.15); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .loading::after { animation: none !important; }
}
