/* Noctave — the catalog pages of the website (task L.1): song, composer and index pages,
   generated by app/tool/build_site.dart. Loaded after styles.css and ecrin.css; same tokens,
   same components (DESIGN.md « Site web »). The difficulty bands keep their colours of the app:
   mint, blue, amber, ruby « Maître ». */

:root {
  --master: #F0444A;
}

.catalog {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px var(--gutter) 72px;
}

/* ------------------------------------------------------------------ Breadcrumb */

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 14px;
}

.crumbs li + li::before {
  content: "›";
  margin: 0 8px;
  color: rgba(255, 196, 107, 0.6);
}

.crumbs a {
  color: var(--text-secondary);
}

.crumbs a:hover {
  color: var(--text-primary);
}

.crumbs [aria-current] {
  color: var(--text-primary);
}

/* ------------------------------------------------------------------ Difficulty */

.level {
  --level: var(--good);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--level);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.level-intermediate { --level: var(--ok); }
.level-advanced { --level: var(--accent); }
.level-master { --level: var(--master); }

.level .level-steps {
  display: inline-flex;
  gap: 4px;
}

.level .level-steps i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--level);
  opacity: 0.45;
}

.level .level-steps i.lit {
  background: var(--level);
  box-shadow: 0 0 8px var(--level);
  opacity: 1;
}

/* ------------------------------------------------------------------ Song page head */

.song-head,
.composer-head {
  display: flex;
  align-items: center;
  gap: 40px;
  margin: 0 0 40px;
}

.song-head-text {
  flex: 1;
  min-width: 0;
}

.song-head h1,
.composer-head h1,
.catalog-head h1 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
  overflow-wrap: break-word;
}

.catalog-head h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), #FFE2B0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.song-composer {
  margin: 14px 0 0;
  font-size: 20px;
}

.song-composer span {
  color: var(--text-secondary);
}

.song-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
}

.song-facts > * {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 3px 14px;
  border: 1px solid rgba(255, 196, 107, 0.24);
  border-radius: 999px;
  background: rgba(18, 17, 32, 0.8);
  color: var(--text-primary);
  font-size: 14px;
}

.song-facts > .level {
  border-color: color-mix(in srgb, var(--level) 45%, transparent);
  color: var(--level);
}

.song-facts > a {
  color: var(--right-hand);
  text-decoration: none;
}

.song-facts > a:hover {
  border-color: var(--right-hand);
}

/* The composer's moonlit portrait, under an arch (as on the app's title screen). */
.portrait {
  display: block;
  width: 180px;
  height: 240px;
  flex: none;
  object-fit: cover;
  border-radius: 90px 90px 16px 16px;
  border: 1.5px solid rgba(255, 196, 107, 0.5);
  background: var(--bg-elevated);
  box-shadow: 0 0 40px rgba(92, 225, 255, 0.16), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.portrait.large {
  width: 210px;
  height: 280px;
  border-radius: 105px 105px 18px 18px;
}

.portrait-link {
  flex: none;
  border-radius: 90px 90px 16px 16px;
}

.lyre-frame {
  display: grid;
  place-items: center;
}

.lyre-frame .lyre {
  width: 50%;
  height: auto;
}

/* ------------------------------------------------------------------ Song page body */

.song-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: start;
}

.song-main,
.song-side {
  display: grid;
  gap: 32px;
  min-width: 0;
}

.catalog h2 {
  margin: 0 0 14px;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: 28px;
  line-height: 1.2;
}

.catalog .card h2 {
  font-size: 24px;
}

.listen audio {
  display: block;
  width: 100%;
  margin: 4px 0 10px;
  color-scheme: dark;
}

.hint {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.song-text p,
.composer-bio p {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.7;
}

.composer-bio {
  max-width: 760px;
  margin: 0 0 48px;
}

.traits dl,
.license-facts {
  display: grid;
  gap: 14px;
  margin: 0;
}

.traits dl > div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--stroke);
}

.traits dl > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.traits dt {
  color: var(--accent);
  font-weight: 500;
}

.traits dd,
.license-facts dd {
  margin: 0;
}

/* The first page of the score, on paper. */
.score-preview {
  margin: 0;
}

.score-preview a {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 196, 107, 0.4), 0 18px 50px rgba(0, 0, 0, 0.5);
  transition: transform 200ms var(--ease);
}

.score-preview a:hover {
  transform: translateY(-3px);
}

.score-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.score-preview figcaption {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.download-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 18px;
}

.download-keys .key {
  flex: 1 1 140px;
  flex-direction: column;
  gap: 0;
  --height: 60px;
}

.download-keys .key small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}

.downloads > p {
  color: var(--text-secondary);
}

.license-facts {
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--stroke);
  font-size: 14px;
}

.license-facts dt {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.edition-notes {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.edition-notes summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--right-hand);
  cursor: pointer;
}

.edition-notes code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ Call to Noctave */

.play-panel {
  max-width: 760px;
  margin: 88px auto 0;
  padding: 56px 36px 40px;
  text-align: center;
}

.play-panel p {
  margin: 0 auto 28px;
  max-width: 560px;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------------ Lists of songs */

.more {
  margin: 72px 0 0;
}

.song-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.song-card a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255, 196, 107, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 120px),
    var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 160ms, transform 160ms var(--ease);
}

.song-card a:hover {
  border-color: rgba(255, 196, 107, 0.5);
  transform: translateY(-2px);
}

.song-card-title {
  font-family: var(--font-title);
  font-weight: 300;
  font-size: 19px;
  line-height: 1.25;
}

.song-card-meta {
  color: var(--text-secondary);
  font-size: 14px;
}

.song-card .level {
  margin-top: auto;
  padding-top: 6px;
  font-size: 13px;
}

.more-links {
  margin: 18px 0 0;
}

.name-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ------------------------------------------------------------------ Indexes */

.catalog-head {
  max-width: 820px;
  margin: 0 auto 40px;
  text-align: center;
}

.catalog-head .lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 18px;
}

.lead-links {
  margin: 14px 0 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 20px;
  margin: 0 0 40px;
  padding: 20px 24px;
}

.filters[hidden] {
  display: none;
}

.filters label {
  display: grid;
  gap: 6px;
  flex: 1 1 180px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filters select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 196, 107, 0.3);
  border-radius: 12px;
  background: var(--bg-overlay);
  color: var(--text-primary);
  font: inherit;
  font-size: 16px;
  letter-spacing: normal;
  text-transform: none;
}

.filters select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filters-count {
  flex: 1 1 auto;
  align-self: center;
  margin: 0;
  color: var(--text-secondary);
}

.band {
  margin: 0 0 48px;
}

.band h2,
.band h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
}

.band h2 .level,
.band h3 .level {
  font-family: var(--font-title);
  font-weight: 300;
  font-size: 28px;
}

.band h2 small {
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 16px;
}

.composer-songs h2 {
  margin-bottom: 28px;
}

.composer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 28px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.composer-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-primary);
  text-align: center;
  text-decoration: none;
}

.composer-card .portrait {
  width: 150px;
  height: 200px;
  margin: 0 0 10px;
  border-radius: 75px 75px 14px 14px;
  transition: transform 200ms var(--ease), box-shadow 200ms;
}

.composer-card a:hover .portrait {
  transform: translateY(-3px);
  box-shadow: 0 0 50px rgba(92, 225, 255, 0.3), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.composer-card-name {
  font-family: var(--font-title);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.2;
}

/* ------------------------------------------------------------------ Small screens */

@media (max-width: 1000px) {
  .song-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .song-side {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 700px) {
  .song-head,
  .composer-head {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 24px;
  }

  .song-head .portrait,
  .portrait-link {
    width: 120px;
    height: 160px;
    border-radius: 60px 60px 12px 12px;
  }

  .composer-head {
    flex-direction: column;
  }

  .portrait.large {
    width: 150px;
    height: 200px;
    border-radius: 75px 75px 14px 14px;
  }

  .song-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .score-preview {
    max-width: 320px;
  }

  .traits dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .song-text p,
  .composer-bio p {
    font-size: 17px;
  }

  .play-panel {
    padding: 52px 20px 32px;
  }

  .composer-card .portrait {
    width: 120px;
    height: 160px;
  }

  .composer-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* The header holds one more link than the other pages (« Partitions »). */
@media (max-width: 440px) {
  .topbar {
    column-gap: 8px;
  }

  .brand img {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .song-card a,
  .score-preview a,
  .composer-card .portrait {
    transition: none;
  }
}
