/* Personnalisez les couleurs ici */
:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --line: #e4e1db;
  --accent: #b5442c;
  --accent-text: #ffffff;
  --radius: 10px;
  --banner-bg: #1d1d1f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214; --card: #1c1c1f; --text: #ececee; --muted: #9a9aa2;
    --line: #2c2c31; --accent: #e0694f; --banner-bg: #000;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 Inter, system-ui, sans-serif; padding-bottom: 96px;
}
a { color: var(--accent); }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* Bannière */
.banner {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  min-height: 180px; padding: 24px max(16px, calc((100% - 1060px) / 2));
  background: var(--banner-bg) center / cover no-repeat; color: #fff;
}
.banner-name { color: #fff; text-decoration: none; font-size: clamp(26px, 5vw, 42px); font-weight: 700; text-shadow: 0 2px 12px #0008; }
.banner nav { display: flex; gap: 18px; }
.banner nav a { color: #fff; text-decoration: none; font-weight: 500; text-shadow: 0 1px 6px #000a; }
.banner nav a:hover { text-decoration: underline; }

/* Mise en page */
.page {
  display: grid; grid-template-columns: 1fr 280px; gap: 40px;
  max-width: 1060px; margin: 0 auto; padding: 32px 16px;
}
@media (max-width: 800px) { .page { grid-template-columns: 1fr; } .artist { order: -1; } }

/* Colonne artiste */
.artist img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.artist h2 { margin: 14px 0 0; font-size: 20px; }
.artist .loc { color: var(--muted); margin: 0 0 10px; }
.artist p { white-space: pre-line; }
.artist ul { list-style: none; padding: 0; margin: 0; }
.artist li { margin: 4px 0; }
@media (max-width: 800px) {
  .artist { display: grid; grid-template-columns: 96px 1fr; gap: 0 16px; align-items: start; }
  .artist img { grid-row: span 3; }
  .artist h2 { margin-top: 0; }
  .artist p, .artist ul { grid-column: 1 / -1; }
}

/* Discographie */
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 4px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px; }
.release-card { text-decoration: none; color: inherit; }
.release-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); transition: transform .15s; }
.release-card:hover img { transform: translateY(-3px); }
.release-card strong { display: block; margin-top: 10px; }
.release-card span { color: var(--muted); font-size: 13px; }
.artist-card img, .artist-card .noimg { border-radius: 50%; }
.artist-card .noimg { width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: var(--line); color: var(--muted); font-size: 48px; font-weight: 700; }
.artist-card { text-align: center; }
.section-title.spaced { margin-top: 48px; }

/* Page d'une sortie */
.release { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.release .cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.release .by { color: var(--muted); margin: 0 0 20px; }
@media (max-width: 640px) { .release { grid-template-columns: 1fr; } .release .cover { order: -1; } }

.buy-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.buy-box .fmt { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-text); padding: 10px 16px; font-weight: 600; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 4px 10px; font-size: 13px; }
.price { color: var(--muted); margin-left: 8px; }

.play-all { margin-bottom: 8px; }
.tracks { list-style: none; padding: 0; margin: 0 0 24px; border-top: 1px solid var(--line); }
.track { display: grid; grid-template-columns: 36px 28px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.track .num { color: var(--muted); font-size: 13px; }
.track .dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.track.playing .t-title { color: var(--accent); font-weight: 600; }
.round {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--text); display: grid; place-items: center; font-size: 12px;
}
.round:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 480px) { .track { grid-template-columns: 36px 1fr auto; } .track .num, .track .dur { display: none; } }

.desc { white-space: pre-line; }
.credits { color: var(--muted); font-size: 13px; white-space: pre-line; }

/* Lecteur */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto minmax(0, 1.4fr); gap: 14px; align-items: center;
  padding: 10px 16px; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px #0001;
}
.player img { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; }
.p-info { min-width: 0; display: flex; flex-direction: column; }
.p-info strong, .p-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-info span { color: var(--muted); font-size: 13px; }
.p-controls { display: flex; gap: 6px; align-items: center; }
.p-controls button { background: none; border: 0; color: var(--text); font-size: 16px; padding: 6px; }
.p-controls .p-play { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--accent-text); }
.p-progress { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-progress input { flex: 1; accent-color: var(--accent); }
@media (max-width: 640px) {
  .player { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .player img { width: 44px; height: 44px; }
  .p-progress { grid-column: 1 / -1; }
  body { padding-bottom: 130px; }
}

/* Fenêtre d'achat */
dialog {
  width: min(440px, calc(100% - 32px)); border: 0; border-radius: 14px; padding: 20px 24px 24px;
  background: var(--card); color: var(--text);
}
dialog::backdrop { background: #000a; }
.close-row { display: flex; justify-content: flex-end; margin: -8px -12px 0 0; }
.close-row button { background: none; border: 0; color: var(--muted); font-size: 18px; }
dialog h2 { margin: 0 0 4px; font-size: 20px; }
dialog .muted { color: var(--muted); font-size: 13px; }
.amount { display: flex; align-items: center; gap: 8px; margin: 16px 0; }
.amount input { width: 120px; font: inherit; font-size: 20px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.error { color: #c62828; }
.downloads { list-style: none; padding: 0; }
.downloads li { margin: 8px 0; }
.downloads a { word-break: break-all; }
#paypal-buttons { margin-top: 16px; min-height: 50px; }

.purchase { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }

.site-footer { max-width: 1060px; margin: 0 auto; padding: 24px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Page artiste avec couleur de fond personnalisée : liens et boutons suivent le texte */
body.themed a:not(.btn):not(.release-card) { color: var(--text); text-decoration-color: var(--muted); }
body.themed .btn.ghost { color: var(--text); border-color: var(--text); }

/* Application installable */
.banner nav .install { background: #fff2; color: #fff; border: 1px solid #fff8; border-radius: 99px; padding: 3px 12px;
  font-weight: 500; text-shadow: none; }
.banner nav .install:hover { background: #fff3; }
.ios-steps { padding-left: 20px; line-height: 1.7; }
.share-icon { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
@media (display-mode: standalone) {
  .banner { padding-top: max(24px, env(safe-area-inset-top)); }
  .player { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* Bandeau et grille d'artistes sur petit écran */
.banner { flex-wrap: wrap; }
.banner nav { flex-wrap: wrap; align-items: center; row-gap: 8px; }
.banner nav a, .banner nav .install { white-space: nowrap; }
@media (max-width: 640px) {
  .banner { min-height: 140px; }
  .banner nav { gap: 14px; font-size: 14px; }
  .artists-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px; }
}
