/* ============================================================
   LyricsRoad — Design Tokens
   Palette pulled straight from the brand mark: saffron-orange
   music note + forest-green winding road, set on a near-black
   "night drive" surface so the mark itself pops as the one
   warm thing on the page (Spotify/IMDb-at-night inspiration).
   ============================================================ */
:root {
  --bg:            #FFFFFF;
  --bg-elevated:   #FCF6E9;
  --bg-card:       #FFFFFF;
  --border:        #CFE6D5;

  --orange:        #F5A623;
  --orange-dim:    #D98F1E;
  --green:         #1F8A4C;
  --green-bright:  #16A34A;

  --text:          #17301F;
  --text-dim:      #4B6B57;
  --text-faint:    #8AA694;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.brand img { height: 32px; width: auto; }
.brand .lyrics { color: var(--orange); }
.brand .road { color: var(--green-bright); }

.main-nav { display: flex; gap: 20px; align-items: center; }
.main-nav a {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
  transition: color .15s ease;
}
.main-nav a:hover { color: var(--orange); }

/* Temporary mobile fix: wrap nav below the logo instead of overlapping
   it. This is not the full hamburger-menu treatment — that's scoped
   for Phase 5 (Header navigation overhaul) — just enough to stop the
   nav links from visually colliding with the brand mark on narrow
   screens in the meantime. */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; row-gap: 8px; }
  .main-nav { width: 100%; flex-wrap: wrap; gap: 14px; justify-content: flex-start; }
}

/* ---------- Hero + Search ---------- */
.hero {
  padding: 64px 0 40px;
  text-align: center;
  position: relative;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  max-width: 760px;
  margin: 0 auto 14px;
}
.hero h1 .accent { color: var(--orange); }
.hero p.subhead {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 32px;
  font-size: 16px;
}

.search-form {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 18px 56px 18px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 16px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 167, 59, 0.15);
}
.search-submit {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  width: 46px;
  border-radius: 999px;
  border: none;
  background: var(--orange);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-submit:hover { background: var(--green-bright); color: #FFFFFF; }

.autocomplete-box {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  overflow: hidden;
  z-index: 40;
  display: none;
  max-height: 420px;
  overflow-y: auto;
}
.autocomplete-box.active { display: block; }
.ac-group-label {
  padding: 8px 18px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 700;
  background: var(--bg-elevated);
}
.ac-item {
  padding: 10px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item:focus { background: var(--bg-elevated); outline: none; }
.ac-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green-bright);
}

/* ---------- Sections ---------- */
.section {
  padding: 40px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 22px; }
.section-head .eyebrow {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green-bright);
  margin-bottom: 6px;
  font-weight: 600;
}
.section-head a.see-all {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}
.section-head a.see-all:hover { color: var(--orange); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
  position: relative;
}
.card:hover { transform: translateY(-4px); border-color: var(--orange-dim); }
.card .cover {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 12px;
}
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 12px 14px 14px; }
.card .title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.card .subtitle { font-size: 12px; color: var(--text-dim); }
.card .rank-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--orange);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Artist circular cards */
.artist-card { text-align: center; background: none; border: none; }
.artist-card .cover { border-radius: 50%; }
.artist-card:hover { transform: translateY(-4px); }

/* Table-style ranked list (Top 50) */
.rank-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.rank-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: var(--bg-elevated); }
.rank-row .num { color: var(--text-faint); font-weight: 700; }
.rank-row .meta { color: var(--text-dim); font-size: 12px; }
.rank-row .score { color: var(--green-bright); font-weight: 700; font-size: 12px; }

/* ---------- A-Z bar ---------- */
.az-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.az-bar a {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  color: var(--text-dim);
}
.az-bar a:hover { border-color: var(--orange); color: var(--orange); }

/* ---------- Buttons / Pills ---------- */
.pill-group { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}
.pill.active, .pill:hover { border-color: var(--green-bright); color: var(--green-bright); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
}
.btn-primary { background: var(--orange); color: var(--text); }
.btn-primary:hover { background: var(--green-bright); color: #FFFFFF; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }

/* ---------- Platform link buttons on song page ---------- */
.platform-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.platform-links a {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.platform-links a:hover { border-color: var(--green-bright); color: var(--green-bright); }

/* ---------- Ad slots (component-based, AdSense-ready) ---------- */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
}
.ad-slot--leaderboard { min-height: 90px; margin: 24px auto; max-width: 728px; }
.ad-slot--sidebar { min-height: 250px; }
.ad-slot--footer { min-height: 90px; margin: 32px auto 0; max-width: 728px; }
.ad-slot--infeed { min-height: 100px; margin: 12px 0; grid-column: 1 / -1; }

/* ---------- Detail pages ---------- */
.detail-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 48px 0 24px;
  align-items: end;
}
.detail-hero .cover {
  width: 220px; height: 220px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
}
.detail-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero .eyebrow { color: var(--green-bright); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.detail-hero h1 { font-size: clamp(28px, 4vw, 44px); margin: 8px 0; }
.detail-hero .meta-line { color: var(--text-dim); font-size: 14px; }

@media (max-width: 640px) {
  .detail-hero { grid-template-columns: 1fr; text-align: center; }
  .detail-hero .cover { margin: 0 auto; }
}

/* ---------- Quiz ---------- */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 18px;
}
.quiz-question { font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-option {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  background: var(--bg-elevated);
}
.quiz-option:hover { border-color: var(--orange); }
.quiz-option.correct { border-color: var(--green-bright); color: var(--green-bright); }
.quiz-option.wrong { border-color: #C1543A; color: #C1543A; }
@media (max-width: 480px) { .quiz-options { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 40px;
  color: var(--text-faint);
  font-size: 13px;
}
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; margin-bottom: 24px; }
.footer-cols h4 { color: var(--text-dim); font-size: 13px; margin-bottom: 10px; }
.footer-cols a { display: block; color: var(--text-faint); padding: 3px 0; }
.footer-cols a:hover { color: var(--orange); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); padding-top: 20px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state h3 { margin-bottom: 8px; color: var(--text); }

.results-list { display: flex; flex-direction: column; gap: 10px; }
.result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.result-row:hover { border-color: var(--orange-dim); }
.result-row .tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--green-bright); font-weight: 700;
}

/* ---------- Phase 1: accessibility utility ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Phase 1: rich search result cards ---------- */
.result-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.result-card {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.result-card:hover { border-color: var(--orange-dim); }
.result-card-cover {
  flex-shrink: 0;
  width: 84px; height: 84px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 11px;
  overflow: hidden;
}
.result-card-cover--round { border-radius: 50%; }
.result-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.result-card-body { flex: 1; min-width: 0; }
.result-card-body .tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--green-bright); font-weight: 700;
}
.result-card-body h3 {
  font-size: 15px; margin: 4px 0 6px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-card-meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  font-size: 12px; color: var(--text-dim); margin-bottom: 8px;
}
.result-card-links { display: flex; flex-wrap: wrap; gap: 6px; }
.result-card-links a {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim);
}
.result-card-links a:hover { border-color: var(--green-bright); color: var(--green-bright); }

@media (max-width: 480px) {
  .result-card-grid { grid-template-columns: 1fr; }
}
