/* notes-library-skin.css — Notes Library specifics layered on the shared
   cosmic base (chord-styles.css supplies .bg / .rail / .shell / .mz-topbar /
   .mz-hero / .card). Tokens (--surface, --ink, --sub, --accent, --line,
   --shadow-card, --font-body/display) all come from the shared theme. */

/* ── Shell: interface body ~80% of the width, gaps each side so the cosmic
   background + theme breathe, with the usual rail gutter on the left. ─────── */
/* Shell geometry matches VR's .shell EXACTLY (1080px column, rail-offset 92) so the
   top menu / brand / hero land in the same position as every other page. */
.nl-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 22px 24px 80px 92px;
}
@media (max-width: 760px) { .nl-shell { width: auto; padding: 16px 16px 56px; padding-left: 72px; } }

/* ── Search + sort control bar ───────────────────────────────────────────── */
.nl-controls {
  padding: 22px 24px;
  margin-bottom: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px 28px;
  align-items: end;
}
.nl-search { min-width: 0; }
.nl-search-label,
.nl-sort-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--ink);
  margin-bottom: 9px;
}
.nl-search-row { display: flex; gap: 12px; align-items: stretch; }
.nl-input-wrap { position: relative; flex: 1; min-width: 0; }
.nl-input-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--sub); pointer-events: none; display: grid; place-items: center;
}
.nl-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.nl-input::placeholder { color: var(--sub); opacity: .85; }
.nl-input:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, var(--bg) 56%, transparent);
}
.nl-search-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border: 0; border-radius: 13px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
  color: var(--accent-ink, #fff);
  background: var(--cta, linear-gradient(135deg, var(--accent2), var(--accent)));
  box-shadow: var(--cta-glow, 0 16px 38px -14px rgba(0,0,0,.4));
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.nl-search-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.nl-search-btn:active { transform: translateY(0); }

.nl-sort { display: flex; flex-direction: column; }
.nl-sort-select {
  appearance: none; -webkit-appearance: none;
  height: 48px; min-width: 190px;
  padding: 0 40px 0 15px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 13px;
  background-color: color-mix(in srgb, var(--bg) 42%, transparent);
  color: var(--ink);
  font-family: var(--font-body); font-size: 14.5px; font-weight: 500;
  cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='gray' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat; background-position: right 15px center;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.nl-sort-select:focus { border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.nl-sort-select option { color: #111; }

/* ── Results header ──────────────────────────────────────────────────────── */
.nl-results-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.nl-heading {
  margin: 0; font-family: var(--font-body); font-weight: 700;
  font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.02em; color: var(--ink);
}
.nl-count { font-family: var(--font-body); font-size: 13.5px; color: var(--sub); }

/* ── Card grid ───────────────────────────────────────────────────────────── */
.nl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 22px;
}

.nl-card {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  transition: transform .2s cubic-bezier(.3,.7,.4,1), box-shadow .2s ease, border-color .2s ease;
}
.nl-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-pop, 0 36px 84px -30px rgba(0,0,0,.5));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}
.nl-cover {
  position: relative;
  height: 132px;
  display: grid; place-items: center;
  color: rgba(255,255,255,.94);
}
.nl-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.32) 100%);
}
.nl-cover svg { position: relative; z-index: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.nl-card-body { padding: 16px 17px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.nl-card-title {
  margin: 0; font-family: var(--font-body); font-weight: 700;
  font-size: 16px; line-height: 1.28; letter-spacing: -.01em; color: var(--ink);
  text-wrap: pretty;
}
.nl-card-composer {
  margin: 0; display: flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-size: 13px; color: var(--sub); line-height: 1.3;
}
.nl-card-composer .ic { color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.nl-card-meta {
  margin-top: auto; padding-top: 11px;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.nl-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-body); font-size: 11.5px; font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
}
.nl-measures {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body); font-size: 12.5px; color: var(--sub);
}
.nl-open {
  margin-left: auto; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--accent-ink, #fff);
  background: color-mix(in srgb, var(--accent) 90%, transparent);
  transition: transform .18s ease, background .18s ease;
}
.nl-card:hover .nl-open { transform: translateX(2px) scale(1.06);
  background: var(--accent); }

/* ── Loading + empty ─────────────────────────────────────────────────────── */
.nl-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 30px 0 6px; color: var(--sub);
  font-family: var(--font-body); font-size: 14px;
}
.nl-spin { display: grid; place-items: center; color: var(--accent); animation: nl-spin 1s linear infinite; }
@keyframes nl-spin { to { transform: rotate(360deg); } }

.nl-empty {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 56px 24px;
  color: var(--sub); font-family: var(--font-body);
}
.nl-empty-ico { color: var(--sub); opacity: .55; }
.nl-empty p { margin: 0; font-size: 15.5px; }
.nl-clear {
  appearance: none; cursor: pointer;
  padding: 9px 18px; border-radius: 11px;
  border: 1px solid var(--line-strong, var(--line));
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  color: var(--ink); font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  transition: border-color .18s ease, color .18s ease;
}
.nl-clear:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .nl-controls { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
  .nl-sort-select { width: 100%; }
  .nl-search-row { flex-direction: column; }
  .nl-search-btn { height: 46px; justify-content: center; }
  .nl-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
}
@media (max-width: 460px) { .nl-grid { grid-template-columns: 1fr; } }
