/* ============================================================
   iTunes Playlist Site — Magazine Dark Theme
   style.css — shared across all pages
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@400;500;600&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */

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

:root {
  --bg:           #111111;
  --bg-card:      #1a1a1a;
  --bg-card-hover:#202020;
  --text:         #f0f0f0;
  --text-muted:   #888888;
  --text-dim:     #555555;
  --accent:       #e8b84b;
  --accent-glow:  rgba(232, 184, 75, 0.25);
  --border:       #2a2a2a;
  --border-hover: #3a3a3a;
  --radius:       6px;
  --radius-lg:    10px;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --transition:   0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

/* ── Site Header / Nav ────────────────────────────────────── */

.site-header {
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  height: 52px;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-logo a { color: inherit; }
.site-logo a:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-shrink: 0;
}

.site-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--transition);
}

.site-nav a:hover,
.site-nav a.active { color: var(--accent); text-decoration: none; }

/* ── Hero Banner (Landing Page) ───────────────────────────── */

.hero {
  background: linear-gradient(180deg, #0a0a0a 0%, #111 60%, var(--bg) 100%);
  text-align: center;
  padding: 4rem 2rem 3rem;
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.hero-title span { color: var(--accent); }

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 400;
}

.hero-stats {
  display: inline-flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.hero-stats span { color: var(--accent); }

/* ── Page Header (Playlist Pages) ────────────────────────── */

.page-header {
  background: linear-gradient(180deg, #0a0a0a 0%, var(--bg) 100%);
  padding: 2.5rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
}

.page-header-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.page-header-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.page-header-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.page-header-meta span { color: var(--text-dim); margin: 0 0.4em; }

/* ── Main Content Area ────────────────────────────────────── */

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── Section Dividers ─────────────────────────────────────── */

.section-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Landing Page: Playlist Card Grid ────────────────────── */

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (max-width: 900px) { .playlist-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .playlist-grid { grid-template-columns: 1fr; } }

.playlist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.playlist-card:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  text-decoration: none;
}

.playlist-card a {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

/* Playlist card: name header */
.card-header {
  padding: 1rem 1rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.card-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

/* Art cloud: wrapping mosaic of album art thumbnails */
.art-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 0.6rem 0.75rem 0.5rem;
  min-height: 54px;
  align-content: flex-start;
}

.cloud-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.cloud-placeholder {
  width: 44px;
  height: 44px;
  background: #222;
  border-radius: 3px;
}

.playlist-card-footer {
  padding: 0.65rem 1rem 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-track-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-year-range {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Playlist Page: Track Grid ────────────────────────────── */

.track-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (max-width: 900px) { .track-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .track-grid { grid-template-columns: 1fr; } }

.track-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.track-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.track-art-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #222;
  overflow: hidden;
}

.track-art-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-number-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(0,0,0,0.72);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.track-info {
  padding: 0.7rem 0.85rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.track-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.track-artist {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.track-original {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-style: italic;
}

.track-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.track-links {
  padding: 0 0.85rem 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.track-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  border: 1px solid var(--border-hover);
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition),
              background var(--transition);
}

.track-link-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Review pills — gold background, stand out from database links */
.track-link-pill.pill-review {
  background: var(--accent);
  color: #1a1209;
  border-color: var(--accent);
}

.track-link-pill.pill-review:hover {
  background: #f2d07c;
  border-color: #f2d07c;
  color: #1a1209;
}

/* Favicon icon inside pill */
.pill-favicon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

/* ── Search Page ──────────────────────────────────────────── */

.search-bar-wrap {
  max-width: 640px;
  margin: 2rem auto 0;
  position: relative;
}

.search-bar-wrap input[type="search"] {
  width: 100%;
  padding: 0.9rem 1.1rem 0.9rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.search-bar-wrap input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.search-results {
  margin-top: 2rem;
  padding-left: 2rem;
}

.search-result-group {
  margin-bottom: 2rem;
}

.search-result-track {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.search-result-artist {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.search-result-playlists {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-result-playlist-pill {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}

.search-result-playlist-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.search-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 3rem;
  font-style: italic;
}

/* Search result track rows */
.search-track {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.4rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.st-title  { color: var(--text); font-weight: 600; }
.st-sep    { color: var(--text-dim); }
.st-artist { color: var(--accent); }
.st-orig   { font-size: 0.78rem; font-style: italic; color: var(--text-muted); }
.st-year   { font-size: 0.75rem; color: var(--text-dim); margin-left: auto; }

.search-group { margin-bottom: 2.5rem; }
.search-group-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.search-group-title a { color: inherit; text-decoration: none; }
.search-group-title a:hover { color: var(--accent); }
.search-group-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: auto;
}

.search-result-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4rem;
}

/* ── Utilities ────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
