/* ============================================================
   Vinylothèque — rétro vinyle / hi-fi 70s
   Palette :
     --bois     #221810  fond, plinthe noyer sombre
     --creme    #F3E7D3  papier de pochette
     --creme-2  #E8D9BE  papier vieilli
     --ambre    #E2A13C  lueur VU-mètre
     --rouille  #A8431F  accent chaud
     --olive    #5C6E4F  accent secondaire
     --encre    #2B2016  texte sur crème
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Shrikhand&family=Young+Serif&family=Karla:ital,wght@0,400;0,500;0,700;1,400&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bois: #221810;
  --bois-2: #2e2115;
  --creme: #f3e7d3;
  --creme-2: #e8d9be;
  --ambre: #e2a13c;
  --rouille: #a8431f;
  --olive: #5c6e4f;
  --encre: #2b2016;
  --encre-doux: #5a4a38;
  --radius: 6px;
  --font-display: 'Shrikhand', cursive;
  --font-title: 'Young Serif', serif;
  --font-body: 'Karla', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bois);
  /* sillons très subtils, façon macro de vinyle */
  background-image:
    radial-gradient(circle at 120% -20%, rgba(226, 161, 60, 0.07), transparent 55%),
    repeating-radial-gradient(circle at 50% 130%,
      rgba(255, 255, 255, 0.012) 0 2px,
      transparent 2px 7px);
  color: var(--creme);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--ambre); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--ambre); outline-offset: 2px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 22px; }

/* ---------- Header / hero ---------- */

.site-header { padding: 56px 0 34px; text-align: center; }

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  margin: 0;
  color: var(--ambre);
  letter-spacing: 0.5px;
  text-shadow: 3px 3px 0 var(--rouille);
  line-height: 1.05;
}
.site-title a { color: inherit; }
.site-title a:hover { text-decoration: none; }

.site-tagline {
  color: var(--creme-2);
  opacity: 0.85;
  margin: 14px auto 0;
  max-width: 520px;
  font-size: 1.02rem;
}

/* filets façon étiquette de label */
.rule {
  display: flex; align-items: center; gap: 14px;
  color: var(--rouille);
  margin: 26px auto 0; max-width: 420px;
}
.rule::before, .rule::after {
  content: ''; flex: 1; height: 2px;
  background: currentColor; opacity: 0.6; border-radius: 2px;
}
.rule span {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--ambre);
}

/* ---------- Grille de pochettes ---------- */

.crate {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 46px 34px;
  padding: 30px 0 90px;
}

.sleeve {
  position: relative;
  display: block;
  color: var(--encre);
  text-decoration: none;
}
.sleeve:hover { text-decoration: none; }

/* le disque qui dépasse de la pochette */
.sleeve .disc {
  position: absolute;
  top: 6%; right: 4%;
  width: 88%; aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 17%, rgba(0,0,0,0) 17%),
    repeating-radial-gradient(circle, #111 0 1.5px, #1d1d1d 1.5px 3px);
  background-color: #141414;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  transform: translateX(7%);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
  z-index: 0;
}
.sleeve .disc::after { /* label central = avatar */
  content: '';
  position: absolute; inset: 31%;
  border-radius: 50%;
  background: var(--rouille) var(--avatar, none) center/cover;
  border: 3px solid #0d0d0d;
}
.sleeve:hover .disc,
.sleeve:focus-visible .disc {
  transform: translateX(26%) rotate(80deg);
}

/* la pochette elle-même */
.sleeve .cover {
  position: relative; z-index: 1;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--creme-2);
  box-shadow:
    inset 0 0 0 1px rgba(43, 32, 22, 0.25),
    6px 8px 0 rgba(0, 0, 0, 0.35);
}
.sleeve .cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.92) contrast(0.98);
}
.sleeve .cover .no-cover {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--font-title);
  font-size: 2.4rem; color: var(--rouille);
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(168, 67, 31, 0.08) 14px 28px),
    var(--creme-2);
}
/* petit sticker prix/label en coin */
.sleeve .sticker {
  position: absolute; z-index: 2;
  top: 10px; left: 10px;
  background: var(--ambre); color: var(--encre);
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  rotate: -4deg;
}

.sleeve .meta { padding: 14px 4px 0; color: var(--creme); }
.sleeve .meta h2 {
  font-family: var(--font-title);
  font-size: 1.35rem; margin: 0; color: var(--creme);
}
.sleeve .meta p {
  margin: 5px 0 0; font-size: 0.92rem;
  color: var(--creme-2); opacity: 0.8;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-crate {
  text-align: center; padding: 70px 20px 110px; color: var(--creme-2);
}
.empty-crate .big { font-family: var(--font-title); font-size: 1.5rem; color: var(--ambre); }

/* ---------- Page playlist : verso de pochette ---------- */

.back-sleeve {
  background: var(--creme);
  color: var(--encre);
  border-radius: 10px;
  box-shadow: 8px 10px 0 rgba(0, 0, 0, 0.4);
  margin: 10px 0 90px;
  overflow: hidden;
}

.back-head {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 28px;
  padding: 34px 38px 26px;
  border-bottom: 2px solid rgba(43, 32, 22, 0.15);
  background:
    radial-gradient(circle at -10% -40%, rgba(226, 161, 60, 0.25), transparent 50%),
    var(--creme);
}
.back-head .art {
  width: 210px; aspect-ratio: 1;
  border-radius: 4px; overflow: hidden;
  box-shadow: 4px 5px 0 rgba(43, 32, 22, 0.25);
}
.back-head .art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.back-head .who { min-width: 0; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--rouille); margin: 0 0 8px;
}
.back-head h1 {
  font-family: var(--font-title);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  margin: 0 0 10px; line-height: 1.12;
}
.back-head .bio { color: var(--encre-doux); margin: 0 0 16px; max-width: 56ch; }

.friend-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(92, 110, 79, 0.14);
  border: 1px solid rgba(92, 110, 79, 0.4);
  border-radius: 999px; padding: 5px 14px 5px 6px;
  font-weight: 700; font-size: 0.92rem; color: var(--olive);
  margin-bottom: 14px;
}
.friend-chip img, .friend-chip .ph {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  background: var(--olive); color: var(--creme);
  display: grid; place-items: center; font-family: var(--font-title);
}

.stats {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--encre-doux);
}
.stats b { color: var(--rouille); font-size: 1rem; }

.btn {
  display: inline-block;
  background: var(--rouille); color: var(--creme);
  font-family: var(--font-body); font-weight: 700; font-size: 0.92rem;
  padding: 9px 20px; border: none; border-radius: 999px;
  cursor: pointer; margin-top: 16px;
  box-shadow: 3px 3px 0 rgba(43, 32, 22, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(43,32,22,0.35); }
.btn.secondary { background: var(--olive); }
.btn.ghost { background: transparent; color: var(--rouille); box-shadow: inset 0 0 0 2px var(--rouille); }
.btn.small { padding: 6px 14px; font-size: 0.82rem; margin-top: 0; }
.btn.danger { background: #7c2413; }

/* tracklist façon dos de pochette */
.tracks { padding: 26px 38px 40px; column-gap: 46px; }
@media (min-width: 880px) { .tracks { columns: 2; } }

.track {
  break-inside: avoid;
  display: grid;
  grid-template-columns: 2.2em 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
  padding: 7px 4px;
  border-bottom: 1px dotted rgba(43, 32, 22, 0.3);
}
.track .num {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--rouille); text-align: right;
}
.track .t { min-width: 0; }
.track .t .name { font-weight: 700; }
.track .t .name a { color: var(--encre); }
.track .t .artists {
  display: block; font-size: 0.86rem; color: var(--encre-doux);
}
.track .dur {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--encre-doux);
}

.top-artists { padding: 0 38px 34px; }
.top-artists h2 {
  font-family: var(--font-title); font-size: 1.1rem;
  color: var(--rouille); margin: 0 0 10px;
}
.tag {
  display: inline-block; margin: 0 8px 8px 0;
  background: rgba(226, 161, 60, 0.18);
  border: 1px solid rgba(226, 161, 60, 0.55);
  color: var(--encre); border-radius: 999px;
  padding: 4px 13px; font-size: 0.86rem;
}
.tag b { color: var(--rouille); font-family: var(--font-mono); font-size: 0.78rem; }

.backlink {
  display: inline-block; margin: 26px 0 18px;
  font-family: var(--font-mono); font-size: 0.82rem;
  letter-spacing: 0.08em; color: var(--creme-2);
}
.backlink:hover { color: var(--ambre); }

.stale-note {
  padding: 10px 38px; font-size: 0.85rem;
  background: rgba(226, 161, 60, 0.2); color: var(--encre-doux);
}

/* ---------- Admin ---------- */

.panel {
  background: var(--creme); color: var(--encre);
  border-radius: 10px; padding: 28px 30px;
  box-shadow: 8px 10px 0 rgba(0, 0, 0, 0.4);
  margin-bottom: 34px;
}
.panel h1, .panel h2 {
  font-family: var(--font-title); margin: 0 0 16px; color: var(--encre);
}
.panel h1 { font-size: 1.6rem; }
.panel h2 { font-size: 1.15rem; color: var(--rouille); }

.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 5px; }
label .hint { font-weight: 400; color: var(--encre-doux); }

input[type="text"], input[type="password"], textarea, input[type="number"], input[type="file"] {
  width: 100%; font: inherit; color: var(--encre);
  background: #fffaf0;
  border: 2px solid rgba(43, 32, 22, 0.3);
  border-radius: var(--radius); padding: 9px 12px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--rouille); }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--encre-doux); padding: 8px 10px;
  border-bottom: 2px solid rgba(43, 32, 22, 0.25);
}
.admin-table td {
  padding: 10px; border-bottom: 1px dotted rgba(43, 32, 22, 0.3);
  vertical-align: middle;
}
.admin-table .avatar-mini {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  background: var(--olive);
}
.admin-table .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-table form { display: inline; }

.flash {
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 22px;
  font-weight: 700;
}
.flash.ok { background: rgba(92, 110, 79, 0.9); color: var(--creme); }
.flash.err { background: rgba(124, 36, 19, 0.92); color: var(--creme); }

.admin-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin: 26px 0;
}
.admin-bar .title { font-family: var(--font-display); color: var(--ambre); font-size: 1.5rem; }

/* ---------- Footer ---------- */

.site-footer {
  text-align: center; padding: 30px 0 44px;
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.1em; color: var(--creme-2); opacity: 0.55;
}
.site-footer a { color: inherit; }

/* ---------- Responsive & accessibilité ---------- */

@media (max-width: 640px) {
  .back-head { grid-template-columns: 1fr; padding: 26px 22px 20px; }
  .back-head .art { width: 160px; }
  .tracks { padding: 20px 22px 30px; }
  .top-artists { padding: 0 22px 28px; }
  .stale-note { padding: 10px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
