/* assets/pages/library/library-base.css */
/* Shared library page styles */

.page-hero {
  padding: 60px 5% 48px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
}

.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1.2;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 720px;
  line-height: 1.8;
  margin: 0;
}

.filters {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 5% 22px;
  display: grid;
  gap: 14px;
  align-items: stretch;
  justify-content: center;
}

.filters select,
.filters input {
  width: min(100%, 230px);
  max-width: 230px;
  min-width: 0;
  justify-self: center;
  background: var(--surface);
  border: 1px solid rgba(200,164,90,0.24);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  outline: none;
  transition: all 0.25s var(--ease);
  box-shadow: inset 0 0 0 1px rgba(200,164,90,0.04);
  -webkit-appearance: none;
  appearance: none;
}

.filters select:hover,
.filters input:hover {
  border-color: rgba(200,164,90,0.38);
  background: var(--surface2);
}

.filters select:focus,
.filters input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,164,90,0.10);
  background: var(--surface2);
}

.filters select option {
  background: var(--bg3);
  color: var(--text);
}

.filters-jump {
  width: fit-content;
  min-width: 0;
  max-width: 230px;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(200,164,90,0.10);
  border: 1px solid rgba(200,164,90,0.28);
  color: var(--gold-light);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.25s var(--ease);
  box-shadow: inset 0 0 0 1px rgba(200,164,90,0.04);
}

.filters-jump:hover {
  background: rgba(200,164,90,0.18);
  border-color: rgba(200,164,90,0.46);
  color: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(200,164,90,0.12);
}

.filters-jump:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,164,90,0.12);
  background: rgba(200,164,90,0.16);
}

.request-sheet-section {
  scroll-margin-top: 120px;
}

#list.grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5% 100px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1180px) {
  #list.grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  #list.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #list.grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0.012)), var(--bg2);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: all 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0,0,0,0.34);
  border-color: rgba(200,164,90,0.28);
}

.card-header {
  display: grid;
  gap: 8px;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-size: clamp(0.92rem, 0.9vw, 1.02rem);
  font-weight: 900;
  line-height: 1.28;
  color: var(--text);
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-composer,
.card-performer {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.badge-song {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(200,164,90,0.2);
}

.badge-inst {
  background: rgba(200,164,90,0.12);
  color: var(--gold-light);
  border-color: rgba(200,164,90,0.55);
  box-shadow: inset 0 0 0 1px rgba(200,164,90,0.08);
}

.card-meta,
.card-meta-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.card-maqam,
.card-tonic,
.card-tag,
.card-tag-muted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
  line-height: 1.22;
  text-align: center;
}

.card-tag-clickable,
.maqam-link {
  color: var(--gold-light);
  border-color: rgba(200,164,90,0.2);
  background: rgba(200,164,90,0.08);
}

.card-tag-clickable:hover,
.maqam-link:hover {
  color: var(--gold-light);
  border-color: rgba(200,164,90,0.42);
  background: rgba(200,164,90,0.14);
}

.card-credits {
  direction: rtl;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}

.card-credit-row,
html[dir="rtl"] .card-credit-row {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: start;
  gap: 5px;
  text-align: center;
}

.card-credit-row-empty {
  visibility: hidden;
  display: grid;
}

.card-credit-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--text-dim);
  font-size: 0.64rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.card-credit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(200,164,90,0.08);
  border: 1px solid rgba(200,164,90,0.2);
  color: var(--text);
  font-size: clamp(0.68rem, 0.72vw, 0.8rem);
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

.card-maqam-credit {
  color: var(--gold-light);
}

.card-credit-link:hover {
  color: var(--gold-light);
  background: rgba(200,164,90,0.14);
  border-color: rgba(200,164,90,0.42);
}

.card-rhythm-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  padding-top: 9px;
  padding-bottom: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 0;
}

.download-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  background: var(--gold);
  color: var(--bg);
  border: 2px solid var(--gold);
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 900;
  transition: all 0.25s var(--ease);
}

.download-btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(200,164,90,0.25);
}

@media (max-width: 640px) {
  .card {
    padding: 15px;
    gap: 12px;
  }

  .card-header {
    gap: 10px;
  }

  .card-title {
    font-size: 1rem;
    line-height: 1.35;
  }

  .card-credit-label {
    font-size: 0.66rem;
    padding: 3px 7px;
  }

  .card-credit-link {
    font-size: 0.78rem;
    padding: 5px 8px;
    min-height: 29px;
  }
}

@media (max-width: 520px) {
  .card-credits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
}
