/* =========================================================
   Lyricly — search interface styles
   Clean, search-engine-like, slightly warmer than Google.
   ========================================================= */

:root {
  --bg:            #fafaf7;
  --bg-elev:      #ffffff;
  --ink:           #1a1a1a;
  --ink-soft:     #4a4a4a;
  --ink-faint:    #6a6a6a;
  --accent:       #2b4eff;          /* link blue */
  --accent-soft:  #e8edff;
  --mark-bg:      #fff3a8;
  --border:       #e5e3db;
  --shadow:       0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.04);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Charter", "Georgia", "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Topbar ---------- */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 28px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar.slim { grid-template-columns: auto 1fr; }

.logo {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.logo::first-letter { color: var(--accent); }

/* ---------- Search bar ---------- */
.searchbar {
  display: flex;
  gap: 8px;
  max-width: 720px;
  width: 100%;
}
.searchbar input {
  flex: 1;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.searchbar input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.searchbar button {
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg-elev);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.searchbar button:hover  { background: #000; }
.searchbar button:active { transform: translateY(1px); }

/* ---------- Mode toggle ---------- */
.modes { display: inline-flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 999px; border: 1px solid var(--border); }
.mode {
  padding: 6px 14px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mode:hover  { color: var(--ink); }
.mode.active { background: var(--ink); color: var(--bg-elev); }

/* ---------- Results ---------- */
.results {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}
.count {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 18px;
}
.hit {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.hit:last-child { border-bottom: 0; }
.hit-url {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hit-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.hit-title a { color: var(--accent); }
.hit-title a:visited { color: #7a3fb8; }
.hit-meta {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.hit-snippet {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}
.hit-snippet mark, .hit-snippet .hl {
  background: var(--mark-bg);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* ---------- Status / empty ---------- */
.status {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px;
  color: var(--ink-faint);
  font-size: 15px;
}
.status.error { color: #b33; }

/* ---------- Song page ---------- */
.back {
  justify-self: end;
  font-size: 14px;
  color: var(--ink-soft);
}
.song {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}
.song-title {
  font-size: 32px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.song-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--ink-faint);
  font-size: 14px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.song-lyrics {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  background: transparent;
  padding: 0;
  margin: 0;
}

/* ---------- Footer ---------- */
.foot {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }
  .modes { justify-self: start; }
  .searchbar { max-width: 100%; }
  .song-title { font-size: 26px; }
  .foot { flex-direction: column; gap: 4px; }
}
