@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;600&display=swap');

/* ── Variables ─────────────────────────── */
:root {
  --pink:         #D4537E;
  --pink-dark:    #993556;
  --pink-light:   #FBEAF0;
  --pink-border:  #ED93B1;
  --gray-bg:      #F1EFE8;
  --border:       #D3D1C7;
  --text-primary:   #2C2C2A;
  --text-secondary: #5F5E5A;
  --text-muted:     #888780;
  --radius:       8px;
}

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

body {
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: #FAFAF8;
}

a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--pink-dark); }

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

/* ── Layout ────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .page-grid { grid-template-columns: 1fr; }
}

/* ── Header ────────────────────────────── */
.site-header {
  background: white;
  border-bottom: 0.5px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}
.logo:hover { color: var(--pink); }

.nav a {
  color: var(--text-secondary);
  font-size: 14px;
  margin-left: 20px;
}
.nav a:hover { color: var(--pink); }

/* ── Footer ────────────────────────────── */
.site-footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 0.5px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Breadcrumb ────────────────────────── */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 0;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb span { margin: 0 6px; }

/* ── Hero (Index) ──────────────────────── */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}
.hero h1 { font-size: 28px; font-weight: 600; }
.hero-sub {
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 8px;
}

.search-box {
  max-width: 500px;
  margin: 20px auto 0;
}
.search-box input {
  width: 100%;
  padding: 10px 16px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.search-box input:focus {
  border-color: var(--pink-border);
  box-shadow: 0 0 0 3px var(--pink-light);
}

/* ── Section ───────────────────────────── */
.section {
  margin-top: 40px;
}
.section h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* ── Artist Grid ───────────────────────── */
.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.artist-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.15s;
}
.artist-card:hover {
  border-color: var(--pink-border);
}

.artist-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--pink);
  margin-bottom: 10px;
}
.artist-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-card-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.artist-card-count {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Artist Hero ───────────────────────── */
.artist-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
}

.artist-avatar-lg {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: var(--pink);
  flex-shrink: 0;
}
.artist-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-info h1 { font-size: 24px; font-weight: 600; }
.artist-info .meta { color: var(--text-secondary); font-size: 14px; }

/* ── Album Section ─────────────────────── */
.album-section {
  margin-bottom: 32px;
}
.album-title {
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  background: var(--gray-bg);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

/* ── Track List ────────────────────────── */
.track-list {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
  transition: background 0.1s;
}
.track-row:last-child { border-bottom: none; }
.track-row:hover { background: var(--pink-light); }

.track-num {
  width: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

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

.track-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-name:hover { color: var(--pink); }

.track-artist {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.track-duration {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dl-btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--pink);
  font-size: 14px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.dl-btn-sm:hover {
  background: var(--pink);
  color: white;
}

/* ── Song Card ─────────────────────────── */
.song-card {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.song-header {
  display: flex;
  gap: 20px;
  align-items: center;
}

.song-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--pink);
  flex-shrink: 0;
}

.song-info h1 { font-size: 22px; font-weight: 500; }
.song-info .artist-link { font-size: 15px; margin-top: 4px; }
.song-meta { margin-top: 8px; display: flex; gap: 10px; align-items: center; }

/* ── Badge ─────────────────────────────── */
.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gray-bg);
  color: var(--text-secondary);
}

.badge-sm {
  font-size: 10px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
}

.meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Download Box ──────────────────────── */
.download-box {
  background: linear-gradient(135deg, #fff 0%, var(--pink-light) 100%);
  border: 1px solid var(--pink-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-top: 20px;
  text-align: center;
}
.download-box h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.dl-btn.primary {
  display: inline-block;
  background: var(--pink);
  color: white;
  border: none;
  padding: 14px 40px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(212, 83, 126, 0.25);
}
.dl-btn.primary:hover {
  background: var(--pink-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(212, 83, 126, 0.35);
}

.badge-sm {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

.dl-file-info {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.audio-preview {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--pink-border);
}
.audio-preview h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text-secondary);
}
.audio-preview audio {
  width: 100%;
  max-width: 360px;
  height: 40px;
  border-radius: 20px;
}

.dl-note {
  margin-top: 14px;
  font-size: 13px;
  color: #4a8c3f;
}

.dl-alternatives {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--pink-border);
  text-align: left;
}
.dl-alternatives h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text-secondary);
}
.dl-alternatives ul {
  list-style: none;
  padding: 0;
}
.dl-alternatives li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s;
  border-bottom: 0.5px solid var(--border);
}
.dl-alternatives li:last-child {
  border-bottom: none;
}
.dl-alternatives li:hover {
  background: rgba(255,255,255,0.6);
}
.dl-alternatives li a {
  color: var(--pink);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}
.dl-alternatives li a:hover {
  text-decoration: underline;
}
.dl-alternatives li .meta {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* ── How To ────────────────────────────── */
.how-to {
  background: var(--gray-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 20px;
}
.how-to h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 10px;
}
.how-to ol {
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.how-to li { margin-bottom: 6px; }

/* ── Sidebar ───────────────────────────── */
.sidebar-card {
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.sidebar-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
}

/* ── Info Table ─────────────────────────── */
.info-table {
  width: 100%;
  font-size: 13px;
}
.info-table td {
  padding: 4px 0;
  vertical-align: top;
}
.info-table td:first-child {
  color: var(--text-muted);
  width: 80px;
}

/* ── Related List ──────────────────────── */
.related-list {
  list-style: none;
}
.related-list li { border-bottom: 0.5px solid var(--border); }
.related-list li:last-child { border-bottom: none; }
.related-list a {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: var(--text-primary);
  font-size: 13px;
}
.related-list a:hover { color: var(--pink); }
.r-duration { color: var(--text-muted); }

.see-all {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
}

/* ── Artist List Small (Sidebar) ───────── */
.artist-list-sm {
  list-style: none;
}
.artist-list-sm li {
  margin-bottom: 10px;
}
.artist-list-sm a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}
.artist-list-sm a:hover { color: var(--pink); }

.artist-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--pink);
  flex-shrink: 0;
}
.artist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ra-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.ra-count {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Section Header ───────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.section-header h1,
.section-header h2 {
  margin-bottom: 0;
}
.section-header .see-all {
  font-size: 14px;
  color: var(--pink);
  text-decoration: none;
  white-space: nowrap;
}
.section-header .see-all:hover {
  text-decoration: underline;
}

/* ── Pagination ───────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  text-decoration: none;
  color: var(--pink);
  border: 1px solid var(--pink-border);
  transition: background 0.15s;
}
.page-btn:hover {
  background: var(--pink-light);
}
.page-btn.disabled {
  color: var(--text-muted);
  border-color: var(--border);
  cursor: default;
  pointer-events: none;
}
.page-numbers {
  display: flex;
  gap: 4px;
  align-items: center;
}
.page-num {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 14px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.page-num:hover {
  background: var(--pink-light);
  color: var(--pink);
}
.page-num.active {
  background: var(--pink);
  color: white;
  font-weight: 500;
}
.page-dots {
  display: inline-flex;
  width: 36px;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}
