/* ============================================
   Music Archive — Search & Browse
   ============================================ */

/* --- Hero with mosaic background --- */
.music-hero {
  position: relative;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 2rem) 2rem 3rem;
  overflow: hidden;
}

.music-hero-bg {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, 120px);
  grid-template-rows: repeat(auto-fill, 80px);
  gap: 2px;
  opacity: 0.12;
  overflow: hidden;
  pointer-events: none;
}

.music-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  width: 100%;
}

.music-hero-content .label {
  margin-bottom: 0.75rem;
  display: block;
}

.music-hero-content h1 {
  margin-bottom: 1rem;
}

.music-hero-stats {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

/* --- Search Box --- */
.search-box {
  position: relative;
  max-width: 560px;
  margin: 0 auto 1.5rem;
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 1rem 3rem 1rem 3.2rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition);
}

.search-box input:focus {
  background: rgba(255,255,255,0.1);
  border-color: var(--text-dim);
}

.search-box input::placeholder { color: var(--text-dim); }

.search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--text-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.search-clear.visible { opacity: 1; pointer-events: all; }

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  max-width: 700px;
  margin: 0 auto;
}

.filter-btn {
  padding: 0.35rem 0.9rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid transparent;
  border-radius: 100px;
  transition: all var(--transition);
}
.filter-btn:hover { color: var(--text-muted); border-color: var(--border); }
.filter-btn.active { color: var(--text); border-color: var(--text-muted); }

.filter-sep {
  color: var(--border);
  font-size: 0.9rem;
  margin: 0 0.3rem;
}

/* --- Results bar --- */
.music-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.5rem, 4vw, 4rem);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  background: var(--bg);
  z-index: 100;
}

.music-results-bar span {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.shuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color var(--transition);
}
.shuffle-btn:hover { color: var(--text); }

/* --- Artist Grid --- */
.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  padding: 0;
}

.artist-card {
  background: var(--bg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
}

.artist-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: brightness(0.7) saturate(0.85);
}

.artist-card:hover img {
  transform: scale(1.05);
  filter: brightness(0.9) saturate(1);
}

.artist-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
  pointer-events: none;
}

.artist-card-name {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}

.artist-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.artist-card-stars {
  color: #c9a84c;
  font-size: 0.65rem;
  letter-spacing: 1px;
}

.artist-card-count {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* --- Inline Photo Results (search mode) --- */
.photo-results {
  background: var(--bg);
  padding: 0;
}

.photo-result-group {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem clamp(1rem, 3vw, 3rem);
}

.photo-result-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.3rem 0;
}

.photo-result-name {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.photo-result-stars {
  color: #c9a84c;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.photo-result-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-left: auto;
}

.photo-result-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}
.photo-result-strip::-webkit-scrollbar { display: none; }

.photo-result-item {
  flex: 0 0 auto;
  height: clamp(180px, 28vh, 320px);
  cursor: pointer;
  overflow: hidden;
}

.photo-result-item img {
  height: 100%;
  width: auto;
  display: block;
  transition: filter 0.3s ease;
  filter: brightness(0.88);
}
.photo-result-item:hover img { filter: brightness(1); }

/* No results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-dim);
  background: var(--bg);
}
.no-results h3 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-muted); }

/* --- Artist Detail View --- */
.artist-detail {
  display: none;
  min-height: 80vh;
  padding-bottom: 3rem;
}

.artist-detail.open {
  display: block;
}

.artist-detail-header {
  padding: 1.5rem clamp(1.5rem, 4vw, 4rem);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.artist-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
  flex-shrink: 0;
}
.artist-detail-back:hover { color: var(--text); }

.artist-detail-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.detail-stars {
  color: #c9a84c;
  font-size: 0.8rem;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.detail-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-left: auto;
  flex-shrink: 0;
}

/* Artist photos — NO CROPPING, natural aspect ratio */
.artist-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: clamp(1.5rem, 3vw, 3rem);
  justify-content: center;
}

.artist-photo-item {
  height: clamp(280px, 45vh, 550px);
  cursor: pointer;
  overflow: hidden;
  flex: 0 0 auto;
}

.artist-photo-item img {
  height: 100%;
  width: auto;
  display: block;
  transition: filter 0.4s ease;
  filter: brightness(0.9);
}

.artist-photo-item:hover img {
  filter: brightness(1);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .music-hero { min-height: 50vh; padding-top: calc(var(--header-h) + 1rem); }
  .music-hero-content h1 { font-size: 2rem; }
  .filter-bar { gap: 0.3rem; }
  .filter-btn { padding: 0.3rem 0.6rem; font-size: 0.6rem; }
  .artist-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .artist-card-name { font-size: 0.75rem; }
  .artist-detail-header { flex-wrap: wrap; gap: 0.8rem; }
  .artist-photos { gap: 0.5rem; padding: 1rem; }
  .artist-photo-item { height: 220px; }
  .music-results-bar { top: var(--header-h); }
}
